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

functor that returns 1 if SmoothIndicatorF A intersects IndicatorF B; otherwise, 0 More...

#include <latticeIndicatorSmoothIndicatorIntersection3D.h>

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

Public Member Functions

 BlockLatticeIndicatorSmoothIndicatorIntersection3D (BlockLattice< T, DESCRIPTOR > &blockLattice, BlockGeometry< T, 3 > &blockGeometry, IndicatorF3D< T > &normalInd, SmoothIndicatorF3D< T, T, HLBM > &smoothInd)
 
bool operator() (T output[], const int input[]) override
 has to be implemented for 'every' derived class
 
- Public Member Functions inherited from olb::BlockLatticeF3D< T, DESCRIPTOR >
BlockLattice< T, DESCRIPTOR > & getBlock ()
 Copy Constructor.
 
- Public Member Functions inherited from olb::BlockF3D< T >
 ~BlockF3D () override
 virtual destructor for defined behaviour
 
virtual BlockStructureD< 3 > & getBlockStructure () const
 
BlockF3D< T > & operator- (BlockF3D< T > &rhs)
 
BlockF3D< T > & operator+ (BlockF3D< T > &rhs)
 
BlockF3D< T > & operator* (BlockF3D< T > &rhs)
 
BlockF3D< T > & operator/ (BlockF3D< T > &rhs)
 
- Public Member Functions inherited from olb::GenericF< T, int >
virtual ~GenericF ()=default
 
int getSourceDim () const
 read only access to member variable _m
 
int getTargetDim () const
 read only access to member variable _n
 
std::string & getName ()
 read and write access to name
 
std::string const & getName () const
 read only access to name
 
bool operator() (T output[])
 wrapper that call the pure virtual operator() (T output[], const S input[]) from above
 
bool operator() (T output[], int input0)
 
bool operator() (T output[], int input0, int input1)
 
bool operator() (T output[], int input0, int input1, int input2)
 
bool operator() (T output[], int input0, int input1, int input2, int input3)
 

Additional Inherited Members

- Public Types inherited from olb::GenericF< T, int >
using targetType
 
using sourceType
 
- Public Attributes inherited from olb::GenericF< T, int >
std::shared_ptr< GenericF< T, int > > _ptrCalcC
 memory management, frees resouces (calcClass)
 
- Protected Member Functions inherited from olb::BlockLatticeF3D< T, DESCRIPTOR >
 BlockLatticeF3D (BlockLattice< T, DESCRIPTOR > &blockLattice, int targetDim)
 
- Protected Member Functions inherited from olb::BlockF3D< T >
 BlockF3D (BlockStructureD< 3 > &blockStructure, int targetDim)
 
- Protected Member Functions inherited from olb::GenericF< T, int >
 GenericF (int targetDim, int sourceDim)
 
- Protected Attributes inherited from olb::BlockLatticeF3D< T, DESCRIPTOR >
BlockLattice< T, DESCRIPTOR > & _blockLattice
 
- Protected Attributes inherited from olb::BlockF3D< T >
BlockStructureD< 3 > & _blockStructure
 

Detailed Description

template<typename T, typename DESCRIPTOR, bool HLBM>
class olb::BlockLatticeIndicatorSmoothIndicatorIntersection3D< T, DESCRIPTOR, HLBM >

functor that returns 1 if SmoothIndicatorF A intersects IndicatorF B; otherwise, 0

Definition at line 61 of file latticeIndicatorSmoothIndicatorIntersection3D.h.

Constructor & Destructor Documentation

◆ BlockLatticeIndicatorSmoothIndicatorIntersection3D()

template<typename T , typename DESCRIPTOR , bool HLBM>
olb::BlockLatticeIndicatorSmoothIndicatorIntersection3D< T, DESCRIPTOR, HLBM >::BlockLatticeIndicatorSmoothIndicatorIntersection3D ( BlockLattice< T, DESCRIPTOR > & blockLattice,
BlockGeometry< T, 3 > & blockGeometry,
IndicatorF3D< T > & normalInd,
SmoothIndicatorF3D< T, T, HLBM > & smoothInd )

Definition at line 78 of file latticeIndicatorSmoothIndicatorIntersection3D.hh.

