53 coeffsDict_(
dict.optionalSubDict(typeName +
"Coeffs")),
54 maxIter_(coeffsDict_.
get<label>(
"maxIter")),
55 maxCo_(coeffsDict_.
get<scalar>(
"maxCo")),
56 freezeFraction_(coeffsDict_.
get<scalar>(
"freezeFraction")),
57 verbose_(coeffsDict_.getOrDefault(
"verbose", true))
63 template<
class ConnectionListListType>
66 const ConnectionListListType& cellCells
69 const label nOldCells(cellCells.size());
75 std::iota(position.begin(), position.end(), 0);
82 scalar
maxCo = (maxCo_ * nOldCells);
84 for (label iter = 0; iter < maxIter_; ++iter)
98 for (label oldCelli = 0; oldCelli < nOldCells; ++oldCelli)
100 const label celli = oldToNew[oldCelli];
102 for (
const label nbr : cellCells[oldCelli])
104 const label nbrCelli = oldToNew[nbr];
106 sumForce[celli] += (position[nbrCelli]-position[celli]);
122 Info<<
"Iter:" << iter
123 <<
" maxCo:" <<
maxCo 124 <<
" deltaT:" << deltaT
130 displacement *= deltaT;
140 position += displacement;
142 position *= (position.size()-1)/
Foam::max(position);
145 maxCo *= freezeFraction_;
156 return invert(nOldCells, oldToNew);
169 return renumberImpl(cellCells);
178 return renumberImpl(cellCells);
187 return renumberImpl(cellCells);
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
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.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
Inplace reorder the elements of a list.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Macros for easy insertion into run-time selection tables.
Abstract base class for renumbering.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
A packed storage of objects of type <T> using an offset table for access.
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)
Mesh consisting of general polyhedral cells.
static void calcCellCells(const polyMesh &mesh, const labelUList &agglom, const label nLocalCoarse, const bool parallel, CompactListList< label > &cellCells)
Determine (local or global) cellCells from mesh agglomeration.
List< label > labelList
A List of labels.
void shuffle(UList< T > &list)
Randomise the list order.
virtual labelList renumber(const polyMesh &mesh) const
Return the cell visit order (from ordered back to original cell id) using the mesh to determine the c...
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
static constexpr const zero Zero
Global zero (0)