50 dict_(renumberDict.optionalSubDict(typeName+
"Coeffs")),
51 maxCo_(dict_.lookup<scalar>(
"maxCo")),
52 maxIter_(dict_.lookup<
label>(
"maxIter")),
53 freezeFraction_(dict_.lookup<scalar>(
"freezeFraction"))
91 position[celli] = celli;
98 for (
label iter = 0; iter < maxIter_; iter++)
112 forAll(cellCells, oldCelli)
114 const labelList& cCells = cellCells[oldCelli];
115 label celli = oldToNew[oldCelli];
119 label nbrCelli = oldToNew[cCells[i]];
121 sumForce[celli] += (position[nbrCelli]-position[celli]);
135 Info<<
"Iter:" << iter
136 <<
" maxCo:" <<
maxCo
137 <<
" deltaT:" << deltaT
151 position += displacement;
152 position -=
min(position);
153 position *= (position.
size()-1)/
max(position);
156 maxCo *= freezeFraction_;
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
void size(const label)
Override size to be inconsistent with allocated storage.
List< Container > list() const
Convert to List<Container>
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.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Mesh consisting of general polyhedral cells.
Abstract base class for renumbering.
Use spring analogy - attract neighbouring cells according to the distance of their cell indices.
springRenumber(const dictionary &renumberDict)
Construct given the renumber dictionary.
virtual labelList renumber(const pointField &) const
Return the order in which cells need to be visited, i.e.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
Ostream & endl(Ostream &os)
Add newline and flush stream.
labelList invert(const label len, const labelUList &)
Invert one-to-one map. Unmapped elements will be -1.
ListType renumber(const labelUList &oldToNew, const ListType &)
Renumber the values (not the indices) of a list.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
dimensioned< scalar > mag(const dimensioned< Type > &)
defineTypeNameAndDebug(combustionModel, 0)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
void sortedOrder(const UList< T > &, labelList &order)
Generate the (stable) sort order for the list.
void inplaceReorder(const labelUList &oldToNew, ListType &)
Inplace reorder the elements of a list.