OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
olb::BlockIndicatorF2D< T > Class Template Referenceabstract

Base block indicator functor (discrete) More...

#include <blockIndicatorBaseF2D.h>

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

Public Member Functions

 BlockIndicatorF2D (BlockGeometry< T, 2 > &geometry)
 
BlockGeometry< T, 2 > & getBlockGeometry ()
 Get underlying block geometry structure.
 
bool operator() (const int input[])
 Block indicator specific function operator overload.
 
bool operator() (int iX, int iY)
 
bool operator() (LatticeR< 2 > loc)
 
void setCache (const BlockData< 2, T, bool > &cache)
 Set bool-mask cache to be used by indicator operator overloads.
 
virtual bool isEmpty ()
 Returns true only if the indicated domain subset is empty.
 
virtual Vector< int, 2 > getMin ()=0
 Returns min lattice position of the indicated subset's bounding box.
 
virtual Vector< int, 2 > getMax ()=0
 Returns max lattice position of the indicated subset's bounding box.
 
- Public Member Functions inherited from olb::BlockF2D< bool >
virtual BlockStructureD< 2 > & getBlockStructure ()
 virtual destructor for defined behaviour
 
void setBlockStructure (BlockStructureD< 2 > *blockStructure)
 
BlockF2D< bool > & operator- (BlockF2D< bool > &rhs)
 
BlockF2D< bool > & operator+ (BlockF2D< bool > &rhs)
 
BlockF2D< bool > & operator* (BlockF2D< bool > &rhs)
 
BlockF2D< bool > & operator/ (BlockF2D< bool > &rhs)
 
- Public Member Functions inherited from olb::GenericF< T, S >
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
 
virtual bool operator() (T output[], const S input[])=0
 has to be implemented for 'every' derived class
 
bool operator() (T output[])
 wrapper that call the pure virtual operator() (T output[], const S input[]) from above
 
bool operator() (T output[], S input0)
 
bool operator() (T output[], S input0, S input1)
 
bool operator() (T output[], S input0, S input1, S input2)
 
bool operator() (T output[], S input0, S input1, S input2, S input3)
 

Protected Attributes

BlockGeometry< T, 2 > & _blockGeometryStructure
 
const BlockData< 2, T, bool > * _cachedData
 
- Protected Attributes inherited from olb::BlockF2D< bool >
BlockStructureD< 2 > * _blockStructure
 

Additional Inherited Members

- Public Types inherited from olb::GenericF< T, S >
using targetType = T
 
using sourceType = S
 
- Public Attributes inherited from olb::GenericF< T, S >
std::shared_ptr< GenericF< T, S > > _ptrCalcC
 memory management, frees resouces (calcClass)
 
- Protected Member Functions inherited from olb::BlockF2D< bool >
 BlockF2D (BlockStructureD< 2 > &blockStructure, int targetDim)
 
 BlockF2D (int targetDim)
 
- Protected Member Functions inherited from olb::GenericF< T, S >
 GenericF (int targetDim, int sourceDim)
 

Detailed Description

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

Base block indicator functor (discrete)

Definition at line 36 of file blockIndicatorBaseF2D.h.

Constructor & Destructor Documentation

◆ BlockIndicatorF2D()

template<typename T >
olb::BlockIndicatorF2D< T >::BlockIndicatorF2D ( BlockGeometry< T, 2 > & geometry)

Definition at line 33 of file blockIndicatorBaseF2D.hh.

34 : BlockF2D<bool>(geometry, 1),
36 _cachedData{nullptr}
37{ }
const BlockData< 2, T, bool > * _cachedData
BlockGeometry< T, 2 > & _blockGeometryStructure

Member Function Documentation

◆ getBlockGeometry()

template<typename T >
BlockGeometry< T, 2 > & olb::BlockIndicatorF2D< T >::getBlockGeometry ( )

Get underlying block geometry structure.

Returns
_blockGeometryStructure

Definition at line 40 of file blockIndicatorBaseF2D.hh.

41{
43}
+ Here is the caller graph for this function:

◆ getMax()

template<typename T >
virtual Vector< int, 2 > olb::BlockIndicatorF2D< T >::getMax ( )
pure virtual

◆ getMin()

template<typename T >
virtual Vector< int, 2 > olb::BlockIndicatorF2D< T >::getMin ( )
pure virtual

◆ isEmpty()

template<typename T >
bool olb::BlockIndicatorF2D< T >::isEmpty ( )
virtual

Returns true only if the indicated domain subset is empty.

May return false even if the indicated domain subset is in fact empty. Primarily implemented to minimize block accesses if an empty domain can be inferred by e.g. BlockGeometryStatistics2D data.

i.e. only override this method if the domain can be checked for emptyness in an efficient fashion.

Reimplemented in olb::BlockIndicatorMaterial2D< T >.

Definition at line 78 of file blockIndicatorBaseF2D.hh.

79{
80 // There is no way to determine domain emptyness in a fashion that is both
81 // generic and efficient.
82 return false;
83}

◆ operator()() [1/3]

template<typename T >
bool olb::BlockIndicatorF2D< T >::operator() ( const int input[])

Block indicator specific function operator overload.

The boolean return value of operator()(T output[], S input[]) describes the call's success and by convention must not describe the indicated domain.

Returns
Domain indicator i.e. true iff the input lies within the described subset.

Definition at line 46 of file blockIndicatorBaseF2D.hh.

47{
48 bool output{};
49 if (_cachedData == nullptr) {
50 this->operator()(&output, input);
51 }
52 else {
53 _cachedData->get(input);
54 }
55 return output;
56}
U & get(std::size_t iCell, int iD=0)
Definition blockData.hh:94
bool operator()(const int input[])
Block indicator specific function operator overload.

◆ operator()() [2/3]

template<typename T >
bool olb::BlockIndicatorF2D< T >::operator() ( int iX,
int iY )

Definition at line 59 of file blockIndicatorBaseF2D.hh.

60{
61 int latticeR[2] { iX, iY };
62 return this->operator()(latticeR);
63}

◆ operator()() [3/3]

template<typename T >
bool olb::BlockIndicatorF2D< T >::operator() ( LatticeR< 2 > loc)

Definition at line 66 of file blockIndicatorBaseF2D.hh.

67{
68 return operator()(loc[0], loc[1]);
69}

◆ setCache()

template<typename T >
void olb::BlockIndicatorF2D< T >::setCache ( const BlockData< 2, T, bool > & cache)

Set bool-mask cache to be used by indicator operator overloads.

Definition at line 72 of file blockIndicatorBaseF2D.hh.

73{
74 _cachedData = &cache;
75}

Member Data Documentation

◆ _blockGeometryStructure

template<typename T >
BlockGeometry<T,2>& olb::BlockIndicatorF2D< T >::_blockGeometryStructure
protected

Definition at line 38 of file blockIndicatorBaseF2D.h.

◆ _cachedData

template<typename T >
const BlockData<2,T,bool>* olb::BlockIndicatorF2D< T >::_cachedData
protected

Definition at line 39 of file blockIndicatorBaseF2D.h.


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