MAIA bb96820c
Multiphysics at AIA
|
Class for the decomposition (partition) of structured grids. More...
#include <structuredpartition.h>
Public Member Functions | |
StructuredDecomposition (const MInt, const MString, MPI_Comm, const MInt) | |
Constructor for HDF5 grid file name Reads the size of the coordinate datasets for all blocks. More... | |
StructuredDecomposition (const MInt, ParallelIoHdf5 *pio, MPI_Comm, const MInt) | |
Constructor for HDF5 grid file handle Reads the size of the coordinate datasets for all blocks. More... | |
~StructuredDecomposition () | |
void | decompose () |
Decompose the grid into partitions for the set number of domains. More... | |
MBool | readFromFile () |
Read a precomputed partition info from an external file. More... | |
MInt | getBlockIdFromPartition (const MInt domainId_) |
MInt | getPartitionOffset (const MInt domainId_, const MInt dim) |
MInt | getPartitionSize (const MInt domainId_, const MInt dim) |
MInt | getBlockOffset (const MInt domainId_, const MInt dim) |
MInt | getBlockSize (const MInt domainId_, const MInt dim) |
Private Member Functions | |
MInt | rounding (MFloat x) |
void | initializeChilds (treeNode *&treePointer) |
Initializes the childs of the given tree node. More... | |
void | setPartitionInfoHelper (treeNode *&, const MInt, const MInt(&)[nDim], MInt &, MInt(&)[nDim], MInt(&)[nDim], MInt(&)[nDim]) |
Helper function for setPartionInfo. More... | |
void | setPartitionInfo (treeNode **&, MIntScratchSpace &) |
Computes partition information from given BCT. More... | |
void | traverseForInsertionNode (treeNode *&treePointer, const MInt, const MInt(&)[nDim], treeNode *&) |
Recursively traverses the given tree to find the next insertion position. More... | |
void | destroyChilds (treeNode *&treePointer) |
Recursively destroy all childs of a tree node. More... | |
MInt | sumLeaves (treeNode *&treePointer) |
Compute the number of leaves of a tree nodes. More... | |
void | insertChildAtNode (treeNode *&, const MInt, const MInt(&)[nDim]) |
Inserts new child node below given tree node. More... | |
void | addLeaf (treeNode **&treeRoot, MIntScratchSpace &level2dimension) |
Add a leaf into the tree. More... | |
MInt | noDomains () const |
Private Attributes | |
const MInt | m_noBlocks |
const MPI_Comm | m_mpiComm |
const MInt | m_noDomains |
MInt | m_noPartitions |
const MFloat | m_eps |
std::vector< std::unique_ptr< PartitionInfo< nDim > > > | m_blockInfo {} |
std::vector< std::unique_ptr< PartitionInfo< nDim > > > | m_partitionInfo {} |
The class will decompose a given multi-block grid into a number of partitions using the balanced cut trees method described in
G. Geiser, W. Schröder, Structured multi-block grid partitioning using balanced cut trees, J. Parallel Distrib. Comput. 138 (2020)
Note that throughout the class the term 'block' and the corresponding 'blockId' refer to input block, i.e., the blocks of the grid file, whereas the term 'partition' refers to the partitions created by the decomposition. Finally, the number of partitions should be equal to the given number of MPI domains.
Definition at line 59 of file structuredpartition.h.
StructuredDecomposition< nDim >::StructuredDecomposition | ( | const MInt | noBlocks_, |
const MString | fileName_, | ||
MPI_Comm | comm_, | ||
const MInt | noDomains_ | ||
) |
[in] | noBlock | Number of blocks in the grid file |
[in] | fileName | File name of the grid file |
[in] | comm | MPI communicator |
[in] | noDomains_ | Number of MPI domains to be used for decomposition |
Definition at line 26 of file structuredpartition.cpp.
StructuredDecomposition< nDim >::StructuredDecomposition | ( | const MInt | noBlocks_, |
ParallelIoHdf5 * | pio, | ||
MPI_Comm | comm_, | ||
const MInt | noDomains_ | ||
) |
[in] | noBlock | Number of blocks in the grid file |
[in] | pio | ParallelIO file handle of the grid file |
[in] | noDomains_ | Number of MPI domains to be used for decomposition |
[in] | comm | MPI communicator |
Definition at line 85 of file structuredpartition.cpp.
|
inline |
Definition at line 63 of file structuredpartition.h.
|
private |
[in] | treeRoot | Roots of the trees, same number as number of blocks |
[in] | level2dimension | Array to map the current level to the space dimension |
Definition at line 340 of file structuredpartition.cpp.
void StructuredDecomposition< nDim >::decompose |
Definition at line 376 of file structuredpartition.cpp.
|
private |
[in] | treePointer | Pointer to a tree node |
Definition at line 276 of file structuredpartition.cpp.
|
inline |
Definition at line 66 of file structuredpartition.h.
|
inline |
Definition at line 69 of file structuredpartition.h.
|
inline |
Definition at line 70 of file structuredpartition.h.
|
inline |
Definition at line 67 of file structuredpartition.h.
|
inline |
Definition at line 68 of file structuredpartition.h.
|
private |
[in] | treePointer | Pointer to the tree |
Definition at line 257 of file structuredpartition.cpp.
|
private |
[in] | insertTreePointer | Pointer to the tree node below which new child is inserted |
[in] | blockId | block id of the current subtree |
[in] | level2dimension1D | Array of level to space dimension mapping |
Definition at line 316 of file structuredpartition.cpp.
|
inlineprivate |
Definition at line 83 of file structuredpartition.h.
MBool StructuredDecomposition< nDim >::readFromFile |
Definition at line 434 of file structuredpartition.cpp.
|
private |
Definition at line 484 of file structuredpartition.cpp.
|
private |
[in] | treeRoot | Node of a (sub)tree |
[in] | level2dimension | Array of level to space dimension mapping |
Definition at line 185 of file structuredpartition.cpp.
|
private |
Goes trough the tree recursively and computes the partition information
[in] | treePointer | Pointer to a tree node |
[in] | blockId | block id of the subtree |
[in] | level2dimension1D | Array of level to dimension mapping |
[in] | partitionCounter | Counter of the number of partitions |
[in] | beginPartitionCounter | |
[in] | endPartitionCounter | |
[in] | divisor |
Definition at line 127 of file structuredpartition.cpp.
|
private |
[in] | treePointer | Pointer to a tree node |
Definition at line 292 of file structuredpartition.cpp.
|
private |
[in] | level2dimension1D | Array of level to space dimension mapping |
[in] | insertTreePointer | Pointer to the node where new node is inserted |
Definition at line 216 of file structuredpartition.cpp.
|
private |
Definition at line 91 of file structuredpartition.h.
|
private |
Definition at line 89 of file structuredpartition.h.
|
private |
Definition at line 86 of file structuredpartition.h.
|
private |
Definition at line 85 of file structuredpartition.h.
|
private |
Definition at line 87 of file structuredpartition.h.
|
private |
Definition at line 88 of file structuredpartition.h.
|
private |
Definition at line 92 of file structuredpartition.h.