Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
medialAxisMeshMover Class Reference

Mesh motion solver that uses a medial axis algorithm to work out a fraction between the (nearest point on a) moving surface and the (nearest point on a) fixed surface. More...

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

Public Member Functions

 TypeName ("displacementMedialAxis")
 Runtime type information. More...
 
 medialAxisMeshMover (const dictionary &dict, const List< labelPair > &baffles, pointVectorField &pointDisplacement)
 Construct from dictionary and displacement field. More...
 
virtual ~medialAxisMeshMover ()
 
virtual bool move (const dictionary &, const label nAllowableErrors, labelList &checkFaces)
 Move mesh using current pointDisplacement boundary values. More...
 
virtual void movePoints (const pointField &)
 Update local data for geometry changes. More...
 
virtual void updateMesh (const mapPolyMesh &)
 Update local data for topology changes. More...
 
- Public Member Functions inherited from externalDisplacementMeshMover
 TypeName ("externalDisplacementMeshMover")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, externalDisplacementMeshMover, dictionary,(const dictionary &dict, const List< labelPair > &baffles, pointVectorField &pointDisplacement),(dict, baffles, pointDisplacement))
 
 externalDisplacementMeshMover (const dictionary &dict, const List< labelPair > &baffles, pointVectorField &pointDisplacement)
 Construct from dictionary and displacement field. Dictionary is. More...
 
virtual ~externalDisplacementMeshMover ()
 Destructor. More...
 
pointVectorFieldpointDisplacement ()
 Return reference to the point motion displacement field. More...
 
const pointVectorFieldpointDisplacement () const
 Return const reference to the point motion displacement field. More...
 
const pointMeshpMesh () const
 
const polyMeshmesh () const
 

Private Member Functions

wordList getPatchFieldTypes (const pointVectorField &fld)
 Extract bc types. Replace fixedValue derivatives with fixedValue. More...
 
bool isMaxEdge (const List< PointData< vector > > &pointWallDist, const label edgeI, const scalar minCos) const
 Is mesh edge on a cusp of displacement. More...
 
void update (const dictionary &)
 Initialise medial axis. Uses pointDisplacement field only. More...
 
void syncPatchDisplacement (const scalarField &minThickness, pointField &patchDisp, List< autoLayerDriver::extrudeMode > &extrudeStatus) const
 Synchronise extrusion. More...
 
void handleFeatureAngleLayerTerminations (const scalar minCos, const PackedBoolList &isMasterPoint, const labelList &meshEdges, List< autoLayerDriver::extrudeMode > &extrudeStatus, pointField &patchDisp, label &nPointCounter) const
 Stop layer growth at feature edges. More...
 
void findIsolatedRegions (const scalar minCosLayerTermination, const bool detectExtrusionIsland, const PackedBoolList &isMasterPoint, const PackedBoolList &isMasterEdge, const labelList &meshEdges, const scalarField &minThickness, List< autoLayerDriver::extrudeMode > &extrudeStatus, pointField &patchDisp) const
 Find isolated islands (points, edges and faces and layer. More...
 
void calculateDisplacement (const dictionary &, const scalarField &minThickness, List< autoLayerDriver::extrudeMode > &extrudeStatus, pointField &patchDisp)
 Calculate desired displacement. Modifies per-patch displacement. More...
 
bool shrinkMesh (const dictionary &meshQualityDict, const label nAllowableErrors, labelList &checkFaces)
 Move mesh according to calculated displacement. More...
 
 medialAxisMeshMover (const medialAxisMeshMover &)
 Disallow default bitwise copy construct. More...
 
void operator= (const medialAxisMeshMover &)
 Disallow default bitwise assignment. More...
 

Static Private Member Functions

static bool unmarkExtrusion (const label patchPointI, pointField &patchDisp, List< autoLayerDriver::extrudeMode > &extrudeStatus)
 Unmark extrusion at given point. More...
 

Private Attributes

const labelList adaptPatchIDs_
 
autoPtr< indirectPrimitivePatchadaptPatchPtr_
 
pointScalarField scale_
 Scale factor for displacement. More...
 
pointField oldPoints_
 Starting mesh position. More...
 
motionSmootherAlgo meshMover_
 Mesh mover algorithm. More...
 
fieldSmoother fieldSmoother_
 Field smoothing. More...
 
pointVectorField dispVec_
 Normal of nearest wall. Where this normal changes direction. More...
 
pointScalarField medialRatio_
 Ratio of medial distance to wall distance. More...
 
pointScalarField medialDist_
 Distance to nearest medial axis point. More...
 
pointVectorField medialVec_
 Location on nearest medial axis point. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from externalDisplacementMeshMover
static autoPtr< externalDisplacementMeshMoverNew (const word &type, const dictionary &dict, const List< labelPair > &baffles, pointVectorField &pointDisplacement)
 Return a reference to the selected meshMover model. More...
 
- Static Protected Member Functions inherited from externalDisplacementMeshMover
static labelList getFixedValueBCs (const pointVectorField &)
 Extract fixed-value patchfields. More...
 
static autoPtr< indirectPrimitivePatchgetPatch (const polyMesh &, const labelList &)
 Construct patch on selected patches. More...
 
- Protected Attributes inherited from externalDisplacementMeshMover
List< labelPairbaffles_
 Baffles in the mesh. More...
 
pointVectorFieldpointDisplacement_
 Reference to point motion field. More...
 

Detailed Description

Mesh motion solver that uses a medial axis algorithm to work out a fraction between the (nearest point on a) moving surface and the (nearest point on a) fixed surface.

This fraction is then used to scale the motion. Use

Source files

Definition at line 63 of file medialAxisMeshMover.H.

Constructor & Destructor Documentation

◆ medialAxisMeshMover() [1/2]

Disallow default bitwise copy construct.

◆ medialAxisMeshMover() [2/2]

medialAxisMeshMover ( const dictionary dict,
const List< labelPair > &  baffles,
pointVectorField pointDisplacement 
)

Construct from dictionary and displacement field.

Definition at line 1180 of file medialAxisMeshMover.C.

References dict.

◆ ~medialAxisMeshMover()

~medialAxisMeshMover ( )
virtual

Definition at line 1278 of file medialAxisMeshMover.C.

Member Function Documentation

◆ getPatchFieldTypes()

wordList getPatchFieldTypes ( const pointVectorField fld)
private

Extract bc types. Replace fixedValue derivatives with fixedValue.

◆ isMaxEdge()

bool isMaxEdge ( const List< PointData< vector > > &  pointWallDist,
const label  edgeI,
const scalar  minCos 
) const
private

Is mesh edge on a cusp of displacement.

Detect based on vector to nearest point differing for both endpoints

v0 /= magV0; v1 /= magV1;

Test angle. if ((v0 & v1) < minCos) { return true; } else { return false; }

Detect based on extrusion vector differing for both endpoints

the idea is that e.g. a sawtooth wall can still be extruded successfully as long as it is done all to the same direction.

Definition at line 58 of file medialAxisMeshMover.C.

References Foam::constant::electromagnetic::e, Foam::mag(), mesh, and points.

Referenced by medialAxisMeshMover::update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update()

void update ( const dictionary coeffDict)
private

Initialise medial axis. Uses pointDisplacement field only.

for boundary types, not values.

Smooth surface normals

When is medial axis

Feature angle when to stop adding layers

When to slip along wall

Smooth internal normals

Number of edges walking out

Note: maybe less strict:

( wDist2 < sqr(meshRefiner_.mergeDistance()) && mDist < meshRefiner_.mergeDistance() )

Definition at line 115 of file medialAxisMeshMover.C.

References medialAxisMeshMover::adaptPatchIDs_, medialAxisMeshMover::adaptPatchPtr_, DynamicList::append(), GeometricField::boundaryField(), polyMesh::boundaryMesh(), Foam::cos(), polyPatch::coupled(), Foam::decrIndent(), Foam::degToRad(), medialAxisMeshMover::dispVec_, Foam::e, primitiveMesh::edges(), Foam::endl(), medialAxisMeshMover::fieldSmoother_, pointPatchField::fixesValue(), forAll, HashTable::found(), dictionary::found(), syncTools::getMasterEdges(), meshRefinement::getMasterEdges(), syncTools::getMasterPoints(), meshRefinement::getMasterPoints(), PointEdgeWave< Type, TrackingData >::getUnsetPoints(), polyMesh::globalData(), Foam::incrIndent(), Foam::Info, medialAxisMeshMover::isMaxEdge(), PointEdgeWave< Type, TrackingData >::iterate(), dictionary::lookup(), dictionary::lookupOrDefault(), Foam::mag(), Foam::magSqr(), medialAxisMeshMover::medialDist_, medialAxisMeshMover::medialRatio_, medialAxisMeshMover::medialVec_, externalDisplacementMeshMover::mesh(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshEdges(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), patchIdentifier::name(), Foam::nl, nPoints, globalMeshData::nTotalPoints(), patches, externalDisplacementMeshMover::pointDisplacement(), PatchTools::pointNormals(), points, polyMesh::points(), Foam::readLabel(), Foam::readScalar(), Foam::returnReduce(), s(), DynamicList::shrink(), List::size(), fieldSmoother::smoothNormals(), fieldSmoother::smoothPatchNormals(), Foam::sqr(), Foam::sqrt(), and WarningInFunction.

Here is the call graph for this function:

◆ unmarkExtrusion()

bool unmarkExtrusion ( const label  patchPointI,
pointField patchDisp,
List< autoLayerDriver::extrudeMode > &  extrudeStatus 
)
staticprivate

Unmark extrusion at given point.

Definition at line 624 of file medialAxisMeshMover.C.

References autoLayerDriver::EXTRUDE, autoLayerDriver::EXTRUDEREMOVE, autoLayerDriver::NOEXTRUDE, and Vector< scalar >::zero.

◆ syncPatchDisplacement()

void syncPatchDisplacement ( const scalarField minThickness,
pointField patchDisp,
List< autoLayerDriver::extrudeMode > &  extrudeStatus 
) const
private

Synchronise extrusion.

Definition at line 650 of file medialAxisMeshMover.C.

References forAll, Foam::mag(), mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), Foam::returnReduce(), Vector< scalar >::rootMax, and syncTools::syncPointList().

Here is the call graph for this function:

◆ handleFeatureAngleLayerTerminations()

void handleFeatureAngleLayerTerminations ( const scalar  minCos,
const PackedBoolList isMasterPoint,
const labelList meshEdges,
List< autoLayerDriver::extrudeMode > &  extrudeStatus,
pointField patchDisp,
label nPointCounter 
) const
private

◆ findIsolatedRegions()

void findIsolatedRegions ( const scalar  minCosLayerTermination,
const bool  detectExtrusionIsland,
const PackedBoolList isMasterPoint,
const PackedBoolList isMasterEdge,
const labelList meshEdges,
const scalarField minThickness,
List< autoLayerDriver::extrudeMode > &  extrudeStatus,
pointField patchDisp 
) const
private

◆ calculateDisplacement()

void calculateDisplacement ( const dictionary coeffDict,
const scalarField minThickness,
List< autoLayerDriver::extrudeMode > &  extrudeStatus,
pointField patchDisp 
)
private

Calculate desired displacement. Modifies per-patch displacement.

and calculates displacement for whole mesh (in pointDisplacement)

(lambda-mu) smoothing of internal displacement

Layer thickness too big

Feature angle when to stop adding layers

Stop layer growth where mesh wraps around sharp edge

Smoothing wanted patch thickness

Number of edges walking out

Use strict extrusionIsland detection

Option 1: look only at extrusion thickness v.s. distance

to nearest (medial axis or static) point.

Option 2: Look at component in the direction

of nearest (medial axis or static) point.

Definition at line 1285 of file medialAxisMeshMover.C.

References Foam::cos(), Foam::degToRad(), Foam::endl(), forAll, syncTools::getMasterEdges(), meshRefinement::getMasterEdges(), syncTools::getMasterPoints(), meshRefinement::getMasterPoints(), polyMesh::globalData(), Foam::Info, PointEdgeWave< Type, TrackingData >::iterate(), dictionary::lookup(), dictionary::lookupOrDefault(), Foam::mag(), mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::meshEdges(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), n, autoLayerDriver::NOEXTRUDE, nPoints, globalMeshData::nTotalPoints(), path(), points, polyMesh::points(), Foam::Pout, Foam::readLabel(), Foam::readScalar(), Foam::reduce(), autoPtr::reset(), List::size(), timeName, autoPtr::valid(), and Vector< scalar >::zero.

Here is the call graph for this function:

◆ shrinkMesh()

bool shrinkMesh ( const dictionary meshQualityDict,
const label  nAllowableErrors,
labelList checkFaces 
)
private

Move mesh according to calculated displacement.

Number of attempts shrinking the mesh

Definition at line 1638 of file medialAxisMeshMover.C.

References Foam::endl(), Foam::Info, dictionary::lookup(), and Foam::readLabel().

Here is the call graph for this function:

◆ operator=()

void operator= ( const medialAxisMeshMover )
private

Disallow default bitwise assignment.

◆ TypeName()

TypeName ( "displacementMedialAxis"  )

Runtime type information.

◆ move()

bool move ( const dictionary moveDict,
const label  nAllowableErrors,
labelList checkFaces 
)
virtual

Move mesh using current pointDisplacement boundary values.

Return true if succesful (errors on checkFaces less than allowable). Updates pointDisplacement.

Name of field specifying min thickness

Move mesh according to calculated displacement

Implements externalDisplacementMeshMover.

Definition at line 1700 of file medialAxisMeshMover.C.

References autoLayerDriver::EXTRUDE, forAll, dictionary::lookup(), objectRegistry::lookupObject(), Foam::mag(), mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), autoLayerDriver::NOEXTRUDE, and PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints().

