All to do with snapping to surface. More...
#include <autoMesh/autoSnapDriver.H>
All to do with snapping to surface.
Definition at line 53 of file autoSnapDriver.H.
Classes | |
class | minMagEqOp |
Combine operator class for equalizing displacements.
| |
Public Member Functions | |
ClassName ("autoSnapDriver") | |
Runtime type information.
| |
autoSnapDriver (meshRefinement &meshRefiner, const labelList &globalToPatch) | |
Construct from components.
| |
autoPtr< mapPolyMesh > | createZoneBaffles (List< labelPair > &) |
Create baffles for faces straddling zoned surfaces. Return.
| |
autoPtr< mapPolyMesh > | mergeZoneBaffles (const List< labelPair > &) |
Merge baffles.
| |
scalarField | calcSnapDistance (const snapParameters &snapParams, const indirectPrimitivePatch &) const |
Calculate edge length per patch point.
| |
void | preSmoothPatch (const snapParameters &snapParams, const label nInitErrors, const List< labelPair > &baffles, motionSmoother &) const |
Smooth the mesh (patch and internal) to increase visibility.
| |
labelList | getZoneSurfacePoints (const indirectPrimitivePatch &, const word &zoneName) const |
Get points both on patch and facezone.
| |
vectorField | calcNearestSurface (const scalarField &snapDist, motionSmoother &meshMover) const |
Per patch point calculate point on nearest surface. Set as.
| |
void | smoothDisplacement (const snapParameters &snapParams, motionSmoother &) const |
Smooth the displacement field to the internal.
| |
void | scaleMesh (const snapParameters &snapParams, const label nInitErrors, const List< labelPair > &baffles, motionSmoother &) |
Do the hard work: move the mesh according to displacement,.
| |
autoPtr< mapPolyMesh > | repatchToSurface (const snapParameters &snapParams, const labelList &adaptPatchIDs) |
Repatch faces according to surface nearest the face centre.
| |
void | doSnap (const dictionary &snapDict, const dictionary &motionDict, const snapParameters &snapParams) |
autoSnapDriver | ( | meshRefinement & | meshRefiner, |
const labelList & | globalToPatch | ||
) |
Construct from components.
Definition at line 667 of file autoSnapDriver.C.
ClassName | ( | "autoSnapDriver" | ) |
Runtime type information.
Foam::autoPtr< Foam::mapPolyMesh > createZoneBaffles | ( | List< labelPair > & | baffles ) |
Create baffles for faces straddling zoned surfaces. Return.
baffles.
Definition at line 680 of file autoSnapDriver.C.
References Foam::abort(), cpuTime::cpuTimeIncrement(), HashTable< T, Key, Hash >::end(), Foam::endl(), Foam::FatalError, FatalErrorIn, HashTable< T, Key, Hash >::find(), forAll, forAllConstIter, Foam::Info, primitiveMesh::nFaces(), Foam::nl, Foam::Pout, Foam::returnReduce(), List< T >::setSize(), HashTable< T, Key, Hash >::size(), List< T >::size(), fvMesh::time(), and fvMesh::write().
Foam::autoPtr< Foam::mapPolyMesh > mergeZoneBaffles | ( | const List< labelPair > & | baffles ) |
Merge baffles.
Definition at line 765 of file autoSnapDriver.C.
References Foam::endl(), Foam::Info, Foam::nl, Foam::returnReduce(), and List< T >::size().
Foam::scalarField calcSnapDistance | ( | const snapParameters & | snapParams, |
const indirectPrimitivePatch & | pp | ||
) | const |
Calculate edge length per patch point.
Definition at line 793 of file autoSnapDriver.C.
References e, PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), edge::mag(), Foam::max(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), PrimitivePatch< Face, FaceList, PointField, PointType >::pointEdges(), List< T >::size(), snapParameters::snapTol(), and syncTools::syncPointList().
void preSmoothPatch | ( | const snapParameters & | snapParams, |
const label | nInitErrors, | ||
const List< labelPair > & | baffles, | ||
motionSmoother & | meshMover | ||
) | const |
Smooth the mesh (patch and internal) to increase visibility.
of surface points (on castellated mesh) w.r.t. surface.
Definition at line 834 of file autoSnapDriver.C.
References motionSmoother::correct(), cpuTime::cpuTimeIncrement(), Foam::endl(), forAll, Foam::Info, primitiveMesh::nFaces(), Foam::nl, snapParameters::nSmoothPatch(), snapParameters::nSnap(), Foam::Pout, motionSmoother::scaleMesh(), motionSmoother::setDisplacement(), motionSmoother::setErrorReduction(), List< T >::setSize(), fvMesh::time(), and fvMesh::write().
Foam::labelList getZoneSurfacePoints | ( | const indirectPrimitivePatch & | pp, |
const word & | zoneName | ||
) | const |
Get points both on patch and facezone.
Definition at line 915 of file autoSnapDriver.C.
References HashTable< T, Key, Hash >::end(), Foam::exit(), polyMesh::faces(), polyMesh::faceZones(), Foam::FatalError, FatalErrorIn, HashTable< T, Key, Hash >::find(), Foam::findIndices(), ZoneMesh< ZoneType, MeshType >::findZoneID(), forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPointMap(), and PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints().
Foam::vectorField calcNearestSurface | ( | const scalarField & | snapDist, |
motionSmoother & | meshMover | ||
) | const |
Per patch point calculate point on nearest surface. Set as.
boundary conditions of motionSmoother displacement field. Return displacement of patch points.
Definition at line 966 of file autoSnapDriver.C.
References cpuTime::cpuTimeIncrement(), Foam::endl(), refinementSurfaces::faceZoneNames(), refinementSurfaces::findNearest(), forAll, Foam::gMax(), Foam::gMin(), Foam::gSum(), Foam::Info, PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::mag(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), Foam::min(), Foam::nl, motionSmoother::patch(), Time::path(), Foam::Pout, Foam::returnReduce(), motionSmoother::setDisplacement(), List< T >::size(), Foam::sqr(), refinementSurfaces::surfaces(), syncTools::syncPointList(), fvMesh::time(), WarningIn, and Vector< Cmpt >::zero.
void smoothDisplacement | ( | const snapParameters & | snapParams, |
motionSmoother & | meshMover | ||
) | const |
Smooth the displacement field to the internal.
Definition at line 1161 of file autoSnapDriver.C.
References cpuTime::cpuTimeIncrement(), motionSmoother::displacement(), Foam::endl(), Foam::Info, PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::mag(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), Foam::nl, snapParameters::nSmoothDispl(), motionSmoother::patch(), Time::path(), motionSmoother::pMesh(), Foam::Pout, motionSmoother::smooth(), fvMesh::time(), regIOobject::write(), and fvMesh::write().
void scaleMesh | ( | const snapParameters & | snapParams, |
const label | nInitErrors, | ||
const List< labelPair > & | baffles, | ||
motionSmoother & | meshMover | ||
) |
Do the hard work: move the mesh according to displacement,.
locally relax the displacement.
Definition at line 1223 of file autoSnapDriver.C.
References cpuTime::cpuTimeIncrement(), motionSmoother::displacement(), Foam::endl(), Foam::identity(), Foam::Info, Foam::mag(), primitiveMesh::nFaces(), Foam::nl, snapParameters::nSnap(), Foam::Pout, motionSmoother::scaleMesh(), motionSmoother::setErrorReduction(), fvMesh::time(), regIOobject::write(), and fvMesh::write().
Foam::autoPtr< Foam::mapPolyMesh > repatchToSurface | ( | const snapParameters & | snapParams, |
const labelList & | adaptPatchIDs | ||
) |
Repatch faces according to surface nearest the face centre.
Definition at line 1284 of file autoSnapDriver.C.
References polyMesh::boundaryMesh(), cpuTime::cpuTimeIncrement(), Foam::endl(), primitiveMesh::faceCentres(), refinementSurfaces::faceZoneNames(), polyMesh::faceZones(), refinementSurfaces::findNearestRegion(), ZoneMesh< ZoneType, MeshType >::findZoneID(), forAll, refinementSurfaces::globalRegion(), Foam::Info, PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), meshRefinement::makePatch(), Foam::max(), primitiveMesh::nFaces(), Foam::nl, Foam::returnReduce(), Foam::sqr(), polyPatch::start(), refinementSurfaces::surfaces(), and fvMesh::time().
void doSnap | ( | const dictionary & | snapDict, |
const dictionary & | motionDict, | ||
const snapParameters & | snapParams | ||
) |
Get smoothly varying internal displacement field. 2009-12-16 : was not found to be beneficial. Keeping internal
fields fixed slightly increases skewness (on boundary) but lowers non-orthogonality quite a bit (e.g. 65->59 degrees). Maybe if better smoother? smoothDisplacement(snapParams, meshMover);
Definition at line 1437 of file autoSnapDriver.C.
References motionSmoother::checkMesh(), cpuTime::cpuTimeIncrement(), Foam::endl(), Foam::Info, meshRefinement::makeDisplacementField(), meshRefinement::makePatch(), MeshObject< polyMesh, pointMesh >::New(), primitiveMesh::nFaces(), Foam::nl, Foam::returnReduce(), and fvMesh::time().
Referenced by autoHexMeshDriver::doMesh().