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

#include <materialBoundary3D.h>

+ Inheritance diagram for olb::MaterialBoundary3D< T, PARTICLETYPE >:
+ Collaboration diagram for olb::MaterialBoundary3D< T, PARTICLETYPE >:

Public Member Functions

 MaterialBoundary3D (SuperGeometry< T, 3 > &sg)
 Constructor.
 
 MaterialBoundary3D (MaterialBoundary3D< T, PARTICLETYPE > &f)
 Copy constructor.
 
 MaterialBoundary3D (SuperGeometry< T, 3 > &sg, std::set< int > material)
 Constructor with set of material numbers.
 
 ~MaterialBoundary3D () override
 
void addMaterial (int mat)
 Add a single material number.
 
void addMaterial (std::vector< int > mats)
 Add several material numbers.
 
void applyBoundary (typename std::deque< PARTICLETYPE< T > >::iterator &p, ParticleSystem3D< T, PARTICLETYPE > &psSys) override
 Apply the boundary condition.
 
- Public Member Functions inherited from olb::Boundary3D< T, PARTICLETYPE >
 Boundary3D ()
 
 Boundary3D (Boundary3D< T, PARTICLETYPE > &)
 
 Boundary3D (const Boundary3D< T, PARTICLETYPE > &)
 
virtual ~Boundary3D ()
 

Additional Inherited Members

- Protected Attributes inherited from olb::Boundary3D< T, PARTICLETYPE >
OstreamManager clout
 

Detailed Description

template<typename T, template< typename U > class PARTICLETYPE>
class olb::MaterialBoundary3D< T, PARTICLETYPE >

Definition at line 46 of file materialBoundary3D.h.

Constructor & Destructor Documentation

◆ MaterialBoundary3D() [1/3]

template<typename T , template< typename U > class PARTICLETYPE>
olb::MaterialBoundary3D< T, PARTICLETYPE >::MaterialBoundary3D ( SuperGeometry< T, 3 > & sg)

Constructor.

Definition at line 33 of file materialBoundary3D.hh.

35 : Boundary3D<T, PARTICLETYPE>(),
36 _sg(sg)
37{
38 _matIter = _materials.begin();
39}

◆ MaterialBoundary3D() [2/3]

template<typename T , template< typename U > class PARTICLETYPE>
olb::MaterialBoundary3D< T, PARTICLETYPE >::MaterialBoundary3D ( MaterialBoundary3D< T, PARTICLETYPE > & f)

Copy constructor.

◆ MaterialBoundary3D() [3/3]

template<typename T , template< typename U > class PARTICLETYPE>
olb::MaterialBoundary3D< T, PARTICLETYPE >::MaterialBoundary3D ( SuperGeometry< T, 3 > & sg,
std::set< int > material )

Constructor with set of material numbers.

Definition at line 42 of file materialBoundary3D.hh.

45 : Boundary3D<T, PARTICLETYPE>(),
46 _sg(sg),
47 _materials(materials.begin(),materials.end())
48{
49}

◆ ~MaterialBoundary3D()

template<typename T , template< typename U > class PARTICLETYPE>
olb::MaterialBoundary3D< T, PARTICLETYPE >::~MaterialBoundary3D ( )
inlineoverride

Definition at line 55 of file materialBoundary3D.h.

56 {
57 }

Member Function Documentation

◆ addMaterial() [1/2]

template<typename T , template< typename U > class PARTICLETYPE>
void olb::MaterialBoundary3D< T, PARTICLETYPE >::addMaterial ( int mat)
inline

Add a single material number.

Definition at line 59 of file materialBoundary3D.h.

60 {
61 _materials.insert(mat);
62 }

◆ addMaterial() [2/2]

template<typename T , template< typename U > class PARTICLETYPE>
void olb::MaterialBoundary3D< T, PARTICLETYPE >::addMaterial ( std::vector< int > mats)
inline

Add several material numbers.

Definition at line 64 of file materialBoundary3D.h.

65 {
66 for (unsigned i=0; i< mats.size(); ++i) {
67 _materials.insert(mats[i]);
68 }
69 }

◆ applyBoundary()

template<typename T , template< typename U > class PARTICLETYPE>
void olb::MaterialBoundary3D< T, PARTICLETYPE >::applyBoundary ( typename std::deque< PARTICLETYPE< T > >::iterator & p,
ParticleSystem3D< T, PARTICLETYPE > & psSys )
overridevirtual

Apply the boundary condition.

Implements olb::Boundary3D< T, PARTICLETYPE >.

Definition at line 52 of file materialBoundary3D.hh.

55{
56 int latticeR[3] = { 0 };
57 _sg.getCuboidGeometry().get(p->getCuboid()).getFloorLatticeR(latticeR, &p->getPos()[0]);
58 // Read only access to the material numbers of nodes around particle position
59 const BlockGeometry<T,3>& bg = _sg.getBlockGeometry(
60 _sg.getLoadBalancer().loc(p->getCuboid()));
61 // + overlap is because of lower boundaries, latticeR has to be shifted up
62 int iX = latticeR[0];
63 int iY = latticeR[1];
64 int iZ = latticeR[2];
65 for (_matIter = _materials.begin(); _matIter != _materials.end(); _matIter++) {
66 if (bg.get({iX, iY, iZ}) == *_matIter ||
67 bg.get({iX, iY+1, iZ}) == *_matIter ||
68 bg.get({iX, iY, iZ+1}) == *_matIter ||
69 bg.get({iX, iY+1, iZ+1}) == *_matIter ||
70 bg.get({iX+1, iY, iZ}) == *_matIter ||
71 bg.get({iX+1, iY+1, iZ}) == *_matIter ||
72 bg.get({iX+1, iY, iZ+1}) == *_matIter ||
73 bg.get({iX+1, iY+1, iZ+1}) == *_matIter
74 ) {
75 p->setActive(false);
76 return;
77 }
78 }
79}
BlockGeometry< T, D > & getBlockGeometry(int locIC)
Read and write access to a single block geometry.
CuboidGeometry< T, D > & getCuboidGeometry()
Read and write access to cuboid geometry.
LoadBalancer< T > & getLoadBalancer()
Read and write access to the load balancer.

References olb::BlockGeometry< T, D >::get().

+ Here is the call graph for this function:

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