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

#include <wireBoundaryForMagP3D.h>

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

Public Member Functions

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

Definition at line 44 of file wireBoundaryForMagP3D.h.

Constructor & Destructor Documentation

◆ WireBoundaryForMagP3D() [1/2]

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

Copy constructor.

◆ WireBoundaryForMagP3D() [2/2]

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

Constructor with set of material numbers.

Definition at line 34 of file wireBoundaryForMagP3D.hh.

36 : Boundary3D<T, PARTICLETYPE>(),
37 _sg(sg),
38 _materials(materials.begin(), materials.end())
39{
40}

◆ ~WireBoundaryForMagP3D()

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

Definition at line 52 of file wireBoundaryForMagP3D.h.

52{};

Member Function Documentation

◆ addMaterial() [1/2]

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

Add a single material number.

Definition at line 55 of file wireBoundaryForMagP3D.h.

56 {
57 _materials.insert(mat);
58 }

◆ addMaterial() [2/2]

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

Add several material numbers.

Definition at line 60 of file wireBoundaryForMagP3D.h.

61 {
62 for (unsigned i = 0; i < mats.size(); ++i) {
63 _materials.insert(mats[i]);
64 }
65 }

◆ applyBoundary()

template<typename T , template< typename U > class PARTICLETYPE>
void olb::WireBoundaryForMagP3D< 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 43 of file wireBoundaryForMagP3D.hh.

46{
47
48 int latticeR[3] = { 0 };
49 _sg.getCuboidGeometry().get(p->getCuboid()).getFloorLatticeR(latticeR, &p->getPos()[0]);
50
51 // Read only access to the material numbers of nodes around particle position
52 const BlockGeometry<T,3>& bg = _sg.getBlockGeometry(
53 _sg.getLoadBalancer().loc(p->getCuboid()));
54
55 // + overlap is because of lower boundaries, latticeR has to be shifted up
56 int iX = latticeR[0];
57 int iY = latticeR[1];
58 int iZ = latticeR[2];
59 for (_matIter = _materials.begin(); _matIter != _materials.end(); _matIter++) {
60
61 if (bg.get(iX, iY, iZ) == *_matIter ||
62 bg.get(iX, iY + 1, iZ) == *_matIter ||
63 bg.get(iX, iY, iZ + 1) == *_matIter ||
64 bg.get(iX, iY + 1, iZ + 1) == *_matIter ||
65 bg.get(iX + 1, iY, iZ) == *_matIter ||
66 bg.get(iX + 1, iY + 1, iZ) == *_matIter ||
67 bg.get(iX + 1, iY, iZ + 1) == *_matIter ||
68 bg.get(iX + 1, iY + 1, iZ + 1) == *_matIter) {
69
70 if ((*_matIter == 5) && (p->getSActivity() != 3)) {
71
72 std::vector<T> vel(3, T()) ;
73 p->setVel(vel) ;
74 p->setSActivity(3) ;
75 break;
76 }
77 if ((*_matIter == 4) && (p->getActive() != false)) {
78
79 p->setActive(false) ;
80 break;
81 }
82 }
83 }
84 return;
85}
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: