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

#include <materialSTLBoundary3D.h>

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

Public Member Functions

 MaterialSTLBoundary3D (SuperGeometry< T, 3 > &sg)
 Constructor.
 
 MaterialSTLBoundary3D (MaterialSTLBoundary3D< T, PARTICLETYPE > &f)
 Copy constructor.
 
 MaterialSTLBoundary3D (SuperGeometry< T, 3 > &sg, std::set< int > material, STLreader< T > &stlReader)
 Constructor with set of material numbers.
 
 ~MaterialSTLBoundary3D () 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::MaterialSTLBoundary3D< T, PARTICLETYPE >

Definition at line 49 of file materialSTLBoundary3D.h.

Constructor & Destructor Documentation

◆ MaterialSTLBoundary3D() [1/3]

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

Constructor.

◆ MaterialSTLBoundary3D() [2/3]

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

Copy constructor.

◆ MaterialSTLBoundary3D() [3/3]

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

Constructor with set of material numbers.

Definition at line 35 of file materialSTLBoundary3D.hh.

39 : Boundary3D<T, PARTICLETYPE>(),
40 _sg(sg),
41 _materials(materials.begin(),materials.end()),
42 _stlReader(stlReader)
43{
44
45}

◆ ~MaterialSTLBoundary3D()

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

Definition at line 62 of file materialSTLBoundary3D.h.

63 {
64 }

Member Function Documentation

◆ addMaterial() [1/2]

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

Add a single material number.

Definition at line 66 of file materialSTLBoundary3D.h.

67 {
68 _materials.insert(mat);
69 }

◆ addMaterial() [2/2]

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

Add several material numbers.

Definition at line 71 of file materialSTLBoundary3D.h.

72 {
73 for (unsigned i=0; i< mats.size(); ++i) {
74 _materials.insert(mats[i]);
75 }
76 }

◆ applyBoundary()

template<typename T , template< typename U > class PARTICLETYPE>
void olb::MaterialSTLBoundary3D< 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 93 of file materialSTLBoundary3D.hh.

96{
97
98 /*Particle3D<T>& particle= &p;
99 auto &position = particle->getPos();
100 std::cout << position << std::endl;*/
101
102 int latticeR[3] = { 0 };
103 _sg.getCuboidGeometry().get(p->getCuboid()).getFloorLatticeR(latticeR, &p->getPos()[0]);
104 //std::cout <<"particle position " << p->getPos()[0] << '\t' << p->getPos()[1] << '\t' << p->getPos()[2] << std::endl;
105 // std::cout << "output stlReader " << _stlReader.signedDistance(Vector<T,3>(p->getPos())) << std::endl;
106
107 // Read only access to the material numbers of nodes around particle position
108
109 const BlockGeometry<T,3>& bg = _sg.getBlockGeometry(
110 _sg.getLoadBalancer().loc(p->getCuboid()));
111 // + overlap is because of lower boundaries, latticeR has to be shifted up
112 int iX = latticeR[0];
113 int iY = latticeR[1];
114 int iZ = latticeR[2];
115 for (_matIter = _materials.begin(); _matIter != _materials.end(); _matIter++) {
116 if (bg.get({iX, iY, iZ}) == *_matIter ||
117 bg.get({iX, iY+1, iZ}) == *_matIter ||
118 bg.get({iX, iY, iZ+1}) == *_matIter ||
119 bg.get({iX, iY+1, iZ+1}) == *_matIter ||
120 bg.get({iX+1, iY, iZ}) == *_matIter ||
121 bg.get({iX+1, iY+1, iZ}) == *_matIter ||
122 bg.get({iX+1, iY, iZ+1}) == *_matIter ||
123 bg.get({iX+1, iY+1, iZ+1}) == *_matIter
124 ) {
125 if(p->getActive()){
126 //std::vector<std::vector<T>> direction//std::cout << "signed function called" << std::endl;
127 //for ( auto i=0; i <
128//if ( std::abs(_stlReader.signedDistance(Vector<T,3>(p->getPos()))) < p->getRad())
129 T distance = 0.;
130 //std::cout <<"new distance function" << std::endl;
131 _stlReader.distance(distance, Vector<T,3>(p->getPos()), p->getVel());
132 if ( std::abs(distance) < p->getRad())
133 {
134 //std::cout << "signed function called ended" << std::endl;
135 p->setActive(false);
136 /*std::cout << "Particle " <<p->getID() << " deposited at material number " << *_matIter << std::endl;
137 std::cout <<"Particle position " << p->getPos()[0] << '\t' << p->getPos()[1] << '\t' << p->getPos()[2] << std::endl;
138 std::cout << "Output stlReader " << std::abs(distance) << std::endl;
139 std::cout << "Particle Radius " << p->getRad() << std::endl;*/
140
141 }
142
143 }
144 //p->setActive(false);
145 return;
146 }
147 }
148}
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.
bool distance(S &distance, const Vector< S, D > &origin, const Vector< S, D > &direction, S precision, S pitch, F1 isInside, F2 isInsideBoundingBox)

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: