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

#include <blockGeometryFaces2D.h>

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

Public Member Functions

 BlockGeometryFaces2D (BlockIndicatorF2D< 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::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::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::BlockF2D< T >
BlockStructureD< 2 > * _blockStructure
 

Detailed Description

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

Definition at line 34 of file blockGeometryFaces2D.h.

Constructor & Destructor Documentation

◆ BlockGeometryFaces2D()

template<typename T >
olb::BlockGeometryFaces2D< T >::BlockGeometryFaces2D ( BlockIndicatorF2D< T > & indicatorF,
T latticeL )

Definition at line 33 of file blockGeometryFaces2D.hh.

34 : BlockF2D<T>(indicatorF.getBlockStructure(), 5),
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::BlockGeometryFaces2D< 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 blockGeometryFaces2D.hh.

43{
44 for (int i=0; i<5; ++i) {
45 output[i] = T();
46 }
47
48 std::size_t counter[5] = {0};
49
50 if (!_indicatorF.isEmpty()) {
51 const auto& blockGeometry = _indicatorF.getBlockGeometry();
52 const Vector<int,2> min = _indicatorF.getMin();
53 const Vector<int,2> 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 // Lock at solid nodes only
59 if (_indicatorF(iX, iY)) {
60 if (blockGeometry.getMaterial({iX-1, iY}) == 1) {
61 counter[0]++;
62 }
63 if (blockGeometry.getMaterial({iX, iY-1}) == 1) {
64 counter[1]++;
65 }
66 if (blockGeometry.getMaterial({iX+1, iY}) == 1) {
67 counter[2]++;
68 }
69 if (blockGeometry.getMaterial({iX, iY+1}) == 1) {
70 counter[3]++;
71 }
72 }
73 }
74 }
75
76 const T dx2 = _latticeL*_latticeL;
77 T total = T(); //added
78 for (int i=0; i<4; ++i) {
79 output[i] = (T) counter[i] * dx2;
80 total+= (T) counter[i] * dx2; //was output[4]
81 }
82 output[4]=total;
83 return true;
84 } else {
85 for (int i=0; i<5; ++i) {
86 output[i]=T();
87 }
88 return true;
89 }
90 return false;
91}
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: