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_t > | numberOfCells_ |
uint64_t | totalNumberOfBlocksContainingCell_ |
std::vector< uint64_t > | numberOfBlocksContainingCell_ |
weak_ptr< StructuredBlockStorage > | blocks_ |
bool | allFlagsMustBeSet_ |
const Set< FlagUID > | cellsToCount_ |
const ConstBlockDataID | flagFieldId_ |
math::AABB | aabb_ |
Set< SUID > | requiredSelectors_ |
Set< SUID > | incompatibleSelectors_ |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void walberla::field::CellCounter< FlagField_T >::operator() |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |