walberla::blockforest::BlockForest Class Reference

#include <BlockForest.h>

+ Inheritance diagram for walberla::blockforest::BlockForest:

Classes

class  BlockInformation
 
class  RefreshCallbackWrappper
 
class  RefreshFunctor
 
class  SnapshotCreationFunctor
 

Public Types

enum  FileIOMode { MPI_PARALLEL, MASTER_SLAVE, SERIALIZED_DISTRIBUTED }
 
typedef std::function< void(std::vector< std::pair< const Block *, uint_t > > &minTargetLevels, std::vector< const Block * > &blocksAlreadyMarkedForRefinement, const BlockForest &forest) > RefreshMinTargetLevelDeterminationFunction
 
typedef std::function< void(BlockForest &forest, const PhantomBlockForest &phantomForest) > RefreshCallbackFunction
 
typedef std::function< void(std::vector< uint_t > &sendTo, std::vector< uint_t > &recvFrom) > SnapshotCreationFunction
 
typedef std::function< uint_t(const uint_t) > SnapshotRestorenFunction
 
typedef std::function< void() > SnapshotRestoreCallbackFunction
 

Public Member Functions

 BlockForest (const uint_t process, const SetupBlockForest &forest, const bool keepGlobalBlockInformation=false)
 
 BlockForest (const uint_t process, const char *const filename, const bool broadcastFile=true, const bool keepGlobalBlockInformation=false)
 
 ~BlockForest ()
 
uint_t getProcess () const
 
uint_t getProcessIdBytes () const
 
uint_t getXSize () const
 number of coarse blocks on the initial grid (= number of octree root blocks) in x direction More...
 
uint_t getYSize () const
 number of coarse blocks on the initial grid (= number of octree root blocks) in y direction More...
 
uint_t getZSize () const
 number of coarse blocks on the initial grid (= number of octree root blocks) in z direction More...
 
uint_t getSize (const uint_t index) const
 
real_t getRootBlockXSize () const
 
real_t getRootBlockYSize () const
 
real_t getRootBlockZSize () const
 
bool storesUniformBlockGrid () const
 
uint_t getTreeIdDigits () const
 
uint_t getBlockIdBytes () const
 
uint_t getDepth () const
 
uint_t getNumberOfLevels () const
 
bool limitedDepth () const
 
bool limitedLevels () const
 
uint_t getMaxDepth () const
 
uint_t getMaxLevels () const
 
uint_t getNumberOfBlocks () const
 
uint_t getNumberOfBlocks (const uint_t level) const
 
const std::map< BlockID, shared_ptr< Block > > & getBlockMap () const
 
void getBlocks (std::vector< const Block * > &blocks, const uint_t level) const
 
void getBlocks (std::vector< Block * > &blocks, const uint_t level)
 
void getBlocksContainedWithinAABB (std::vector< const IBlock * > &blocks, const AABB &aabb) const
 
void getBlocksContainedWithinAABB (std::vector< IBlock * > &blocks, const AABB &aabb)
 
void getBlocksOverlappedByAABB (std::vector< const IBlock * > &blocks, const AABB &aabb) const
 
void getBlocksOverlappedByAABB (std::vector< IBlock * > &blocks, const AABB &aabb)
 
const BlockgetBlock (const IBlockID &id) const
 
BlockgetBlock (const IBlockID &id)
 
const BlockgetBlock (const real_t x, const real_t y, const real_t z) const
 
BlockgetBlock (const real_t x, const real_t y, const real_t z)
 
const BlockgetRootBlock (const uint_t x, const uint_t y, const uint_t z) const
 
BlockgetRootBlock (const uint_t x, const uint_t y, const uint_t z)
 
bool containsGlobalBlockInformation () const
 
void getAllBlocks (std::vector< shared_ptr< IBlockID > > &blocks) const
 
bool blockExists (const real_t x, const real_t y, const real_t z) const
 
bool blockExistsLocally (const real_t x, const real_t y, const real_t z) const
 
bool blockExistsRemotely (const real_t x, const real_t y, const real_t z) const
 
bool blockExists (const IBlockID &id) const
 
bool blockExistsLocally (const IBlockID &id) const
 
bool blockExistsRemotely (const IBlockID &id) const
 
bool rootBlockExists (const uint_t x, const uint_t y, const uint_t z) const
 
bool rootBlockExistsLocally (const uint_t x, const uint_t y, const uint_t z) const
 
bool rootBlockExistsRemotely (const uint_t x, const uint_t y, const uint_t z) const
 
void getBlockID (IBlockID &id, const real_t x, const real_t y, const real_t z) const
 
void getAABB (AABB &aabb, const IBlockID &id) const
 
void getState (Set< SUID > &state, const IBlockID &id) const
 
void getProcessRank (uint_t &rank, const IBlockID &id) const
 
void getRootBlockAABB (AABB &aabb, const uint_t x, const uint_t y, const uint_t z) const
 
void getRootBlockState (Set< SUID > &state, const uint_t x, const uint_t y, const uint_t z) const
 
void getRootBlockProcessRank (uint_t &rank, const uint_t x, const uint_t y, const uint_t z) const
 
const BlockInformationgetBlockInformation () const
 
uint_t getLevel (const IBlock &block) const
 
uint_t getLevelFromBlockId (const BlockID &id) const
 
uint_t getAABBFromBlockId (AABB &aabb, const BlockID &id) const
 
AABB getAABBFromBlockId (const BlockID &id) const
 
void getForestCoordinates (uint_t &x, uint_t &y, uint_t &z, const BlockID &id) const
 
void getRootBlockCoordinates (uint_t &x, uint_t &y, uint_t &z, const BlockID &id) const
 
void getRootBlockID (BlockID &id, const uint_t x, const uint_t y, const uint_t z) const
 
bool insertBuffersIntoProcessNetwork () const
 
const std::vector< uint_t > & getNeighborhood () const
 
const std::vector< uint_t > & getNeighboringProcesses () const
 
std::map< uint_t, std::vector< Vector3< real_t > > > getNeighboringProcessOffsets () const
 
internal::BlockDataHandlingAdder addBlockData (const std::string &identifier=std::string())
 
template<typename T >
BlockDataID addBlockData (const shared_ptr< T > &dataHandling, const std::string &identifier=std::string(), const Set< SUID > &requiredSelectors=Set< SUID >::emptySet(), const Set< SUID > &incompatibleSelectors=Set< SUID >::emptySet())
 
template<typename T >
BlockDataID addBlockData (std::function< T *(IBlock *const block) > function, const std::string &identifier=std::string(), const Set< SUID > &requiredSelectors=Set< SUID >::emptySet(), const Set< SUID > &incompatibleSelectors=Set< SUID >::emptySet())
 
BlockDataID addBlockData (const domain_decomposition::internal::SelectableBlockDataHandlingWrapper &dataHandling, const std::string &identifier=std::string())
 
template<typename T >
BlockDataID loadBlockData (const std::string &file, const shared_ptr< T > &dataHandling, const std::string &identifier=std::string(), const Set< SUID > &requiredSelectors=Set< SUID >::emptySet(), const Set< SUID > &incompatibleSelectors=Set< SUID >::emptySet())
 
BlockDataID loadBlockData (const std::string &file, const domain_decomposition::internal::SelectableBlockDataHandlingWrapper &dataHandling, const std::string &identifier=std::string())
 
void refresh ()
 Triggeres AMR Pipeline. More...
 
RefreshFunctor getRefreshFunctor (const uint_t checkFrequency=uint_t(1))
 Functor that calls refresh with given frequency. More...
 
uint_t getModificationStamp () const
 Modification stamp is changed when refresh moves a block or refines/coarsens at least one block however, stamp may (in rare cases) also change if block structure was not altered i.e. More...
 
const WcTimingPoolgetRefreshTiming () const
 Returns timing pool that contains measurement for sub-steps of AMR pipeline. More...
 
void clearRefreshTiming ()
 
bool recalculateBlockLevelsInRefresh () const
 switches AMR pipeline step 1 on/off More...
 
void recalculateBlockLevelsInRefresh (const bool r)
 
void alwaysRebalanceInRefresh (const bool b)
 by default rebalancing can be skipped if no block level has changed with this switch one can force the execution of the rebalancing step More...
 
bool alwaysRebalanceInRefresh () const
 
void setRefreshMinTargetLevelDeterminationFunction (const RefreshMinTargetLevelDeterminationFunction &f)
 callback for AMR pipeline step 1 guaranteed minimal block level More...
 
bool allowMultipleRefreshCycles () const
 allow multiple AMR passes (possibility to refine more than once within one time step) if true, one all-to-all reduction with a boolean value is performed during refresh More...
 
void allowMultipleRefreshCycles (const bool m)
 
bool reevaluateMinTargetLevelsAfterForcedRefinement () const
 call setRefreshMinTargetLevelDeterminationFunction callback again after AMR internal refinement to keep 2:1 balance if true, one all-to-all reduction with a boolean value is performed during refresh More...
 
void reevaluateMinTargetLevelsAfterForcedRefinement (const bool c)
 
bool checkForEarlyOutInRefresh () const
 exit pipeline after first AMR step if no block level has changed after setRefreshMinTargetLevelDeterminationFunction callback can be overwritten by alwaysRebalanceInRefresh if true, one all-to-all reduction with a boolean value is performed during refresh More...
 
void checkForEarlyOutInRefresh (const bool c)
 
bool checkForLateOutInRefresh () const
 exit pipeline after first AMR step if no block level has changed can be overwritten by alwaysRebalanceInRefresh if true, one all-to-all reduction with a boolean value is performed during refresh More...
 
void checkForLateOutInRefresh (const bool c)
 
bool allowRefreshChangingDepth () const
 maximal depth of block structure is allowed to change? if true, one all-to-all reduction with an unsigned int value is performed after refresh More...
 
void allowRefreshChangingDepth (const bool c)
 
bool checkForEarlyOutAfterLoadBalancing () const
 if true, one all-to-all reduction with a boolean value is performed during refresh More...
 
void checkForEarlyOutAfterLoadBalancing (const bool c)
 
void setRefreshBlockStateDeterminationFunction (const PhantomBlockForest::BlockStateDeterminationFunction &f)
 callback which determines the state id (SUID) of the new block during refinement/coarsening More...
 
void setRefreshPhantomBlockDataAssignmentFunction (const PhantomBlockForest::PhantomBlockDataAssignmentFunction &f)
 callback to assign arbitrary data to a phantom block (used only during load balancing), e.g. weights More...
 
void setRefreshPhantomBlockMigrationPreparationFunction (const PhantomBlockForest::MigrationPreparationFunction &f)
 load balancing algorithm More...
 
void setRefreshPhantomBlockDataPackFunction (const PhantomBlockForest::PhantomBlockDataPackFunction &f)
 
void setRefreshPhantomBlockDataUnpackFunction (const PhantomBlockForest::PhantomBlockDataUnpackFunction &f)
 
bool loadBalancingFunctionRegistered () const
 
uint_t phantomBlockMigrationIterations () const
 get number of "setRefreshPhantomBlockMigrationPreparationFunction" calls More...
 
uint_t addRefreshCallbackFunctionBeforeBlockDataIsPacked (const RefreshCallbackFunction &f)
 
void removeRefreshCallbackFunctionBeforeBlockDataIsPacked (const uint_t handle)
 
uint_t addRefreshCallbackFunctionBeforeBlockDataIsUnpacked (const RefreshCallbackFunction &f)
 
void removeRefreshCallbackFunctionBeforeBlockDataIsUnpacked (const uint_t handle)
 
uint_t addRefreshCallbackFunctionAfterBlockDataIsUnpacked (const RefreshCallbackFunction &f)
 
void removeRefreshCallbackFunctionAfterBlockDataIsUnpacked (const uint_t handle)
 
void createSnapshot (const std::vector< uint_t > &sendTo, const std::vector< uint_t > &recvFrom)
 
void restoreSnapshot (const SnapshotRestorenFunction &processMapping, const bool rebelance=true)
 
SnapshotCreationFunctor getSnapshotCreationFunctor (const SnapshotCreationFunction &function, const uint_t checkFrequency=uint_t(1))
 
uint_t addCallbackFunctionAfterBlockDataIsRestored (const SnapshotRestoreCallbackFunction &f)
 
void removeCallbackFunctionAfterBlockDataIsRestored (const uint_t handle)
 
void saveToFile (const std::string &filename, FileIOMode fileIOMode=MPI_PARALLEL) const
 Block states are reduced using MPI. More...
 
void saveToFile (const std::string &filename, const Set< SUID > &blockStates, FileIOMode fileIOMode=MPI_PARALLEL) const
 Block states are passed by argument (ATTENTION: 'blockStates' must be identical for every process!) More...
 
void checkBlockInformationConsistency (const SetupBlockForest &forest) const
 

Protected Member Functions

bool equal (const BlockStorage *rhs) const
 
void addBlockData (IBlock *const block, const BlockDataID &index, domain_decomposition::internal::BlockData *const data)
 

Private Member Functions

void constructBlockInformation (const SetupBlockForest &forest)
 
void constructBlockInformation (const std::vector< BlockID > &ids, const std::vector< shared_ptr< BlockInformation::Node > > &nodes)
 
void constructBlockInformation ()
 
void registerRefreshTimer ()
 
bool determineBlockTargetLevels (bool &additionalRefreshCycleRequired, bool &rerun)
 
void update (PhantomBlockForest &phantomForest)
 
void saveToFile (const std::string &filename, FileIOMode fileIOMode, const std::map< SUID, std::vector< bool > > &suidMap, const uint_t suidBytes) const
 For a description of the file format see BlockForestFile.h. More...
 
void storeFileHeader (std::vector< uint8_t > &data, uint_t &offset) const
 

Private Attributes

uint_t process_
 
uint_t processIdBytes_
 
uint_t size_ [3]
 
uint_t depth_
 
uint_t treeIdDigits_
 
std::map< BlockID, shared_ptr< Block > > blocks_
 
bool insertBuffersIntoProcessNetwork_
 
std::vector< uint_tneighborhood_
 
shared_ptr< BlockInformationblockInformation_
 
uint_t modificationStamp_
 
WcTimingPool refreshTiming_
 
bool recalculateBlockLevelsInRefresh_
 
bool alwaysRebalanceInRefresh_
 
RefreshMinTargetLevelDeterminationFunction refreshMinTargetLevelDeterminationFunction_
 
bool allowMultipleRefreshCycles_
 
bool reevaluateMinTargetLevelsAfterForcedRefinement_
 
bool checkForEarlyOutInRefresh_
 
bool checkForLateOutInRefresh_
 
bool allowChangingDepth_
 
bool checkForEarlyOutAfterLoadBalancing_
 
PhantomBlockForest::BlockStateDeterminationFunction refreshBlockStateDeterminationFunction_
 
PhantomBlockForest::PhantomBlockDataAssignmentFunction refreshPhantomBlockDataAssignmentFunction_
 
PhantomBlockForest::MigrationPreparationFunction refreshPhantomBlockMigrationPreparationFunction_
 
PhantomBlockForest::PhantomBlockDataPackFunction refreshPhantomBlockDataPackFunction_
 
PhantomBlockForest::PhantomBlockDataUnpackFunction refreshPhantomBlockDataUnpackFunction_
 
uint_t phantomBlockMigrationIterations_
 
std::map< uint_t, RefreshCallbackFunctioncallbackBeforeBlockDataIsPacked_
 
std::map< uint_t, RefreshCallbackFunctioncallbackBeforeBlockDataIsUnpacked_
 
std::map< uint_t, RefreshCallbackFunctioncallbackAfterBlockDataIsUnpacked_
 
uint_t nextCallbackBeforeBlockDataIsPackedHandle_
 
uint_t nextCallbackBeforeBlockDataIsUnpackedHandle_
 
uint_t nextCallbackAfterBlockDataIsUnpackedHandle_
 
bool snapshotExists_
 
uint_t snapshotDepth_
 
uint_t snapshotBlockDataItems_
 
std::map< uint_t, mpi::RecvBuffersnapshot_
 
std::map< uint_t, SnapshotRestoreCallbackFunctioncallbackAfterBlockDataIsRestored_
 
uint_t nextCallbackAfterBlockDataIsRestoredHandle_
 

Friends

class BlockInformation
 

Member Typedef Documentation

typedef std::function< void ( BlockForest & forest, const PhantomBlockForest & phantomForest ) > walberla::blockforest::BlockForest::RefreshCallbackFunction
typedef std::function< void ( std::vector< std::pair< const Block *, uint_t > > & minTargetLevels, std::vector< const Block * > & blocksAlreadyMarkedForRefinement, const BlockForest & forest ) > walberla::blockforest::BlockForest::RefreshMinTargetLevelDeterminationFunction
typedef std::function< void ( std::vector<uint_t> & sendTo, std::vector<uint_t> & recvFrom ) > walberla::blockforest::BlockForest::SnapshotCreationFunction

Member Enumeration Documentation

Enumerator
MPI_PARALLEL 
MASTER_SLAVE 
SERIALIZED_DISTRIBUTED 

Constructor & Destructor Documentation

walberla::blockforest::BlockForest::BlockForest ( const uint_t  process,
const SetupBlockForest forest,
const bool  keepGlobalBlockInformation = false 
)
walberla::blockforest::BlockForest::BlockForest ( const uint_t  process,
const char *const  filename,
const bool  broadcastFile = true,
const bool  keepGlobalBlockInformation = false 
)
walberla::blockforest::BlockForest::~BlockForest ( )
inline

Member Function Documentation

internal::BlockDataHandlingAdder walberla::blockforest::BlockForest::addBlockData ( const std::string &  identifier = std::string())
inline
template<typename T >
BlockDataID walberla::blockforest::BlockForest::addBlockData ( const shared_ptr< T > &  dataHandling,
const std::string &  identifier = std::string(),
const Set< SUID > &  requiredSelectors = Set<SUID>::emptySet(),
const Set< SUID > &  incompatibleSelectors = Set<SUID>::emptySet() 
)
inline
template<typename T >
BlockDataID walberla::blockforest::BlockForest::addBlockData ( std::function< T *(IBlock *const block) >  function,
const std::string &  identifier = std::string(),
const Set< SUID > &  requiredSelectors = Set<SUID>::emptySet(),
const Set< SUID > &  incompatibleSelectors = Set<SUID>::emptySet() 
)
inline
BlockDataID walberla::blockforest::BlockForest::addBlockData ( const domain_decomposition::internal::SelectableBlockDataHandlingWrapper dataHandling,
const std::string &  identifier = std::string() 
)
inline
void walberla::blockforest::BlockForest::addBlockData ( IBlock *const  block,
const BlockDataID &  index,
domain_decomposition::internal::BlockData *const  data 
)
inlineprotected
uint_t walberla::blockforest::BlockForest::addCallbackFunctionAfterBlockDataIsRestored ( const SnapshotRestoreCallbackFunction f)
inline
uint_t walberla::blockforest::BlockForest::addRefreshCallbackFunctionAfterBlockDataIsUnpacked ( const RefreshCallbackFunction f)
inline
uint_t walberla::blockforest::BlockForest::addRefreshCallbackFunctionBeforeBlockDataIsPacked ( const RefreshCallbackFunction f)
inline
uint_t walberla::blockforest::BlockForest::addRefreshCallbackFunctionBeforeBlockDataIsUnpacked ( const RefreshCallbackFunction f)
inline
bool walberla::blockforest::BlockForest::allowMultipleRefreshCycles ( ) const
inline

allow multiple AMR passes (possibility to refine more than once within one time step) if true, one all-to-all reduction with a boolean value is performed during refresh

void walberla::blockforest::BlockForest::allowMultipleRefreshCycles ( const bool  m)
inline
bool walberla::blockforest::BlockForest::allowRefreshChangingDepth ( ) const
inline

maximal depth of block structure is allowed to change? if true, one all-to-all reduction with an unsigned int value is performed after refresh

void walberla::blockforest::BlockForest::allowRefreshChangingDepth ( const bool  c)
inline
void walberla::blockforest::BlockForest::alwaysRebalanceInRefresh ( const bool  b)
inline

by default rebalancing can be skipped if no block level has changed with this switch one can force the execution of the rebalancing step

bool walberla::blockforest::BlockForest::alwaysRebalanceInRefresh ( ) const
inline
bool walberla::blockforest::BlockForest::blockExists ( const real_t  x,
const real_t  y,
const real_t  z 
) const
inline
bool walberla::blockforest::BlockForest::blockExists ( const IBlockID &  id) const
inline
bool walberla::blockforest::BlockForest::blockExistsLocally ( const real_t  x,
const real_t  y,
const real_t  z 
) const
inline
bool walberla::blockforest::BlockForest::blockExistsLocally ( const IBlockID &  id) const
inline
bool walberla::blockforest::BlockForest::blockExistsRemotely ( const real_t  x,
const real_t  y,
const real_t  z 
) const
inline
bool walberla::blockforest::BlockForest::blockExistsRemotely ( const IBlockID &  id) const
inline
void walberla::blockforest::BlockForest::checkBlockInformationConsistency ( const SetupBlockForest forest) const
bool walberla::blockforest::BlockForest::checkForEarlyOutAfterLoadBalancing ( ) const
inline

if true, one all-to-all reduction with a boolean value is performed during refresh

void walberla::blockforest::BlockForest::checkForEarlyOutAfterLoadBalancing ( const bool  c)
inline
bool walberla::blockforest::BlockForest::checkForEarlyOutInRefresh ( ) const
inline

exit pipeline after first AMR step if no block level has changed after setRefreshMinTargetLevelDeterminationFunction callback can be overwritten by alwaysRebalanceInRefresh if true, one all-to-all reduction with a boolean value is performed during refresh

void walberla::blockforest::BlockForest::checkForEarlyOutInRefresh ( const bool  c)
inline
bool walberla::blockforest::BlockForest::checkForLateOutInRefresh ( ) const
inline

exit pipeline after first AMR step if no block level has changed can be overwritten by alwaysRebalanceInRefresh if true, one all-to-all reduction with a boolean value is performed during refresh

void walberla::blockforest::BlockForest::checkForLateOutInRefresh ( const bool  c)
inline
void walberla::blockforest::BlockForest::clearRefreshTiming ( )
inline
void walberla::blockforest::BlockForest::constructBlockInformation ( const SetupBlockForest forest)
private
void walberla::blockforest::BlockForest::constructBlockInformation ( const std::vector< BlockID > &  ids,
const std::vector< shared_ptr< BlockInformation::Node > > &  nodes 
)
private
void walberla::blockforest::BlockForest::constructBlockInformation ( )
private
bool walberla::blockforest::BlockForest::containsGlobalBlockInformation ( ) const
inline
void walberla::blockforest::BlockForest::createSnapshot ( const std::vector< uint_t > &  sendTo,
const std::vector< uint_t > &  recvFrom 
)
bool walberla::blockforest::BlockForest::determineBlockTargetLevels ( bool &  additionalRefreshCycleRequired,
bool &  rerun 
)
private
bool walberla::blockforest::BlockForest::equal ( const BlockStorage *  rhs) const
protected
void walberla::blockforest::BlockForest::getAABB ( AABB &  aabb,
const IBlockID &  id 
) const
uint_t walberla::blockforest::BlockForest::getAABBFromBlockId ( AABB &  aabb,
const BlockID id 
) const
inline
AABB walberla::blockforest::BlockForest::getAABBFromBlockId ( const BlockID id) const
inline
void walberla::blockforest::BlockForest::getAllBlocks ( std::vector< shared_ptr< IBlockID > > &  blocks) const
inline
const Block * walberla::blockforest::BlockForest::getBlock ( const IBlockID &  id) const
inline
Block * walberla::blockforest::BlockForest::getBlock ( const IBlockID &  id)
inline
const Block * walberla::blockforest::BlockForest::getBlock ( const real_t  x,
const real_t  y,
const real_t  z 
) const
inline
Block * walberla::blockforest::BlockForest::getBlock ( const real_t  x,
const real_t  y,
const real_t  z 
)
inline
void walberla::blockforest::BlockForest::getBlockID ( IBlockID &  id,
const real_t  x,
const real_t  y,
const real_t  z 
) const
uint_t walberla::blockforest::BlockForest::getBlockIdBytes ( ) const
inline
const BlockInformation& walberla::blockforest::BlockForest::getBlockInformation ( ) const
inline
const std::map< BlockID, shared_ptr< Block > >& walberla::blockforest::BlockForest::getBlockMap ( ) const
inline
void walberla::blockforest::BlockForest::getBlocks ( std::vector< const Block * > &  blocks,
const uint_t  level 
) const
inline
void walberla::blockforest::BlockForest::getBlocks ( std::vector< Block * > &  blocks,
const uint_t  level 
)
inline
void walberla::blockforest::BlockForest::getBlocksContainedWithinAABB ( std::vector< const IBlock * > &  blocks,
const AABB &  aabb 
) const
inline
void walberla::blockforest::BlockForest::getBlocksContainedWithinAABB ( std::vector< IBlock * > &  blocks,
const AABB &  aabb 
)
inline
void walberla::blockforest::BlockForest::getBlocksOverlappedByAABB ( std::vector< const IBlock * > &  blocks,
const AABB &  aabb 
) const
inline
void walberla::blockforest::BlockForest::getBlocksOverlappedByAABB ( std::vector< IBlock * > &  blocks,
const AABB &  aabb 
)
inline
uint_t walberla::blockforest::BlockForest::getDepth ( ) const
inline
void walberla::blockforest::BlockForest::getForestCoordinates ( uint_t x,
uint_t y,
uint_t z,
const BlockID id 
) const
uint_t walberla::blockforest::BlockForest::getLevel ( const IBlock &  block) const
inline
uint_t walberla::blockforest::BlockForest::getLevelFromBlockId ( const BlockID id) const
inline
uint_t walberla::blockforest::BlockForest::getMaxDepth ( ) const
inline
uint_t walberla::blockforest::BlockForest::getMaxLevels ( ) const
inline
uint_t walberla::blockforest::BlockForest::getModificationStamp ( ) const
inline

Modification stamp is changed when refresh moves a block or refines/coarsens at least one block however, stamp may (in rare cases) also change if block structure was not altered i.e.

if modification stamp stays the same the block structure was not changed (no block movements, no level changes)

const std::vector< uint_t >& walberla::blockforest::BlockForest::getNeighborhood ( ) const
inline
const std::vector< uint_t >& walberla::blockforest::BlockForest::getNeighboringProcesses ( ) const
inline
std::map< uint_t, std::vector< Vector3< real_t > > > walberla::blockforest::BlockForest::getNeighboringProcessOffsets ( ) const
uint_t walberla::blockforest::BlockForest::getNumberOfBlocks ( ) const
inline
uint_t walberla::blockforest::BlockForest::getNumberOfBlocks ( const uint_t  level) const
inline
uint_t walberla::blockforest::BlockForest::getNumberOfLevels ( ) const
inline
uint_t walberla::blockforest::BlockForest::getProcess ( ) const
inline
uint_t walberla::blockforest::BlockForest::getProcessIdBytes ( ) const
inline
void walberla::blockforest::BlockForest::getProcessRank ( uint_t rank,
const IBlockID &  id 
) const
RefreshFunctor walberla::blockforest::BlockForest::getRefreshFunctor ( const uint_t  checkFrequency = uint_t(1))
inline

Functor that calls refresh with given frequency.

const WcTimingPool& walberla::blockforest::BlockForest::getRefreshTiming ( ) const
inline

Returns timing pool that contains measurement for sub-steps of AMR pipeline.

const Block * walberla::blockforest::BlockForest::getRootBlock ( const uint_t  x,
const uint_t  y,
const uint_t  z 
) const
inline
Block * walberla::blockforest::BlockForest::getRootBlock ( const uint_t  x,
const uint_t  y,
const uint_t  z 
)
inline
void walberla::blockforest::BlockForest::getRootBlockAABB ( AABB &  aabb,
const uint_t  x,
const uint_t  y,
const uint_t  z 
) const
void walberla::blockforest::BlockForest::getRootBlockCoordinates ( uint_t x,
uint_t y,
uint_t z,
const BlockID id 
) const
inline
void walberla::blockforest::BlockForest::getRootBlockID ( BlockID id,
const uint_t  x,
const uint_t  y,
const uint_t  z 
) const
inline
void walberla::blockforest::BlockForest::getRootBlockProcessRank ( uint_t rank,
const uint_t  x,
const uint_t  y,
const uint_t  z 
) const
void walberla::blockforest::BlockForest::getRootBlockState ( Set< SUID > &  state,
const uint_t  x,
const uint_t  y,
const uint_t  z 
) const
real_t walberla::blockforest::BlockForest::getRootBlockXSize ( ) const
inline
real_t walberla::blockforest::BlockForest::getRootBlockYSize ( ) const
inline
real_t walberla::blockforest::BlockForest::getRootBlockZSize ( ) const
inline
uint_t walberla::blockforest::BlockForest::getSize ( const uint_t  index) const
inline
SnapshotCreationFunctor walberla::blockforest::BlockForest::getSnapshotCreationFunctor ( const SnapshotCreationFunction function,
const uint_t  checkFrequency = uint_t(1) 
)
inline
void walberla::blockforest::BlockForest::getState ( Set< SUID > &  state,
const IBlockID &  id 
) const
uint_t walberla::blockforest::BlockForest::getTreeIdDigits ( ) const
inline
uint_t walberla::blockforest::BlockForest::getXSize ( ) const
inline

number of coarse blocks on the initial grid (= number of octree root blocks) in x direction

uint_t walberla::blockforest::BlockForest::getYSize ( ) const
inline

number of coarse blocks on the initial grid (= number of octree root blocks) in y direction

uint_t walberla::blockforest::BlockForest::getZSize ( ) const
inline

number of coarse blocks on the initial grid (= number of octree root blocks) in z direction

bool walberla::blockforest::BlockForest::insertBuffersIntoProcessNetwork ( ) const
inline
bool walberla::blockforest::BlockForest::limitedDepth ( ) const
inline
bool walberla::blockforest::BlockForest::limitedLevels ( ) const
inline
bool walberla::blockforest::BlockForest::loadBalancingFunctionRegistered ( ) const
inline
template<typename T >
BlockDataID walberla::blockforest::BlockForest::loadBlockData ( const std::string &  file,
const shared_ptr< T > &  dataHandling,
const std::string &  identifier = std::string(),
const Set< SUID > &  requiredSelectors = Set<SUID>::emptySet(),
const Set< SUID > &  incompatibleSelectors = Set<SUID>::emptySet() 
)
inline
BlockDataID walberla::blockforest::BlockForest::loadBlockData ( const std::string &  file,
const domain_decomposition::internal::SelectableBlockDataHandlingWrapper dataHandling,
const std::string &  identifier = std::string() 
)
inline
uint_t walberla::blockforest::BlockForest::phantomBlockMigrationIterations ( ) const
inline

get number of "setRefreshPhantomBlockMigrationPreparationFunction" calls

bool walberla::blockforest::BlockForest::recalculateBlockLevelsInRefresh ( ) const
inline

switches AMR pipeline step 1 on/off

void walberla::blockforest::BlockForest::recalculateBlockLevelsInRefresh ( const bool  r)
inline
bool walberla::blockforest::BlockForest::reevaluateMinTargetLevelsAfterForcedRefinement ( ) const
inline

call setRefreshMinTargetLevelDeterminationFunction callback again after AMR internal refinement to keep 2:1 balance if true, one all-to-all reduction with a boolean value is performed during refresh

void walberla::blockforest::BlockForest::reevaluateMinTargetLevelsAfterForcedRefinement ( const bool  c)
inline
void walberla::blockforest::BlockForest::refresh ( )

Triggeres AMR Pipeline.

void walberla::blockforest::BlockForest::registerRefreshTimer ( )
private
void walberla::blockforest::BlockForest::removeCallbackFunctionAfterBlockDataIsRestored ( const uint_t  handle)
inline
void walberla::blockforest::BlockForest::removeRefreshCallbackFunctionAfterBlockDataIsUnpacked ( const uint_t  handle)
inline
void walberla::blockforest::BlockForest::removeRefreshCallbackFunctionBeforeBlockDataIsPacked ( const uint_t  handle)
inline
void walberla::blockforest::BlockForest::removeRefreshCallbackFunctionBeforeBlockDataIsUnpacked ( const uint_t  handle)
inline
void walberla::blockforest::BlockForest::restoreSnapshot ( const SnapshotRestorenFunction processMapping,
const bool  rebelance = true 
)
bool walberla::blockforest::BlockForest::rootBlockExists ( const uint_t  x,
const uint_t  y,
const uint_t  z 
) const
inline
bool walberla::blockforest::BlockForest::rootBlockExistsLocally ( const uint_t  x,
const uint_t  y,
const uint_t  z 
) const
inline
bool walberla::blockforest::BlockForest::rootBlockExistsRemotely ( const uint_t  x,
const uint_t  y,
const uint_t  z 
) const
inline
void walberla::blockforest::BlockForest::saveToFile ( const std::string &  filename,
FileIOMode  fileIOMode = MPI_PARALLEL 
) const

Block states are reduced using MPI.

void walberla::blockforest::BlockForest::saveToFile ( const std::string &  filename,
const Set< SUID > &  blockStates,
FileIOMode  fileIOMode = MPI_PARALLEL 
) const

Block states are passed by argument (ATTENTION: 'blockStates' must be identical for every process!)

ATTENTION: 'blockStates' must be identical for every process!

void walberla::blockforest::BlockForest::saveToFile ( const std::string &  filename,
FileIOMode  fileIOMode,
const std::map< SUID, std::vector< bool > > &  suidMap,
const uint_t  suidBytes 
) const
private

For a description of the file format see BlockForestFile.h.

Attention
'suidMap' and 'suidBytes' must be identical for every process!
See also
BlockForestFile.h
void walberla::blockforest::BlockForest::setRefreshBlockStateDeterminationFunction ( const PhantomBlockForest::BlockStateDeterminationFunction f)
inline

callback which determines the state id (SUID) of the new block during refinement/coarsening

void walberla::blockforest::BlockForest::setRefreshMinTargetLevelDeterminationFunction ( const RefreshMinTargetLevelDeterminationFunction f)
inline

callback for AMR pipeline step 1 guaranteed minimal block level

void walberla::blockforest::BlockForest::setRefreshPhantomBlockDataAssignmentFunction ( const PhantomBlockForest::PhantomBlockDataAssignmentFunction f)
inline

callback to assign arbitrary data to a phantom block (used only during load balancing), e.g. weights

void walberla::blockforest::BlockForest::setRefreshPhantomBlockDataPackFunction ( const PhantomBlockForest::PhantomBlockDataPackFunction f)
inline
void walberla::blockforest::BlockForest::setRefreshPhantomBlockDataUnpackFunction ( const PhantomBlockForest::PhantomBlockDataUnpackFunction f)
inline
void walberla::blockforest::BlockForest::setRefreshPhantomBlockMigrationPreparationFunction ( const PhantomBlockForest::MigrationPreparationFunction f)
inline

load balancing algorithm

void walberla::blockforest::BlockForest::storeFileHeader ( std::vector< uint8_t > &  data,
uint_t offset 
) const
private
bool walberla::blockforest::BlockForest::storesUniformBlockGrid ( ) const
inline
void walberla::blockforest::BlockForest::update ( PhantomBlockForest phantomForest)
private

Friends And Related Function Documentation

friend class BlockInformation
friend

Member Data Documentation

bool walberla::blockforest::BlockForest::allowChangingDepth_
private
bool walberla::blockforest::BlockForest::allowMultipleRefreshCycles_
private
bool walberla::blockforest::BlockForest::alwaysRebalanceInRefresh_
private
shared_ptr< BlockInformation > walberla::blockforest::BlockForest::blockInformation_
private
std::map< BlockID, shared_ptr< Block > > walberla::blockforest::BlockForest::blocks_
private
std::map< uint_t, SnapshotRestoreCallbackFunction > walberla::blockforest::BlockForest::callbackAfterBlockDataIsRestored_
private
std::map< uint_t, RefreshCallbackFunction > walberla::blockforest::BlockForest::callbackAfterBlockDataIsUnpacked_
private
std::map< uint_t, RefreshCallbackFunction > walberla::blockforest::BlockForest::callbackBeforeBlockDataIsPacked_
private
std::map< uint_t, RefreshCallbackFunction > walberla::blockforest::BlockForest::callbackBeforeBlockDataIsUnpacked_
private
bool walberla::blockforest::BlockForest::checkForEarlyOutAfterLoadBalancing_
private
bool walberla::blockforest::BlockForest::checkForEarlyOutInRefresh_
private
bool walberla::blockforest::BlockForest::checkForLateOutInRefresh_
private
uint_t walberla::blockforest::BlockForest::depth_
private
bool walberla::blockforest::BlockForest::insertBuffersIntoProcessNetwork_
private
uint_t walberla::blockforest::BlockForest::modificationStamp_
private
std::vector< uint_t > walberla::blockforest::BlockForest::neighborhood_
private
uint_t walberla::blockforest::BlockForest::nextCallbackAfterBlockDataIsRestoredHandle_
private
uint_t walberla::blockforest::BlockForest::nextCallbackAfterBlockDataIsUnpackedHandle_
private
uint_t walberla::blockforest::BlockForest::nextCallbackBeforeBlockDataIsPackedHandle_
private
uint_t walberla::blockforest::BlockForest::nextCallbackBeforeBlockDataIsUnpackedHandle_
private
uint_t walberla::blockforest::BlockForest::phantomBlockMigrationIterations_
private
uint_t walberla::blockforest::BlockForest::process_
private
uint_t walberla::blockforest::BlockForest::processIdBytes_
private
bool walberla::blockforest::BlockForest::recalculateBlockLevelsInRefresh_
private
bool walberla::blockforest::BlockForest::reevaluateMinTargetLevelsAfterForcedRefinement_
private
PhantomBlockForest::BlockStateDeterminationFunction walberla::blockforest::BlockForest::refreshBlockStateDeterminationFunction_
private
RefreshMinTargetLevelDeterminationFunction walberla::blockforest::BlockForest::refreshMinTargetLevelDeterminationFunction_
private
PhantomBlockForest::PhantomBlockDataAssignmentFunction walberla::blockforest::BlockForest::refreshPhantomBlockDataAssignmentFunction_
private
PhantomBlockForest::PhantomBlockDataPackFunction walberla::blockforest::BlockForest::refreshPhantomBlockDataPackFunction_
private
PhantomBlockForest::PhantomBlockDataUnpackFunction walberla::blockforest::BlockForest::refreshPhantomBlockDataUnpackFunction_
private
PhantomBlockForest::MigrationPreparationFunction walberla::blockforest::BlockForest::refreshPhantomBlockMigrationPreparationFunction_
private
WcTimingPool walberla::blockforest::BlockForest::refreshTiming_
private
uint_t walberla::blockforest::BlockForest::size_[3]
private
std::map< uint_t, mpi::RecvBuffer > walberla::blockforest::BlockForest::snapshot_
private
uint_t walberla::blockforest::BlockForest::snapshotBlockDataItems_
private
uint_t walberla::blockforest::BlockForest::snapshotDepth_
private
bool walberla::blockforest::BlockForest::snapshotExists_
private
uint_t walberla::blockforest::BlockForest::treeIdDigits_
private

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