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

#include <blockGeometryFaces2D.h>

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

Public Member Functions

 BlockGeometryFacesIndicator2D (BlockGeometry< T, 2 > &blockGeometry, SmoothIndicatorF2D< T, T, HLBM > &indicator, int material, T deltaX)
 
bool operator() (T output[], const int input[]) override
 has to be implemented for 'every' derived class
 
- 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::GenericF< T, int >
 GenericF (int targetDim, int sourceDim)
 

Detailed Description

template<typename T, bool HLBM = false>
class olb::BlockGeometryFacesIndicator2D< T, HLBM >

Definition at line 44 of file blockGeometryFaces2D.h.

Constructor & Destructor Documentation

◆ BlockGeometryFacesIndicator2D()

template<typename T , bool HLBM>
olb::BlockGeometryFacesIndicator2D< T, HLBM >::BlockGeometryFacesIndicator2D ( BlockGeometry< T, 2 > & blockGeometry,
SmoothIndicatorF2D< T, T, HLBM > & indicator,
int material,
T deltaX )

Definition at line 94 of file blockGeometryFaces2D.hh.

97 : GenericF<T,int>(5,0), _blockGeometry(blockGeometry), _indicator(indicator),
98 _material(material), _latticeL(latticeL) // _latticeLsqr(latticeL*latticeL)
99{
100 this->getName() = "facesSmoothInd";
101}
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 , bool HLBM>
bool olb::BlockGeometryFacesIndicator2D< T, HLBM >::operator() ( T output[],
const int input[] )
overridevirtual

has to be implemented for 'every' derived class

Implements olb::GenericF< T, int >.

Definition at line 103 of file blockGeometryFaces2D.hh.

104{
105 int counter[4] = {0,0,0,0};
106 T inside[1];
107 T physR[2];
108 if (_blockGeometry.getStatistics().getNvoxel(_material)!=0) {
109 const int x0 = _blockGeometry.getStatistics().getMinLatticeR(_material)[0];
110 const int y0 = _blockGeometry.getStatistics().getMinLatticeR(_material)[1];
111 const int x1 = _blockGeometry.getStatistics().getMaxLatticeR(_material)[0];
112 const int y1 = _blockGeometry.getStatistics().getMaxLatticeR(_material)[1];
113
114 // Iterate over all cells and count the cells of the face
115 for (int iX = x0; iX <= x1; ++iX) {
116 for (int iY = y0; iY <= y1; ++iY) {
117 // Look at solid nodes only
118 _blockGeometry.getPhysR(physR, {iX, iY});
119 _indicator(inside, physR);
120 if ( !util::nearZero(inside[0]) ) {
121 _blockGeometry.getPhysR(physR, {iX-1, iY});
122 _indicator(inside, physR);
123 if ( util::nearZero(inside[0]) )
124 counter[0]++;
125 _blockGeometry.getPhysR(physR, {iX, iY-1});
126 _indicator(inside, physR);
127 if ( util::nearZero(inside[0]) )
128 counter[1]++;
129 _blockGeometry.getPhysR(physR, {iX+1, iY});
130 _indicator(inside, physR);
131 if ( util::nearZero(inside[0]) )
132 counter[2]++;
133 _blockGeometry.getPhysR(physR, {iX, iY+1});
134 _indicator(inside, physR);
135 if ( util::nearZero(inside[0]) )
136 counter[3]++;
137 }
138 }
139 }
140
141 T total = T();
142 for (int i=0; i<4; ++i) {
143 output[i]= ((T) counter[i]) * _latticeL;
144 total+= ((T) counter[i]) * _latticeL;
145 }
146 output[4]=total;
147 return true;
148 } else {
149 for (int i=0; i<5; ++i) {
150 output[i]=T();
151 }
152 return true;
153 }
154 return false;
155
156}
const BlockGeometryStatistics< T, D > & getStatistics() const
Read only access to the associated block statistic.
Vector< T, D > getPhysR(LatticeR< D > latticeR)
bool nearZero(const ADf< T, DIM > &a)
Definition aDiff.h:1087

References olb::util::nearZero().

+ Here is the call graph for this function:

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