38 namespace pointSmoothers
44 laplacianConstraintPointSmoother,
85 reset(facesToMove, counts, pointDisplacement);
99 for (
const auto&
pp : pMesh.boundary())
101 const auto&
mp =
pp.meshPoints();
102 const auto* mppPtr = isA<meshPointPatch>(
pp);
105 const auto& pc = mppPtr->constraints();
108 nConstraints[
mp[i]] = pc[i].first();
117 pp.applyConstraint(i, pc);
118 nConstraints[
mp[i]] = pc.first();
128 forAll(pointEdges, pointi)
130 if (isMovingPoint[pointi])
132 const auto& pEdges = pointEdges[pointi];
133 for (
const label edgei : pEdges)
135 const label otherPointi = edges[edgei].otherVertex(pointi);
136 if (nConstraints[otherPointi] >= nConstraints[pointi])
138 pointDisplacement[pointi] +=
139 currentPoints[otherPointi]
149 average(facesToMove, counts, pointDisplacement);
156 if (isMovingPoint[pointi] && !counts[pointi])
158 pointDisplacement[pointi] = currentPoints[pointi]-oldPoints[pointi];
virtual void calculate(const labelList &facesToMove, const pointField &oldPoints, const pointField ¤tPoints, const pointField &faceCentres, const vectorField &faceAreas, const pointField &cellCentres, const scalarField &cellVolumes, vectorField &pointDisplacement) const
Calculate the point displacement.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Abstract base class for point smoothing methods. Handles parallel communication via reset and average...
const labelListList & pointEdges() const
static FOAM_NO_DANGLING_REFERENCE const pointMesh & New(const polyMesh &mesh, Args &&... args)
Get existing or create MeshObject registered with typeName.
bitSet pointsToMove(const labelList &facesToMove, const bool moveInternalFaces) const
Get list of the points to be moved.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
const polyMesh & mesh() const noexcept
Access the mesh.
addToRunTimeSelectionTable(pointSmoother, equipotentialPointSmoother, dictionary)
laplacianConstraintPointSmoother(const polyMesh &mesh, const dictionary &dict)
Construct from a dictionary and a polyMesh.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void reset(const labelList &facesToMove, Field< weightType > &weights, vectorField &pointDisplacement, const bool resetInternalFaces=true) const
Reset the relevant weights and displacements to zero.
Mesh consisting of general polyhedral cells.
void average(const labelList &facesToMove, Field< weightType > &weights, vectorField &pointDisplacement) const
Average the displacements using the weights provided.
const dimensionedScalar mp
Proton mass.
defineTypeNameAndDebug(equipotentialPointSmoother, 0)
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
static constexpr const zero Zero
Global zero (0)