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

#include <blockLatticeRefinementMetricF2D.h>

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

Public Member Functions

 BlockLatticeRefinementMetricKnudsen2D (BlockLattice< T, DESCRIPTOR > &blockLattice, const UnitConverter< T, DESCRIPTOR > &converter)
 
bool operator() (T output[])
 
bool operator() (T output[], const int input[]) override
 has to be implemented for 'every' derived class
 
- Public Member Functions inherited from olb::BlockLatticeKnudsen2D< T, DESCRIPTOR >
 BlockLatticeKnudsen2D (BlockLattice< T, DESCRIPTOR > &blockLattice)
 
- 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>
class olb::BlockLatticeRefinementMetricKnudsen2D< T, DESCRIPTOR >

Definition at line 41 of file blockLatticeRefinementMetricF2D.h.

Constructor & Destructor Documentation

◆ BlockLatticeRefinementMetricKnudsen2D()

template<typename T , typename DESCRIPTOR >
olb::BlockLatticeRefinementMetricKnudsen2D< T, DESCRIPTOR >::BlockLatticeRefinementMetricKnudsen2D ( BlockLattice< T, DESCRIPTOR > & blockLattice,
const UnitConverter< T, DESCRIPTOR > & converter )

Definition at line 68 of file blockLatticeRefinementMetricF2D.hh.

71 : BlockLatticeKnudsen2D<T, DESCRIPTOR>(blockLattice),
72 _knudsen(converter.getKnudsenNumber())
73{
74 this->getName() = "refinementMetricKnudsen";
75}
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()() [1/2]

template<typename T , typename DESCRIPTOR >
bool olb::BlockLatticeRefinementMetricKnudsen2D< T, DESCRIPTOR >::operator() ( T output[])

Definition at line 78 of file blockLatticeRefinementMetricF2D.hh.

79{
80 const std::size_t cellCount = this->_blockLattice.getNx() * this->_blockLattice.getNy();
81
82 T blockSum = 0.;
83
84 T localOutput[1] = { };
85 int localInput[2] = { };
86
87 for (localInput[0] = 0; localInput[0] < this->_blockLattice.getNx(); ++localInput[0]) {
88 for (localInput[1] = 0; localInput[1] < this->_blockLattice.getNy(); ++localInput[1]) {
90
91 blockSum += localOutput[0];
92 }
93 }
94
95 const T blockC = blockSum / cellCount;
96
97 output[0] = std::log2(blockC / _knudsen);
98
99 if ( output[0] <= 0. || blockC <= 0. ) {
100 output[0] = 0.;
101 }
102
103 return true;
104}
BlockLattice< T, DESCRIPTOR > & _blockLattice
bool operator()(T output[], const int input[]) override
has to be implemented for 'every' derived class

References olb::BlockLatticeKnudsen2D< T, DESCRIPTOR >::operator()().

+ Here is the call graph for this function:

◆ operator()() [2/2]

template<typename T , typename DESCRIPTOR >
bool olb::BlockLatticeRefinementMetricKnudsen2D< T, DESCRIPTOR >::operator() ( T output[],
const int input[] )
overridevirtual

has to be implemented for 'every' derived class

Reimplemented from olb::BlockLatticeKnudsen2D< T, DESCRIPTOR >.

Definition at line 107 of file blockLatticeRefinementMetricF2D.hh.

109{
110 T measuredKnudsen[1] { };
112
113 output[0] = std::log2(measuredKnudsen[0] / _knudsen);
114
115 if ( output[0] <= 0. || measuredKnudsen[0] <= 0. ) {
116 output[0] = 0.;
117 }
118
119 return true;
120}

References olb::BlockLatticeKnudsen2D< T, DESCRIPTOR >::operator()().

+ Here is the call graph for this function:

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