52 Foam::structuredRenumber::structuredRenumber
58 coeffsDict_(
dict.optionalSubDict(typeName +
"Coeffs")),
60 nLayers_(coeffsDict_.getOrDefault<label>(
"nLayers",
labelMax)),
61 depthFirst_(coeffsDict_.
get<bool>(
"depthFirst")),
62 reverse_(coeffsDict_.getOrDefault(
"reverse", false)),
69 bool Foam::structuredRenumber::layerLess::operator()
75 const auto& ta = distance_[a];
76 const auto& tb = distance_[
b];
86 if (ta.data() < tb.data())
91 else if (ta.data() > tb.data())
98 return ta.distance() < tb.distance();
103 if (ta.distance() < tb.distance())
107 else if (ta.distance() > tb.distance())
114 return ta.data() < tb.data();
132 return order_[a] < order_[
b];
143 const polyBoundaryMesh&
pbm =
mesh.boundaryMesh();
149 nFaces +=
pbm[patchi].size();
160 label nTotalSeeds =
returnReduce(patchCells.size(), sumOp<label>());
162 label nTotalCells =
mesh.globalData().nTotalCells();
163 const label nLayers = nTotalCells/nTotalSeeds;
165 Info<<
type() <<
" : seeding " << nTotalSeeds
166 <<
" cells on (estimated) " << nLayers <<
" layers" <<
nl 176 fvMeshSubset subsetter
178 dynamic_cast<const fvMesh&>(
mesh),
182 const labelList& cellMap = subsetter.cellMap();
185 labelList subOrder = method_().renumber(subsetter.subMesh());
189 const globalIndex globalSubCells(subOrder.size());
194 orderedToOld[cellMap[i]] =
195 globalSubCells.toGlobal(subOrigToOrdered[i]);
202 List<topoDistanceData<label>> patchData(nFaces);
206 const polyPatch&
pp =
pbm[patchi];
210 patchFaces[nFaces] =
pp.start()+i;
211 patchData[nFaces] = topoDistanceData<label>
221 List<topoDistanceData<label>> cellData(
mesh.nCells());
222 List<topoDistanceData<label>> faceData(
mesh.nFaces());
225 OppositeFaceCellWave<topoDistanceData<label>> deltaCalc
235 deltaCalc.iterate(nLayers_);
237 Info<<
type() <<
" : did not visit " 238 << deltaCalc.nUnvisitedCells()
239 <<
" cells out of " << nTotalCells
240 <<
"; using " << method_().type() <<
" renumbering for these" <<
endl;
256 layerLess(depthFirst_, oldToOrdered, cellData)
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
const labelList patchIDs(pbm.indices(polyPatchNames, true))
const polyBoundaryMesh & pbm
A list of keyword definitions, which are a keyword followed by a number of values (eg...
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
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.
virtual labelList renumber(const polyMesh &mesh) const
Return the cell visit order (from ordered back to original cell id)
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Abstract base class for renumbering.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
A List of wordRe with additional matching capabilities.
void reverse(UList< T > &list, const label n)
Reverse the first n elements of the list.
defineTypeNameAndDebug(combustionModel, 0)
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
messageStream Info
Information stream (stdout output on master, null elsewhere)
List< label > labelList
A List of labels.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)