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

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

#include <latticeIndicatorSmoothIndicatorIntersection2D.h>

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

Public Member Functions

 BlockLatticeIndicatorSmoothIndicatorIntersection2D (BlockLattice< T, DESCRIPTOR > &blockLattice, BlockGeometry< T, 2 > &blockGeometry, IndicatorF2D< T > &normalInd, SmoothIndicatorF2D< 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::BlockLatticeF2D< T, DESCRIPTOR >
BlockLattice< T, DESCRIPTOR > & getBlock ()
 Copy Constructor.
 
- Public Member Functions inherited from olb::BlockF2D< T >
virtual BlockStructureD< 2 > & getBlockStructure ()
 virtual destructor for defined behaviour
 
void setBlockStructure (BlockStructureD< 2 > *blockStructure)
 
BlockF2D< T > & operator- (BlockF2D< T > &rhs)
 
BlockF2D< T > & operator+ (BlockF2D< T > &rhs)
 
BlockF2D< T > & operator* (BlockF2D< T > &rhs)
 
BlockF2D< T > & operator/ (BlockF2D< 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::BlockLatticeF2D< T, DESCRIPTOR >
 BlockLatticeF2D (BlockLattice< T, DESCRIPTOR > &blockLattice, int targetDim)
 
- Protected Member Functions inherited from olb::BlockF2D< T >
 BlockF2D (BlockStructureD< 2 > &blockStructure, int targetDim)
 
 BlockF2D (int targetDim)
 
- Protected Member Functions inherited from olb::GenericF< T, int >
 GenericF (int targetDim, int sourceDim)
 
- Protected Attributes inherited from olb::BlockLatticeF2D< T, DESCRIPTOR >
BlockLattice< T, DESCRIPTOR > & _blockLattice
 
- Protected Attributes inherited from olb::BlockF2D< T >
BlockStructureD< 2 > * _blockStructure
 

Detailed Description

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

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

Definition at line 52 of file latticeIndicatorSmoothIndicatorIntersection2D.h.

Constructor & Destructor Documentation

◆ BlockLatticeIndicatorSmoothIndicatorIntersection2D()

template<typename T , typename DESCRIPTOR , bool HLBM>
olb::BlockLatticeIndicatorSmoothIndicatorIntersection2D< T, DESCRIPTOR, HLBM >::BlockLatticeIndicatorSmoothIndicatorIntersection2D ( BlockLattice< T, DESCRIPTOR > & blockLattice,
BlockGeometry< T, 2 > & blockGeometry,
IndicatorF2D< T > & normalInd,
SmoothIndicatorF2D< T, T, HLBM > & smoothInd )

Definition at line 78 of file latticeIndicatorSmoothIndicatorIntersection2D.hh.

82 : BlockLatticeF2D<T, DESCRIPTOR>(blockLattice, 1),
83 _blockGeometry(blockGeometry), _normalInd(normalInd), _smoothInd(smoothInd)
84{
85 this->getName() = "Indicator-SmoothIndicator Intersection";
86}
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::BlockLatticeIndicatorSmoothIndicatorIntersection2D< 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 89 of file latticeIndicatorSmoothIndicatorIntersection2D.hh.

90{
91 output[0] = 0.;
92 int start[2] = {0};
93 int end[2] = {0};
94 // check for intersection of cuboid and smoothIndicator
95 Cuboid2D<T> tmpCuboid(_blockGeometry.getOrigin()[0], _blockGeometry.getOrigin()[1], _blockGeometry.getDeltaR(), _blockGeometry.getNx(), _blockGeometry.getNy());
96 T posXmin = _smoothInd.getPos()[0] - _smoothInd.getCircumRadius();
97 T posXmax = _smoothInd.getPos()[0] + _smoothInd.getCircumRadius();
98 T posYmin = _smoothInd.getPos()[1] - _smoothInd.getCircumRadius();
99 T posYmax = _smoothInd.getPos()[1] + _smoothInd.getCircumRadius();
100 if (tmpCuboid.checkInters(posXmin, posXmax, posYmin, posYmax, start[0], end[0], start[1], end[1])) {
101
102 for (int k=0; k<2; k++) {
103 start[k] -= 1;
104 if (start[k] < 0) {
105 start[k] = 0;
106 }
107 end[k] += 2;
108 if (end[k] > _blockGeometry.getExtent()[k]) {
109 end[k] = _blockGeometry.getExtent()[k];
110 }
111 }
112
113 // iterate over cells in the constructed intersection box
114 for (int iX = start[0]; iX < end[0]; iX++) {
115 for (int iY = start[1]; iY < end[1]; iY++) {
116
117 // check if cell belongs to particle
118 T insideT[1] = {0.};
119 T posIn[2] = {0.};
120 _blockGeometry.getPhysR(posIn, {iX, iY});
121 _smoothInd( insideT, posIn);
122 if ( !util::nearZero(insideT[0]) && this->_blockGeometry.get({iX,iY})==1) {
123 // Return 1 if at least one cell is found to be inside both A and B
124 bool insideBool[1] = {false};
125 _normalInd(insideBool, posIn);
126 if (insideBool[0]) {
127 output[0] = 1.;
128 return true;
129 }
130 }
131 }
132 }
133 }
134
135 return true;
136}
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.
bool nearZero(const ADf< T, DIM > &a)
Definition aDiff.h:1087

References olb::Cuboid2D< 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: