walberla::blockforest Namespace Reference

Namespaces

 communication
 
 internal
 

Classes

class  AABBRefinementSelection
 
class  AlwaysCreateBlockDataHandling
 
class  AlwaysInitializeBlockDataHandling
 
class  Block
 
class  BlockDataHandling
 
class  BlockForest
 
class  BlockForestEvaluation
 
class  BlockID
 
struct  BlockInfo
 
class  BlockReconstruction
 
struct  BlockSorter
 
class  CartesianDistribution
 
class  CombinedMinTargetLevelDeterminationFunctions
 
class  DirectionBasedReduceScheme
 Communication Scheme class for ghost layer based communication with the direction neighbors. More...
 
class  DynamicCurveBalance
 This class implements Hilber and Morton space filling curves for load balancing. More...
 
class  DynamicDiffusionBalance
 This class implements a diffusive algorithm for load balancing. More...
 
class  DynamicParMetis
 
class  DynamicParMetisBlockInfo
 
struct  DynamicParMetisBlockInfoPackUnpack
 
class  FixedRefinementLevelSelector
 
class  GlobalLoadBalancing
 
class  MetisAssignmentFunctor
 Assignment functor for ParMetis based load balancing. More...
 
class  MinMaxLevelDetermination
 
class  MinTargetLevelDeterminationFunctions
 
class  NoPhantomData
 
class  PhantomBlock
 
class  PhantomBlockForest
 
class  PODPhantomWeight
 
struct  PODPhantomWeightPackUnpack
 
class  RefinementSelectionFunctions
 
class  SetSorter
 
class  SetupBlock
 
class  SetupBlockForest
 
class  SimpleCommunication
 
class  StaticLevelwiseCurveBalance
 
class  StaticLevelwiseCurveBalanceWeighted
 
class  StaticLevelwiseParMetis
 
class  StructuredBlockForest
 
class  UpdateSecondGhostLayer
 
class  WeightAssignmentFunctor
 General assignment functor for load balancing. More...
 

Typedefs

template<typename PhantomData_T >
using DynamicLevelwiseCurveBalance = DynamicCurveBalance< PhantomData_T >
 
template<typename PhantomData_T >
using DynamicLevelwiseDiffusionBalance = DynamicDiffusionBalance< PhantomData_T >
 
using InfoCollection = std::map< BlockID, BlockInfo >
 
using InfoCollectionPair = std::pair< InfoCollection::key_type, InfoCollection::mapped_type >
 
using idx_t = uint_t
 
using workload_t = real_t
 
using memory_t = real_t
 

Enumerations

enum  LocalCommunicationMode { START = 0, WAIT = 1, BUFFER = 2, NO_OPTIMIZATION = 3 }
 

Functions

void logDuringRefresh (BlockForest &forest, const PhantomBlockForest &)
 
std::ostream & operator<< (std::ostream &os, const BlockForest &forest)
 
static void pushBackNeighborhoodSectionBlockCenters (const AABB &blockAABB, const real_t x, const real_t y, const real_t z, std::vector< real_t > &centers)
 
void constructNeighborhoodSectionBlockCenters (uint_t sectionIndex, const AABB &blockAABB, std::vector< real_t > &centers)
 
uint_t getBlockNeighborhoodSectionIndex (const int x, const int y, const int z)
 
uint_t getBlockNeighborhoodSectionIndex (const uint_t x, const uint_t y, const uint_t z)
 
uint_t getBlockNeighborhoodSectionIndex (const stencil::Direction &d)
 
uint_t getBlockMaxNeighborhoodSectionSize (const uint_t sectionIndex)
 
const std::array< uint_t, 6 > & getFaceNeighborhoodSectionIndices ()
 
const std::array< uint_t, 12 > & getEdgeNeighborhoodSectionIndices ()
 
const std::array< uint_t, 8 > & getCornerNeighborhoodSectionIndices ()
 
shared_ptr< StructuredBlockForestcreateUniformBlockGridFromConfig (const shared_ptr< Config > &config, CellInterval *requestedDomainSize, const bool keepGlobalBlockInformation)
 Parses config block called 'DomainSetup' and creates a StructuredBlockForest. More...
 
shared_ptr< StructuredBlockForestcreateUniformBlockGridFromConfig (const Config::BlockHandle &configBlock, CellInterval *requestedDomainSize, const bool keepGlobalBlockInformation)
 Parses config block and creates a StructuredBlockForest. More...
 
shared_ptr< BlockForestcreateBlockForest (const AABB &domainAABB, const uint_t numberOfXBlocks, const uint_t numberOfYBlocks, const uint_t numberOfZBlocks, const uint_t numberOfXProcesses, const uint_t numberOfYProcesses, const uint_t numberOfZProcesses, const bool xPeriodic, const bool yPeriodic, const bool zPeriodic, const bool keepGlobalBlockInformation)
 Function for creating a block forest that represents a uniform block grid. More...
 
std::unique_ptr< SetupBlockForestcreateSetupBlockForest (const math::AABB &simulationDomain, Vector3< uint_t > blocks, const Vector3< bool > &isPeriodic, const uint_t numberOfProcesses, const uint_t initialRefinementLevel)
 
shared_ptr< BlockForestcreateBlockForest (const math::AABB &simulationDomain, const Vector3< uint_t > &blocks, const Vector3< bool > &isPeriodic, const uint_t numberOfProcesses, const uint_t initialRefinementLevel, const bool keepGlobalBlockInformation)
 
shared_ptr< BlockForestcreateBlockForest (const math::AABB &simulationDomain, const Vector3< uint_t > &blocks, const Vector3< bool > &isPeriodic, const bool setupRun, const std::string &sbffile, const uint_t numberOfProcesses, const uint_t initialRefinementLevel, const bool keepGlobalBlockInformation)
 
shared_ptr< BlockForestcreateBlockForestFromConfig (const Config::BlockHandle &mainConf, const bool keepGlobalBlockInformation)
 
shared_ptr< StructuredBlockForestcreateUniformBlockGrid (const AABB &domainAABB, const uint_t numberOfXBlocks, const uint_t numberOfYBlocks, const uint_t numberOfZBlocks, const uint_t numberOfXCellsPerBlock, const uint_t numberOfYCellsPerBlock, const uint_t numberOfZCellsPerBlock, const uint_t numberOfXProcesses, const uint_t numberOfYProcesses, const uint_t numberOfZProcesses, const bool xPeriodic, const bool yPeriodic, const bool zPeriodic, const bool keepGlobalBlockInformation)
 Function for creating a structured block forest that represents a uniform block grid. More...
 
shared_ptr< StructuredBlockForestcreateUniformBlockGrid (const uint_t numberOfXBlocks, const uint_t numberOfYBlocks, const uint_t numberOfZBlocks, const uint_t numberOfXCellsPerBlock, const uint_t numberOfYCellsPerBlock, const uint_t numberOfZCellsPerBlock, const real_t dx, const uint_t numberOfXProcesses, const uint_t numberOfYProcesses, const uint_t numberOfZProcesses, const bool xPeriodic, const bool yPeriodic, const bool zPeriodic, const bool keepGlobalBlockInformation)
 Function for creating a structured block forest that represents a uniform block grid. More...
 
shared_ptr< StructuredBlockForestcreateUniformBlockGrid (const AABB &domainAABB, const uint_t numberOfXBlocks, const uint_t numberOfYBlocks, const uint_t numberOfZBlocks, const uint_t numberOfXCellsPerBlock, const uint_t numberOfYCellsPerBlock, const uint_t numberOfZCellsPerBlock, const bool oneBlockPerProcess, const bool xPeriodic, const bool yPeriodic, const bool zPeriodic, const bool keepGlobalBlockInformation)
 Function for creating a structured block forest that represents a uniform block grid. More...
 
shared_ptr< StructuredBlockForestcreateUniformBlockGrid (const uint_t numberOfXBlocks, const uint_t numberOfYBlocks, const uint_t numberOfZBlocks, const uint_t numberOfXCellsPerBlock, const uint_t numberOfYCellsPerBlock, const uint_t numberOfZCellsPerBlock, const real_t dx, const bool oneBlockPerProcess, const bool xPeriodic, const bool yPeriodic, const bool zPeriodic, const bool keepGlobalBlockInformation)
 Function for creating a structured block forest that represents a uniform block grid. More...
 
shared_ptr< StructuredBlockForestcreateUniformBlockGrid (const AABB &domainAABB, const uint_t numberOfXBlocks, const uint_t numberOfYBlocks, const uint_t numberOfZBlocks, const uint_t numberOfXCellsPerBlock, const uint_t numberOfYCellsPerBlock, const uint_t numberOfZCellsPerBlock, const uint_t maxBlocksPerProcess, const bool includeMetis, const bool forceMetis, const bool xPeriodic, const bool yPeriodic, const bool zPeriodic, const bool keepGlobalBlockInformation)
 Function for creating a structured block forest that represents a uniform block grid. More...
 
shared_ptr< StructuredBlockForestcreateUniformBlockGrid (const uint_t numberOfXBlocks, const uint_t numberOfYBlocks, const uint_t numberOfZBlocks, const uint_t numberOfXCellsPerBlock, const uint_t numberOfYCellsPerBlock, const uint_t numberOfZCellsPerBlock, const real_t dx, const uint_t maxBlocksPerProcess, const bool includeMetis, const bool forceMetis, const bool xPeriodic, const bool yPeriodic, const bool zPeriodic, const bool keepGlobalBlockInformation)
 Function for creating a structured block forest that represents a uniform block grid. More...
 
shared_ptr< StructuredBlockForestcreateUniformBlockGrid (const std::string &filename, const uint_t numberOfXCellsPerBlock, const uint_t numberOfYCellsPerBlock, const uint_t numberOfZCellsPerBlock, const bool keepGlobalBlockInformation)
 Function for creating a structured block forest that represents a uniform block grid. More...
 
void calculateCellDistribution (const Vector3< uint_t > &cells, uint_t nrOfBlocks, Vector3< uint_t > &blocksOut, Vector3< uint_t > &cellsPerBlock)
 Tries to distribute a given amount of total cells to a given amount of blocks. More...
 
void uniformWorkloadAndMemoryAssignment (SetupBlockForest &forest)
 
memory_t cellWeightedCommunicationCost (const SetupBlock *const a, const SetupBlock *const b, uint_t xCellsPerBlock, uint_t yCellsPerBlock, uint_t zCellsPerBlock)
 
memory_t uniformFacesDominantCommunication (const SetupBlock *const a, const SetupBlock *const b)
 
BlockInfo operator+ (const BlockInfo &lhs, const BlockInfo &rhs)
 
std::ostream & operator<< (std::ostream &os, const BlockInfo &bi)
 
template<typename T , typename G >
mpi::GenericSendBuffer< T, G > & operator<< (mpi::GenericSendBuffer< T, G > &buf, const BlockInfo &info)
 
template<typename T >
mpi::GenericRecvBuffer< T > & operator>> (mpi::GenericRecvBuffer< T > &buf, BlockInfo &info)
 
std::pair< uint_t, uint_tgetBlockSequenceRange (uint_t numLocalBlocks, MPI_Comm comm)
 
std::map< blockforest::BlockID, uint_tgetBlockIdToSequenceMapping (const PhantomBlockForest &phantomForest, const std::vector< std::pair< const PhantomBlock *, uint_t > > &targetProcess, const std::pair< uint_t, uint_t > &blockSequenceRange, MPI_Comm comm)
 
std::pair< uint_t, uint_tgetBlockSequenceRange (const PhantomBlockForest &phantomForest, MPI_Comm comm)
 
std::map< blockforest::BlockID, uint_tgetBlockIdToSequenceMapping (const PhantomBlockForest &phantomForest, const std::pair< uint_t, uint_t > &blockSequenceRange, MPI_Comm comm)
 
template<typename T >
T * ptr (std::vector< T > &v)
 
void writeColor (std::ofstream &outfile, const uint_t index, const uint_t selector)
 
std::ostream & operator<< (std::ostream &os, const SetupBlockForest &forest)
 
 WALBERLA_STATIC_ASSERT (sizeof(workload_t)==4||sizeof(workload_t)==8)
 
std::string naturalNumberToGroupedThousandsString (const uint_t number, const char separator=' ')
 Returns the string representation of 'number', every three digits the character 'separator' is inserted (172408725 -> "172 408 725") More...
 
template<typename UINT >
std::string uintToBitString (const UINT value)
 Returns a string that stores the bitwise representation of 'value' (must be an unsigned integer) More...
 
template<typename T >
workload_t workloadSum (const T &array)
 
template<typename T >
memory_t memorySum (const T &array)
 
memory_t bytesToMiB (memory_t bytes)
 
std::string naturalNumberToGroupedThousandsString (const real_t number, const char separator=' ')
 
void fillStream (std::ostream &ostream, const char fill, uint_t length)
 
template<typename... Stencils>
void exportUniformBufferedScheme (pybind11::module_ &m)
 
template<typename... Stencils>
void exportUniformDirectScheme (pybind11::module_ &m)
 
template<typename... Stencils>
void exportUniformDirectScheme (py::module_ &m)
 
template<typename... Stencils>
void exportUniformBufferedScheme (py::module_ &m)
 

Variables

static const uint_t hilbertOrder [24][8]
 
static const uint_t hilbertOrientation [24][8]
 
static const uint_t PARAVIEW = 0
 
static const uint_t GNUPLOT = 1
 

Typedef Documentation

◆ DynamicLevelwiseCurveBalance

template<typename PhantomData_T >
using walberla::blockforest::DynamicLevelwiseCurveBalance = typedef DynamicCurveBalance<PhantomData_T>

◆ DynamicLevelwiseDiffusionBalance

template<typename PhantomData_T >
using walberla::blockforest::DynamicLevelwiseDiffusionBalance = typedef DynamicDiffusionBalance<PhantomData_T>

◆ idx_t

◆ InfoCollection

◆ InfoCollectionPair

using walberla::blockforest::InfoCollectionPair = typedef std::pair<InfoCollection::key_type, InfoCollection::mapped_type>

◆ memory_t

◆ workload_t

Enumeration Type Documentation

◆ LocalCommunicationMode

Enumerator
START 
WAIT 
BUFFER 
NO_OPTIMIZATION 

Function Documentation

◆ bytesToMiB()

memory_t walberla::blockforest::bytesToMiB ( memory_t  bytes)
inline

◆ calculateCellDistribution()

void walberla::blockforest::calculateCellDistribution ( const Vector3< uint_t > &  cells,
uint_t  nrOfBlocks,
Vector3< uint_t > &  blocksOut,
Vector3< uint_t > &  cellsPerBlock 
)

Tries to distribute a given amount of total cells to a given amount of blocks.

It may happen that divisibility of the nr of cells requested prevents a distribution in this case the number of cells is chosen bigger than requested

Parameters
cellstotal number of cells requested
nrOfBlockstotal number of blocks to distribute the cells to
[out]blocksOutcalculated number of blocks in x/y/z
[out]cellsPerBlockhow many cells to put on each block it may happen that divisibility of the number of cells requested prevents a distribution in this case the number of cells is chosen (slightly) bigger than requested

Example: in: cells = (10,15,16) in: blocks = 8 out: blocks = (2,2,2) out: cellsPerBlock = (5,8,8) out: newCells = (10,16,16)

◆ cellWeightedCommunicationCost()

memory_t walberla::blockforest::cellWeightedCommunicationCost ( const SetupBlock *const  a,
const SetupBlock *const  b,
uint_t  xCellsPerBlock,
uint_t  yCellsPerBlock,
uint_t  zCellsPerBlock 
)

◆ constructNeighborhoodSectionBlockCenters()

void walberla::blockforest::constructNeighborhoodSectionBlockCenters ( uint_t  sectionIndex,
const AABB &  blockAABB,
std::vector< real_t > &  centers 
)

◆ createBlockForest() [1/3]

shared_ptr< BlockForest > walberla::blockforest::createBlockForest ( const AABB &  domainAABB,
const uint_t  numberOfXBlocks,
const uint_t  numberOfYBlocks,
const uint_t  numberOfZBlocks,
const uint_t  numberOfXProcesses,
const uint_t  numberOfYProcesses,
const uint_t  numberOfZProcesses,
const bool  xPeriodic,
const bool  yPeriodic,
const bool  zPeriodic,
const bool  keepGlobalBlockInformation 
)

Function for creating a block forest that represents a uniform block grid.

Uniform block grid: Cartesian domain decomposition into blocks, each block has the same size. The distribution of blocks to processes also follows a Cartesian decomposition.

Parameters
domainAABBAn axis-aligned bounding box that spans the entire simulation space/domain
numberOfXBlocksNumber of blocks in x direction
numberOfYBlocksNumber of blocks in y direction
numberOfZBlocksNumber of blocks in z direction
numberOfXProcessesNumber of processes the blocks are distributed to in x direction
numberOfYProcessesNumber of processes the blocks are distributed to in y direction
numberOfZProcessesNumber of processes the blocks are distributed to in z direction
xPeriodicIf true, the block structure is periodic in x direction [false by default]
yPeriodicIf true, the block structure is periodic in y direction [false by default]
zPeriodicIf true, the block structure is periodic in z direction [false by default]
keepGlobalBlockInformationIf true, each process keeps information about remote blocks (blocks that reside on other processes). This information includes the process rank, the state, and the axis-aligned bounding box of any block (local or remote). [false by default]

◆ createBlockForest() [2/3]

shared_ptr< BlockForest > walberla::blockforest::createBlockForest ( const math::AABB simulationDomain,
const Vector3< uint_t > &  blocks,
const Vector3< bool > &  isPeriodic,
const bool  setupRun,
const std::string &  sbffile,
const uint_t  numberOfProcesses,
const uint_t  initialRefinementLevel,
const bool  keepGlobalBlockInformation 
)

◆ createBlockForest() [3/3]

shared_ptr< BlockForest > walberla::blockforest::createBlockForest ( const math::AABB simulationDomain,
const Vector3< uint_t > &  blocks,
const Vector3< bool > &  isPeriodic,
const uint_t  numberOfProcesses,
const uint_t  initialRefinementLevel,
const bool  keepGlobalBlockInformation 
)

◆ createBlockForestFromConfig()

shared_ptr< BlockForest > walberla::blockforest::createBlockForestFromConfig ( const Config::BlockHandle mainConf,
const bool  keepGlobalBlockInformation 
)

◆ createSetupBlockForest()

std::unique_ptr<SetupBlockForest> walberla::blockforest::createSetupBlockForest ( const math::AABB simulationDomain,
Vector3< uint_t blocks,
const Vector3< bool > &  isPeriodic,
const uint_t  numberOfProcesses,
const uint_t  initialRefinementLevel 
)

◆ createUniformBlockGrid() [1/7]

shared_ptr< StructuredBlockForest > walberla::blockforest::createUniformBlockGrid ( const AABB &  domainAABB,
const uint_t  numberOfXBlocks,
const uint_t  numberOfYBlocks,
const uint_t  numberOfZBlocks,
const uint_t  numberOfXCellsPerBlock,
const uint_t  numberOfYCellsPerBlock,
const uint_t  numberOfZCellsPerBlock,
const bool  oneBlockPerProcess,
const bool  xPeriodic,
const bool  yPeriodic,
const bool  zPeriodic,
const bool  keepGlobalBlockInformation 
)

Function for creating a structured block forest that represents a uniform block grid.

Uniform block grid: Cartesian domain decomposition into blocks of cells, each block has the same size and contains the same number of cells. Either all blocks are assigned to the same process (useful for non-parallel simulations) or each blocks is assigned to a different process (useful if only one block shall be assigned to each process).

Parameters
domainAABBAn axis-aligned bounding box that spans the entire simulation space/domain
numberOfXBlocksNumber of blocks in x direction
numberOfYBlocksNumber of blocks in y direction
numberOfZBlocksNumber of blocks in z direction
numberOfXCellsPerBlockNumber of cells of each block in x direction
numberOfYCellsPerBlockNumber of cells of each block in y direction
numberOfZCellsPerBlockNumber of cells of each block in z direction
oneBlockPerProcessIf true, each block is assigned to a different process. If false, all blocks are assigned to the same process (process 0).
xPeriodicIf true, the block structure is periodic in x direction [false by default]
yPeriodicIf true, the block structure is periodic in y direction [false by default]
zPeriodicIf true, the block structure is periodic in z direction [false by default]
keepGlobalBlockInformationIf true, each process keeps information about remote blocks (blocks that reside on other processes). This information includes the process rank, the state, and the axis-aligned bounding box of any block (local or remote). [false by default]

◆ createUniformBlockGrid() [2/7]

shared_ptr< StructuredBlockForest > walberla::blockforest::createUniformBlockGrid ( const AABB &  domainAABB,
const uint_t  numberOfXBlocks,
const uint_t  numberOfYBlocks,
const uint_t  numberOfZBlocks,
const uint_t  numberOfXCellsPerBlock,
const uint_t  numberOfYCellsPerBlock,
const uint_t  numberOfZCellsPerBlock,
const uint_t  maxBlocksPerProcess,
const bool  includeMetis,
const bool  forceMetis,
const bool  xPeriodic,
const bool  yPeriodic,
const bool  zPeriodic,
const bool  keepGlobalBlockInformation 
)

Function for creating a structured block forest that represents a uniform block grid.

Uniform block grid: Cartesian domain decomposition into blocks of cells, each block has the same size and contains the same number of cells. The number of active MPI processes is used in order to determine the process distribution = in order to perform the initial, static load balancing. Each block is assumed to generate the same amount of work and to require the same amount of memory.

Parameters
domainAABBAn axis-aligned bounding box that spans the entire simulation space/domain
numberOfXBlocksNumber of blocks in x direction
numberOfYBlocksNumber of blocks in y direction
numberOfZBlocksNumber of blocks in z direction
numberOfXCellsPerBlockNumber of cells of each block in x direction
numberOfYCellsPerBlockNumber of cells of each block in y direction
numberOfZCellsPerBlockNumber of cells of each block in z direction
maxBlocksPerProcessMaximum number of blocks that are allowed to be assigned to one process. If a value of '0' is provided, any number of blocks are allowed to be located on one process - meaning static load balancing doesn't try to obey any memory limit. ['0' by default]
includeMetisIf true (and if available!), METIS is also used during load balancing. [true by default]
forceMetisIf true, METIS is always preferred over space filling curves [false by default]
xPeriodicIf true, the block structure is periodic in x direction [false by default]
yPeriodicIf true, the block structure is periodic in y direction [false by default]
zPeriodicIf true, the block structure is periodic in z direction [false by default]
keepGlobalBlockInformationIf true, each process keeps information about remote blocks (blocks that reside on other processes). This information includes the process rank, the state, and the axis-aligned bounding box of any block (local or remote). [false by default]

◆ createUniformBlockGrid() [3/7]

shared_ptr< StructuredBlockForest > walberla::blockforest::createUniformBlockGrid ( const AABB &  domainAABB,
const uint_t  numberOfXBlocks,
const uint_t  numberOfYBlocks,
const uint_t  numberOfZBlocks,
const uint_t  numberOfXCellsPerBlock,
const uint_t  numberOfYCellsPerBlock,
const uint_t  numberOfZCellsPerBlock,
const uint_t  numberOfXProcesses,
const uint_t  numberOfYProcesses,
const uint_t  numberOfZProcesses,
const bool  xPeriodic,
const bool  yPeriodic,
const bool  zPeriodic,
const bool  keepGlobalBlockInformation 
)

Function for creating a structured block forest that represents a uniform block grid.

Uniform block grid: Cartesian domain decomposition into blocks of cells, each block has the same size and contains the same number of cells. The distribution of blocks to processes also follows a Cartesian decomposition.

Parameters
domainAABBAn axis-aligned bounding box that spans the entire simulation space/domain
numberOfXBlocksNumber of blocks in x direction
numberOfYBlocksNumber of blocks in y direction
numberOfZBlocksNumber of blocks in z direction
numberOfXCellsPerBlockNumber of cells of each block in x direction
numberOfYCellsPerBlockNumber of cells of each block in y direction
numberOfZCellsPerBlockNumber of cells of each block in z direction
numberOfXProcessesNumber of processes the blocks are distributed to in x direction
numberOfYProcessesNumber of processes the blocks are distributed to in y direction
numberOfZProcessesNumber of processes the blocks are distributed to in z direction
xPeriodicIf true, the block structure is periodic in x direction [false by default]
yPeriodicIf true, the block structure is periodic in y direction [false by default]
zPeriodicIf true, the block structure is periodic in z direction [false by default]
keepGlobalBlockInformationIf true, each process keeps information about remote blocks (blocks that reside on other processes). This information includes the process rank, the state, and the axis-aligned bounding box of any block (local or remote). [false by default]

◆ createUniformBlockGrid() [4/7]

shared_ptr< StructuredBlockForest > walberla::blockforest::createUniformBlockGrid ( const std::string &  filename,
const uint_t  numberOfXCellsPerBlock,
const uint_t  numberOfYCellsPerBlock,
const uint_t  numberOfZCellsPerBlock,
const bool  keepGlobalBlockInformation 
)

Function for creating a structured block forest that represents a uniform block grid.

Uniform block grid: Cartesian domain decomposition into blocks of cells, each block has the same size and contains the same number of cells. The entire block structure and its corresponding process distribution are loaded from file.

Parameters
filenameA file that stores a block structure and its corresponding process distribution
numberOfXCellsPerBlockNumber of cells of each block in x direction
numberOfYCellsPerBlockNumber of cells of each block in y direction
numberOfZCellsPerBlockNumber of cells of each block in z direction
keepGlobalBlockInformationIf true, each process keeps information about remote blocks (blocks that reside on other processes). This information includes the process rank, the state, and the axis-aligned bounding box of any block (local or remote). [false by default]

◆ createUniformBlockGrid() [5/7]

shared_ptr< StructuredBlockForest > walberla::blockforest::createUniformBlockGrid ( const uint_t  numberOfXBlocks,
const uint_t  numberOfYBlocks,
const uint_t  numberOfZBlocks,
const uint_t  numberOfXCellsPerBlock,
const uint_t  numberOfYCellsPerBlock,
const uint_t  numberOfZCellsPerBlock,
const real_t  dx,
const bool  oneBlockPerProcess,
const bool  xPeriodic,
const bool  yPeriodic,
const bool  zPeriodic,
const bool  keepGlobalBlockInformation 
)

Function for creating a structured block forest that represents a uniform block grid.

Uniform block grid: Cartesian domain decomposition into blocks of cells, each block has the same size and contains the same number of cells. Either all blocks are assigned to the same process (useful for non-parallel simulations) or each blocks is assigned to a different process (useful if only one block shall be assigned to each process).

Parameters
numberOfXBlocksNumber of blocks in x direction
numberOfYBlocksNumber of blocks in y direction
numberOfZBlocksNumber of blocks in z direction
numberOfXCellsPerBlockNumber of cells of each block in x direction
numberOfYCellsPerBlockNumber of cells of each block in y direction
numberOfZCellsPerBlockNumber of cells of each block in z direction
dxEdge length of each cell (cells are assumed to be cubes)
oneBlockPerProcessIf true, each block is assigned to a different process. If false, all blocks are assigned to the same process (process 0).
xPeriodicIf true, the block structure is periodic in x direction [false by default]
yPeriodicIf true, the block structure is periodic in y direction [false by default]
zPeriodicIf true, the block structure is periodic in z direction [false by default]
keepGlobalBlockInformationIf true, each process keeps information about remote blocks (blocks that reside on other processes). This information includes the process rank, the state, and the axis-aligned bounding box of any block (local or remote). [false by default]

◆ createUniformBlockGrid() [6/7]

shared_ptr< StructuredBlockForest > walberla::blockforest::createUniformBlockGrid ( const uint_t  numberOfXBlocks,
const uint_t  numberOfYBlocks,
const uint_t  numberOfZBlocks,
const uint_t  numberOfXCellsPerBlock,
const uint_t  numberOfYCellsPerBlock,
const uint_t  numberOfZCellsPerBlock,
const real_t  dx,
const uint_t  maxBlocksPerProcess,
const bool  includeMetis,
const bool  forceMetis,
const bool  xPeriodic,
const bool  yPeriodic,
const bool  zPeriodic,
const bool  keepGlobalBlockInformation 
)

Function for creating a structured block forest that represents a uniform block grid.

Uniform block grid: Cartesian domain decomposition into blocks of cells, each block has the same size and contains the same number of cells. The number of active MPI processes is used in order to determine the process distribution = in order to perform the initial, static load balancing. Each block is assumed to generate the same amount of work and to require the same amount of memory.

Parameters
numberOfXBlocksNumber of blocks in x direction
numberOfYBlocksNumber of blocks in y direction
numberOfZBlocksNumber of blocks in z direction
numberOfXCellsPerBlockNumber of cells of each block in x direction
numberOfYCellsPerBlockNumber of cells of each block in y direction
numberOfZCellsPerBlockNumber of cells of each block in z direction
dxEdge length of each cell (cells are assumed to be cubes)
maxBlocksPerProcessMaximum number of blocks that are allowed to be assigned to one process. If a value of '0' is provided, any number of blocks are allowed to be located on one process - meaning static load balancing doesn't try to obey any memory limit. ['0' by default]
includeMetisIf true (and if available!), METIS is also used during load balancing. [true by default]
forceMetisIf true, METIS is always preferred over space filling curves [false by default]
xPeriodicIf true, the block structure is periodic in x direction [false by default]
yPeriodicIf true, the block structure is periodic in y direction [false by default]
zPeriodicIf true, the block structure is periodic in z direction [false by default]
keepGlobalBlockInformationIf true, each process keeps information about remote blocks (blocks that reside on other processes). This information includes the process rank, the state, and the axis-aligned bounding box of any block (local or remote). [false by default]

◆ createUniformBlockGrid() [7/7]

shared_ptr< StructuredBlockForest > walberla::blockforest::createUniformBlockGrid ( const uint_t  numberOfXBlocks,
const uint_t  numberOfYBlocks,
const uint_t  numberOfZBlocks,
const uint_t  numberOfXCellsPerBlock,
const uint_t  numberOfYCellsPerBlock,
const uint_t  numberOfZCellsPerBlock,
const real_t  dx,
const uint_t  numberOfXProcesses,
const uint_t  numberOfYProcesses,
const uint_t  numberOfZProcesses,
const bool  xPeriodic,
const bool  yPeriodic,
const bool  zPeriodic,
const bool  keepGlobalBlockInformation 
)

Function for creating a structured block forest that represents a uniform block grid.

Uniform block grid: Cartesian domain decomposition into blocks of cells, each block has the same size and contains the same number of cells. The distribution of blocks to processes also follows a Cartesian decomposition.

Parameters
numberOfXBlocksNumber of blocks in x direction
numberOfYBlocksNumber of blocks in y direction
numberOfZBlocksNumber of blocks in z direction
numberOfXCellsPerBlockNumber of cells of each block in x direction
numberOfYCellsPerBlockNumber of cells of each block in y direction
numberOfZCellsPerBlockNumber of cells of each block in z direction
dxEdge length of each cell (cells are assumed to be cubes)
numberOfXProcessesNumber of processes the blocks are distributed to in x direction
numberOfYProcessesNumber of processes the blocks are distributed to in y direction
numberOfZProcessesNumber of processes the blocks are distributed to in z direction
xPeriodicIf true, the block structure is periodic in x direction [false by default]
yPeriodicIf true, the block structure is periodic in y direction [false by default]
zPeriodicIf true, the block structure is periodic in z direction [false by default]
keepGlobalBlockInformationIf true, each process keeps information about remote blocks (blocks that reside on other processes). This information includes the process rank, the state, and the axis-aligned bounding box of any block (local or remote). [false by default]

◆ createUniformBlockGridFromConfig() [1/2]

shared_ptr< StructuredBlockForest > walberla::blockforest::createUniformBlockGridFromConfig ( const Config::BlockHandle configBlock,
CellInterval requestedDomainSize,
const bool  keepGlobalBlockInformation 
)

Parses config block and creates a StructuredBlockForest.

Two possibilities: 1) Using the cells per block and number of blocks for each direction

          {
             cellsPerBlock < 10, 20, 30 > ;  // required
             blocks        < 1,   2,  3 > ;  // required
             periodic      < 0, 0, 1 >;      // not required, defaults to no periodicity

             dx  0.01;  // defaults to 1.0
          }

An optional config parameter 'cartesianSetup' is available. Its default, true, causes one block to be assigned to each process. Setting it to false allows multiple blocks to be assigned to each process. If the number of blocks is not divisible by the number of processes, the loadbalancer tries to assign the blocks to processes as evenly as possible. 2) Using the number of global cells, #blocks = #processes, if this does not fit, extend the domain

          {
             cells <    10,40,90>;    // required
             periodic   < 0, 0, 1 >;  // not required, defaults to no periodicity
             dx  0.01;                // defaults to 1.0
          }

