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

This class computes a slip BC in 2D. More...

#include <boundaryPostProcessors2D.h>

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

Public Member Functions

 SlipBoundaryProcessor2D (int x0_, int x1_, int y0_, int y1_, int discreteNormalX_, int discreteNormalY_)
 
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_) override
 Execute post-processing step on a sublattice.
 
- Public Member Functions inherited from olb::PostProcessor2D< T, DESCRIPTOR >
 PostProcessor2D ()
 
virtual ~PostProcessor2D ()
 
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::PostProcessor2D< T, DESCRIPTOR >
int _priority
 

Detailed Description

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

This class computes a slip BC in 2D.

Definition at line 176 of file boundaryPostProcessors2D.h.

Constructor & Destructor Documentation

◆ SlipBoundaryProcessor2D()

template<typename T , typename DESCRIPTOR >
olb::SlipBoundaryProcessor2D< T, DESCRIPTOR >::SlipBoundaryProcessor2D ( int x0_,
int x1_,
int y0_,
int y1_,
int discreteNormalX_,
int discreteNormalY_ )

Definition at line 217 of file boundaryPostProcessors2D.hh.

219 : x0(x0_), x1(x1_), y0(y0_), y1(y1_)
220{
221 this->getName() = "SlipBoundaryProcessor2D";
222 OLB_PRECONDITION(x0==x1 || y0==y1);
223 reflectionPop[0] = 0;
224 for (int iPop = 1; iPop < DESCRIPTOR::q; iPop++) {
225 reflectionPop[iPop] = 0;
226 // iPop are the directions which ointing into the fluid, discreteNormal is pointing outwarts
227 if (descriptors::c<DESCRIPTOR>(iPop,0)*discreteNormalX + descriptors::c<DESCRIPTOR>(iPop,1)*discreteNormalY < 0) {
228 // std::cout << "-----" <<s td::endl;
229 int mirrorDirection0;
230 int mirrorDirection1;
231 int mult = 1;
232 if (discreteNormalX*discreteNormalY==0) {
233 mult = 2;
234 }
235 mirrorDirection0 = (descriptors::c<DESCRIPTOR>(iPop,0) - mult*(descriptors::c<DESCRIPTOR>(iPop,0)*discreteNormalX + descriptors::c<DESCRIPTOR>(iPop,1)*discreteNormalY )*discreteNormalX);
236 mirrorDirection1 = (descriptors::c<DESCRIPTOR>(iPop,1) - mult*(descriptors::c<DESCRIPTOR>(iPop,0)*discreteNormalX + descriptors::c<DESCRIPTOR>(iPop,1)*discreteNormalY )*discreteNormalY);
237
238 // computes mirror jPop
239 for (reflectionPop[iPop] = 1; reflectionPop[iPop] < DESCRIPTOR::q ; reflectionPop[iPop]++) {
240 if (descriptors::c<DESCRIPTOR>(reflectionPop[iPop],0)==mirrorDirection0 && descriptors::c<DESCRIPTOR>(reflectionPop[iPop],1)==mirrorDirection1 ) {
241 break;
242 }
243 }
244 //std::cout <<iPop << " to "<< jPop <<" for discreteNormal= "<< discreteNormalX << "/"<<discreteNormalY <<std::endl;
245 }
246 }
247}
std::string & getName()
read and write access to name
#define OLB_PRECONDITION(COND)
Definition olbDebug.h:46

References olb::PostProcessor2D< 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::SlipBoundaryProcessor2D< T, DESCRIPTOR >::extent ( ) const
inlineoverridevirtual

Extent of application area (0 for purely local operations)

Implements olb::PostProcessor2D< T, DESCRIPTOR >.

Definition at line 179 of file boundaryPostProcessors2D.h.

180 {
181 return 0;
182 }

◆ extent() [2/2]

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

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

Implements olb::PostProcessor2D< T, DESCRIPTOR >.

Definition at line 183 of file boundaryPostProcessors2D.h.

184 {
185 return 0;
186 }

◆ process()

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

Execute post-processing step.

Implements olb::PostProcessor2D< T, DESCRIPTOR >.

Definition at line 277 of file boundaryPostProcessors2D.hh.

279{
280 processSubDomain(blockLattice, x0, x1, y0, y1);
281}
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_) override
Execute post-processing step on a sublattice.

◆ processSubDomain()

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

Execute post-processing step on a sublattice.

Implements olb::PostProcessor2D< T, DESCRIPTOR >.

Definition at line 250 of file boundaryPostProcessors2D.hh.

252{
253 int newX0, newX1, newY0, newY1;
254 if ( util::intersect (
255 x0, x1, y0, y1,
256 x0_, x1_, y0_, y1_,
257 newX0, newX1, newY0, newY1 ) ) {
258
259 int iX;
260#ifdef PARALLEL_MODE_OMP
261 #pragma omp parallel for
262#endif
263 for (iX=newX0; iX<=newX1; ++iX) {
264 for (int iY=newY0; iY<=newY1; ++iY) {
265 for (int iPop = 1; iPop < DESCRIPTOR::q ; ++iPop) {
266 if (reflectionPop[iPop]!=0) {
267 //do reflection
268 blockLattice.get(iX,iY)[iPop] = blockLattice.get(iX,iY)[reflectionPop[iPop]];
269 }
270 }
271 }
272 }
273 }
274}
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: