decompositionMethod Class Referenceabstract

Abstract base class for domain decomposition. More...

Inheritance diagram for decompositionMethod:
[legend]
Collaboration diagram for decompositionMethod:
[legend]

Public Member Functions

 TypeName ("decompositionMethod")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, decompositionMethod, dictionary,(const dictionary &decompDict),(decompDict))
 
 declareRunTimeSelectionTable (autoPtr, decompositionMethod, dictionaryRegion,(const dictionary &decompDict, const word &regionName),(decompDict, regionName))
 
 decompositionMethod (const dictionary &decompDict)
 Construct given the decomposition dictionary. More...
 
 decompositionMethod (const dictionary &decompDict, const word &regionName)
 Construct given the decomposition dictionary for specific region. More...
 
virtual ~decompositionMethod ()=default
 Destructor. More...
 
label nDomains () const
 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 for every coordinate the wanted processor number. 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 &regionPoints, const scalarField &regionWeights) const
 Return for every coordinate the wanted processor number. Gets. More...
 
virtual labelList decompose (const polyMesh &mesh, const labelList &cellToRegion, const pointField &regionPoints) 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)
 Return the numberOfSubdomains entry from the dictionary. More...
 
static label nDomains (const dictionary &decompDict, const word &regionName)
 Return the numberOfSubdomains from a region within the. More...
 
static const dictionaryoptionalRegionDict (const dictionary &decompDict, const word &regionName)
 Return an optional region dictionary from "regions" sub-dictionary. More...
 
static autoPtr< decompositionMethodNew (const dictionary &decompDict)
 Return a reference to the selected decomposition method. More...
 
static autoPtr< decompositionMethodNew (const dictionary &decompDict, const word &regionName)
 
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 dictionaryfindCoeffsDict (const word &coeffsName, int select=selectionType::DEFAULT) const
 Locate coeffsName dictionary or the fallback "coeffs" dictionary. More...
 

Static Protected Member Functions

static const dictionaryfindCoeffsDict (const dictionary &dict, const word &coeffsName, int select=selectionType::DEFAULT)
 

Protected Attributes

const dictionarydecompDict_
 Top-level decomposition dictionary (eg, decomposeParDict) More...
 
const dictionarydecompRegionDict_
 Region-specific decomposition dictionary information. More...
 
label nDomains_
 Number of domains for the decomposition. More...
 
PtrList< decompositionConstraintconstraints_
 Optional constraints. More...
 

Detailed Description

Abstract base class for domain decomposition.

Source files

Definition at line 51 of file decompositionMethod.H.

Member Enumeration Documentation

◆ selectionType

enum selectionType
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 76 of file decompositionMethod.H.

Constructor & Destructor Documentation

◆ decompositionMethod() [1/2]

decompositionMethod ( const dictionary decompDict)

Construct given the decomposition dictionary.

Definition at line 327 of file decompositionMethod.C.

◆ decompositionMethod() [2/2]

decompositionMethod ( const dictionary decompDict,
const word regionName 
)

Construct given the decomposition dictionary for specific region.

Definition at line 340 of file decompositionMethod.C.

◆ ~decompositionMethod()

virtual ~decompositionMethod ( )
virtualdefault

Destructor.

Member Function Documentation

◆ findCoeffsDict() [1/2]

const Foam::dictionary & findCoeffsDict ( const dictionary dict,
const word coeffsName,
int  select = selectionType::DEFAULT 
)
staticprotected

Locate coeffsName dictionary or the fallback "coeffs" dictionary within an enclosing dictionary.

Parameters
selectchoose to include "coeffs" in the search, make failure a FatalError, return dictionary::null instead on failure.
Returns
the coefficients dictionary found. If nothing was found, return the enclosing dictionary or dictionary::null (depending on the select parameter).

Definition at line 229 of file decompositionMethod.C.

References Foam::abort(), dictionary::csearch(), Foam::defaultName, dict, dictionary::Searcher< Const >::dict(), Foam::endl(), Foam::FatalIOError, dictionary::name(), and dictionary::null.

Here is the call graph for this function:

◆ findCoeffsDict() [2/2]

const Foam::dictionary & findCoeffsDict ( const word coeffsName,
int  select = selectionType::DEFAULT 
) const
protected

Locate coeffsName dictionary or the fallback "coeffs" dictionary.

Searches both the region-specific decomposition dictionary and the top-level decomposition dictionary.

Parameters
selectchoose to include "coeffs" in the search, make failure a FatalError, return dictionary::null instead on failure.
Returns
the coefficients dictionary found. If nothing was found, return the top-level (non-region) dictionary or dictionary::null (depending on the select parameter).

Definition at line 269 of file decompositionMethod.C.

References Foam::abort(), Foam::defaultName, dictionary::Searcher< Const >::dict(), Foam::endl(), Foam::FatalIOError, and dictionary::null.

Here is the call graph for this function:

◆ TypeName()

TypeName ( "decompositionMethod"  )

Runtime type information.

◆ declareRunTimeSelectionTable() [1/2]

declareRunTimeSelectionTable ( autoPtr  ,
decompositionMethod  ,
dictionary  ,
(const dictionary &decompDict)  ,
(decompDict)   
)

◆ declareRunTimeSelectionTable() [2/2]

declareRunTimeSelectionTable ( autoPtr  ,
decompositionMethod  ,
dictionaryRegion  ,
(const dictionary &decompDict, const word &regionName ,
(decompDict, regionName  
)

◆ nDomains() [1/3]

Foam::label nDomains ( const dictionary decompDict)
static

Return the numberOfSubdomains entry from the dictionary.

Definition at line 62 of file decompositionMethod.C.

References dictionary::get().

Here is the call graph for this function:

◆ nDomains() [2/3]

Foam::label nDomains ( const dictionary decompDict,
const word regionName 
)
static

Return the numberOfSubdomains from a region within the.

"regions" sub-dictionary

Definition at line 69 of file decompositionMethod.C.

References Foam::endl(), Foam::nl, dictionary::readIfPresent(), regionName, and WarningInFunction.

Here is the call graph for this function:

◆ optionalRegionDict()

const Foam::dictionary & optionalRegionDict ( const dictionary decompDict,
const word regionName 
)
static

Return an optional region dictionary from "regions" sub-dictionary.

or dictionary::null on failure.

Definition at line 98 of file decompositionMethod.C.

References dictionary::csearch(), dictionary::Searcher< Const >::dict(), dictionary::null, and regionName.

Here is the call graph for this function:

◆ New() [1/2]

Foam::autoPtr< Foam::decompositionMethod > New ( const dictionary decompDict)
static

Return a reference to the selected decomposition method.

Definition at line 359 of file decompositionMethod.C.

References Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, dictionary::get(), and Foam::Info.

Referenced by decompositionModel::decomposer(), decompositionMethod::New(), and structuredDecomp::structuredDecomp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ New() [2/2]

Foam::autoPtr< Foam::decompositionMethod > New ( const dictionary decompDict,
const word regionName 
)
static

Return a reference to the selected decomposition method, with region specification

Definition at line 389 of file decompositionMethod.C.

References Foam::endl(), dictionary::get(), Foam::Info, decompositionMethod::New(), Foam::nl, dictionary::readIfPresent(), regionName, and WarningInFunction.

Here is the call graph for this function:

◆ nDomains() [3/3]

label nDomains ( ) const
inline

Number of domains.

Definition at line 230 of file decompositionMethod.H.

References decompositionMethod::nDomains_.

Referenced by structuredDecomp::structuredDecomp().

Here is the caller graph for this function:

◆ parallelAware()

virtual bool parallelAware ( ) const
pure virtual

Is method parallel aware?

(i.e. does it synchronize domains across proc boundaries)

Implemented in scotchDecomp, hierarchGeomDecomp, kahipDecomp, metisDecomp, ptscotchDecomp, multiLevelDecomp, simpleGeomDecomp, manualDecomp, structuredDecomp, noDecomp, and randomDecomp.

◆ decompose() [1/10]

virtual labelList decompose ( const pointField points,
const scalarField pointWeights 
) const
inlinevirtual

Return for every coordinate the wanted processor number.

Reimplemented in simpleGeomDecomp, geomDecomp, randomDecomp, and hierarchGeomDecomp.

Definition at line 244 of file decompositionMethod.H.

References NotImplemented.

Referenced by meshRefinement::balance().

Here is the caller graph for this function:

◆ decompose() [2/10]

virtual labelList decompose ( const pointField points) const
inlinevirtual

Decompose with uniform weights on the points.

Reimplemented in geomDecomp, simpleGeomDecomp, randomDecomp, and hierarchGeomDecomp.

Definition at line 254 of file decompositionMethod.H.

References NotImplemented.

◆ decompose() [3/10]

virtual labelList decompose ( const polyMesh mesh,
const pointField points,
const scalarField pointWeights 
) const
pure virtual

Return for every coordinate the wanted processor number.

Use the mesh connectivity (if needed)

Implemented in simpleGeomDecomp, scotchDecomp, ptscotchDecomp, multiLevelDecomp, metisLikeDecomp, structuredDecomp, hierarchGeomDecomp, manualDecomp, randomDecomp, and noDecomp.

◆ decompose() [4/10]

Foam::labelList decompose ( const polyMesh mesh,
const pointField points 
) const
virtual

Decompose with uniform weights on the points.

Reimplemented in simpleGeomDecomp, and hierarchGeomDecomp.

Definition at line 433 of file decompositionMethod.C.

References mesh, and points.

◆ decompose() [5/10]

Foam::labelList decompose ( const polyMesh mesh,
const labelList cellToRegion,
const pointField regionPoints,
const scalarField regionWeights 
) const
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, ptscotchDecomp, and metisLikeDecomp.

Definition at line 445 of file decompositionMethod.C.

References forAll, and mesh.

◆ decompose() [6/10]

Foam::labelList decompose ( const polyMesh mesh,
const labelList cellToRegion,
const pointField regionPoints 
) const
virtual

Like decompose but with uniform weights on the regions.

Definition at line 486 of file decompositionMethod.C.

References mesh.

◆ decompose() [7/10]

virtual labelList decompose ( const labelListList globalCellCells,
const pointField cc,
const scalarField cWeights 
) const
pure virtual

Return for every coordinate the wanted processor number.

The connectivity is equal to mesh.cellCells() except for

  • in parallel the cell numbers are global cell numbers (starting from 0 at processor0 and then incrementing all through the processors)
  • the connections are across coupled patches

Implemented in metisLikeDecomp, scotchDecomp, hierarchGeomDecomp, ptscotchDecomp, simpleGeomDecomp, multiLevelDecomp, manualDecomp, randomDecomp, noDecomp, and structuredDecomp.

◆ decompose() [8/10]

Foam::labelList decompose ( const labelListList globalCellCells,
const pointField cc 
) const
virtual

Like decompose but with uniform weights on the cells.

Reimplemented in hierarchGeomDecomp.

Definition at line 505 of file decompositionMethod.C.

◆ calcCellCells() [1/2]

void calcCellCells ( const polyMesh mesh,
const labelList agglom,
const label  nLocalCoarse,
const bool  global,
CompactListList< label > &  cellCells 
)
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 517 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, Container >::m(), mesh, UPstream::msgType(), primitiveMesh::nBoundaryFaces(), primitiveMesh::nInternalFaces(), CompactListList< T, Container >::offsets(), patches, CompactListList< T, Container >::setSize(), List< T >::setSize(), CompactListList< T, Container >::size(), syncTools::swapBoundaryFaceList(), globalIndex::toGlobal(), globalIndex::toLocal(), UPstream::worldComm, and Foam::Zero.

Referenced by CuthillMcKeeRenumber::renumber(), and springRenumber::renumber().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calcCellCells() [2/2]

void calcCellCells ( const polyMesh mesh,
const labelList agglom,
const label  nLocalCoarse,
const bool  parallel,
CompactListList< label > &  cellCells,
CompactListList< scalar > &  cellCellWeights 
)
static

◆ setConstraints()

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 1266 of file decompositionMethod.C.

References PtrList< T >::clear(), List< T >::clear(), mesh, primitiveMesh::nFaces(), and List< T >::setSize().

Referenced by meshRefinement::balance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyConstraints()

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 1295 of file decompositionMethod.C.

References mesh.

◆ decompose() [9/10]

Foam::labelList decompose ( const polyMesh mesh,
const scalarField cellWeights,
const boolList blockedFace,
const PtrList< labelList > &  specifiedProcessorFaces,
const labelList specifiedProcessor,
const List< labelPair > &  explicitConnections 
) const
virtual
Parameters
blockedFaceWhether owner and neighbour should be on same processor (takes priority over explicitConnections)
specifiedProcessorFacesWhether whole sets of faces (and point neighbours) need to be kept on single processor
explicitConnectionsAdditional connections between boundary faces

Definition at line 916 of file decompositionMethod.C.

References Foam::BitOps::all(), polyMesh::boundaryMesh(), primitiveMesh::cellCentres(), Foam::BitOps::count(), Foam::expressions::patchExpr::debug, Foam::endl(), Foam::exit(), f(), primitiveMesh::faceCentres(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), Foam::FatalError, FatalErrorInFunction, forAll, polyMesh::globalData(), Foam::Info, primitiveMesh::isInternalFace(), VectorSpace< Vector< Cmpt >, Cmpt, 3 >::max, mesh, primitiveMesh::nCells(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), Foam::nl, regionSplit::nLocalRegions(), globalMeshData::nTotalCells(), UPstream::parRun(), patches, pFaces, primitiveMesh::pointFaces(), Foam::reduce(), Foam::returnReduce(), Foam::BitOps::set(), syncTools::swapBoundaryCellList(), and Foam::Zero.

Here is the call graph for this function:

◆ decompose() [10/10]

Foam::labelList decompose ( const polyMesh mesh,
const scalarField cWeights 
) const

Decompose a mesh.

Apply all constraints from decomposeParDict ('preserveFaceZones' etc). Calls either

  • no constraints, empty weights: decompose(mesh, cellCentres())
  • no constraints, set weights: decompose(mesh, cellCentres(), cellWeights)
  • valid constraints: decompose(mesh, cellToRegion, regionPoints, regionWeights)

Definition at line 1320 of file decompositionMethod.C.

References mesh.

Member Data Documentation

◆ decompDict_

const dictionary& decompDict_
protected

Top-level decomposition dictionary (eg, decomposeParDict)

Definition at line 89 of file decompositionMethod.H.

◆ decompRegionDict_

const dictionary& decompRegionDict_
protected

Region-specific decomposition dictionary information.

Definition at line 92 of file decompositionMethod.H.

◆ nDomains_

label nDomains_
protected

Number of domains for the decomposition.

Definition at line 95 of file decompositionMethod.H.

Referenced by decompositionMethod::nDomains().

◆ constraints_

PtrList<decompositionConstraint> constraints_
protected

Optional constraints.

Definition at line 98 of file decompositionMethod.H.


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