32 template<
class Triangulation>
33 bool 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(),
92 typename Triangulation::Finite_vertices_iterator vit
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
static const word & zeroGradientType() noexcept
The type name for zeroGradient patch fields.
pointFromPoint topoint(const Point &P)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool & parRun() noexcept
Test if this a parallel run.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
#define forAll(list, i)
Loop across all elements in list.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const dimensionedScalar e
Elementary charge.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static const word null
An empty word.
void distribute(const backgroundMeshDecomposition &decomposition)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
messageStream Info
Information stream (stdout output on master, null elsewhere)
cellShapeControlMesh & shapeControlMesh()
List< label > labelList
A List of labels.
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)