walberla::blockforest::Block Class Reference

#include <Block.h>

+ Inheritance diagram for walberla::blockforest::Block:

Classes

struct  NeighborBlock
 

Public Member Functions

 Block (BlockForest &forest, const SetupBlock *const block)
 
 Block (BlockForest &forest, const BlockID &id, const AABB &aabb, const Set< SUID > &state, const uint_t level, const BlockReconstruction::NeighborhoodReconstruction< Block > &neighborhoodReconstruction, const std::vector< BlockReconstruction::NeighborhoodReconstructionBlock > &neighbors)
 
 Block (BlockForest &forest, const PhantomBlock &phantom)
 
 Block (BlockForest &forest, const BlockID &id, const AABB &aabb, const uint_t level, mpi::RecvBuffer &buffer, const std::function< uint_t(const uint_t) > &processMapping=std::function< uint_t(const uint_t) >())
 
 ~Block () override=default
 
void toBuffer (mpi::SendBuffer &buffer) const
 
const BlockForestgetForest () const
 
BlockForestgetForest ()
 
const BlockIDgetId () const override
 
uint_t getProcess () const
 
uint_t getLevel () const
 
void clearNeighborhoodSection (const uint_t index)
 
const std::vector< NeighborBlock * > & getNeighborhoodSection (const uint_t index) const
 
uint_t getNeighborhoodSectionSize (const uint_t index) const
 
void addNeighbor (const uint_t sectionIndex, const uint_t neighborIndex)
 
const NeighborBlockgetNeighbor (const uint_t sectionIndex, const uint_t neighborIndex) const
 
const BlockIDgetNeighborId (const uint_t sectionIndex, const uint_t neighborIndex) const
 
uint_t getNeighborProcess (const uint_t sectionIndex, const uint_t neighborIndex) const
 
bool neighborExistsLocally (const uint_t sectionIndex, const uint_t neighborIndex) const
 
bool neighborExistsRemotely (const uint_t sectionIndex, const uint_t neighborIndex) const
 
const Set< SUID > & getNeighborState (const uint_t sectionIndex, const uint_t neighborIndex) const
 
const AABB & getNeighborAABB (const uint_t sectionIndex, const uint_t neighborIndex) const
 
bool neighborhoodSectionHasBlocks (const uint_t sectionIndex) const
 
bool neighborhoodSectionHasSmallerBlocks (const uint_t sectionIndex) const
 
bool neighborhoodSectionHasEquallySizedBlock (const uint_t sectionIndex) const
 
bool neighborhoodSectionHasLargerBlock (const uint_t sectionIndex) const
 
void clearNeighborhood ()
 
const std::vector< NeighborBlock > & getNeighborhood () const
 
uint_t getNeighborhoodSize () const
 
void addNeighbor (const BlockID &id, const uint_t process, const Set< SUID > &state)
 
const NeighborBlockgetNeighbor (const uint_t index) const
 
const BlockIDgetNeighborId (const uint_t index) const
 
uint_t getNeighborProcess (const uint_t index) const
 
bool neighborExistsLocally (const uint_t index) const
 
bool neighborExistsRemotely (const uint_t index) const
 
const Set< SUID > & getNeighborState (const uint_t index) const
 
const AABB & getNeighborAABB (const uint_t index) const
 
void resetNeighborhood (const PhantomBlock &phantom)
 
bool targetBlockHasTheSameSize () const
 
bool targetBlockIsLarger () const
 
bool targetBlockIsSmaller () const
 
uint_t getTargetLevel () const
 
void setTargetLevel (const uint_t tl)
 
const std::vector< uint_t > & getTargetProcess () const
 
void clearTargetProcess ()
 
void addTargetProcess (const uint_t process)
 
void setTargetProcess (const uint_t index, const uint_t process)
 
- Public Member Functions inherited from walberla::domain_decomposition::IBlock
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

bool equal (const IBlock *rhs) const override
 The following members are not used for checking if two Block objects are equal: forest_. More...
 
- Protected Member Functions inherited from walberla::domain_decomposition::IBlock
 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...
 

Private Attributes

BlockForestforest_
 
BlockID id_
 
uint_t level_
 
std::vector< NeighborBlock * > neighborhoodSection_ [26]
 
std::vector< NeighborBlockneighborhood_
 
uint_t targetLevel_
 