Here is the call graph for this function:

◆ movePoints()

void movePoints ( const pointField p)
virtual

Update local data for geometry changes.

Reimplemented from externalDisplacementMeshMover.

Definition at line 1762 of file medialAxisMeshMover.C.

References externalDisplacementMeshMover::movePoints(), and p.

Here is the call graph for this function:

◆ updateMesh()

virtual void updateMesh ( const mapPolyMesh )
inlinevirtual

Update local data for topology changes.

Reimplemented from externalDisplacementMeshMover.

Definition at line 233 of file medialAxisMeshMover.H.

References NotImplemented.

Field Documentation

◆ adaptPatchIDs_

const labelList adaptPatchIDs_
private

Definition at line 69 of file medialAxisMeshMover.H.

Referenced by medialAxisMeshMover::update().

◆ adaptPatchPtr_

autoPtr<indirectPrimitivePatch> adaptPatchPtr_
private

Definition at line 71 of file medialAxisMeshMover.H.

Referenced by medialAxisMeshMover::update().

◆ scale_

pointScalarField scale_
private

Scale factor for displacement.

Definition at line 74 of file medialAxisMeshMover.H.

◆ oldPoints_

pointField oldPoints_
private

Starting mesh position.

Definition at line 77 of file medialAxisMeshMover.H.

◆ meshMover_

motionSmootherAlgo meshMover_
private

Mesh mover algorithm.

Definition at line 80 of file medialAxisMeshMover.H.

◆ fieldSmoother_

fieldSmoother fieldSmoother_
private

Field smoothing.

Definition at line 83 of file medialAxisMeshMover.H.

Referenced by medialAxisMeshMover::update().

◆ dispVec_

pointVectorField dispVec_
private

Normal of nearest wall. Where this normal changes direction.

defines the medial axis

Definition at line 90 of file medialAxisMeshMover.H.

Referenced by medialAxisMeshMover::update().

◆ medialRatio_

pointScalarField medialRatio_
private

Ratio of medial distance to wall distance.

(1 at wall, 0 at medial axis)

Definition at line 94 of file medialAxisMeshMover.H.

Referenced by medialAxisMeshMover::update().

◆ medialDist_

pointScalarField medialDist_
private

Distance to nearest medial axis point.

Definition at line 97 of file medialAxisMeshMover.H.

Referenced by medialAxisMeshMover::update().

◆ medialVec_

pointVectorField medialVec_
private

Location on nearest medial axis point.

Definition at line 100 of file medialAxisMeshMover.H.

Referenced by medialAxisMeshMover::update().


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