An optional config parameter 'oneBlockPerProcess' is available. Setting it to false forces all blocks to be assigned to a single process, which may be useful for debugging purposes. Otherwise, one block is assigned to each process. Example: cells < 31,31,31> started using 8 processors
calculated processor distribution <2,2,2>
real domain is then extended to <32,32,32> and every processor gets a block of <16,16,16>

When this setup is used and requestedDomainSize is not the null pointer, it is set to
the requested domain size ( in the example <31,31,31> )

◆ createUniformBlockGridFromConfig() [2/2]

shared_ptr< StructuredBlockForest > walberla::blockforest::createUniformBlockGridFromConfig ( const shared_ptr< Config > &  config,
CellInterval requestedDomainSize,
const bool  keepGlobalBlockInformation 
)

Parses config block called 'DomainSetup' and creates a StructuredBlockForest.

For more information see function below.

◆ exportUniformBufferedScheme() [1/2]

template<typename... Stencils>
void walberla::blockforest::exportUniformBufferedScheme ( py::module_ &  m)

◆ exportUniformBufferedScheme() [2/2]

template<typename... Stencils>
void walberla::blockforest::exportUniformBufferedScheme ( pybind11::module_ &  m)

◆ exportUniformDirectScheme() [1/2]

template<typename... Stencils>
void walberla::blockforest::exportUniformDirectScheme ( py::module_ &  m)

◆ exportUniformDirectScheme() [2/2]

template<typename... Stencils>
void walberla::blockforest::exportUniformDirectScheme ( pybind11::module_ &  m)

◆ fillStream()

void walberla::blockforest::fillStream ( std::ostream &  ostream,
const char  fill,
uint_t  length 
)
inline

◆ getBlockIdToSequenceMapping() [1/2]

std::map< blockforest::BlockID, uint_t > walberla::blockforest::getBlockIdToSequenceMapping ( const PhantomBlockForest phantomForest,
const std::pair< uint_t, uint_t > &  blockSequenceRange,
MPI_Comm  comm 
)

◆ getBlockIdToSequenceMapping() [2/2]

std::map< blockforest::BlockID, uint_t > walberla::blockforest::getBlockIdToSequenceMapping ( const PhantomBlockForest phantomForest,
const std::vector< std::pair< const PhantomBlock *, uint_t > > &  targetProcess,
const std::pair< uint_t, uint_t > &  blockSequenceRange,
MPI_Comm  comm 
)

◆ getBlockMaxNeighborhoodSectionSize()

uint_t walberla::blockforest::getBlockMaxNeighborhoodSectionSize ( const uint_t  sectionIndex)
inline

◆ getBlockNeighborhoodSectionIndex() [1/3]

uint_t walberla::blockforest::getBlockNeighborhoodSectionIndex ( const int  x,
const int  y,
const int  z 
)
inline

◆ getBlockNeighborhoodSectionIndex() [2/3]

uint_t walberla::blockforest::getBlockNeighborhoodSectionIndex ( const stencil::Direction d)
inline

◆ getBlockNeighborhoodSectionIndex() [3/3]

uint_t walberla::blockforest::getBlockNeighborhoodSectionIndex ( const uint_t  x,
const uint_t  y,
const uint_t  z 
)
inline

◆ getBlockSequenceRange() [1/2]

std::pair<uint_t, uint_t> walberla::blockforest::getBlockSequenceRange ( const PhantomBlockForest phantomForest,
MPI_Comm  comm 
)

◆ getBlockSequenceRange() [2/2]

std::pair<uint_t, uint_t> walberla::blockforest::getBlockSequenceRange ( uint_t  numLocalBlocks,
MPI_Comm  comm 
)

◆ getCornerNeighborhoodSectionIndices()

const std::array<uint_t, 8>& walberla::blockforest::getCornerNeighborhoodSectionIndices ( )
inline

◆ getEdgeNeighborhoodSectionIndices()

const std::array<uint_t,12>& walberla::blockforest::getEdgeNeighborhoodSectionIndices ( )
inline

◆ getFaceNeighborhoodSectionIndices()

const std::array<uint_t, 6>& walberla::blockforest::getFaceNeighborhoodSectionIndices ( )
inline

◆ logDuringRefresh()

void walberla::blockforest::logDuringRefresh ( BlockForest forest,
const PhantomBlockForest  
)
inline

◆ memorySum()

template<typename T >
memory_t walberla::blockforest::memorySum ( const T &  array)

◆ naturalNumberToGroupedThousandsString() [1/2]

std::string walberla::blockforest::naturalNumberToGroupedThousandsString ( const real_t  number,
const char  separator = ' ' 
)
inline

◆ naturalNumberToGroupedThousandsString() [2/2]

std::string walberla::blockforest::naturalNumberToGroupedThousandsString ( uint_t  number,
const char  separator 
)

Returns the string representation of 'number', every three digits the character 'separator' is inserted (172408725 -> "172 408 725")

◆ operator+()

BlockInfo walberla::blockforest::operator+ ( const BlockInfo lhs,
const BlockInfo rhs 
)
inline

◆ operator<<() [1/4]

template<typename T , typename G >
mpi::GenericSendBuffer<T,G>& walberla::blockforest::operator<< ( mpi::GenericSendBuffer< T, G > &  buf,
const BlockInfo info 
)

◆ operator<<() [2/4]

std::ostream& walberla::blockforest::operator<< ( std::ostream &  os,
const BlockForest forest 
)
inline

◆ operator<<() [3/4]

std::ostream& walberla::blockforest::operator<< ( std::ostream &  os,
const BlockInfo bi 
)
inline

◆ operator<<() [4/4]

std::ostream& walberla::blockforest::operator<< ( std::ostream &  os,
const SetupBlockForest forest 
)
inline

