walberla::field::CellCounter< FlagField_T > Class Template Reference

Detailed Description

template<typename FlagField_T>
class walberla::field::CellCounter< FlagField_T >

Class/functor for counting cells of a specific type that are stored in parallel on all processes in a structured block storage.

Returns the total number of cells of a specific type that are stored in a 'StructuredBlockStorage'. Can also return the number of cells that are contained only on a specific level. For counting cells of a specific type, a flag field is used: Only cells marked with certain flags (these flags have to be specified in the constructor) are counted. By default, if at least on flag is set for a certain cell, this cell is counted. If you only want to count cells for which all specified flags are set, call member function 'allFlagsMustBeSet(true)'. After calling this function, only cells for which all flags are set are counted. If no flags are provided (= an empty set is passed to the constructor -> this is the default behavior), all cells are counted - independent of their specific type. Additionally, you can provide an axis-aligned bounding box via member function 'addAABBFilter'. If an AABB is added as a filter, only cells intersected by this AABB are considered during counting.

#include <CellCounter.h>

Public Member Functions

 CellCounter (const weak_ptr< StructuredBlockStorage > &blocks, const ConstBlockDataID &flagFieldId, const Set< FlagUID > &cellsToCount=Set< FlagUID >::emptySet(), const Set< SUID > &requiredSelectors=Set< SUID >::emptySet(), const Set< SUID > &incompatibleSelectors=Set< SUID >::emptySet())
 
void allFlagsMustBeSet (const bool b)
 
bool allFlagsMustBeSet () const
 
void addAABBFilter (const math::AABB &aabb)
 
void clearAABBFilter ()
 
uint64_t numberOfCells () const
 
uint64_t numberOfCells (const uint_t level) const
 
const std::vector< uint64_t > & numberOfCellsPerLevel () const
 
uint64_t numberOfBlocksContainingCell () const
 
uint64_t numberOfBlocksContainingCell (const uint_t level) const
 
const std::vector< uint64_t > & numberOfBlocksContainingCellPerLevel () const
 
void operator() ()
 

Private Attributes

uint64_t totalNumberOfCells_
 
std::vector< uint64_tnumberOfCells_
 
uint64_t totalNumberOfBlocksContainingCell_
 
std::vector< uint64_tnumberOfBlocksContainingCell_
 
weak_ptr< StructuredBlockStorageblocks_
 
bool allFlagsMustBeSet_
 
const Set< FlagUID > cellsToCount_
 
const ConstBlockDataID flagFieldId_
 
math::AABB aabb_
 
Set< SUID > requiredSelectors_
 
Set< SUID > incompatibleSelectors_
 

Constructor & Destructor Documentation

◆ CellCounter()

template<typename FlagField_T >
walberla::field::CellCounter< FlagField_T >::CellCounter ( const weak_ptr< StructuredBlockStorage > &  blocks,
const ConstBlockDataID flagFieldId,
const Set< FlagUID > &  cellsToCount = Set< FlagUID >::emptySet(),
const Set< SUID > &  requiredSelectors = Set<SUID>::emptySet(),
const Set< SUID > &  incompatibleSelectors = Set<SUID>::emptySet() 
)
inline

Member Function Documentation

◆ addAABBFilter()

template<typename FlagField_T >
void walberla::field::CellCounter< FlagField_T >::addAABBFilter ( const math::AABB aabb)
inline

◆ allFlagsMustBeSet() [1/2]

template<typename FlagField_T >
bool walberla::field::CellCounter< FlagField_T >::allFlagsMustBeSet ( ) const
inline

◆ allFlagsMustBeSet() [2/2]

template<typename FlagField_T >
void walberla::field::CellCounter< FlagField_T >::allFlagsMustBeSet ( const bool  b)
inline

◆ clearAABBFilter()

template<typename FlagField_T >
void walberla::field::CellCounter< FlagField_T >::clearAABBFilter ( )
inline

◆ numberOfBlocksContainingCell() [1/2]

template<typename FlagField_T >
uint64_t walberla::field::CellCounter< FlagField_T >::numberOfBlocksContainingCell ( ) const
inline

◆ numberOfBlocksContainingCell() [2/2]

template<typename FlagField_T >
uint64_t walberla::field::CellCounter< FlagField_T >::numberOfBlocksContainingCell ( const uint_t  level) const
inline

◆ numberOfBlocksContainingCellPerLevel()

template<typename FlagField_T >
const std::vector< uint64_t >& walberla::field::CellCounter< FlagField_T >::numberOfBlocksContainingCellPerLevel ( ) const
inline

◆ numberOfCells() [1/2]

template<typename FlagField_T >
uint64_t walberla::field::CellCounter< FlagField_T >::numberOfCells ( ) const
inline

◆ numberOfCells() [2/2]

template<typename FlagField_T >
uint64_t walberla::field::CellCounter< FlagField_T >::numberOfCells ( const uint_t  level) const
inline

◆ numberOfCellsPerLevel()

template<typename FlagField_T >
const std::vector< uint64_t >& walberla::field::CellCounter< FlagField_T >::numberOfCellsPerLevel ( ) const
inline

◆ operator()()

template<typename FlagField_T >
void walberla::field::CellCounter< FlagField_T >::operator()

Member Data Documentation

◆ aabb_

template<typename FlagField_T >
math::AABB walberla::field::CellCounter< FlagField_T >::aabb_
private

◆ allFlagsMustBeSet_

template<typename FlagField_T >
bool walberla::field::CellCounter< FlagField_T >::allFlagsMustBeSet_
private

◆ blocks_

template<typename FlagField_T >
weak_ptr< StructuredBlockStorage > walberla::field::CellCounter< FlagField_T >::blocks_
private

◆ cellsToCount_

template<typename FlagField_T >
const Set< FlagUID > walberla::field::CellCounter< FlagField_T >::cellsToCount_
private

◆ flagFieldId_

template<typename FlagField_T >
const ConstBlockDataID walberla::field::CellCounter< FlagField_T >::flagFieldId_
private

◆ incompatibleSelectors_

template<typename FlagField_T >
Set<SUID> walberla::field::CellCounter< FlagField_T >::incompatibleSelectors_
private

◆ numberOfBlocksContainingCell_

template<typename FlagField_T >
std::vector< uint64_t > walberla::field::CellCounter< FlagField_T >::numberOfBlocksContainingCell_
private

◆ numberOfCells_

template<typename FlagField_T >
std::vector< uint64_t > walberla::field::CellCounter< FlagField_T >::numberOfCells_
private

◆ requiredSelectors_

template<typename FlagField_T >
Set<SUID> walberla::field::CellCounter< FlagField_T >::requiredSelectors_
private

◆ totalNumberOfBlocksContainingCell_

template<typename FlagField_T >
uint64_t walberla::field::CellCounter< FlagField_T >::totalNumberOfBlocksContainingCell_
private

◆ totalNumberOfCells_

template<typename FlagField_T >
uint64_t walberla::field::CellCounter< FlagField_T >::totalNumberOfCells_
private

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