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...
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... | |
![]() | |
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... | |
pointVectorField & | pointDisplacement () |
Return reference to the point motion displacement field. More... | |
const pointVectorField & | pointDisplacement () const |
Return const reference to the point motion displacement field. More... | |
const pointMesh & | pMesh () const |
const polyMesh & | mesh () 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< indirectPrimitivePatch > | adaptPatchPtr_ |
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 autoPtr< externalDisplacementMeshMover > | New (const word &type, const dictionary &dict, const List< labelPair > &baffles, pointVectorField &pointDisplacement) |
Return a reference to the selected meshMover model. More... | |
![]() | |
static labelList | getFixedValueBCs (const pointVectorField &) |
Extract fixed-value patchfields. More... | |
static autoPtr< indirectPrimitivePatch > | getPatch (const polyMesh &, const labelList &) |
Construct patch on selected patches. More... | |
![]() | |
List< labelPair > | baffles_ |
Baffles in the mesh. More... | |
pointVectorField & | pointDisplacement_ |
Reference to point motion field. More... | |
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
Definition at line 63 of file medialAxisMeshMover.H.
|
private |
Disallow default bitwise copy construct.
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.
|
virtual |
Definition at line 1278 of file medialAxisMeshMover.C.
|
private |
Extract bc types. Replace fixedValue derivatives with fixedValue.
|
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().
|
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.
|
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.
|
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().
|
private |
Stop layer growth at feature edges.
Definition at line 769 of file medialAxisMeshMover.C.
References Foam::e, PrimitivePatch< Face, FaceList, PointField, PointType >::edgeFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), f(), PrimitivePatch< Face, FaceList, PointField, PointType >::faceNormals(), forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::nEdges(), autoLayerDriver::NOEXTRUDE, List::setSize(), List::size(), and syncTools::syncEdgeList().
|
private |
Find isolated islands (points, edges and faces and layer.
terminations) in the layer mesh and stop any layer growth at these points
Definition at line 901 of file medialAxisMeshMover.C.
References Foam::acos(), Foam::e, PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), Foam::endl(), f(), forAll, Foam::indent(), Foam::Info, PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), Foam::nl, autoLayerDriver::NOEXTRUDE, PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), pFaces, PrimitivePatch< Face, FaceList, PointField, PointType >::pointFaces(), Foam::radToDeg(), Foam::reduce(), Foam::returnReduce(), and syncTools::syncPointList().
|
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.
|
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().
|
private |
Disallow default bitwise assignment.
TypeName | ( | "displacementMedialAxis" | ) |
Runtime type information.
|
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().
|
virtual |
Update local data for geometry changes.
Reimplemented from externalDisplacementMeshMover.
Definition at line 1762 of file medialAxisMeshMover.C.
References externalDisplacementMeshMover::movePoints(), and p.
|
inlinevirtual |
Update local data for topology changes.
Reimplemented from externalDisplacementMeshMover.
Definition at line 233 of file medialAxisMeshMover.H.
References NotImplemented.
|
private |
Definition at line 69 of file medialAxisMeshMover.H.
Referenced by medialAxisMeshMover::update().
|
private |
Definition at line 71 of file medialAxisMeshMover.H.
Referenced by medialAxisMeshMover::update().
|
private |
Scale factor for displacement.
Definition at line 74 of file medialAxisMeshMover.H.
|
private |
Starting mesh position.
Definition at line 77 of file medialAxisMeshMover.H.
|
private |
Mesh mover algorithm.
Definition at line 80 of file medialAxisMeshMover.H.
|
private |
Field smoothing.
Definition at line 83 of file medialAxisMeshMover.H.
Referenced by medialAxisMeshMover::update().
|
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().
|
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().
|
private |
Distance to nearest medial axis point.
Definition at line 97 of file medialAxisMeshMover.H.
Referenced by medialAxisMeshMover::update().
|
private |
Location on nearest medial axis point.
Definition at line 100 of file medialAxisMeshMover.H.
Referenced by medialAxisMeshMover::update().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.