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

Indicator functor from material numbers. More...

#include <superIndicatorF2D.h>

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

Public Member Functions

 SuperIndicatorMaterial2D (SuperGeometry< T, 2 > &geometry, std::vector< int > materials)
 
 SuperIndicatorMaterial2D (SuperGeometry< T, 2 > &geometry, std::list< int > materials)
 
bool operator() (bool output[], const int input[]) override
 
- Public Member Functions inherited from olb::SuperIndicatorF2D< T >
 SuperIndicatorF2D (SuperGeometry< T, 2 > &geometry)
 
BlockIndicatorF2D< T > & getBlockIndicatorF (int iCloc)
 Get block indicator.
 
SuperGeometry< T, 2 > & getSuperGeometry ()
 Get underlying super geometry.
 
bool operator() (const int input[])
 Indicator specific function operator overload.
 
bool operator() (int iC, int iX, int iY)
 Indicator specific function operator overload.
 
void cache ()
 Optional: initialize _cachedData for faster access.
 
- Public Member Functions inherited from olb::SuperF2D< T, bool >
SuperF2D< T, bool > & operator- (SuperF2D< T, bool > &rhs)
 
SuperF2D< T, bool > & operator+ (SuperF2D< T, bool > &rhs)
 
SuperF2D< T, bool > & operator* (SuperF2D< T, bool > &rhs)
 
SuperF2D< T, bool > & operator/ (SuperF2D< T, bool > &rhs)
 
SuperStructure< T, 2 > & getSuperStructure ()
 
int getBlockFSize () const
 
BlockF2D< bool > & getBlockF (int iCloc)
 
bool operator() (bool output[], const int input[]) override
 
- 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)
 

Additional Inherited Members

- Public Types inherited from olb::SuperIndicatorF2D< T >
using identity_functor_type = SuperIndicatorIdentity2D<T>
 
- Public Types inherited from olb::SuperF2D< T, bool >
using identity_functor_type
 
- 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::SuperF2D< T, bool >
 SuperF2D (SuperStructure< T, 2 > &superStructure, int targetDim)
 
- Protected Member Functions inherited from olb::GenericF< T, S >
 GenericF (int targetDim, int sourceDim)
 
- Protected Attributes inherited from olb::SuperIndicatorF2D< T >
SuperGeometry< T, 2 > & _superGeometry
 
std::unique_ptr< SuperData< 2, T, bool > > _cachedData
 
- Protected Attributes inherited from olb::SuperF2D< T, bool >
SuperStructure< T, 2 > & _superStructure
 
std::vector< std::unique_ptr< BlockF2D< bool > > > _blockF
 Super functors may consist of several BlockF2D<W> derived functors.
 

Detailed Description

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

Indicator functor from material numbers.

Material number comparsion is implemented in BlockIndicatorMaterial2D.

Definition at line 81 of file superIndicatorF2D.h.

Constructor & Destructor Documentation

◆ SuperIndicatorMaterial2D() [1/2]

template<typename T >
olb::SuperIndicatorMaterial2D< T >::SuperIndicatorMaterial2D ( SuperGeometry< T, 2 > & geometry,
std::vector< int > materials )
Parameters
geometrySuper geometry required for block indicator construction and global material number queries
materialsVector of material numbers to be indicated

Definition at line 92 of file superIndicatorF2D.hh.

94 : SuperIndicatorF2D<T>(geometry)
95{
96 geometry.updateStatistics(false);
97 const std::string matString = std::accumulate(
98 materials.begin()+1,
99 materials.end(),
100 std::to_string(materials[0]),
101 [](const std::string& a, int b) {
102 return a + '_' + std::to_string(b);
103 });
104 this->getName() = "SuperIndicator_on_Material_" + matString;
105
106 for (int iC = 0; iC < this->_superGeometry.getLoadBalancer().size(); ++iC) {
107 this->_blockF.emplace_back(
108 new BlockIndicatorMaterial2D<T>(this->_superGeometry.getBlockGeometry(iC),
109 materials)
110 );
111 }
112}
std::string & getName()
read and write access to name
Definition genericF.hh:51
std::vector< std::unique_ptr< BlockF2D< bool > > > _blockF
Super functors may consist of several BlockF2D<W> derived functors.
void updateStatistics(bool verbose=true)
Updates the super geometry at the boundaries if needed and afterwards the statisics if needed.
BlockGeometry< T, D > & getBlockGeometry(int locIC)
Read and write access to a single block geometry.
SuperGeometry< T, 2 > & _superGeometry
LoadBalancer< T > & getLoadBalancer()
Read and write access to the load balancer.

References olb::SuperF2D< T, bool >::_blockF, olb::SuperIndicatorF2D< T >::_superGeometry, olb::SuperGeometry< T, D >::getBlockGeometry(), olb::SuperStructure< T, D >::getLoadBalancer(), olb::GenericF< T, S >::getName(), and olb::SuperGeometry< T, D >::updateStatistics().

+ Here is the call graph for this function:

◆ SuperIndicatorMaterial2D() [2/2]

template<typename T >
olb::SuperIndicatorMaterial2D< T >::SuperIndicatorMaterial2D ( SuperGeometry< T, 2 > & geometry,
std::list< int > materials )
Parameters
geometrySuper geometry required for block indicator construction and global material number queries
materialsList of material numbers to be indicated

Definition at line 115 of file superIndicatorF2D.hh.

117 : SuperIndicatorMaterial2D(geometry,
118 std::vector<int>(materials.begin(), materials.end()))
119{ }
SuperIndicatorMaterial2D(SuperGeometry< T, 2 > &geometry, std::vector< int > materials)

Member Function Documentation

◆ operator()()

template<typename T >
bool olb::SuperIndicatorMaterial2D< T >::operator() ( bool output[],
const int input[] )
override

Definition at line 122 of file superIndicatorF2D.hh.

123{
124 output[0] = false;
125
126 LoadBalancer<T>& load = this->_superGeometry.getLoadBalancer();
127
128 if (!this->_blockF.empty() && load.isLocal(input[0])) {
129 // query material number of appropriate block indicator
130 return this->getBlockF(load.loc(input[0]))(output, &input[1]);
131 }
132 else {
133 return false;
134 }
135}
BlockF2D< bool > & getBlockF(int iCloc)

References olb::LoadBalancer< T >::isLocal(), and olb::LoadBalancer< T >::loc().

+ Here is the call graph for this function:

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