Go to the documentation of this file.
50 Foam::springRenumber::springRenumber(
const dictionary& renumberDict)
53 dict_(renumberDict.optionalSubDict(typeName+
"Coeffs")),
54 maxCo_(dict_.
get<scalar>(
"maxCo")),
55 maxIter_(dict_.
get<label>(
"maxIter")),
56 freezeFraction_(dict_.
get<scalar>(
"freezeFraction"))
94 position[celli] = celli;
99 scalar
maxCo = maxCo_ * cellCells.size();
101 for (label iter = 0; iter < maxIter_; iter++)
115 forAll(cellCells, oldCelli)
117 const labelList& cCells = cellCells[oldCelli];
118 label celli = oldToNew[oldCelli];
122 label nbrCelli = oldToNew[cCells[i]];
124 sumForce[celli] += (position[nbrCelli]-position[celli]);
138 Info<<
"Iter:" << iter
139 <<
" maxCo:" <<
maxCo
140 <<
" deltaT:" << deltaT
154 position += displacement;
155 position -=
min(position);
156 position *= (position.size()-1)/
max(position);
159 maxCo *= freezeFraction_;
170 return invert(oldToNew.size(), oldToNew);
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
List< label > labelList
A List of labels.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static void calcCellCells(const polyMesh &mesh, const labelList &agglom, const label nLocalCoarse, const bool global, CompactListList< label > &cellCells)
static constexpr const zero Zero
A packed storage unstructured matrix of objects of type <T> using an offset table for access.
Ostream & endl(Ostream &os)
label min(const labelHashSet &set, label minValue=labelMax)
labelList invert(const label len, const labelUList &map)
Mesh consisting of general polyhedral cells.
label nCells() const noexcept
Generic templated field type.
label max(const labelHashSet &set, label maxValue=labelMin)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
Abstract base class for renumbering.
IntListType renumber(const labelUList &oldToNew, const IntListType &input)
virtual labelList renumber(const pointField &) const
void shuffle(UList< T > &a)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
labelList identity(const label len, label start=0)
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
labelList sortedOrder(const UList< T > &input)
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)