38#ifndef Foam_decompositionMethod_H
39#define Foam_decompositionMethod_H
61 bool constraintCompat(
const word& modelType)
const;
64 void readConstraints();
112 const word& coeffsName,
131 const word& coeffsName,
237 virtual bool geometric()
const {
return false; }
397 const label nLocalCoarse,
410 const label nLocalCoarse,
A packed storage of objects of type <T> using an offset table for access.
static const Field< scalar > & null() noexcept
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
label nDomains(const label n)
Set number of domains. Return old value.
selectionType
Selection type when handling the coefficients dictionary.
@ EXACT
No fallback to "coeffs" if main name not found.
@ DEFAULT
Default request.
@ MANDATORY
Fatal if dictionary could not be found.
const dictionary & decompRegionDict_
Region-specific decomposition dictionary information.
label nDomains_
Number of domains for the decomposition.
PtrList< decompositionConstraint > constraints_
Optional constraints.
virtual labelList decompose(const polyMesh &mesh, const pointField &points, const scalarField &pointWeights=scalarField::null()) const =0
Return for every coordinate the wanted processor number, using uniform or specified point weights.
virtual bool geometric() const
True if the method is purely geometric, often using cell centre points.
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.
void operator=(const decompositionMethod &)=delete
No copy assignment.
virtual labelList decompose(const CompactListList< label > &globalCellCells, const pointField &cc, const scalarField &cWeights=scalarField::null()) const =0
Return for every coordinate the wanted processor number.
const dictionary & decompDict_
Top-level decomposition dictionary (eg, decomposeParDict).
TypeName("decompositionMethod")
Runtime type information.
virtual labelList decompose(const labelListList &globalCellCells, const pointField &cc, const scalarField &cWeights=scalarField::null()) const =0
Return for every coordinate the wanted processor number.
void setConstraints(const polyMesh &mesh, boolList &blockedFace, PtrList< labelList > &specifiedProcessorFaces, labelList &specifiedProcessor, List< labelPair > &explicitConnections) const
Helper: extract constraints:
virtual ~decompositionMethod()=default
Destructor.
decompositionMethod(const label numDomains)
Construct with specified number of domains, no coefficients or constraints.
static autoPtr< decompositionMethod > New(const dictionary &decompDict, const word ®ionName="")
Return a reference to the selected decomposition method, optionally region-specific.
virtual labelList decompose(const pointField &points, const scalarField &pointWeights=scalarField::null()) const
Return the wanted processor number for every coordinate, using uniform or specified point weights.
static FOAM_NO_DANGLING_REFERENCE 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.
virtual bool parallelAware() const =0
Is method parallel aware?
declareRunTimeSelectionTable(autoPtr, decompositionMethod, dictionary,(const dictionary &decompDict, const word ®ionName),(decompDict, regionName))
static void calcCellCells(const polyMesh &mesh, const labelList &agglom, const label nLocalCoarse, const bool parallel, CompactListList< label > &cellCells)
Determine (local or global) cellCells from mesh agglomeration.
static const dictionary & optionalRegionDict(const dictionary &decompDict, const word ®ionName)
Return an optional region-specific dictionary from "regions" sub-dictionary, or dictionary::null on f...
label nDomains() const noexcept
Number of domains.
decompositionMethod(const decompositionMethod &)=delete
No copy construct.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Mesh consisting of general polyhedral cells.
A class for handling words, derived from Foam::string.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
List< bool > boolList
A List of bools.
vectorField pointField
pointField is a vectorField.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes).
#define FOAM_NO_DANGLING_REFERENCE
#define FOAM_DEPRECATED_STRICT(since, replacement)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.