◆ operator>>()

template<typename T >
mpi::GenericRecvBuffer<T>& walberla::blockforest::operator>> ( mpi::GenericRecvBuffer< T > &  buf,
BlockInfo info 
)

◆ ptr()

template<typename T >
T* walberla::blockforest::ptr ( std::vector< T > &  v)

◆ pushBackNeighborhoodSectionBlockCenters()

static void walberla::blockforest::pushBackNeighborhoodSectionBlockCenters ( const AABB &  blockAABB,
const real_t  x,
const real_t  y,
const real_t  z,
std::vector< real_t > &  centers 
)
inlinestatic

◆ uintToBitString()

template<typename UINT >
std::string walberla::blockforest::uintToBitString ( const UINT  value)

Returns a string that stores the bitwise representation of 'value' (must be an unsigned integer)

8bit display: 0101_1101
16bit display: 1110_0101.1100_0001
32bit display: 1000_0011.0110_1101.0000_0001.1010_0110
64bit analogously ...

◆ uniformFacesDominantCommunication()

memory_t walberla::blockforest::uniformFacesDominantCommunication ( const SetupBlock *const  a,
const SetupBlock *const  b 
)

◆ uniformWorkloadAndMemoryAssignment()

void walberla::blockforest::uniformWorkloadAndMemoryAssignment ( SetupBlockForest forest)

◆ WALBERLA_STATIC_ASSERT()

walberla::blockforest::WALBERLA_STATIC_ASSERT ( sizeof(workload_t = =4||sizeof(workload_t)==8)

◆ workloadSum()

template<typename T >
workload_t walberla::blockforest::workloadSum ( const T &  array)

◆ writeColor()

void walberla::blockforest::writeColor ( std::ofstream &  outfile,
const uint_t  index,
const uint_t  selector 
)

Variable Documentation

◆ GNUPLOT

const uint_t walberla::blockforest::GNUPLOT = 1
static

◆ hilbertOrder

const uint_t walberla::blockforest::hilbertOrder[24][8]
static
Initial value:
= { { 0, 1, 3, 2, 6, 7, 5, 4 },
{ 0, 4, 6, 2, 3, 7, 5, 1 },
{ 0, 1, 5, 4, 6, 7, 3, 2 },
{ 5, 1, 0, 4, 6, 2, 3, 7 },
{ 3, 7, 6, 2, 0, 4, 5, 1 },
{ 6, 7, 3, 2, 0, 1, 5, 4 },
{ 5, 1, 3, 7, 6, 2, 0, 4 },
{ 0, 4, 5, 1, 3, 7, 6, 2 },
{ 5, 4, 0, 1, 3, 2, 6, 7 },
{ 5, 4, 6, 7, 3, 2, 0, 1 },
{ 0, 2, 3, 1, 5, 7, 6, 4 },
{ 6, 4, 0, 2, 3, 1, 5, 7 },
{ 5, 7, 3, 1, 0, 2, 6, 4 },
{ 3, 7, 5, 1, 0, 4, 6, 2 },
{ 6, 4, 5, 7, 3, 1, 0, 2 },
{ 0, 2, 6, 4, 5, 7, 3, 1 },
{ 6, 2, 0, 4, 5, 1, 3, 7 },
{ 6, 2, 3, 7, 5, 1, 0, 4 },
{ 3, 2, 0, 1, 5, 4, 6, 7 },
{ 6, 7, 5, 4, 0, 1, 3, 2 },
{ 5, 7, 6, 4, 0, 2, 3, 1 },
{ 3, 2, 6, 7, 5, 4, 0, 1 },
{ 3, 1, 0, 2, 6, 4, 5, 7 },
{ 3, 1, 5, 7, 6, 4, 0, 2 } }

◆ hilbertOrientation

const uint_t walberla::blockforest::hilbertOrientation[24][8]
static
Initial value:
= { { 1, 2, 0, 3, 4, 0, 5, 6 },
{ 0, 7, 1, 8, 5, 1, 4, 9 },
{ 15, 0, 2, 22, 20, 2, 19, 23 },
{ 20, 6, 3, 23, 15, 3, 16, 22 },
{ 22, 13, 4, 12, 11, 4, 1, 20 },
{ 11, 19, 5, 20, 22, 5, 0, 12 },
{ 9, 3, 6, 2, 21, 6, 17, 0 },
{ 10, 1, 7, 11, 12, 7, 13, 14 },
{ 12, 9, 8, 14, 10, 8, 18, 11 },
{ 6, 8, 9, 7, 17, 9, 21, 1 },
{ 7, 15, 10, 16, 13, 10, 12, 17 },
{ 5, 14, 11, 9, 0, 11, 22, 8 },
{ 8, 20, 12, 19, 18, 12, 10, 5 },
{ 18, 4, 13, 5, 8, 13, 7, 19 },
{ 17, 11, 14, 1, 6, 14, 23, 7 },
{ 2, 10, 15, 18, 19, 15, 20, 21 },
{ 19, 17, 16, 21, 2, 16, 3, 18 },
{ 14, 16, 17, 15, 23, 17, 6, 10 },
{ 13, 21, 18, 17, 7, 18, 8, 16 },
{ 16, 5, 19, 4, 3, 19, 2, 13 },
{ 3, 12, 20, 13, 16, 20, 15, 4 },
{ 23, 18, 21, 10, 14, 21, 9, 15 },
{ 4, 23, 22, 6, 1, 22, 11, 3 },
{ 21, 22, 23, 0, 9, 23, 14, 2 } }

◆ PARAVIEW

const uint_t walberla::blockforest::PARAVIEW = 0
static