std::vector< uint_ttargetProcess_
 

Additional Inherited Members

- Public Types inherited from walberla::domain_decomposition::IBlock
using BlockData = internal::BlockData
 
- Protected Attributes inherited from walberla::domain_decomposition::IBlock
AABB aabb_
 an axis-aligned bounding box that defines the exact part of the simulation space that is assigned to this block More...
 

Constructor & Destructor Documentation

◆ Block() [1/4]

walberla::blockforest::Block::Block ( BlockForest forest,
const SetupBlock *const  block 
)

◆ Block() [2/4]

walberla::blockforest::Block::Block ( BlockForest forest,
const BlockID id,
const AABB &  aabb,
const Set< SUID > &  state,
const uint_t  level,
const BlockReconstruction::NeighborhoodReconstruction< Block > &  neighborhoodReconstruction,
const std::vector< BlockReconstruction::NeighborhoodReconstructionBlock > &  neighbors 
)

◆ Block() [3/4]

walberla::blockforest::Block::Block ( BlockForest forest,
const PhantomBlock phantom 
)

◆ Block() [4/4]

walberla::blockforest::Block::Block ( BlockForest forest,
const BlockID id,
const AABB &  aabb,
const uint_t  level,
mpi::RecvBuffer buffer,
const std::function< uint_t(const uint_t) > &  processMapping = std::function< uint_t ( const uint_t ) >() 
)

◆ ~Block()

walberla::blockforest::Block::~Block ( )
overridedefault

Member Function Documentation

◆ addNeighbor() [1/2]

void walberla::blockforest::Block::addNeighbor ( const BlockID id,
const uint_t  process,
const Set< SUID > &  state 
)
inline

◆ addNeighbor() [2/2]

void walberla::blockforest::Block::addNeighbor ( const uint_t  sectionIndex,
const uint_t  neighborIndex 
)
inline

◆ addTargetProcess()

void walberla::blockforest::Block::addTargetProcess ( const uint_t  process)
inline

◆ clearNeighborhood()

void walberla::blockforest::Block::clearNeighborhood ( )
inline

◆ clearNeighborhoodSection()

void walberla::blockforest::Block::clearNeighborhoodSection ( const uint_t  index)
inline

◆ clearTargetProcess()

void walberla::blockforest::Block::clearTargetProcess ( )
inline

◆ equal()

bool walberla::blockforest::Block::equal ( const IBlock rhs) const
overrideprotectedvirtual

The following members are not used for checking if two Block objects are equal: forest_.

Implements walberla::domain_decomposition::IBlock.

◆ getForest() [1/2]

BlockForest& walberla::blockforest::Block::getForest ( )
inline

◆ getForest() [2/2]

const BlockForest& walberla::blockforest::Block::getForest ( ) const
inline

◆ getId()

const BlockID& walberla::blockforest::Block::getId ( ) const
inlineoverridevirtual

◆ getLevel()

uint_t walberla::blockforest::Block::getLevel ( ) const
inline

◆ getNeighbor() [1/2]

const Block::NeighborBlock & walberla::blockforest::Block::getNeighbor ( const uint_t  index) const
inline

◆ getNeighbor() [2/2]

const Block::NeighborBlock & walberla::blockforest::Block::getNeighbor ( const uint_t  sectionIndex,
const uint_t  neighborIndex 
) const
inline

◆ getNeighborAABB() [1/2]

const AABB & walberla::blockforest::Block::getNeighborAABB ( const uint_t  index) const
inline

◆ getNeighborAABB() [2/2]

const AABB & walberla::blockforest::Block::getNeighborAABB ( const uint_t  sectionIndex,
const uint_t  neighborIndex 
) const
inline

◆ getNeighborhood()

const std::vector< NeighborBlock >& walberla::blockforest::Block::getNeighborhood ( ) const
inline

◆ getNeighborhoodSection()

const std::vector< Block::NeighborBlock * > & walberla::blockforest::Block::getNeighborhoodSection ( const uint_t  index) const
inline

◆ getNeighborhoodSectionSize()

uint_t walberla::blockforest::Block::getNeighborhoodSectionSize ( const uint_t  index) const
inline

◆ getNeighborhoodSize()

uint_t walberla::blockforest::Block::getNeighborhoodSize ( ) const
inline

◆ getNeighborId() [1/2]

