Go to the documentation of this file.
77 #ifndef motionSmootherAlgo_H
78 #define motionSmootherAlgo_H
83 #include "indirectPrimitivePatch.H"
91 class polyMeshGeometry;
114 scalar magX =
mag(
x[i]);
115 scalar magY =
mag(
y[i]);
121 else if (magX == magY)
197 template<
class Type,
class CombineOp>
201 const CombineOp& cop,
280 const label nPointIter,
409 const bool smoothMesh =
true,
410 const label nAllow = 0
418 const bool smoothMesh =
true,
419 const label nAllow = 0
429 const bool smoothMesh =
true,
430 const label nAllow = 0
tmp< GeometricField< Type, pointPatchField, pointMesh > > avg(const GeometricField< Type, pointPatchField, pointMesh > &fld, const scalarField &edgeWeight) const
Average of connected points.
scalar setErrorReduction(const scalar)
Set the errorReduction (by how much to scale the displacement.
void modifyMotionPoints(pointField &newPoints) const
Apply optional point constraint (2d correction)
PackedBoolList isInternalPoint_
Is mesh point on boundary or not.
labelHashSet getPoints(const labelHashSet &) const
Get points used by given faces.
void correctBoundaryConditions(pointVectorField &) const
Special correctBoundaryConditions which evaluates fixedValue.
A class for managing temporary objects.
ClassName("motionSmootherAlgo")
void correct()
Take over existing mesh position.
void updateMesh()
Update for new mesh topology.
const indirectPrimitivePatch & patch() const
Reference to patch.
const labelList & adaptPatchIDs() const
Patch labels that are being adapted.
static void checkFld(const pointScalarField &)
PackedBoolList isMasterEdge_
Is edge master (always except if on coupled boundary and on.
tmp< pointField > curPoints() const
Get the current points (oldPoints+scale*displacement)
tmp< GeometricField< Type, pointPatchField, pointMesh > > avgPositions(const GeometricField< Type, pointPatchField, pointMesh > &fld, const scalarField &edgeWeight) const
Average postion of connected points.
void testSyncField(const Field< Type > &, const CombineOp &cop, const Type &zero, const scalar maxMag) const
Test synchronisation of generic field (not positions!) on points.
bool scaleMesh(labelList &checkFaces, const bool smoothMesh=true, const label nAllow=0)
Move mesh with given scale. Return true if mesh ok or has.
@ nComponents
Number of components in this vector space.
polyMesh & mesh_
Reference to polyMesh. Non-const since we move mesh.
void setDisplacementPatchFields()
Set patch fields on displacement to be consistent with.
dimensioned< scalar > mag(const dimensioned< Type > &)
void operator=(const motionSmootherAlgo &)
Disallow default bitwise assignment.
void subtractField(const labelHashSet &pointLabels, const scalar f, pointScalarField &) const
Lower on internal points.
Mesh consisting of general polyhedral cells.
pointField & oldPoints_
Starting mesh position.
pointMesh & pMesh_
Reference to pointMesh.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
~motionSmootherAlgo()
Destructor.
Pre-declare SubField and related Field type.
Given a displacement moves the mesh by scaling the displacement back until there are no more mesh err...
bool isInternalPoint(const label pointI) const
Helper function. Is point internal?
void testSyncPositions(const pointField &, const scalar maxMag) const
Test synchronisation of points.
Macro definitions for declaring ClassName(), NamespaceName(), etc.
static void checkConstraints(GeometricField< Type, pointPatchField, pointMesh > &)
Check constraints.
const pointVectorField & pointDisplacement() const
Return const reference to the point motion displacement field.
A list of keyword definitions, which are a keyword followed by any number of values (e....
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
pointScalarField & scale_
Scale factor for displacement.
Mesh representing a set of points created from polyMesh.
motionSmootherAlgo(const motionSmootherAlgo &)
Disallow default bitwise copy construct.
const dictionary & paramDict() const
pointVectorField & displacement_
Displacement field.
void getAffectedFacesAndPoints(const label nPointIter, const faceSet &wrongFaces, labelList &affectedFaces, PackedBoolList &isAffectedPoint) const
Given a set of faces that cause smoothing and a number of.
static bool checkMesh(const bool report, const polyMesh &mesh, const dictionary &dict, labelHashSet &wrongFaces)
Check mesh with mesh settings in dict. Collects incorrect faces.
void operator()(vector &x, const vector &y) const
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const polyMesh & mesh() const
Reference to mesh.
pointVectorField & pointDisplacement()
Return reference to the point motion displacement field.
static void setDisplacement(const labelList &patchIDs, const indirectPrimitivePatch &pp, pointField &patchDisp, pointVectorField &displacement)
Set displacement field from displacement on patch points.
void smooth(const GeometricField< Type, pointPatchField, pointMesh > &fld, const scalarField &edgeWeight, GeometricField< Type, pointPatchField, pointMesh > &newFld) const
Fully explicit smoothing of fields (not positions)
To synchronise displacements. We want max displacement since.
void movePoints()
Update for new mesh geometry.
const pointMesh & pMesh() const
Reference to pointMesh.
Updateable mesh geometry and checking routines.
const labelList adaptPatchIDs_
Indices of fixedValue patches that we're allowed to modify the.
void scaleField(const labelHashSet &pointLabels, const scalar scale, pointScalarField &) const
Scale certain (internal) points of a field.
indirectPrimitivePatch & pp_
Reference to face subset of all adaptPatchIDs.
Generic GeometricField class.
void minSmooth(const scalarField &edgeWeights, const PackedBoolList &isAffectedPoint, const pointScalarField &fld, pointScalarField &newFld) const
Explicit smoothing and min on all affected internal points.
labelList pointLabels(nPoints, -1)
tmp< scalarField > calcEdgeWeights(const pointField &) const
Calculate per-edge weight.
A list of faces which address into the list of points.
A class representing the concept of 0 used to avoid unnecessary manipulations for objects that are kn...