26#ifndef SET_ADVECTION_DIFFUSION_ZERO_GRADIENT_BOUNDARY_3D_HH
27#define SET_ADVECTION_DIFFUSION_ZERO_GRADIENT_BOUNDARY_3D_HH
34template<
typename T,
typename DESCRIPTOR,
typename MixinDynamics>
41template<
typename T,
typename DESCRIPTOR,
typename MixinDynamics>
46 for (
int iCloc = 0; iCloc < sLattice.
getLoadBalancer().size(); iCloc++) {
52 communicator.template requestField<descriptors::POPULATION>();
55 communicator.requestOverlap(_overlap, neighborIndicator);
56 communicator.exchangeRequests();
61template<
typename T,
typename DESCRIPTOR,
typename MixinDynamics>
64 using namespace boundaryhelper;
67 std::vector<int> discreteNormal(4,0);
68 blockGeometryStructure.forSpatialLocations([&](
auto iX,
auto iY,
auto iZ) {
69 if (blockGeometryStructure.getNeighborhoodRadius({iX, iY, iZ}) >= margin
70 && indicator(iX, iY, iZ)) {
71 discreteNormal = blockGeometryStructure.getStatistics().getType(iX, iY, iZ);
72 if (discreteNormal[1]!=0 || discreteNormal[2]!=0 || discreteNormal[3]!=0) {
73 for(
int iPop = 0; iPop < DESCRIPTOR::q; iPop++){
75 T k = c[0]*(-discreteNormal[1]) + c[1]*(-discreteNormal[2]) + c[2]*(-discreteNormal[3]);
76 if(k > T{0.} && blockGeometryStructure.getMaterial(iX+c[0], iY+c[1], iZ+c[2]) == 1 ){
77 _block.get(iX+c[0], iY+c[1], iZ+c[2]).template getFieldPointer<descriptors::NEIGHBOR>()[0] = T{1.};
79 if(k > T{0.} && blockGeometryStructure.getMaterial(iX+2*c[0], iY+2*c[1], iZ+2*c[2]) == 1 ){
80 _block.get(iX+2*c[0], iY+2*c[1], iZ+2*c[2]).template getFieldPointer<descriptors::NEIGHBOR>()[0] = T{1.};
83 _block.addPostProcessor(
87 _block.template defineDynamics<NoCollideDynamics>({iX, iY, iZ});
89 _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.
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.
constexpr int c(unsigned iPop, unsigned iDim) any_platform
Top level namespace for all of OpenLB.
std::conditional_t< D==2, SuperIndicatorBoundaryNeighbor2D< T >, SuperIndicatorBoundaryNeighbor3D< T > > SuperIndicatorBoundaryNeighbor
void setZeroGradientBoundary(SuperLattice< T, DESCRIPTOR > &sLattice, SuperGeometry< T, 3 > &superGeometry, int material)
Initialising the setZeroGradientBoundary function on the superLattice domain This is an AdvectionDiff...
Communication after collision.
Communication after propagation.