const BlockID & walberla::blockforest::Block::getNeighborId ( const uint_t  index) const
inline

◆ getNeighborId() [2/2]

const BlockID & walberla::blockforest::Block::getNeighborId ( const uint_t  sectionIndex,
const uint_t  neighborIndex 
) const
inline

◆ getNeighborProcess() [1/2]

uint_t walberla::blockforest::Block::getNeighborProcess ( const uint_t  index) const
inline

◆ getNeighborProcess() [2/2]

uint_t walberla::blockforest::Block::getNeighborProcess ( const uint_t  sectionIndex,
const uint_t  neighborIndex 
) const
inline

◆ getNeighborState() [1/2]

const Set< SUID > & walberla::blockforest::Block::getNeighborState ( const uint_t  index) const
inline

◆ getNeighborState() [2/2]

const Set< SUID > & walberla::blockforest::Block::getNeighborState ( const uint_t  sectionIndex,
const uint_t  neighborIndex 
) const
inline

◆ getProcess()

uint_t walberla::blockforest::Block::getProcess ( ) const

◆ getTargetLevel()

uint_t walberla::blockforest::Block::getTargetLevel ( ) const
inline

◆ getTargetProcess()

const std::vector< uint_t >& walberla::blockforest::Block::getTargetProcess ( ) const
inline

◆ neighborExistsLocally() [1/2]

bool walberla::blockforest::Block::neighborExistsLocally ( const uint_t  index) const
inline

◆ neighborExistsLocally() [2/2]

bool walberla::blockforest::Block::neighborExistsLocally ( const uint_t  sectionIndex,
const uint_t  neighborIndex 
) const
inline

◆ neighborExistsRemotely() [1/2]

bool walberla::blockforest::Block::neighborExistsRemotely ( const uint_t  index) const
inline

◆ neighborExistsRemotely() [2/2]

bool walberla::blockforest::Block::neighborExistsRemotely ( const uint_t  sectionIndex,
const uint_t  neighborIndex 
) const
inline

◆ neighborhoodSectionHasBlocks()

bool walberla::blockforest::Block::neighborhoodSectionHasBlocks ( const uint_t  sectionIndex) const
inline

◆ neighborhoodSectionHasEquallySizedBlock()

bool walberla::blockforest::Block::neighborhoodSectionHasEquallySizedBlock ( const uint_t  sectionIndex) const
inline

◆ neighborhoodSectionHasLargerBlock()

bool walberla::blockforest::Block::neighborhoodSectionHasLargerBlock ( const uint_t  sectionIndex) const
inline

◆ neighborhoodSectionHasSmallerBlocks()

bool walberla::blockforest::Block::neighborhoodSectionHasSmallerBlocks ( const uint_t  sectionIndex) const
inline

◆ resetNeighborhood()

void walberla::blockforest::Block::resetNeighborhood ( const PhantomBlock phantom)

◆ setTargetLevel()

void walberla::blockforest::Block::setTargetLevel ( const uint_t  tl)
inline

◆ setTargetProcess()

void walberla::blockforest::Block::setTargetProcess ( const uint_t  index,
const uint_t  process 
)
inline

◆ targetBlockHasTheSameSize()

bool walberla::blockforest::Block::targetBlockHasTheSameSize ( ) const
inline

◆ targetBlockIsLarger()

bool walberla::blockforest::Block::targetBlockIsLarger ( ) const
inline

◆ targetBlockIsSmaller()

bool walberla::blockforest::Block::targetBlockIsSmaller ( ) const
inline

◆ toBuffer()

void walberla::blockforest::Block::toBuffer ( mpi::SendBuffer buffer) const

Member Data Documentation

◆ forest_

BlockForest& walberla::blockforest::Block::forest_
private

◆ id_

BlockID walberla::blockforest::Block::id_
private

◆ level_

uint_t walberla::blockforest::Block::level_
private

◆ neighborhood_

std::vector< NeighborBlock > walberla::blockforest::Block::neighborhood_
private

◆ neighborhoodSection_

std::vector< NeighborBlock* > walberla::blockforest::Block::neighborhoodSection_[26]
private

◆ targetLevel_

uint_t walberla::blockforest::Block::targetLevel_
private

◆ targetProcess_

std::vector< uint_t > walberla::blockforest::Block::targetProcess_
private

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