26#ifndef SET_WALL_FUNCTION_BOUNDARY_3D_HH
27#define SET_WALL_FUNCTION_BOUNDARY_3D_HH
36template<
typename T,
typename DESCRIPTOR>
47template<
typename T,
typename DESCRIPTOR>
54 for (
int iCloc = 0; iCloc < sLattice.
getLoadBalancer().size(); ++iCloc) {
56 indicator->getBlockIndicatorF(iCloc),
60 communicator.template requestField<descriptors::POPULATION>();
63 communicator.requestOverlap(_overlap, neighborIndicator);
64 communicator.exchangeRequests();
69template<
typename T,
typename DESCRIPTOR>
79 std::vector<int> discreteNormal(4, 0);
80 blockGeometryStructure.forSpatialLocations([&](
auto iX,
auto iY,
auto iZ) {
81 if (blockGeometryStructure.getNeighborhoodRadius({iX, iY, iZ}) >= margin
82 && indicator(iX, iY, iZ)) {
83 discreteNormal = blockGeometryStructure.getStatistics().getType(iX, iY, iZ);
84 std::vector<int> missingIndices;
85 for (
int x = -1 ; x < 2; ++x) {
86 for (
int y = -1 ; y < 2; ++y) {
87 for (
int z = -1 ; z < 2; ++z) {
88 if (blockGeometryStructure.getMaterial(iX + x, iY + y, iZ + z) == 0) {
89 for (
int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
100 if (discreteNormal[1]!=0 || discreteNormal[2]!=0 || discreteNormal[3]!=0) {
101 discreteNormal.erase(discreteNormal.begin());
104 clout <<
"setWallFunctionBoundary<" << discreteNormal[0] <<
","<< discreteNormal[1] <<
","<< discreteNormal[2] <<
">(" << iX <<
", "<< iX <<
", " << iY <<
", " << iY <<
", " << iZ <<
", " << iZ <<
" )" << std::endl;
106 auto postProcessor = std::unique_ptr<PostProcessorGenerator3D<T, DESCRIPTOR>>{
new WallFunctionBoundaryProcessorGenerator3D<T, DESCRIPTOR>(iX, iX, iY, iY, iZ, iZ, indicator.
getBlockGeometry(), discreteNormal, missingIndices,
109 _block.addPostProcessor(*postProcessor);
113 clout <<
"Warning: Could not setWallFunctionBoundary (" << iX <<
", " << iY <<
", " << iZ <<
"), discreteNormal=(" << discreteNormal[0] <<
","<< discreteNormal[1] <<
","<< discreteNormal[2] <<
","<< discreteNormal[3] <<
"), set to bounceBack" << std::endl;
114 _block.template defineDynamics<BounceBack>({iX, iY, iZ});
Base block indicator functor.
BlockGeometry< T, 3 > & getBlockGeometry()
Get underlying block geometry structure.
Smart pointer for managing the various ways of passing functors around.
IndicatorF3D is an application from .
class for marking output with some text
Representation of a statistic for a parallel 2D geometry.
std::unique_ptr< SuperIndicatorF< T, D > > getMaterialIndicator(std::vector< int > &&materials)
Returns a material indicator using the given vector of materials.
Base indicator functor (discrete)
Super class maintaining block lattices for a cuboid decomposition.
SuperCommunicator< T, SuperLattice > & getCommunicator(STAGE stage=STAGE())
Return communicator for given communication stage.
BlockLattice< T, DESCRIPTOR > & getBlock(int locC)
Return BlockLattice with local index locC.
LoadBalancer< T > & getLoadBalancer()
Read and write access to the load balancer.
Conversion between physical and lattice units, as well as discretization.
constexpr int c(unsigned iPop, unsigned iDim) any_platform
constexpr int opposite(unsigned iPop) any_platform
void setWallFunctionBoundary(SuperLattice< T, DESCRIPTOR > &sLattice, SuperGeometry< T, 3 > &superGeometry, int material, UnitConverter< T, DESCRIPTOR > const &converter, wallFunctionParam< T > const &wallFunctionParam, IndicatorF3D< T > *geoIndicator=NULL)
Initialising the WallFunctionBoundary on the superLattice domain.
Top level namespace for all of OpenLB.
std::conditional_t< D==2, SuperIndicatorBoundaryNeighbor2D< T >, SuperIndicatorBoundaryNeighbor3D< T > > SuperIndicatorBoundaryNeighbor
Communication after propagation.