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)
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.
static constexpr const zero Zero
Global zero (0)
A packed storage unstructured matrix of objects of type <T> using an offset table for access.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
label nCells() const noexcept
Number of mesh cells.
messageStream Info
Information stream (stdout output on master, null elsewhere)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
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)
Renumber the values (not the indices) of a list.
virtual labelList renumber(const pointField &) const
Return the order in which cells need to be visited, i.e.
void shuffle(UList< T > &a)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
Inplace reorder the elements of a list.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)