/* This file is part of the OpenLB library
*
* Copyright (C) 2012 Jonas Kratzke, Mathias J. Krause
* E-mail contact: info@openlb.net
* The most recent release of OpenLB can be downloaded at
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/** \file
* A helper for initialising 3D boundaries -- header file.
*/
#ifndef OFF_BOUNDARY_CONDITION_3D_H
#define OFF_BOUNDARY_CONDITION_3D_H
#include
#include "core/blockLatticeStructure3D.h"
#include "core/blockLatticeStructure3D.h"
#include "offBoundaryCondition3D.h"
#include "dynamics/dynamics.h"
#include "geometry/blockGeometryStatistics3D.h"
#include "io/stlReader.h"
namespace olb {
/**
* This class provides a general off lattice boundary condition
*/
template
class OffLatticeBoundaryCondition3D {
protected:
T _epsFraction;
public:
virtual ~OffLatticeBoundaryCondition3D() { }
/// Using Bouzidi BC OnePoint corresponds to Bounce Back and TwoPoint to linear interpolation
virtual void addOnePointZeroVelocityBoundary(int x, int y, int z, int iPop, T dist) =0;
virtual void addTwoPointZeroVelocityBoundary(int x, int y, int z, int iPop, T dist) =0;
virtual void addOnePointVelocityBoundary(int x, int y, int z, int iPop, T dist) =0;
virtual void addTwoPointVelocityBoundary(int x, int y, int z, int iPop, T dist) =0;
virtual void addOffDynamics(int x, int y, int z, T location[DESCRIPTOR::d]) =0;
virtual void addOffDynamics(int x, int y, int z, T location[DESCRIPTOR::d], T distances[DESCRIPTOR::q]) =0;
virtual void addZeroVelocityBoundary(BlockGeometryStructure3D& blockGeometryStructure,
int x, int y, int z, int iPop, T dist) =0;
virtual void defineU(int iX, int iY, int iZ, int iPop, const T u[DESCRIPTOR::d]) =0;
virtual void addOffDynamics(BlockIndicatorF3D& indicator) =0;
virtual void addZeroVelocityBoundary(BlockIndicatorF3D& boundaryIndicator,
BlockIndicatorF3D& bulkIndicator,
IndicatorF3D& geometryIndicator) =0;
virtual void addVelocityBoundary(BlockIndicatorF3D& boundaryIndicator,
BlockIndicatorF3D& bulkIndicator,
IndicatorF3D& geometryIndicator) =0;
virtual void defineU(BlockIndicatorF3D& indicator,
BlockIndicatorF3D& bulkIndicator,
AnalyticalF3D& u) =0;
/**
* \name Convenience wrappers for boundary functions
* \{
**/
void addOffDynamics(BlockGeometryStructure3D& blockGeometryStructure, int material);
void addZeroVelocityBoundary(BlockGeometryStructure3D& blockGeometryStructure, int material,
IndicatorF3D& geometryIndicator,
std::vector bulkMaterials = std::vector(1,1));
void addVelocityBoundary(BlockGeometryStructure3D& blockGeometryStructure, int material,
IndicatorF3D& indicator,
std::vector bulkMaterials = std::vector(1,1));
void defineU(BlockGeometryStructure3D& blockGeometryStructure, int material,
AnalyticalF3D& u,
std::vector bulkMaterials = std::vector(1,1) );
///\}
virtual BlockLatticeStructure3D& getBlock() =0;
virtual BlockLatticeStructure3D const& getBlock() const =0;
virtual void outputOn() =0;
virtual void outputOff() =0;
};
////////// Factory functions //////////////////////////////////////////////////
/**
* Create specific off lattice boundary conditions
*/
template >
OffLatticeBoundaryCondition3D*
createBouzidiBoundaryCondition3D(BlockLatticeStructure3D& block);
}
#endif