|
IFEM
90A354
|
Class containing domain decomposition related partitioning. More...
#include <DomainDecomposition.h>

Classes | |
| struct | BlockInfo |
| Struct with information per matrix block. More... | |
| class | OrientIterator |
| Iterator for matching nodes on edges/faces with a given orientation and index. More... | |
| class | SlaveOrder |
| Functor to order ghost connections. More... | |
Public Member Functions | |
| DomainDecomposition () | |
| Default constructor. | |
| bool | setup (const ProcessAdm &adm, const SIMbase &sim) |
| Setup domain decomposition. More... | |
| bool | setup (const ProcessAdm &adm, const IntMat &neighs, const IntMat &meqn) |
| Setup domain decomposition. More... | |
| void | setup (const int neq) |
| Setup single-process domain decomposition. More... | |
| std::vector< std::set< int > > | getSubdomains (int nx, int ny, int nz, int overlap, size_t block) const |
| Obtain local subdomains for an equation block. More... | |
| int | getMinEq (size_t idx=0) const |
| Get first equation owned by this process. | |
| int | getMaxEq (size_t idx=0) const |
| Get last equation owned by this process. | |
| int | getNoGlbEqs (size_t idx=0) const |
| Get total number of equations in a block. | |
| int | getMinNode () const |
| Get first node owned by this process. | |
| int | getMaxNode () const |
| Get last node owned by this process. | |
| int | getMinDOF () const |
| Get first DOF owned by this process. | |
| int | getMaxDOF () const |
| Get last DOF owned by this process. | |
| void | setPatchOwner (size_t p, size_t owner) |
| Set owner for a patch. | |
| int | getPatchOwner (size_t p) const |
| Get process owning patch p. | |
| int | getGlobalEq (int lEq, size_t idx=0) const |
| Get global equation number. More... | |
| const IntVec & | getMLGEQ (size_t idx=0) const |
| Obtain local-to-global equation mapping. | |
| const std::set< int > & | getBlockEqs (size_t idx) const |
| Obtain local-to-global equation mapping. More... | |
| const std::map< int, int > & | getG2LEQ (size_t idx) const |
| Obtain global-to-local equation mapping. More... | |
| const IntVec & | getMLGN () const |
| Obtain local-to-global node mapping. | |
| const SAMpatch * | getSAM () const |
| Returns associated SAM. | |
| size_t | getNoBlocks () const |
| Returns number of matrix blocks. | |
| bool | isPartitioned () const |
| Returns whether a graph based partition is used. | |
| const IntVec & | getElms () const |
| Returns elements in partition. | |
| void | setElms (const IntVec &elms, const std::string &save) |
| Set elements in partition. | |
| void | clear () |
| Clear out partitioning information. | |
Static Public Member Functions | |
| static IntMat | calcSubdomains (size_t nel1, size_t nel2, size_t nel3, size_t g1, size_t g2, size_t g3, size_t overlap) |
| Calculates subdomains with a given overlap. More... | |
Public Attributes | |
| std::set< ASM::Interface, SlaveOrder > | ghostConnections |
| Connections to other processes. | |
Private Member Functions | |
| bool | calcGlobalNodeNumbers (const ProcessAdm &adm, const SIMbase &sim) |
| Calculate the global node numbers for given finite element model. | |
| bool | calcGlobalEqNumbers (const ProcessAdm &adm, const SIMbase &sim) |
| Calculate the global equation numbers for an element model. | |
| template<class Callback > | |
| bool | calcGlobalEqNumbersPart (const ProcessAdm &adm, const Callback &cb) |
| Calculate the global equation numbers for a partitioned model. | |
| bool | sanityCheckCorners (const SIMbase &sim) |
| Sanity check model. More... | |
| bool | graphPartition (const ProcessAdm &adm, const IntMat &neigh) |
| Setup domain decomposition based on graph partitioning. | |
Static Private Member Functions | |
| static IntMat | calcSubdomains1D (size_t nel1, size_t g1, size_t overlap) |
| Calculates a 1D partitioning with a given overlap. More... | |
| static IntMat | calcSubdomains2D (size_t nel1, size_t nel2, size_t g1, size_t g2, size_t overlap) |
| Calculates 2D subdomains with a given overlap. More... | |
| static IntMat | calcSubdomains3D (size_t nel1, size_t nel2, size_t nel3, size_t g1, size_t g2, size_t g3, size_t overlap) |
| Calculates 3D subdomains with a given overlap. More... | |
Private Attributes | |
| std::map< int, int > | patchOwner |
| Process that owns a particular patch. | |
| IntVec | MLGN |
| Process-local-to-global node numbers. | |
| std::vector< BlockInfo > | blocks |
| Equation mappings for all matrix blocks. | |
| IntVec | myElms |
| Elements in partition. | |
| int | minDof = 0 |
| First DOF we own. | |
| int | maxDof = 0 |
| Last DOF we own. | |
| int | minNode = 0 |
| First node we own. | |
| int | maxNode = 0 |
| Last node we own. | |
| const SAMpatch * | sam = nullptr |
| The assembly handler the DD is constructed for. | |
| std::string | savePart |
| Non-empty to save partitioning to file. | |
Class containing domain decomposition related partitioning.
|
static |
Calculates subdomains with a given overlap.
| [in] | nel1 | Number of knot-spans in first parameter direction. |
| [in] | nel2 | Number of knot-spans in second parameter direction. |
| [in] | nel3 | Number of knot-spans in third parameter direction. |
| [in] | g1 | Number of subdomains in first parameter direction. |
| [in] | g2 | Number of subdomains in second parameter direction. |
| [in] | g3 | Number of subdomains in third parameter direction. |
| [in] | overlap | Overlap of subdomains. |
nel values determine the dimensionality.
References calcSubdomains1D(), calcSubdomains2D(), and calcSubdomains3D().
Referenced by getSubdomains().
|
staticprivate |
Calculates a 1D partitioning with a given overlap.
| [in] | nel1 | Number of knot-spans in first parameter direction. |
| [in] | g1 | Number of subdomains in first parameter direction. |
| [in] | overlap | Overlap of subdomains. |
Referenced by calcSubdomains().
|
staticprivate |
Calculates 2D subdomains with a given overlap.
| [in] | nel1 | Number of knot-spans in first parameter direction. |
| [in] | nel2 | Number of knot-spans in second parameter direction. |
| [in] | g1 | Number of subdomains in first parameter direction. |
| [in] | g2 | Number of subdomains in second parameter direction. |
| [in] | overlap | Overlap of subdomains. |
Referenced by calcSubdomains().
|
staticprivate |
Calculates 3D subdomains with a given overlap.
| [in] | nel1 | Number of knot-spans in first parameter direction. |
| [in] | nel2 | Number of knot-spans in second parameter direction. |
| [in] | nel3 | Number of knot-spans in third parameter direction. |
| [in] | g1 | Number of subdomains in first parameter direction. |
| [in] | g2 | Number of subdomains in second parameter direction. |
| [in] | g3 | Number of subdomains in third parameter direction. |
| [in] | overlap | Overlap of subdomains. |
Referenced by calcSubdomains().
|
inline |
Obtain local-to-global equation mapping.
| idx | Block equation index (global block not included). |
References blocks.
Referenced by ISTL::BlockPreconditioner::apply(), ISTL::BlockPreconditioner::BlockPreconditioner(), calcGlobalEqNumbers(), PETScMatrix::initAssembly(), ISTL::BlockPreconditioner::post(), ISTL::BlockPreconditioner::pre(), and PETScMatrix::setParameters().
|
inline |
Obtain global-to-local equation mapping.
| idx | Block equation index |
References blocks.
Referenced by _eig_ax(), ISTL::BlockPreconditioner::BlockPreconditioner(), eig_sol_(), SAMpatchPETSc::expandSolution(), PETScMatrix::setupGlb2Blk(), and PETScMatrix::solveEig().
| int DomainDecomposition::getGlobalEq | ( | int | lEq, |
| size_t | idx = 0 |
||
| ) | const |
Get global equation number.
| lEq | Local equation number |
| idx | Block to get index for |
References blocks.
Referenced by _eig_ax(), PETScMatrix::add(), PETScVectors::assemble(), eig_sol_(), PETScVector::endAssembly(), PETScMatrix::initAssembly(), PETScSolParams::setupAdditiveSchwarz(), PETScMatrix::setupGlb2Blk(), and ISTLSolParams::setupPC().
| std::vector< std::set< int > > DomainDecomposition::getSubdomains | ( | int | nx, |
| int | ny, | ||
| int | nz, | ||
| int | overlap, | ||
| size_t | block | ||
| ) | const |
Obtain local subdomains for an equation block.
| nx | Number of domains in x |
| ny | Number of domains in y |
| nz | Number of domains in z |
| overlap | Overlap |
| block | Block to obtain equations for |
References blocks, calcSubdomains(), SAM::getElmEqns(), SAM::getElmNodes(), getNoBlocks(), SAM::getNodeEqns(), SAM::getNodeType(), ASMstruct::getNoStructElms(), and getSAM().
Referenced by PETScSolParams::setupAdditiveSchwarz(), and ISTLSolParams::setupPCInternal().
|
private |
Sanity check model.
Collects the corners of all patches in the model and make sure nodes with matching coordinates have the same global node ID.
References ProcessAdm::dd, ASMbase::getCoord(), ASM2D::getCorner(), ASM3D::getCorner(), SIMbase::getLocalPatchIndex(), getMLGN(), ASMbase::getNoBasis(), ASMbase::getNodeID(), SIMbase::getNoPatches(), ProcessAdm::getNoProcs(), ASMbase::getNoSpaceDim(), SIMbase::getNoSpaceDim(), SIMbase::getPatch(), getPatchOwner(), SIMadmin::getProcessAdm(), and ProcessAdm::isParallel().
Referenced by setup().
| void DomainDecomposition::setup | ( | const int | neq | ) |
| bool DomainDecomposition::setup | ( | const ProcessAdm & | adm, |
| const IntMat & | neighs, | ||
| const IntMat & | meqn | ||
| ) |
Setup domain decomposition.
| [in] | adm | Process administrator to setup dd across |
| [in] | neighs | Element connection graph for model |
| [in] | meqn | Matrix of element equation numbers |
References blocks, calcGlobalEqNumbersPart(), IFEM::cout, getMaxEq(), getMinEq(), ProcessAdm::getNoProcs(), ProcessAdm::getProcId(), graphPartition(), and ProcessAdm::isParallel().
| bool DomainDecomposition::setup | ( | const ProcessAdm & | adm, |
| const SIMbase & | sim | ||
| ) |
Setup domain decomposition.
| [in] | adm | Process administrator to setup dd across |
| [in] | sim | Simulator with model to partition |
References LinSolParams::BlockParams::basis, blocks, calcGlobalEqNumbers(), calcGlobalEqNumbersPart(), calcGlobalNodeNumbers(), LinSolParams::BlockParams::comps, IFEM::cout, ProcessAdm::dd, ASMbase::generateThreadGroupsFromElms(), LinSolParams::getBlock(), utl::getDigits(), SIMbase::getElmConnectivities(), SAM::getEquation(), SAM::getEquations(), SIMbase::getFEModel(), ASMbase::getLMType(), getMaxEq(), getMaxNode(), getMinEq(), getMinNode(), LinSolParams::getNoBlocks(), ASMbase::getNodeID(), ProcessAdm::getNoProcs(), SIMbase::getPatch(), ProcessAdm::getProcId(), getSAM(), SIMbase::getSAM(), SIMbase::getSolParams(), ghostConnections, graphPartition(), ASMbase::isLMn(), ProcessAdm::isParallel(), myElms, sam, and sanityCheckCorners().
Referenced by SIMbase::merge(), and SIMbase::preprocessC().