Abstract base class for domain decomposition. More...
Public Member Functions | |
TypeName ("decompositionMethod") | |
Runtime type information. More... | |
declareRunTimeSelectionTable (autoPtr, decompositionMethod, dictionary,(const dictionary &decompDict, const word ®ionName),(decompDict, regionName)) | |
decompositionMethod (const dictionary &decompDict, const word ®ionName="") | |
Construct given the decomposition dictionary, optionally region-specific. More... | |
virtual | ~decompositionMethod ()=default |
Destructor. More... | |
label | nDomains () const noexcept |
Number of domains. More... | |
virtual bool | parallelAware () const =0 |
Is method parallel aware? More... | |
virtual labelList | decompose (const pointField &points, const scalarField &pointWeights) const |
Return the wanted processor number for every coordinate. More... | |
virtual labelList | decompose (const pointField &points) const |
Decompose with uniform weights on the points. More... | |
virtual labelList | decompose (const polyMesh &mesh, const pointField &points, const scalarField &pointWeights) const =0 |
Return for every coordinate the wanted processor number. More... | |
virtual labelList | decompose (const polyMesh &mesh, const pointField &points) const |
Decompose with uniform weights on the points. More... | |
virtual labelList | decompose (const polyMesh &mesh, const labelList &cellToRegion, const pointField ®ionPoints, const scalarField ®ionWeights) const |
Return for every coordinate the wanted processor number. Gets. More... | |
virtual labelList | decompose (const polyMesh &mesh, const labelList &cellToRegion, const pointField ®ionPoints) const |
Like decompose but with uniform weights on the regions. More... | |
virtual labelList | decompose (const labelListList &globalCellCells, const pointField &cc, const scalarField &cWeights) const =0 |
Return for every coordinate the wanted processor number. More... | |
virtual labelList | decompose (const labelListList &globalCellCells, const pointField &cc) const |
Like decompose but with uniform weights on the cells. More... | |
void | setConstraints (const polyMesh &mesh, boolList &blockedFace, PtrList< labelList > &specifiedProcessorFaces, labelList &specifiedProcessor, List< labelPair > &explicitConnections) const |
Helper: extract constraints: More... | |
void | applyConstraints (const polyMesh &mesh, const boolList &blockedFace, const PtrList< labelList > &specifiedProcessorFaces, const labelList &specifiedProcessor, const List< labelPair > &explicitConnections, labelList &finalDecomp) const |
Helper: apply constraints to a decomposition. More... | |
virtual labelList | decompose (const polyMesh &mesh, const scalarField &cellWeights, const boolList &blockedFace, const PtrList< labelList > &specifiedProcessorFaces, const labelList &specifiedProcessor, const List< labelPair > &explicitConnections) const |
labelList | decompose (const polyMesh &mesh, const scalarField &cWeights) const |
Decompose a mesh. More... | |
Static Public Member Functions | |
static label | nDomains (const dictionary &decompDict, const word ®ionName="") |
Return region-specific or top-level numberOfSubdomains entry. More... | |
static const dictionary & | optionalRegionDict (const dictionary &decompDict, const word ®ionName) |
Return an optional region-specific dictionary from "regions" sub-dictionary, or dictionary::null on failure. More... | |
static autoPtr< decompositionMethod > | New (const dictionary &decompDict, const word ®ionName="") |
Return a reference to the selected decomposition method, optionally region-specific. More... | |
static void | calcCellCells (const polyMesh &mesh, const labelList &agglom, const label nLocalCoarse, const bool global, CompactListList< label > &cellCells) |
Helper: determine (local or global) cellCells from mesh. More... | |
static void | calcCellCells (const polyMesh &mesh, const labelList &agglom, const label nLocalCoarse, const bool parallel, CompactListList< label > &cellCells, CompactListList< scalar > &cellCellWeights) |
Helper: determine (local or global) cellCells and face weights. More... | |
Protected Types | |
enum | selectionType { DEFAULT = 0, EXACT = 1, MANDATORY = 2, NULL_DICT = 4 } |
Selection type when handling the coefficients dictionary. More... | |
Protected Member Functions | |
const dictionary & | findCoeffsDict (const word &coeffsName, int select=selectionType::DEFAULT) const |
Locate coeffsName dictionary or the fallback "coeffs" dictionary. More... | |
Static Protected Member Functions | |
static const dictionary & | findCoeffsDict (const dictionary &dict, const word &coeffsName, int select=selectionType::DEFAULT) |
Locate coeffsName dictionary or the fallback "coeffs" dictionary within an enclosing dictionary. More... | |
Protected Attributes | |
const dictionary & | decompDict_ |
Top-level decomposition dictionary (eg, decomposeParDict) More... | |
const dictionary & | decompRegionDict_ |
Region-specific decomposition dictionary information. More... | |
label | nDomains_ |
Number of domains for the decomposition. More... | |
PtrList< decompositionConstraint > | constraints_ |
Optional constraints. More... | |
Abstract base class for domain decomposition.
Definition at line 47 of file decompositionMethod.H.
|
protected |
Selection type when handling the coefficients dictionary.
To be used as a bit-mask for findCoeffsDict
Enumerator | |
---|---|
DEFAULT | Default request. |
EXACT | No fallback to "coeffs" if main name not found. |
MANDATORY | Fatal if dictionary could not be found. |
NULL_DICT | On failure, return dictionary::null instead of the top-level enclosing dictionary. |
Definition at line 84 of file decompositionMethod.H.
|
explicit |
Construct given the decomposition dictionary, optionally region-specific.
Definition at line 328 of file decompositionMethod.C.
|
virtualdefault |
Destructor.
|
staticprotected |
Locate coeffsName dictionary or the fallback "coeffs" dictionary within an enclosing dictionary.
select | choose to include "coeffs" in the search, make failure a FatalError, return dictionary::null instead on failure. |
Definition at line 247 of file decompositionMethod.C.
References Foam::abort(), Foam::cfindCoeffsDict(), dict, Foam::endl(), Foam::FatalIOError, dictionary::name(), dictionary::null, and Foam::BitOps::select().
|
protected |
Locate coeffsName dictionary or the fallback "coeffs" dictionary.
Searches both the region-specific decomposition dictionary and the top-level decomposition dictionary.
select | choose to include "coeffs" in the search, make failure a FatalError, return dictionary::null instead on failure. |
Definition at line 282 of file decompositionMethod.C.
References Foam::abort(), Foam::cfindCoeffsDict(), Foam::endl(), Foam::FatalIOError, dictionary::null, and Foam::BitOps::select().
TypeName | ( | "decompositionMethod" | ) |
Runtime type information.
declareRunTimeSelectionTable | ( | autoPtr | , |
decompositionMethod | , | ||
dictionary | , | ||
(const dictionary &decompDict, const word ®ionName) | , | ||
(decompDict, regionName) | |||
) |
|
static |
Return region-specific or top-level numberOfSubdomains
entry.
The region-specific version is found within the "regions" sub-dictionary.
Definition at line 75 of file decompositionMethod.C.
References Foam::endl(), Foam::nl, dictionary::readEntry(), dictionary::readIfPresent(), regionName, and WarningInFunction.
|
static |
Return an optional region-specific dictionary from "regions" sub-dictionary, or dictionary::null on failure.
Definition at line 119 of file decompositionMethod.C.
References dictionary::findDict(), and regionName.
|
static |
Return a reference to the selected decomposition method, optionally region-specific.
Definition at line 347 of file decompositionMethod.C.
References Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, dictionary::get(), Foam::Info, dictionary::readIfPresent(), and regionName.
Referenced by decompositionModel::decomposer().
|
inlinenoexcept |
Number of domains.
Definition at line 246 of file decompositionMethod.H.
References decompositionMethod::nDomains_.
|
pure virtual |
Is method parallel aware?
(i.e. does it synchronize domains across proc boundaries)
Implemented in scotchDecomp, hierarchGeomDecomp, kahipDecomp, multiLevelDecomp, simpleGeomDecomp, metisDecomp, ptscotchDecomp, randomDecomp, manualDecomp, structuredDecomp, and noDecomp.
|
virtual |
Return the wanted processor number for every coordinate.
Reimplemented in hierarchGeomDecomp, geomDecomp, simpleGeomDecomp, and randomDecomp.
Definition at line 1323 of file decompositionMethod.C.
References NotImplemented.
Referenced by meshRefinement::balance().
|
virtual |
Decompose with uniform weights on the points.
Reimplemented in hierarchGeomDecomp, geomDecomp, simpleGeomDecomp, and randomDecomp.
Definition at line 1334 of file decompositionMethod.C.
References NotImplemented.
|
pure virtual |
Return for every coordinate the wanted processor number.
Use the mesh connectivity (if needed)
Implemented in scotchDecomp, hierarchGeomDecomp, simpleGeomDecomp, multiLevelDecomp, metisLikeDecomp, randomDecomp, ptscotchDecomp, manualDecomp, structuredDecomp, and noDecomp.
|
virtual |
Decompose with uniform weights on the points.
Reimplemented in hierarchGeomDecomp, and simpleGeomDecomp.
Definition at line 387 of file decompositionMethod.C.
References mesh, points, and UList< T >::size().
|
virtual |
Return for every coordinate the wanted processor number. Gets.
passed agglomeration map (from fine to coarse cells) and coarse cell location. Can be overridden by decomposers that provide this functionality natively. Coarse cells are local to the processor (if in parallel). If you want to have coarse cells spanning processors use the globalCellCells instead.
Reimplemented in scotchDecomp, metisLikeDecomp, and ptscotchDecomp.
Definition at line 399 of file decompositionMethod.C.
References forAll, mesh, UList< T >::size(), and CompactListList< T >::unpack().
|
virtual |
Like decompose but with uniform weights on the regions.
Definition at line 440 of file decompositionMethod.C.
References mesh, and UList< T >::size().
|
pure virtual |
Return for every coordinate the wanted processor number.
The connectivity is equal to mesh.cellCells() except for
Implemented in scotchDecomp, hierarchGeomDecomp, simpleGeomDecomp, metisLikeDecomp, ptscotchDecomp, multiLevelDecomp, randomDecomp, manualDecomp, noDecomp, and structuredDecomp.
|
virtual |
Like decompose but with uniform weights on the cells.
Reimplemented in hierarchGeomDecomp.
Definition at line 459 of file decompositionMethod.C.
References UList< T >::size().
|
static |
Helper: determine (local or global) cellCells from mesh.
agglomeration. Agglomeration is local to the processor. local : connections are in local indices. Coupled across cyclics but not processor patches. global : connections are in global indices. Coupled across cyclics and processor patches.
Definition at line 471 of file decompositionMethod.C.
References polyMesh::boundaryMesh(), HashTable< T, Key, Hash >::clear(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), forAll, HashSet< Key, Hash >::insert(), globalIndex::isLocal(), CompactListList< T >::m(), mesh, primitiveMesh::nBoundaryFaces(), primitiveMesh::nInternalFaces(), CompactListList< T >::offsets(), patches, pp(), List< T >::setSize(), CompactListList< T >::setSize(), CompactListList< T >::size(), syncTools::swapBoundaryFaceList(), globalIndex::toGlobal(), globalIndex::toLocal(), UPstream::worldComm, and Foam::Zero.
Referenced by CuthillMcKeeRenumber::renumber(), and springRenumber::renumber().
|
static |
Helper: determine (local or global) cellCells and face weights.
from mesh agglomeration. Uses mag of faceArea as weights
Definition at line 663 of file decompositionMethod.C.
References polyMesh::boundaryMesh(), HashTable< T, Key, Hash >::clear(), primitiveMesh::faceAreas(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), forAll, HashSet< Key, Hash >::insert(), globalIndex::isLocal(), CompactListList< T >::m(), Foam::mag(), mesh, primitiveMesh::nBoundaryFaces(), primitiveMesh::nInternalFaces(), CompactListList< T >::offsets(), patches, pp(), List< T >::setSize(), CompactListList< T >::setSize(), CompactListList< T >::size(), syncTools::swapBoundaryFaceList(), globalIndex::toGlobal(), globalIndex::toLocal(), UPstream::worldComm, and Foam::Zero.
void setConstraints | ( | const polyMesh & | mesh, |
boolList & | blockedFace, | ||
PtrList< labelList > & | specifiedProcessorFaces, | ||
labelList & | specifiedProcessor, | ||
List< labelPair > & | explicitConnections | ||
) | const |
Helper: extract constraints:
blockedface: existing faces where owner and neighbour on same proc explicitConnections: sets of boundary faces ,, ,, specifiedProcessorFaces: groups of faces with all cells on same processor.
Definition at line 1215 of file decompositionMethod.C.
References PtrList< T >::clear(), List< T >::clear(), mesh, primitiveMesh::nFaces(), and List< T >::setSize().
Referenced by meshRefinement::balance().
void applyConstraints | ( | const polyMesh & | mesh, |
const boolList & | blockedFace, | ||
const PtrList< labelList > & | specifiedProcessorFaces, | ||
const labelList & | specifiedProcessor, | ||
const List< labelPair > & | explicitConnections, | ||
labelList & | finalDecomp | ||
) | const |
Helper: apply constraints to a decomposition.
This gives constraints opportunity to modify decomposition in case the native decomposition method has not obeyed all constraints
Definition at line 1244 of file decompositionMethod.C.
References mesh.
|
virtual |
blockedFace | Whether owner and neighbour should be on same processor |
(takes priority over explicitConnections)
specifiedProcessorFaces | Whether whole sets of faces (and point neighbours) need to be kept |
on single processor
explicitConnections | Additional connections between boundary faces |
Definition at line 858 of file decompositionMethod.C.
References Foam::BitOps::all(), polyMesh::boundaryMesh(), primitiveMesh::cellCentres(), Foam::BitOps::count(), UList< T >::data(), Foam::ensightOutput::debug, UList< T >::empty(), Foam::endl(), Foam::exit(), f(), primitiveMesh::faceCentres(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), Foam::FatalError, FatalErrorInFunction, forAll, polyMesh::globalData(), Foam::Info, primitiveMesh::isInternalFace(), Foam::max(), mesh, primitiveMesh::nCells(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), Foam::nl, regionSplit::nLocalRegions(), globalMeshData::nTotalCells(), UPstream::parRun(), patches, pFaces, primitiveMesh::pointFaces(), pp(), Foam::reduce(), Foam::returnReduce(), Foam::returnReduceOr(), UList< T >::size(), syncTools::swapBoundaryCellList(), and Foam::Zero.
Foam::labelList decompose | ( | const polyMesh & | mesh, |
const scalarField & | cWeights | ||
) | const |
Decompose a mesh.
Apply all constraints from decomposeParDict ('preserveFaceZones' etc). Calls either
Definition at line 1269 of file decompositionMethod.C.
References mesh.
|
protected |
Top-level decomposition dictionary (eg, decomposeParDict)
Definition at line 99 of file decompositionMethod.H.
|
protected |
Region-specific decomposition dictionary information.
Definition at line 104 of file decompositionMethod.H.
|
protected |
Number of domains for the decomposition.
Definition at line 109 of file decompositionMethod.H.
Referenced by decompositionMethod::nDomains().
|
protected |
Optional constraints.
Definition at line 114 of file decompositionMethod.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.