Base class for blocks (blocks are used to partition the simulation space: blocks are rectangular parts of the simulation space that manage all the data that is assigned to their part of the simulation space)
The class 'IBlock' already provides some basic functionality that every type of block will possess - regardless of the actual implementation of any derived block class. Every block ...
- ... has a well defined state - that is a set of SUIDs that describes certain attributes related to this block. The state of a block can be used to determine what kind of data is assigned to this block and what kind of operations/computations are performed with this block.
- ... possesses an axis-aligned bounding box that defines the exact part of the simulation space that is assigned to this block.
- ... can hold any kind of data, which means every block can hold any number of dynamically allocated objects of any type. This "block data" is assigned via block data initialization functions which are managed by the block storage data structure that governs this block. For more information on this procedure refer to 'BlockStorage'. Data stored within a block can be retrieved by calling the member functions 'getData'.
'IBlock' also acts as an interface class which requires every derived class to implement a member function 'getId()' that returns a block ID of type 'IBlockID' (see classes 'IBlockID' and 'BlockStorage') which can be used to uniquely identify a block within its governing block storage data structure.
|
| IBlock ()=delete |
|
virtual const IBlockID & | getId () const =0 |
|
bool | operator== (const IBlock &rhs) const |
| The following members are not used for checking if two IBlock objects are equal: storage_ & storageIndex_.
|
|
bool | operator!= (const IBlock &rhs) const |
|
const Set< SUID > & | getState () const |
|
void | setState (const Set< SUID > &state) |
|
void | addState (const Set< SUID > &state) |
|
void | addState (const SUID &state) |
|
void | clearState () |
|
const AABB & | getAABB () const |
|
bool | isBlockDataAllocated (const ConstBlockDataID &index) const |
| Returns true if block data is allocated on this block at index "index".
|
|
template<typename T > |
const T * | getData (const ConstBlockDataID &index) const |
| For documentation of this function see "const T* IBlock::getData( const BlockDataID index ) const".
|
|
template<typename T > |
const T * | getData (const BlockDataID &index) const |
| Function for retrieving data - data that was previously added by the governing block storage data structure class (see class 'BlockStorage') via block data initialization functions.
|
|
template<typename T > |
T * | getData (const BlockDataID &index) |
| For documentation of this function see "const T* IBlock::getData( const BlockDataID index ) const".
|
|
void | deleteData (const BlockDataID &index) |
| Function for removing all data that corresponds to block data ID 'index'.
|
|
template<typename T > |
bool | isDataOfType (const ConstBlockDataID &index) const |
| Returns true if and only if the data stored at position "index" is of type T.
|
|
template<typename T > |
bool | isDataClassOrSubclassOf (const ConstBlockDataID &index) const |
| Returns true if the data stored at position "index" is of type T or if it is a subclass of T.
|
|
template<typename T > |
bool | isDataSubclassOf (const ConstBlockDataID &index) const |
| Returns true if and only if the type of the data stored at position "index" is a subclass of T.
|
|
bool | isDataOfSameType (const ConstBlockDataID &indexA, const ConstBlockDataID &indexB) const |
| Returns true if the type of the data stored at position "indexA" is equal to the type of the data stored at position "indexB".
|
|
const BlockStorage & | getBlockStorage () const |
| returns a reference to the governing block storage data structure
|
|
BlockStorage & | getBlockStorage () |
| returns a reference to the governing block storage data structure
|
|
template<typename T > |
const T * | uncheckedFastGetData (const ConstBlockDataID &index) const |
| For documentation of this function see "const T* IBlock::uncheckedFastGetData( const BlockDataID index ) const".
|
|
template<typename T > |
const T * | uncheckedFastGetData (const BlockDataID &index) const |
| Identical to "getData", however only works if type T is identical (!) to the type that was once added.
|
|
template<typename T > |
T * | uncheckedFastGetData (const BlockDataID &index) |
| For documentation of this function see "const T* IBlock::uncheckedFastGetData( const BlockDataID index ) const".
|
|
walberla::domain_decomposition::IBlock::IBlock |
( |
BlockStorage & | storage, |
|
|
const AABB & | aabb, |
|
|
const IBlockID::IDType & | id, |
|
|
const bool | local = true ) |
|
protected |
Every derived class must call this constructor and pass a reference to the governing block storage data structure as well as a reference to an axis-aligned bounding box that defines the exact part of the simulation space that is assigned to this block.
If the third parameter 'local' is set to false ('local' is set to true by default), the caller indicates that this block is NOT a normal, local block; Normal, local blocks contain all the block data that is required by the simulation. Setting 'local' to false might be useful in many situations, for example, if a temporary object of type 'IBlock' must be created, or if the governing block storage data structure also allocates remote blocks for whatever reason (remote blocks are "empty shells": blocks that reside on other processes and hence store no local block data).