All to do with snapping to surface. More...
Public Member Functions | |
ClassName ("snappySnapDriver") | |
Runtime type information. More... | |
snappySnapDriver (meshRefinement &meshRefiner, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const bool dryRun=false) | |
Construct from components. More... | |
autoPtr< mapPolyMesh > | mergeZoneBaffles (const List< labelPair > &) |
Merge baffles. More... | |
void | detectNearSurfaces (const scalar planarCos, const indirectPrimitivePatch &, const pointField &nearestPoint, const vectorField &nearestNormal, vectorField &disp) const |
Per patch point override displacement if in gap situation. More... | |
void | smoothDisplacement (const snapParameters &snapParams, motionSmoother &) const |
Smooth the displacement field to the internal. More... | |
bool | scaleMesh (const snapParameters &snapParams, const label nInitErrors, const List< labelPair > &baffles, motionSmoother &) |
Do the hard work: move the mesh according to displacement,. More... | |
autoPtr< mapPolyMesh > | repatchToSurface (const snapParameters &snapParams, const labelList &adaptPatchIDs, const labelList &preserveFaces) |
Repatch faces according to surface nearest the face centre. More... | |
void | doSnap (const dictionary &snapDict, const dictionary &motionDict, const meshRefinement::FaceMergeType mergeType, const scalar featureCos, const scalar planarAngle, const snapParameters &snapParams) |
template<class FaceList > | |
Foam::labelList | getFacePoints (const indirectPrimitivePatch &pp, const FaceList &faces) |
Static Public Member Functions | |
static scalarField | calcSnapDistance (const fvMesh &mesh, const snapParameters &snapParams, const indirectPrimitivePatch &) |
Calculate edge length per patch point. More... | |
static void | preSmoothPatch (const meshRefinement &meshRefiner, const snapParameters &snapParams, const label nInitErrors, const List< labelPair > &baffles, motionSmoother &) |
Smooth the mesh (patch and internal) to increase visibility. More... | |
static tmp< pointField > | avgCellCentres (const fvMesh &mesh, const indirectPrimitivePatch &) |
Helper: calculate average cell centre per point. More... | |
static vectorField | calcNearestSurface (const bool strictRegionSnap, const meshRefinement &meshRefiner, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const scalarField &snapDist, const indirectPrimitivePatch &, pointField &nearestPoint, vectorField &nearestNormal) |
Per patch point calculate point on nearest surface. Set as. More... | |
All to do with snapping to surface.
Definition at line 55 of file snappySnapDriver.H.
snappySnapDriver | ( | meshRefinement & | meshRefiner, |
const labelList & | globalToMasterPatch, | ||
const labelList & | globalToSlavePatch, | ||
const bool | dryRun = false |
||
) |
Construct from components.
Definition at line 806 of file snappySnapDriver.C.
ClassName | ( | "snappySnapDriver" | ) |
Runtime type information.
autoPtr<mapPolyMesh> mergeZoneBaffles | ( | const List< labelPair > & | ) |
Merge baffles.
|
static |
Calculate edge length per patch point.
Definition at line 823 of file snappySnapDriver.C.
References Foam::constant::electromagnetic::e, PrimitivePatch< FaceList, PointField >::edges(), forAll, PrimitivePatch< FaceList, PointField >::localPoints(), Foam::max(), mesh, PrimitivePatch< FaceList, PointField >::meshPoints(), PrimitivePatch< FaceList, PointField >::pointEdges(), pp(), UList< T >::size(), snapParameters::snapTol(), and syncTools::syncPointList().
|
static |
Smooth the mesh (patch and internal) to increase visibility.
of surface points (on castellated mesh) w.r.t. surface.
Definition at line 863 of file snappySnapDriver.C.
References addProfiling, motionSmootherAlgo::correct(), cpuTimePosix::cpuTimeIncrement(), Foam::ensightOutput::debug, Foam::endl(), forAll, Foam::Info, mesh, meshRefinement::MESH, meshRefinement::mesh(), primitiveMesh::nFaces(), Foam::nl, snapParameters::nSmoothInternal(), snapParameters::nSmoothPatch(), snapParameters::nSnap(), Time::path(), motionSmootherAlgo::pointDisplacement(), GeometricField< Type, PatchField, GeoMesh >::primitiveFieldRef(), motionSmootherAlgo::scaleMesh(), motionSmootherAlgo::setDisplacement(), motionSmootherAlgo::setErrorReduction(), List< T >::setSize(), Foam::fvc::smooth(), fvMesh::time(), meshRefinement::timeName(), meshRefinement::write(), meshRefinement::writeLevel(), and meshRefinement::WRITEMESH.
|
static |
Helper: calculate average cell centre per point.
Definition at line 1025 of file snappySnapDriver.C.
References primitiveMesh::cellCentres(), polyMesh::faceOwner(), UList< T >::first(), forAll, weightedPosition::getPoints(), mesh, PrimitivePatch< FaceList, PointField >::meshPoints(), tmp< T >::New(), pFaces, PrimitivePatch< FaceList, PointField >::pointFaces(), pp(), UList< T >::size(), and weightedPosition::syncPoints().
void detectNearSurfaces | ( | const scalar | planarCos, |
const indirectPrimitivePatch & | pp, | ||
const pointField & | nearestPoint, | ||
const vectorField & | nearestNormal, | ||
vectorField & | disp | ||
) | const |
Per patch point override displacement if in gap situation.
Definition at line 1110 of file snappySnapDriver.C.
References meshRefinement::ATTRACTION, Foam::ensightOutput::debug, stdFoam::end(), Foam::endl(), refinementSurfaces::findNearestIntersection(), forAll, meshRefinement::getMasterPoints(), surfaceZonesInfo::getNamedSurfaces(), surfaceZonesInfo::getUnnamedSurfaces(), Foam::Info, PrimitivePatch< FaceList, PointField >::localPoints(), mesh, PrimitivePatch< FaceList, PointField >::meshPoints(), PrimitivePatch< FaceList, PointField >::nPoints(), Time::path(), pp(), autoPtr< T >::reset(), Foam::returnReduce(), refinementSurfaces::surfaces(), refinementSurfaces::surfZones(), fvMesh::time(), and bitSet::toc().
|
static |
Per patch point calculate point on nearest surface. Set as.
boundary conditions of motionSmoother displacement field. Return displacement of patch points.
Definition at line 1788 of file snappySnapDriver.C.
References polyMesh::boundaryMesh(), cpuTimePosix::cpuTimeIncrement(), Foam::endl(), refinementSurfaces::findNearest(), refinementSurfaces::findNearestRegion(), forAll, meshRefinement::gAverage(), refinementSurfaces::geometry(), meshRefinement::getMasterPoints(), surfaceZonesInfo::getNamedSurfaces(), surfaceZonesInfo::getUnnamedSurfaces(), refinementSurfaces::globalRegion(), Foam::gMax(), Foam::gMin(), Foam::identity(), Foam::Info, PrimitivePatch< FaceList, PointField >::localPoints(), Foam::mag(), mesh, meshRefinement::mesh(), PrimitivePatch< FaceList, PointField >::meshPoints(), Foam::nl, PrimitivePatch< FaceList, PointField >::nPoints(), Foam::Pout, pp(), Foam::returnReduceOr(), UList< T >::size(), UPtrList< T >::size(), Foam::sqr(), refinementSurfaces::surfaces(), meshRefinement::surfaces(), refinementSurfaces::surfZones(), syncTools::syncPointList(), fvMesh::time(), bitSet::toc(), WarningInFunction, and Foam::Zero.
void smoothDisplacement | ( | const snapParameters & | snapParams, |
motionSmoother & | meshMover | ||
) | const |
Smooth the displacement field to the internal.
Definition at line 2123 of file snappySnapDriver.C.
References cpuTimePosix::cpuTimeIncrement(), Foam::ensightOutput::debug, motionSmootherData::displacement(), Foam::endl(), Foam::Info, PrimitivePatch< FaceList, PointField >::localPoints(), Foam::mag(), mesh, meshRefinement::MESH, PrimitivePatch< FaceList, PointField >::meshPoints(), Foam::nl, snapParameters::nSmoothDispl(), motionSmootherAlgo::patch(), Time::path(), motionSmootherAlgo::pMesh(), pp(), motionSmootherAlgo::smooth(), fvMesh::time(), Ostream::write(), meshRefinement::writeLevel(), and meshRefinement::WRITEMESH.
bool 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. Return true if ended up with correct mesh, false if not.
Definition at line 2197 of file snappySnapDriver.C.
References addProfiling, cpuTimePosix::cpuTimeIncrement(), Foam::ensightOutput::debug, motionSmootherData::displacement(), Foam::endl(), Foam::identity(), Foam::Info, Foam::mag(), mesh, meshRefinement::MESH, primitiveMesh::nFaces(), Foam::nl, snapParameters::nSnap(), motionSmootherAlgo::scaleMesh(), motionSmootherAlgo::setErrorReduction(), fvMesh::time(), regIOobject::write(), and fvMesh::write().
Foam::autoPtr< Foam::mapPolyMesh > repatchToSurface | ( | const snapParameters & | snapParams, |
const labelList & | adaptPatchIDs, | ||
const labelList & | preserveFaces | ||
) |
Repatch faces according to surface nearest the face centre.
Definition at line 2264 of file snappySnapDriver.C.
References polyMesh::boundaryMesh(), cpuTimePosix::cpuTimeIncrement(), Foam::endl(), f(), primitiveMesh::faceCentres(), polyMesh::faceZones(), refinementSurfaces::findNearestRegion(), forAll, surfaceZonesInfo::getNamedSurfaces(), surfaceZonesInfo::getUnnamedSurfaces(), refinementSurfaces::globalRegion(), Foam::Info, PrimitivePatch< FaceList, PointField >::localFaces(), meshRefinement::makePatch(), Foam::max(), mesh, primitiveMesh::nFaces(), Foam::nl, patches, pp(), Foam::returnReduce(), PtrList< T >::set(), Foam::sqr(), refinementSurfaces::surfaces(), refinementSurfaces::surfZones(), and fvMesh::time().
void doSnap | ( | const dictionary & | snapDict, |
const dictionary & | motionDict, | ||
const meshRefinement::FaceMergeType | mergeType, | ||
const scalar | featureCos, | ||
const scalar | planarAngle, | ||
const snapParameters & | snapParams | ||
) |
Only if in feature attraction mode:
Nearest feature
Any faces to split
Indices in face to split across
Definition at line 2563 of file snappySnapDriver.C.
References addProfiling, DynamicList< T, SizeMin >::append(), meshRefinement::ATTRACTION, motionSmootherAlgo::checkMesh(), autoPtr< T >::clear(), DynamicList< T, SizeMin >::clear(), motionSmootherAlgo::correct(), Foam::cos(), cpuTimePosix::cpuTimeIncrement(), Foam::ensightOutput::debug, Foam::degToRad(), snapParameters::detectNearSurfacesSnap(), motionSmootherData::displacement(), Foam::endl(), Foam::exit(), primitiveMesh::faceCentres(), polyMesh::faceZones(), Foam::FatalError, FatalErrorInFunction, localPointRegion::findDuplicateFacePairs(), forAll, Foam::identity(), Foam::Info, surfaceZonesInfo::INTERNAL, PrimitivePatch< FaceList, PointField >::localPoints(), Foam::mag(), meshRefinement::makeDisplacementField(), meshRefinement::makePatch(), Foam::max(), mesh, meshRefinement::MESH, Foam::name(), MeshObject< polyMesh, UpdateableMeshObject, pointMesh >::New(), primitiveMesh::nFaces(), snapParameters::nFaceSplitInterval(), snapParameters::nFeatureSnap(), Foam::nl, PrimitivePatch< FaceList, PointField >::nPoints(), p, Time::path(), pp(), autoPtr< T >::reset(), Foam::returnReduce(), motionSmootherAlgo::setDisplacement(), List< T >::setSize(), UList< T >::size(), UPtrList< T >::size(), snapParameters::strictRegionSnap(), fvMesh::time(), WarningInFunction, Ostream::write(), regIOobject::write(), meshRefinement::writeLevel(), meshRefinement::WRITEMESH, and Foam::Zero.
Foam::labelList getFacePoints | ( | const indirectPrimitivePatch & | pp, |
const FaceList & | faces | ||
) |
Definition at line 28 of file snappySnapDriverTemplates.C.
References f(), Foam::findIndices(), forAll, and pp().