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 ...
'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.
#include <IBlock.h>
Public Types | |
using | BlockData = internal::BlockData |
Public Member Functions | |
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_. More... | |
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". More... | |
template<typename T > | |
const T * | getData (const ConstBlockDataID &index) const |
For documentation of this function see "const T* IBlock::getData( const BlockDataID index ) const". More... | |
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. More... | |
template<typename T > | |
T * | getData (const BlockDataID &index) |
For documentation of this function see "const T* IBlock::getData( const BlockDataID index ) const". More... | |
void | deleteData (const BlockDataID &index) |
Function for removing all data that corresponds to block data ID 'index'. More... | |
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. More... | |
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. More... | |
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. More... | |
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". More... | |
template<typename T > | |
const T * | uncheckedFastGetData (const ConstBlockDataID &index) const |
For documentation of this function see "const T* IBlock::uncheckedFastGetData( const BlockDataID index ) const". More... | |
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. More... | |
template<typename T > | |
T * | uncheckedFastGetData (const BlockDataID &index) |
For documentation of this function see "const T* IBlock::uncheckedFastGetData( const BlockDataID index ) const". More... | |
Protected Member Functions | |
IBlock (BlockStorage &storage, const AABB &aabb, const IBlockID::IDType &id, const bool local=true) | |
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. More... | |
virtual | ~IBlock () |
Must not be made public! No one should be allowed to delete a variable of type 'IBlock*'. More... | |
virtual bool | equal (const IBlock *rhs) const =0 |
Protected Attributes | |
AABB | aabb_ |
an axis-aligned bounding box that defines the exact part of the simulation space that is assigned to this block More... | |
Private Member Functions | |
IBlock () | |
Must not be made public or protected! Derived classes must call one of the available public/protected constructors. More... | |
void | addData (const BlockDataID &index, BlockData *const data) |
helper function for assigning data to this block (called by 'BlockStorage'), must not be made public or protected! More... | |
Private Member Functions inherited from walberla::NonCopyable | |
NonCopyable ()=default | |
~NonCopyable ()=default | |
Private Attributes | |
Set< SUID > | state_ |
a set of SUIDs the describes the current state of this block More... | |
std::vector< BlockData * > | data_ |
the data assigned to this block More... | |
BlockStorage & | storage_ |
governing block storage data structure More... | |
int | storageIndex_ |
used internally by 'IBlock' and 'BlockStorage' in order to (quite easily) allow iterators for 'BlockStorage' More... | |
Friends | |
class | BlockStorage |
class | StructuredBlockStorage |
|
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).
|
protectedvirtual |
Must not be made public! No one should be allowed to delete a variable of type 'IBlock*'.
|
private |
Must not be made public or protected! Derived classes must call one of the available public/protected constructors.
|
inlineprivate |
helper function for assigning data to this block (called by 'BlockStorage'), must not be made public or protected!
|
inline |
|
inline |
|
inline |
|
inline |
Function for removing all data that corresponds to block data ID 'index'.
Further calls to "getData" with 'index' will return NULL.
|
protectedpure virtual |
Implemented in walberla::blockforest::Block.
|
inline |
|
inline |
For documentation of this function see "const T* IBlock::getData( const BlockDataID index ) const".
|
inline |
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.
Data cannot be added manually by for example calling 'addData', but must be added through the governing block storage data structure that keeps track of assigning BlockDataIDs (BlockDataIDs are required for accessing/retrieving data stored within blocks). Retrieving data will fail if T is neither the same type nor a base class of the data that was added.
|
inline |
For documentation of this function see "const T* IBlock::getData( const BlockDataID index ) const".
|
pure virtual |
Implemented in walberla::blockforest::Block.
|
inline |
|
inline |
Returns true if block data is allocated on this block at index "index".
|
inline |
Returns true if the data stored at position "index" is of type T or if it is a subclass of T.
|
inline |
Returns true if the type of the data stored at position "indexA" is equal to the type of the data stored at position "indexB".
|
inline |
Returns true if and only if the data stored at position "index" is of type T.
This function will return false if the type of the data is a subclass of T! For polymorphic type checking see member functions "isDataClassOrSubclassOf" and "isDataSubclassOf".
|
inline |
Returns true if and only if the type of the data stored at position "index" is a subclass of T.
This function will return false if the type of the data stored at position "index" is equal to T!
|
inline |
bool walberla::domain_decomposition::IBlock::operator== | ( | const IBlock & | rhs | ) | const |
The following members are not used for checking if two IBlock objects are equal: storage_ & storageIndex_.
|
inline |
|
inline |
For documentation of this function see "const T* IBlock::uncheckedFastGetData( const BlockDataID index ) const".
|
inline |
Identical to "getData", however only works if type T is identical (!) to the type that was once added.
If type T is a base class of the class that was once added, this function will lead to undefined behavior of your program! Use with extreme caution!
|
inline |
For documentation of this function see "const T* IBlock::uncheckedFastGetData( const BlockDataID index ) const".
|
friend |
|
friend |
|
protected |
an axis-aligned bounding box that defines the exact part of the simulation space that is assigned to this block
|
private |
the data assigned to this block
|
private |
a set of SUIDs the describes the current state of this block
|
private |
governing block storage data structure
|
private |
used internally by 'IBlock' and 'BlockStorage' in order to (quite easily) allow iterators for 'BlockStorage'