54 maxIter_(coeffsDict_.get<label>(
"maxIter")),
55 maxCo_(coeffsDict_.get<scalar>(
"maxCo")),
56 freezeFraction_(coeffsDict_.get<scalar>(
"freezeFraction")),
57 verbose_(coeffsDict_.getOrDefault(
"verbose", true))
63template<
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);
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A packed storage of objects of type <T> using an offset table for access.
iterator begin() noexcept
Return an iterator to begin traversing the UList.
iterator end() noexcept
Return an iterator to end traversing the UList.
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
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.
Mesh consisting of general polyhedral cells.
Abstract base class for renumbering.
renumberMethod()
Default construct.
Use spring analogy - attract neighbouring cells according to the distance of their cell indices.
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...
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
void shuffle(UList< T > &list)
Randomise the list order.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
Inplace reorder the elements of a list.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
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...
static constexpr const zero Zero
Global zero (0).
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &f1, const label comm)