OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::ZeroDistributionBoundaryProcessor3D< T, DESCRIPTOR > Class Template Reference

This class resets some values of the distribution on the boundary that can have arbitrary values to be zero and thus ensures a correct computation of the density that is about to leave the domain. More...

#include <advectionDiffusionBoundaryPostProcessor3D.h>

+ Inheritance diagram for olb::ZeroDistributionBoundaryProcessor3D< T, DESCRIPTOR >:
+ Collaboration diagram for olb::ZeroDistributionBoundaryProcessor3D< T, DESCRIPTOR >:

Public Member Functions

 ZeroDistributionBoundaryProcessor3D (int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, int discreteNormalX_, int discreteNormalY_, int discreteNormalZ_)
 
int extent () const override
 Extent of application area (0 for purely local operations)
 
int extent (int whichDirection) const override
 Extent of application area along a direction (0 or 1)
 
void process (BlockLattice< T, DESCRIPTOR > &blockLattice) override
 Execute post-processing step.
 
void processSubDomain (BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override
 Execute post-processing step on a sublattice.
 
- Public Member Functions inherited from olb::PostProcessor3D< T, DESCRIPTOR >
 PostProcessor3D ()
 
virtual ~PostProcessor3D ()
 
std::string & getName ()
 read and write access to name
 
std::string const & getName () const
 read only access to name
 
int getPriority () const
 read only access to priority
 

Additional Inherited Members

- Protected Attributes inherited from olb::PostProcessor3D< T, DESCRIPTOR >
int _priority
 

Detailed Description

template<typename T, typename DESCRIPTOR>
class olb::ZeroDistributionBoundaryProcessor3D< T, DESCRIPTOR >

This class resets some values of the distribution on the boundary that can have arbitrary values to be zero and thus ensures a correct computation of the density that is about to leave the domain.

Definition at line 124 of file advectionDiffusionBoundaryPostProcessor3D.h.

Constructor & Destructor Documentation

◆ ZeroDistributionBoundaryProcessor3D()

template<typename T , typename DESCRIPTOR >
olb::ZeroDistributionBoundaryProcessor3D< T, DESCRIPTOR >::ZeroDistributionBoundaryProcessor3D ( int x0_,
int x1_,
int y0_,
int y1_,
int z0_,
int z1_,
int discreteNormalX_,
int discreteNormalY_,
int discreteNormalZ_ )

Definition at line 105 of file advectionDiffusionBoundaryPostProcessor3D.hh.

108 : x0(x0_), x1(x1_), y0(y0_), y1(y1_), z0(z0_), z1(z1_)
109{
110 this->getName() = "ZeroDistributionBoundaryProcessor3D";
111 OLB_PRECONDITION(x0==x1 || y0==y1 || z0==z1);
112
113 resetPop[0] = 0;
114 for (int iPop = 1; iPop < DESCRIPTOR::q; iPop++) {
115 resetPop[iPop] = 0;
116 // find incoming iPop from material 0
117 if (descriptors::c<DESCRIPTOR>(iPop,0)*discreteNormalX + descriptors::c<DESCRIPTOR>(iPop,1)*discreteNormalY + descriptors::c<DESCRIPTOR>(iPop,2)*discreteNormalZ > 0) {
118 resetPop[iPop] = 1;
119 }
120 }
121}
std::string & getName()
read and write access to name
#define OLB_PRECONDITION(COND)
Definition olbDebug.h:46

References olb::PostProcessor3D< T, DESCRIPTOR >::getName(), and OLB_PRECONDITION.

+ Here is the call graph for this function:

Member Function Documentation

◆ extent() [1/2]

template<typename T , typename DESCRIPTOR >
int olb::ZeroDistributionBoundaryProcessor3D< T, DESCRIPTOR >::extent ( ) const
inlineoverridevirtual

Extent of application area (0 for purely local operations)

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 129 of file advectionDiffusionBoundaryPostProcessor3D.h.

130 {
131 return 0;
132 }

◆ extent() [2/2]

template<typename T , typename DESCRIPTOR >
int olb::ZeroDistributionBoundaryProcessor3D< T, DESCRIPTOR >::extent ( int direction) const
inlineoverridevirtual

Extent of application area along a direction (0 or 1)

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 133 of file advectionDiffusionBoundaryPostProcessor3D.h.

134 {
135 return 0;
136 }

◆ process()

template<typename T , typename DESCRIPTOR >
void olb::ZeroDistributionBoundaryProcessor3D< T, DESCRIPTOR >::process ( BlockLattice< T, DESCRIPTOR > & blockLattice)
overridevirtual

Execute post-processing step.

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 152 of file advectionDiffusionBoundaryPostProcessor3D.hh.

154{
155 processSubDomain(blockLattice, x0, x1, y0, y1, z0, z1);
156}
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override
Execute post-processing step on a sublattice.

◆ processSubDomain()

template<typename T , typename DESCRIPTOR >
void olb::ZeroDistributionBoundaryProcessor3D< T, DESCRIPTOR >::processSubDomain ( BlockLattice< T, DESCRIPTOR > & blockLattice,
int x0_,
int x1_,
int y0_,
int y1_,
int z0_,
int z1_ )
overridevirtual

Execute post-processing step on a sublattice.

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 124 of file advectionDiffusionBoundaryPostProcessor3D.hh.

127{
128 int newX0, newX1, newY0, newY1, newZ0, newZ1;
129 if ( util::intersect (
130 x0, x1, y0, y1, z0, z1,
131 x0_, x1_, y0_, y1_, z0_, z1_,
132 newX0, newX1, newY0, newY1, newZ0, newZ1 ) ) {
133
134#ifdef PARALLEL_MODE_OMP
135 #pragma omp parallel for
136#endif
137 for (int iX=newX0; iX<=newX1; ++iX) {
138 for (int iY=newY0; iY<=newY1; ++iY) {
139 for (int iZ=newZ0; iZ<=newZ1; ++iZ) {
140 for (int iPop = 1; iPop < DESCRIPTOR::q ; ++iPop) {
141 if (resetPop[iPop]!=0) {
142 blockLattice.get(iX,iY,iZ)[iPop] = -descriptors::t<T,DESCRIPTOR>(iPop);
143 }
144 }
145 }
146 }
147 }
148 }
149}
bool intersect(int x0, int x1, int y0, int y1, int x0_, int x1_, int y0_, int y1_, int &newX0, int &newX1, int &newY0, int &newY1)
Definition util.h:89

References olb::BlockLattice< T, DESCRIPTOR >::get(), and olb::util::intersect().

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: