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

#include <blockGeometryFaces3D.h>

+ Inheritance diagram for olb::BlockGeometryFaces3D< T >:
+ Collaboration diagram for olb::BlockGeometryFaces3D< T >:

Public Member Functions

 BlockGeometryFaces3D (BlockIndicatorF3D< T > &indicatorF, T latticeL)
 
bool operator() (T output[], const int input[]) override
 has to be implemented for 'every' derived class
 
- 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::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::BlockF3D< T >
BlockStructureD< 3 > & _blockStructure
 

Detailed Description

template<typename T>
class olb::BlockGeometryFaces3D< T >

Definition at line 34 of file blockGeometryFaces3D.h.

Constructor & Destructor Documentation

◆ BlockGeometryFaces3D()

template<typename T >
olb::BlockGeometryFaces3D< T >::BlockGeometryFaces3D ( BlockIndicatorF3D< T > & indicatorF,
T latticeL )

Definition at line 33 of file blockGeometryFaces3D.hh.

34 : BlockF3D<T>(indicatorF.getBlockStructure(), 7),
35 _indicatorF(indicatorF),
36 _latticeL(latticeL)
37{
38 this->getName() = "blockGeometryFaces";
39}
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 olb::BlockGeometryFaces3D< T >::operator() ( T output[],
const int input[] )
overridevirtual

has to be implemented for 'every' derived class

Implements olb::GenericF< T, int >.

Definition at line 42 of file blockGeometryFaces3D.hh.

43{
44 for (int i=0; i<7; ++i) {
45 output[i] = T();
46 }
47
48 std::size_t counter[7] = {0};
49
50 if (!_indicatorF.isEmpty()) {
51 auto& blockGeometry = _indicatorF.getBlockGeometry();
52 const Vector<int,3> min = _indicatorF.getMin();
53 const Vector<int,3> max = _indicatorF.getMax();
54
55 // Iterate over all cells and count the cells of the face
56 for (int iX = min[0]; iX <= max[0]; ++iX) {
57 for (int iY = min[1]; iY <= max[1]; ++iY) {
58 for (int iZ = min[2]; iZ <= max[2]; ++iZ) {
59 // Lock at solid nodes only
60 if (_indicatorF(iX, iY, iZ)) {
61 if (blockGeometry.getMaterial({iX-1, iY, iZ}) == 1) {
62 counter[0]++;
63 }
64 if (blockGeometry.getMaterial({iX, iY-1, iZ}) == 1) {
65 counter[1]++;
66 }
67 if (blockGeometry.getMaterial({iX, iY, iZ-1}) == 1) {
68 counter[2]++;
69 }
70 if (blockGeometry.getMaterial({iX+1, iY, iZ}) == 1) {
71 counter[3]++;
72 }
73 if (blockGeometry.getMaterial({iX, iY+1, iZ}) == 1) {
74 counter[4]++;
75 }
76 if (blockGeometry.getMaterial({iX, iY, iZ+1}) == 1) {
77 counter[5]++;
78 }
79 }
80 }
81 }
82 }
83
84 const T dx2 = _latticeL*_latticeL;
85 for (int i=0; i<6; ++i) {
86 output[i] = (T) counter[i] * dx2;
87 output[6] += (T) counter[i] * dx2;
88 }
89 }
90
91 return true;
92}
Pack< T > min(Pack< T > rhs, Pack< T > lhs)
Definition 256.h:406
Pack< T > max(Pack< T > rhs, Pack< T > lhs)
Definition 256.h:416

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