53 coeffsDict_(
dict.optionalSubDict(typeName+
"Coeffs")),
54 maxIter_(coeffsDict_.
get<label>(
"maxIter")),
55 maxCo_(coeffsDict_.
get<scalar>(
"maxCo")),
56 freezeFraction_(coeffsDict_.
get<scalar>(
"freezeFraction"))
62 template<
class ConnectionListListType>
65 const ConnectionListListType& cellCells
68 const label nOldCells(cellCells.size());
76 position[celli] = celli;
84 scalar
maxCo = (maxCo_ * nOldCells);
86 for (label iter = 0; iter < maxIter_; ++iter)
100 for (label oldCelli = 0; oldCelli < nOldCells; ++oldCelli)
102 const label celli = oldToNew[oldCelli];
103 const auto& neighbours = cellCells[oldCelli];
105 for (
const label nbr : neighbours)
107 const label nbrCelli = oldToNew[nbr];
109 sumForce[celli] += (position[nbrCelli]-position[celli]);
123 Info<<
"Iter:" << iter
124 <<
" maxCo:" <<
maxCo 125 <<
" deltaT:" << deltaT
130 displacement *= deltaT;
140 position += displacement;
141 position -=
min(position);
142 position *= (position.size()-1)/
max(position);
145 maxCo *= freezeFraction_;
156 return invert(nOldCells, oldToNew);
176 return renumberImpl(cellCells);
186 return renumberImpl(cellCells);
196 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.
virtual labelList renumber(const pointField &) const
Return the order in which cells need to be visited (ie. from ordered back to original cell label)...
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.
static void calcCellCells(const polyMesh &mesh, const labelList &agglom, const label nLocalCoarse, const bool parallel, CompactListList< label > &cellCells)
Determine (local or global) cellCells from mesh agglomeration.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
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.
label nCells() const noexcept
Number of mesh cells.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
void shuffle(UList< T > &list)
Randomise the list order.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
static constexpr const zero Zero
Global zero (0)