decompositionMethod Class Referenceabstract

Abstract base class for decomposition. More...

Inheritance diagram for decompositionMethod:
Collaboration diagram for decompositionMethod:

Public Member Functions

 TypeName ("decompositionMethod")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, decompositionMethod, decomposer,(const dictionary &decompositionDict),(decompositionDict))
 
 declareRunTimeSelectionTable (autoPtr, decompositionMethod, distributor,(const dictionary &decompositionDict),(decompositionDict))
 
 decompositionMethod (const dictionary &decompositionDict)
 Construct given the decomposition dictionary. More...
 
 decompositionMethod (const decompositionMethod &)=delete
 Disallow default bitwise copy construction. More...
 
virtual ~decompositionMethod ()
 Destructor. More...
 
label nDomains () const
 
virtual labelList decompose (const pointField &points, const scalarField &pointWeights)
 Return for every coordinate the wanted processor number. More...
 
virtual labelList decompose (const pointField &)
 Like decompose but with uniform weights on the points. More...
 
virtual labelList decompose (const polyMesh &mesh, const pointField &points, const scalarField &pointWeights)=0
 Return for every coordinate the wanted processor number. Use the. More...
 
virtual labelList decompose (const polyMesh &, const pointField &)
 Like decompose but with uniform weights on the points. More...
 
virtual labelList decompose (const polyMesh &mesh, const labelList &cellToRegion, const pointField &regionPoints, const scalarField &regionWeights)
 Return for every coordinate the wanted processor number. Gets. More...
 
virtual labelList decompose (const polyMesh &mesh, const labelList &cellToRegion, const pointField &regionPoints)
 Like decompose but with uniform weights on the regions. More...
 
virtual labelList decompose (const labelListList &globalCellCells, const pointField &cellCentres, const scalarField &cellWeights)=0
 Return for every coordinate the wanted processor number. More...
 
virtual labelList decompose (const labelListList &globalCellCells, const pointField &cellCentres)
 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)
 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)
 Helper: apply constraints to a decomposition. This gives. More...
 
virtual labelList decompose (const polyMesh &mesh, const scalarField &cellWeights, const boolList &blockedFace, const PtrList< labelList > &specifiedProcessorFaces, const labelList &specifiedProcessor, const List< labelPair > &explicitConnections)
 Decompose a mesh with constraints. More...
 
labelList decompose (const polyMesh &mesh, const scalarField &cellWeights)
 Decompose a mesh. Apply all constraints from decomposeParDict. More...
 
void operator= (const decompositionMethod &)=delete
 Disallow default bitwise assignment. More...
 

Static Public Member Functions

static autoPtr< decompositionMethodNewDecomposer (const dictionary &decompositionDict)
 Return a reference to the selected decomposition method. More...
 
static autoPtr< decompositionMethodNewDistributor (const dictionary &decompositionDict)
 Return a reference to the selected decomposition method. More...
 
static IOdictionary decomposeParDict (const Time &time)
 Read and return the decomposeParDict. More...
 
static labelList scaleWeights (const scalarField &weights, label &nWeights, const bool distributed=true)
 Convert the given scalar weights to labels. 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 Member Functions

label nWeights (const pointField &points, const scalarField &pointWeights) const
 Return the number of weights per point. More...
 
label checkWeights (const pointField &points, const scalarField &pointWeights) const
 Check the weights against the points. More...
 

Protected Attributes

dictionary decompositionDict_
 
label nProcessors_
 
PtrList< decompositionConstraintconstraints_
 Optional constraints. More...
 

Detailed Description

Abstract base class for decomposition.

Source files

Definition at line 49 of file decompositionMethod.H.

Constructor & Destructor Documentation

◆ decompositionMethod() [1/2]

decompositionMethod ( const dictionary decompositionDict)

Construct given the decomposition dictionary.

Definition at line 99 of file decompositionMethod.C.

References List< T >::append(), decompositionMethod::constraints_, decompositionMethod::decompositionDict_, dict, forAllConstIter, dictionary::found(), UList< T >::last(), decompositionConstraint::New(), and dictionary::subDict().

Here is the call graph for this function:

◆ decompositionMethod() [2/2]

Disallow default bitwise copy construction.

◆ ~decompositionMethod()

virtual ~decompositionMethod ( )
inlinevirtual

Destructor.

Definition at line 137 of file decompositionMethod.H.

Member Function Documentation

◆ nWeights()

Foam::label nWeights ( const pointField points,
const scalarField pointWeights 
) const
protected

Return the number of weights per point.

Definition at line 54 of file decompositionMethod.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, points, Foam::returnReduce(), and List< T >::size().

Here is the call graph for this function:

◆ checkWeights()

Foam::label checkWeights ( const pointField points,
const scalarField pointWeights 
) const
protected

Check the weights against the points.

and return the number of weights per point

Definition at line 77 of file decompositionMethod.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, points, and Foam::type().

Here is the call graph for this function:

◆ TypeName()

TypeName ( "decompositionMethod"  )

Runtime type information.

◆ declareRunTimeSelectionTable() [1/2]

declareRunTimeSelectionTable ( autoPtr  ,
decompositionMethod  ,
decomposer  ,
(const dictionary &decompositionDict)  ,
(decompositionDict)   
)

◆ declareRunTimeSelectionTable() [2/2]

declareRunTimeSelectionTable ( autoPtr  ,
decompositionMethod  ,
distributor  ,
(const dictionary &decompositionDict)  ,
(decompositionDict)   
)

◆ NewDecomposer()

Foam::autoPtr< Foam::decompositionMethod > NewDecomposer ( const dictionary decompositionDict)
static

Return a reference to the selected decomposition method.

Definition at line 141 of file decompositionMethod.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::Info, Foam::libs, dictionary::lookupBackwardsCompatible(), Foam::nl, and dlLibraryTable::open().

Referenced by multiLevel::multiLevel(), and structured::structured().

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

◆ NewDistributor()

Foam::autoPtr< Foam::decompositionMethod > NewDistributor ( const dictionary decompositionDict)
static

Return a reference to the selected decomposition method.

Definition at line 181 of file decompositionMethod.C.

◆ nDomains()

label nDomains ( ) const
inline

Definition at line 143 of file decompositionMethod.H.

References decompositionMethod::nProcessors_.

Referenced by multiLevel::multiLevel(), and structured::structured().

Here is the caller graph for this function:

◆ decomposeParDict()

Foam::IOdictionary decomposeParDict ( const Time time)
static

Read and return the decomposeParDict.

Definition at line 220 of file decompositionMethod.C.

◆ decompose() [1/10]

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

Return for every coordinate the wanted processor number.

Reimplemented in geometric, hierarchical, and simple.

Definition at line 155 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 )
inlinevirtual

Like decompose but with uniform weights on the points.

Reimplemented in geometric, simple, and hierarchical.

Definition at line 166 of file decompositionMethod.H.

References NotImplemented.

◆ decompose() [3/10]

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

Return for every coordinate the wanted processor number. Use the.

mesh connectivity (if needed)

Implemented in zoltan, scotch, ptscotch, parMetis, metis, structured, multiLevel, random, none, manual, hierarchical, and simple.

◆ decompose() [4/10]

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

Like decompose but with uniform weights on the points.

Reimplemented in hierarchical, and simple.

Definition at line 237 of file decompositionMethod.C.

References points, and List< T >::size().

Here is the call graph for this function:

◆ decompose() [5/10]

Foam::labelList decompose ( const polyMesh mesh,
const labelList cellToRegion,
const pointField regionPoints,
const scalarField regionWeights 
)
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 parMetis, metis, zoltan, scotch, and ptscotch.

Definition at line 249 of file decompositionMethod.C.

References forAll, UCompactListList< T >::list(), and List< T >::size().

Here is the call graph for this function:

◆ decompose() [6/10]

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

Like decompose but with uniform weights on the regions.

Definition at line 290 of file decompositionMethod.C.

References List< T >::size().

Here is the call graph for this function:

◆ decompose() [7/10]

virtual labelList decompose ( const labelListList globalCellCells,
const pointField cellCentres,
const scalarField cellWeights 
)
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 zoltan, scotch, ptscotch, parMetis, metis, structured, simple, random, none, multiLevel, manual, and hierarchical.

◆ decompose() [8/10]

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

Like decompose but with uniform weights on the cells.

Reimplemented in hierarchical.

Definition at line 309 of file decompositionMethod.C.

◆ scaleWeights()

Foam::labelList scaleWeights ( const scalarField weights,
label nWeights,
const bool  distributed = true 
)
static

Convert the given scalar weights to labels.

in the range 0-labelMax/2 Removes 0 weights and updates nWeights accordingly

Definition at line 321 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 431 of file decompositionMethod.C.

References polyMesh::boundaryMesh(), HashTable< T, Key, Hash >::clear(), polyPatch::coupled(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), forAll, HashSet< Key, Hash >::insert(), globalIndex::isLocal(), UCompactListList< T >::m(), UPstream::msgType(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), UCompactListList< T >::offsets(), patches, patchi, CompactListList< T >::setSize(), UCompactListList< T >::size(), polyPatch::start(), syncTools::swapBoundaryFaceList(), globalIndex::toGlobal(), globalIndex::toLocal(), and UPstream::worldComm.

Referenced by renumberMethod::renumber(), 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 
)

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

References List< T >::clear(), PtrList< T >::clear(), forAll, 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 
)

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

References forAll.

◆ 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 
)
virtual

Decompose a mesh with constraints.

Constraints:

  • blockedFace : whether owner and neighbour should be on same processor
  • specifiedProcessorFaces, specifiedProcessor : sets of faces that should go to same processor (as specified in specifiedProcessor, can be -1)
  • explicitConnections : connections between baffle faces (blockedFace should be false on these). Owner and neighbour on same processor. Set all to zero size to have unconstrained decomposition.

Definition at line 825 of file decompositionMethod.C.

References polyMesh::boundaryMesh(), primitiveMesh::cellCentres(), polyPatch::coupled(), UList< T >::data(), FaceCellWave< Type, TrackingData >::data(), Foam::endl(), Foam::exit(), f(), primitiveMesh::faceCentres(), polyMesh::faceNeighbour(), polyMesh::faceOwner(), polyMesh::faces(), Foam::FatalError, FatalErrorInFunction, Pair< Type >::first(), forAll, polyMesh::globalData(), Foam::Info, primitiveMesh::isInternalFace(), VectorSpace< Form, Cmpt, Ncmpts >::max, patchIdentifier::name(), primitiveMesh::nCells(), primitiveMesh::nFaces(), primitiveMesh::nInternalFaces(), regionSplit::nLocalRegions(), globalMeshData::nTotalCells(), UPstream::parRun(), patches, patchi, pFaces, primitiveMesh::pointFaces(), Foam::reduce(), Foam::returnReduce(), Pair< Type >::second(), UPtrList< T >::size(), List< T >::size(), polyPatch::start(), syncTools::swapBoundaryCellList(), and Foam::blendedInterfacialModel::valid().

Here is the call graph for this function:

◆ decompose() [10/10]

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

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

◆ operator=()

void operator= ( const decompositionMethod )
delete

Disallow default bitwise assignment.

Member Data Documentation

◆ decompositionDict_

dictionary decompositionDict_
protected

Definition at line 55 of file decompositionMethod.H.

Referenced by decompositionMethod::decompositionMethod().

◆ nProcessors_

label nProcessors_
protected

Definition at line 57 of file decompositionMethod.H.

Referenced by geometric::geometric(), and decompositionMethod::nDomains().

◆ constraints_

PtrList<decompositionConstraint> constraints_
protected

Optional constraints.

Definition at line 60 of file decompositionMethod.H.

Referenced by decompositionMethod::decompositionMethod().


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