Public Member Functions | List of all members
motionSmoother Class Reference

Given a displacement moves the mesh by scaling the displacement back until there are no more mesh errors. More...

Inheritance diagram for motionSmoother:
Inheritance graph
[legend]
Collaboration diagram for motionSmoother:
Collaboration graph
[legend]

Public Member Functions

 ClassName ("motionSmoother")
 
 motionSmoother (polyMesh &mesh, pointMesh &pMesh, indirectPrimitivePatch &pp, const labelList &adaptPatchIDs, const dictionary &paramDict, const bool dryRun=false)
 
 motionSmoother (polyMesh &mesh, indirectPrimitivePatch &pp, const labelList &adaptPatchIDs, const pointVectorField &displacement, const dictionary &paramDict, const bool dryRun=false)
 
- Public Member Functions inherited from motionSmootherData
 motionSmootherData (const pointMesh &pMesh)
 
 motionSmootherData (const pointVectorField &displacement)
 
pointVectorFielddisplacement ()
 
const pointVectorFielddisplacement () const
 
const pointScalarFieldscale () const
 
const pointFieldoldPoints () const
 
- Public Member Functions inherited from motionSmootherAlgo
 ClassName ("motionSmootherAlgo")
 
 motionSmootherAlgo (polyMesh &, pointMesh &, indirectPrimitivePatch &pp, pointVectorField &displacement, pointScalarField &scale, pointField &oldPoints, const labelList &adaptPatchIDs, const dictionary &paramDict, const bool dryRun=false)
 
 ~motionSmootherAlgo ()
 
const polyMeshmesh () const
 
const pointMeshpMesh () const
 
const indirectPrimitivePatchpatch () const
 
const labelListadaptPatchIDs () const
 
const dictionaryparamDict () const
 
pointVectorFieldpointDisplacement ()
 
const pointVectorFieldpointDisplacement () const
 
void correct ()
 
void setDisplacementPatchFields ()
 
void setDisplacement (pointField &patchDisp)
 
void correctBoundaryConditions (pointVectorField &) const
 
void modifyMotionPoints (pointField &newPoints) const
 
tmp< pointFieldcurPoints () const
 
scalar setErrorReduction (const scalar)
 
bool scaleMesh (labelList &checkFaces, const bool smoothMesh=true, const label nAllow=0)
 
bool scaleMesh (labelList &checkFaces, const List< labelPair > &baffles, const bool smoothMesh=true, const label nAllow=0)
 
bool scaleMesh (labelList &checkFaces, const List< labelPair > &baffles, const dictionary &paramDict, const dictionary &meshQualityDict, const bool smoothMesh=true, const label nAllow=0)
 
void movePoints ()
 
void updateMesh ()
 
template<class Type >
void smooth (const GeometricField< Type, pointPatchField, pointMesh > &fld, const scalarField &edgeWeight, GeometricField< Type, pointPatchField, pointMesh > &newFld) const
 
template<class Type >
Foam::tmp< Foam::GeometricField< Type, Foam::pointPatchField, Foam::pointMesh > > avg (const GeometricField< Type, pointPatchField, pointMesh > &fld, const scalarField &edgeWeight) const
 

Additional Inherited Members

- Static Public Member Functions inherited from motionSmootherAlgo
static void setDisplacementPatchFields (const labelList &patchIDs, pointVectorField &pointDisplacement)
 
static void setDisplacement (const labelList &patchIDs, const indirectPrimitivePatch &pp, pointField &patchDisp, pointVectorField &displacement)
 
static bool checkMesh (const bool report, const polyMesh &mesh, const dictionary &dict, labelHashSet &wrongFaces, const bool dryRun=false)
 
static bool checkMesh (const bool report, const polyMesh &mesh, const dictionary &dict, const labelList &checkFaces, labelHashSet &wrongFaces, const bool dryRun=false)
 
static bool checkMesh (const bool report, const polyMesh &mesh, const dictionary &dict, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet &wrongFaces, const bool dryRun=false)
 
static bool checkMesh (const bool report, const dictionary &dict, const polyMeshGeometry &, const pointField &, const labelList &checkFaces, labelHashSet &wrongFaces, const bool dryRun=false)
 
static bool checkMesh (const bool report, const dictionary &dict, const polyMeshGeometry &, const pointField &, const labelList &checkFaces, const List< labelPair > &baffles, labelHashSet &wrongFaces, const bool dryRun=false)
 
template<class Type >
static Type get (const dictionary &dict, const word &keyword, const bool noExit, enum keyType::option matchOpt, const Type &defaultValue=Zero)
 
- Protected Attributes inherited from motionSmootherData
pointVectorField displacement_
 
pointScalarField scale_
 
pointField oldPoints_
 

Detailed Description

Given a displacement moves the mesh by scaling the displacement back until there are no more mesh errors.

Holds displacement field (read upon construction since need boundary conditions) and scaling factor and optional patch number on which to scale back displacement.

E.g.

    // Construct iterative mesh mover.
    motionSmoother meshMover(mesh, labelList(1, patchi));

    // Set desired displacement:
    meshMover.displacement() = ..

    for (label iter = 0; iter < maxIter; iter++)
    {
        if (meshMover.scaleMesh(true))
        {
            Info<< "Successfully moved mesh" << endl;
            return true;
        }
    }
Note
  • Shared points (parallel): a processor can have points which are part of pp on another processor but have no pp itself (i.e. it has points and/or edges but no faces of pp). Hence we have to be careful when e.g. synchronising displacements that the value from the processor which has faces of pp get priority. This is currently handled in setDisplacement by resetting the internal displacement to zero before doing anything else. The combine operator used will give preference to non-zero values.
  • Various routines take baffles. These are sets of boundary faces that are treated as a single internal face. This is a hack used to apply movement to internal faces.
  • Mesh constraints are looked up from the supplied dictionary. (uses recursive lookup)
Source files

Definition at line 87 of file motionSmoother.H.

Constructor & Destructor Documentation

◆ motionSmoother() [1/2]

motionSmoother ( polyMesh mesh,
pointMesh pMesh,
indirectPrimitivePatch pp,
const labelList adaptPatchIDs,
const dictionary paramDict,
const bool  dryRun = false 
)
Parameters
pp'outside' points
adaptPatchIDspatches forming 'outside'

Definition at line 34 of file motionSmoother.C.

◆ motionSmoother() [2/2]

motionSmoother ( polyMesh mesh,
indirectPrimitivePatch pp,
const labelList adaptPatchIDs,
const pointVectorField displacement,
const dictionary paramDict,
const bool  dryRun = false 
)
Parameters
pp'outside' points
adaptPatchIDspatches forming 'outside'

Definition at line 60 of file motionSmoother.C.

Member Function Documentation

◆ ClassName()

ClassName ( "motionSmoother"  )

The documentation for this class was generated from the following files: