32template<
class Triangulation>
33bool Foam::conformalVoronoiMesh::distributeBackground(
const Triangulation&
mesh)
46 scalar previousLoadUnbalance = 0;
50 scalar maxLoadUnbalance =
mesh.calculateLoadUnbalance();
55 || maxLoadUnbalance <= previousLoadUnbalance
60 return iteration != 0;
63 previousLoadUnbalance = maxLoadUnbalance;
65 Info<<
" Total number of vertices before redistribution "
69 const fvMesh&
bMesh = decomposition_().mesh();
76 bMesh.time().timeName(),
83 zeroGradientFvPatchScalarField::typeName
93 =
mesh.finite_vertices_begin();
94 vit !=
mesh.finite_vertices_end();
99 if (vit->real() && !vit->featurePoint())
103 label celli = cellSearch.findCell(v);
115 celli = cellSearch.findNearestCell(v);
118 cellVertices[celli]++;
122 scalarField& cwi = cellWeights.primitiveFieldRef();
129 cwi[cI] =
max(cellVertices[cI], 1
e-2);
132 autoPtr<mapDistributePolyMesh> mapDist = decomposition_().distribute
Triangulation::Finite_vertices_iterator Finite_vertices_iterator
static bool & parRun() noexcept
Test if this a parallel run.
void distribute(const backgroundMeshDecomposition &decomposition)
cellShapeControlMesh & shapeControlMesh()
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
const dimensionSet dimless
Dimensionless.
List< label > labelList
A List of labels.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
pointFromPoint topoint(const Point &P)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
PrimitivePatch< List< face >, const pointField > bMesh
Holder of faceList and points. (v.s. e.g. primitivePatch which references points)
static constexpr const zero Zero
Global zero (0)
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.