83 : BlockLatticeF3D<T, DESCRIPTOR>(blockLattice, 1),
84 _blockGeometry(blockGeometry), _normalInd(normalInd), _smoothInd(smoothInd)
85{
86 this->getName() = "Indicator-SmoothIndicator Intersection";
87}
std::string & getName()
read and write access to name
Definition genericF.hh:51

References olb::GenericF< T, int >::getName().

+ Here is the call graph for this function:

Member Function Documentation

◆ operator()()

template<typename T , typename DESCRIPTOR , bool HLBM>
bool olb::BlockLatticeIndicatorSmoothIndicatorIntersection3D< T, DESCRIPTOR, HLBM >::operator() ( T output[],
const int input[] )
overridevirtual

has to be implemented for 'every' derived class

Implements olb::GenericF< T, int >.

Definition at line 90 of file latticeIndicatorSmoothIndicatorIntersection3D.hh.

91{
92 output[0] = 0.;
93 int start[3] = {0};
94 int end[3] = {0};
95 // check for intersection of cuboid and smoothIndicator
96 Cuboid3D<T> tmpCuboid(_blockGeometry.getOrigin()[0], _blockGeometry.getOrigin()[1], _blockGeometry.getOrigin()[2], _blockGeometry.getDeltaR(), _blockGeometry.getNx(), _blockGeometry.getNy(), _blockGeometry.getNz());
97 T posXmin = _smoothInd.getPos()[0] - _smoothInd.getCircumRadius();
98 T posXmax = _smoothInd.getPos()[0] + _smoothInd.getCircumRadius();
99 T posYmin = _smoothInd.getPos()[1] - _smoothInd.getCircumRadius();
100 T posYmax = _smoothInd.getPos()[1] + _smoothInd.getCircumRadius();
101 T posZmin = _smoothInd.getPos()[2] - _smoothInd.getCircumRadius();
102 T posZmax = _smoothInd.getPos()[2] + _smoothInd.getCircumRadius();
103 if (tmpCuboid.checkInters(posXmin, posXmax, posYmin, posYmax, posZmin, posZmax, start[0],
104 end[0], start[1], end[1], start[2], end[2])) {
105
106 for (int k=0; k<3; k++) {
107 start[k] -= 1;
108 if (start[k] < 0) {
109 start[k] = 0;
110 }
111 end[k] += 2;
112 if (end[k] > _blockGeometry.getExtent()[k]) {
113 end[k] = _blockGeometry.getExtent()[k];
114 }
115 }
116
117 // iterate over cells in the constructed intersection box
118 for (int iX = start[0]; iX < end[0]; iX++) {
119 for (int iY = start[1]; iY < end[1]; iY++) {
120 for (int iZ = start[2]; iZ < end[2]; iZ++) {
121
122 // check if cell belongs to particle
123 T insideT[1] = {0.};
124 T posIn[3] = {0.};
125 _blockGeometry.getPhysR(posIn, {iX, iY, iZ});
126 _smoothInd( insideT, posIn);
127 if ( !util::nearZero(insideT[0]) && this->_blockGeometry.get({iX,iY,iZ})==1) {
128 // Return true if at least one cell is found to be inside both A and B
129 bool insideBool[1] = {false};
130 _normalInd(insideBool, posIn);
131 if (insideBool[0]) {
132 output[0] = 1.;
133 return true;
134 }
135 }
136 }
137 }
138 }
139 }
140
141 return true;
142}
Vector< T, D > getPhysR(LatticeR< D > latticeR)
T getDeltaR() const
Read only access to the voxel size given in SI units (meter)
Vector< T, D > getOrigin() const
Read only access to the origin position given in SI units (meter)
Vector< int, D > getExtent() const
Returns the extend of the block in lattice units.
std::enable_if_t< sizeof...(L)==D, int > get(L... latticeR) const
Read-only access to a material number.
int getNy() const
Read only access to block height.
int getNx() const
Read only access to block width.
int getNz() const
Read only access to block height.
bool nearZero(const ADf< T, DIM > &a)
Definition aDiff.h:1087

References olb::Cuboid3D< T >::checkInters(), and olb::util::nearZero().

+ Here is the call graph for this function:

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