53 coeffsDict_(
dict.optionalSubDict(typeName+
"Coeffs")),
54 maxIter_(coeffsDict_.get<label>(
"maxIter")),
55 maxCo_(coeffsDict_.get<scalar>(
"maxCo")),
56 freezeFraction_(coeffsDict_.get<scalar>(
"freezeFraction"))
62template<
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);
167 decompositionMethod::calcCellCells
176 return renumberImpl(cellCells);
186 return renumberImpl(cellCells);
196 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 unstructured matrix of objects of type <T> using an offset table for access.
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,...
Mesh consisting of general polyhedral cells.
label nCells() const noexcept
Number of mesh cells.
Abstract base class for renumbering.
Use spring analogy - attract neighbouring cells according to the distance of their cell indices.
virtual labelList renumber(const pointField &) const
#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.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
messageStream Info
Information stream (stdout output on master, null elsewhere)
dimensioned< Type > average(const DimensionedField< Type, GeoMesh > &df)
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.
static constexpr const zero Zero
Global zero (0)
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
#define forAll(list, i)
Loop across all elements in list.