51 Foam::structuredDecomp::structuredDecomp
58 methodDict_(findCoeffsDict(typeName +
"Coeffs", selectionType::MANDATORY)),
70 return method_().parallelAware();
85 for (
const label patchi : patchIDs)
87 nFaces += pbm[patchi].
size();
92 for (
const label patchi : patchIDs)
94 patchCells.insert(pbm[patchi].faceCells());
98 fvMeshSubset subsetter
100 dynamic_cast<const fvMesh&>(
mesh),
103 const fvMesh& subMesh = subsetter.subMesh();
105 scalarField subWeights(cWeights, subsetter.cellMap());
108 labelList subDecomp(method_().decompose(subMesh, subCc, subWeights));
115 finalDecomp[subsetter.cellMap()[i]] = subDecomp[i];
119 List<topoDistanceData<label>> cellData(
mesh.
nCells());
120 List<topoDistanceData<label>> faceData(
mesh.
nFaces());
124 List<topoDistanceData<label>> patchData(nFaces);
126 for (
const label patchi : patchIDs)
128 const polyPatch& pp = pbm[patchi];
132 patchFaces[nFaces] = pp.start()+i;
133 patchData[nFaces] = topoDistanceData<label>(0, finalDecomp[fc[i]]);
139 FaceCellWave<topoDistanceData<label>> deltaCalc
150 bool haveWarned =
false;
151 forAll(finalDecomp, celli)
153 if (!cellData[celli].valid(deltaCalc.data()))
158 <<
"Did not visit some cells, e.g. cell " << celli
160 <<
"Assigning these cells to domain 0." <<
endl;
163 finalDecomp[celli] = 0;
167 finalDecomp[celli] = cellData[celli].data();
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual labelList decompose(const polyMesh &mesh, const pointField &points, const scalarField &pointWeights) const
Return for every coordinate the wanted processor number.
label nFaces() const noexcept
Number of mesh faces.
Macros for easy insertion into run-time selection tables.
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Foam::word regionName(Foam::polyMesh::defaultRegion)
vectorField pointField
pointField is a vectorField.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
label size() const noexcept
The number of elements in the list.
A List of wordRe with additional matching capabilities.
const globalMeshData & globalData() const
Return parallel info.
Abstract base class for domain decomposition.
const vectorField & cellCentres() const
label nDomains() const noexcept
Number of domains.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
virtual bool parallelAware() const
Is method parallel aware.
defineTypeNameAndDebug(combustionModel, 0)
label nTotalCells() const noexcept
Return total number of cells in decomposed mesh.
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
static autoPtr< decompositionMethod > New(const dictionary &decompDict, const word ®ionName="")
Return a reference to the selected decomposition method, optionally region-specific.
#define WarningInFunction
Report a warning using Foam::Warning.
label nCells() const noexcept
Number of mesh cells.
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool useGroups=true) const
Return the set of patch IDs corresponding to the given names.
Mesh consisting of general polyhedral cells.
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
List< label > labelList
A List of labels.