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

#include <boundarySimpleReflection3D.h>

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

Public Member Functions

 ReflectBoundary3D (T dT, SuperGeometry< T, 3 > &sg, std::set< int > materials)
 
 ~ReflectBoundary3D () override
 
void applyBoundary (typename std::deque< PARTICLETYPE< T > >::iterator &p, ParticleSystem3D< T, PARTICLETYPE > &psSys) override
 
- 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::ReflectBoundary3D< T, PARTICLETYPE >

Definition at line 52 of file boundarySimpleReflection3D.h.

Constructor & Destructor Documentation

◆ ReflectBoundary3D()

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

Definition at line 221 of file boundarySimpleReflection3D.hh.

221 :
222 Boundary3D<T, PARTICLETYPE>(), _dT(dT), _sg(sg), _materials(materials)
223{
224 _matIter = _materials.begin();
225}

◆ ~ReflectBoundary3D()

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

Definition at line 55 of file boundarySimpleReflection3D.h.

55{};

Member Function Documentation

◆ applyBoundary()

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

Implements olb::Boundary3D< T, PARTICLETYPE >.

Definition at line 352 of file boundarySimpleReflection3D.hh.

353{
354 //
355 int latticeR[4] = { 0,0,0,0 };
356 latticeR[0] = p->getCuboid();
357 _sg.getCuboidGeometry().get(latticeR[0]).getLatticeR(&(latticeR[1]),&p->getPos()[0]);
358
359 int mat = _sg.get(latticeR);
360 for (_matIter = _materials.begin(); _matIter != _materials.end(); _matIter++) {
361 if (mat == *_matIter) {
362 // Computing the discrete normal(s).
363 Vector<T,3> normal { computeDiscreteNormal(latticeR) };
364 Vector<T,3> P1 { p->getPos() };
365 Vector<T,3> R { _sg.getPhysR({latticeR[0], latticeR[1], latticeR[2], latticeR[3]}) };
366
367 std::vector<T> P1New { p->getPos() };
368 std::vector<T> vNew { p->getVel() };
369
370 for (int iD=0; iD<3; iD++) {
371 if (normal[iD]*(R[iD] - P1[iD]) > 0) {
372 P1New[iD] = 2.*R[iD] - P1[iD];
373 vNew[iD] = -vNew[iD];
374 }
375 }
376 p->setPos(P1New);
377 p->setVel(vNew);
378
379 return;
380 }
381 }
382}
int get(int iCglob, LatticeR< D > latticeR) const
Read only access to the material numbers, error handling: returns 0 if data is not available.
std::vector< T > getPhysR(int iCglob, LatticeR< D > latticeR) const
Transforms a lattice to physical position (SI unites)
CuboidGeometry< T, D > & getCuboidGeometry()
Read and write access to cuboid geometry.

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