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

#include <blockGeometryFaces3D.h>

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

Public Member Functions

 BlockGeometryFacesIndicator3D (BlockGeometry< T, 3 > &blockGeometry, SmoothIndicatorF3D< 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::BlockGeometryFacesIndicator3D< T, HLBM >

Definition at line 44 of file blockGeometryFaces3D.h.

Constructor & Destructor Documentation

◆ BlockGeometryFacesIndicator3D()

template<typename T , bool HLBM>
olb::BlockGeometryFacesIndicator3D< T, HLBM >::BlockGeometryFacesIndicator3D ( BlockGeometry< T, 3 > & blockGeometry,
SmoothIndicatorF3D< T, T, HLBM > & indicator,
int material,
T deltaX )

Definition at line 95 of file blockGeometryFaces3D.hh.

98 : GenericF<T,int>(7,0), _blockGeometry(blockGeometry), _indicator(indicator),
99 _material(material), _latticeLsqr(latticeL*latticeL)
100{
101 this->getName() = "facesSmoothInd";
102}
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::BlockGeometryFacesIndicator3D< 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 104 of file blockGeometryFaces3D.hh.

105{
106 int counter[6] = {0,0,0,0,0,0};
107 T inside[1];
108 T physR[3];
109 if (_blockGeometry.getStatistics().getNvoxel(_material)!=0) {
110 const int x0 = _blockGeometry.getStatistics().getMinLatticeR(_material)[0];
111 const int y0 = _blockGeometry.getStatistics().getMinLatticeR(_material)[1];
112 const int z0 = _blockGeometry.getStatistics().getMinLatticeR(_material)[2];
113 const int x1 = _blockGeometry.getStatistics().getMaxLatticeR(_material)[0];
114 const int y1 = _blockGeometry.getStatistics().getMaxLatticeR(_material)[1];
115 const int z1 = _blockGeometry.getStatistics().getMaxLatticeR(_material)[2];
116
117 // Iterate over all cells and count the cells of the face
118 for (int iX = x0; iX <= x1; ++iX) {
119 for (int iY = y0; iY <= y1; ++iY) {
120 for (int iZ = z0; iZ <= z1; ++iZ) {
121 // Look at solid nodes only
122 _blockGeometry.getPhysR(physR, {iX, iY, iZ});
123 _indicator(inside, physR);
124 if ( !util::nearZero(inside[0]) ) {
125 _blockGeometry.getPhysR(physR, {iX-1, iY, iZ});
126 _indicator(inside, physR);
127 if ( util::nearZero(inside[0]) ) {
128 counter[0]++;
129 }
130 _blockGeometry.getPhysR(physR, {iX, iY-1, iZ});
131 _indicator(inside, physR);
132 if ( util::nearZero(inside[0]) ) {
133 counter[1]++;
134 }
135 _blockGeometry.getPhysR(physR, {iX, iY, iZ-1});
136 _indicator(inside, physR);
137 if ( util::nearZero(inside[0]) ) {
138 counter[2]++;
139 }
140 _blockGeometry.getPhysR(physR, {iX+1, iY, iZ});
141 _indicator(inside, physR);
142 if ( util::nearZero(inside[0]) ) {
143 counter[3]++;
144 }
145 _blockGeometry.getPhysR(physR, {iX, iY+1, iZ});
146 _indicator(inside, physR);
147 if ( util::nearZero(inside[0]) ) {
148 counter[4]++;
149 }
150 _blockGeometry.getPhysR(physR, {iX, iY, iZ+1});
151 _indicator(inside, physR);
152 if ( util::nearZero(inside[0]) ) {
153 counter[5]++;
154 }
155 }
156 }
157 }
158 }
159
160 T total = T();
161 for (int i=0; i<6; ++i) {
162 output[i]= ((T) counter[i]) * _latticeLsqr;
163 total+= ((T) counter[i]) * _latticeLsqr;
164 }
165 output[6]=total;
166 return true;
167 }
168 else {
169 for (int i=0; i<7; ++i) {
170 output[i]=T();
171 }
172 return true;
173 }
174 return false;
175
176}
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: