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

functor returns pointwise an approximation for the volume fraction More...

#include <latticeVolumeFractionApproximation2D.h>

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

Public Member Functions

 BlockLatticeVolumeFractionApproximation2D (BlockLattice< T, DESCRIPTOR > &blockLattice, BlockGeometry< T, 2 > &blockGeometry, IndicatorF2D< T > &indicator, int refinementLevel, const UnitConverter< T, DESCRIPTOR > &converter, bool insideOut)
 
bool operator() (T output[], const int input[])
 has to be implemented for 'every' derived class
 
- 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::BlockLatticeVolumeFractionApproximation2D< T, DESCRIPTOR >

functor returns pointwise an approximation for the volume fraction

Definition at line 52 of file latticeVolumeFractionApproximation2D.h.

Constructor & Destructor Documentation

◆ BlockLatticeVolumeFractionApproximation2D()

template<typename T , typename DESCRIPTOR >
olb::BlockLatticeVolumeFractionApproximation2D< T, DESCRIPTOR >::BlockLatticeVolumeFractionApproximation2D ( BlockLattice< T, DESCRIPTOR > & blockLattice,
BlockGeometry< T, 2 > & blockGeometry,
IndicatorF2D< T > & indicator,
int refinementLevel,
const UnitConverter< T, DESCRIPTOR > & converter,
bool insideOut )

Definition at line 63 of file latticeVolumeFractionApproximation2D.hh.

69 : BlockLatticeF2D<T, DESCRIPTOR>(blockLattice, 1),
70 _blockGeometry(blockGeometry), _indicator(indicator), _refinementLevel(refinementLevel), _converter(converter), _insideOut(insideOut),
71 _physSubGridMinPhysRshift((1./ T(_refinementLevel * 2.) - 0.5) * _converter.getPhysDeltaX()),
72 _physSubGridDeltaX(1. / T(_refinementLevel) * _converter.getPhysDeltaX()),
73 _latticeSubGridVolume(1. / (_refinementLevel * _refinementLevel))
74{
75 this->getName() = "volumeFractionApproximation";
76}
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 , typename DESCRIPTOR >
bool olb::BlockLatticeVolumeFractionApproximation2D< T, DESCRIPTOR >::operator() ( T output[],
const int input[] )
virtual

has to be implemented for 'every' derived class

Implements olb::GenericF< T, int >.

Definition at line 79 of file latticeVolumeFractionApproximation2D.hh.

80{
81 output[0] = 0.;
82 T physR[2];
83 bool inside[1];
84 _blockGeometry.getPhysR(physR, {input[0], input[1]});
85
86 T subGridMinPhysR[2];
87 subGridMinPhysR[0] = physR[0] + _physSubGridMinPhysRshift;
88 subGridMinPhysR[1] = physR[1] + _physSubGridMinPhysRshift;
89
90 for (int x = 0; x < _refinementLevel; x++) {
91 for (int y = 0; y < _refinementLevel; y++) {
92 physR[0] = subGridMinPhysR[0] + x * _physSubGridDeltaX;
93 physR[1] = subGridMinPhysR[1] + y * _physSubGridDeltaX;
94 _indicator(inside, physR);
95 if (!_insideOut) {
96 if (inside[0]) {
97 output[0] += _latticeSubGridVolume;
98 }
99 }
100 else {
101 if (!inside[0]) {
102 output[0] += _latticeSubGridVolume;
103 }
104 }
105 }
106 }
107 return true;
108}
Vector< T, D > getPhysR(LatticeR< D > latticeR)

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