30 template<
class Triangulation>
31 bool Foam::conformalVoronoiMesh::distributeBackground(
const Triangulation& mesh)
44 scalar previousLoadUnbalance = 0;
48 scalar maxLoadUnbalance = mesh.calculateLoadUnbalance();
53 || maxLoadUnbalance <= previousLoadUnbalance
58 return iteration != 0;
61 previousLoadUnbalance = maxLoadUnbalance;
63 Info<<
" Total number of vertices before redistribution " 67 const fvMesh& bMesh = decomposition_().mesh();
74 bMesh.time().timeName(),
81 zeroGradientFvPatchScalarField::typeName
90 typename Triangulation::Finite_vertices_iterator vit
91 = mesh.finite_vertices_begin();
92 vit != mesh.finite_vertices_end();
97 if (vit->real() && !vit->featurePoint())
101 label celli = cellSearch.findCell(v);
113 celli = cellSearch.findNearestCell(v);
116 cellVertices[celli]++;
120 scalarField& cwi = cellWeights.primitiveFieldRef();
127 cwi[cI] =
max(cellVertices[cI], 1
e-2);
130 autoPtr<mapDistributePolyMesh> mapDist = decomposition_().distribute
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
pointFromPoint topoint(const Point &P)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
Ostream & endl(Ostream &os)
Add newline and flush stream.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
List< label > labelList
A List of labels.
void distribute(const backgroundMeshDecomposition &decomposition)
static bool & parRun()
Is this a parallel run?
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
cellShapeControlMesh & shapeControlMesh()
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
const doubleScalar e
Elementary charge.
PrimitivePatch< face, List, const pointField > bMesh
Holder of faceList and points. (v.s. e.g. primitivePatch which references points) ...