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) | |
Construct from components. More... | |
snappySnapDriver (const snappySnapDriver &)=delete | |
Disallow default bitwise copy construction. More... | |
autoPtr< polyTopoChangeMap > | 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< polyTopoChangeMap > | 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 scalar featureCos, const scalar planarAngle, const snapParameters &snapParams) |
void | operator= (const snappySnapDriver &)=delete |
Disallow default bitwise assignment. More... | |
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 labelList | getZoneSurfacePoints (const fvMesh &mesh, const indirectPrimitivePatch &, const word &zoneName) |
Get points both on patch and facezone. More... | |
static tmp< pointField > | avgCellCentres (const fvMesh &mesh, const indirectPrimitivePatch &) |
Helper: calculate average cell centre per point. More... | |
static vectorField | calcNearestSurface (const meshRefinement &meshRefiner, 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 54 of file snappySnapDriver.H.
snappySnapDriver | ( | meshRefinement & | meshRefiner, |
const labelList & | globalToMasterPatch, | ||
const labelList & | globalToSlavePatch | ||
) |
Construct from components.
Definition at line 532 of file snappySnapDriver.C.
|
delete |
Disallow default bitwise copy construction.
ClassName | ( | "snappySnapDriver" | ) |
Runtime type information.
Foam::autoPtr< Foam::polyTopoChangeMap > mergeZoneBaffles | ( | const List< labelPair > & | baffles | ) |
Merge baffles.
Definition at line 547 of file snappySnapDriver.C.
References Foam::endl(), surfaceZonesInfo::getNamedSurfaces(), Foam::Info, Foam::nl, Foam::returnReduce(), and List< T >::size().
|
static |
Calculate edge length per patch point.
Definition at line 576 of file snappySnapDriver.C.
References Foam::e, PrimitivePatch< FaceList, PointField >::edges(), forAll, PrimitivePatch< FaceList, PointField >::localPoints(), Foam::max(), PrimitivePatch< FaceList, PointField >::meshPoints(), PrimitivePatch< FaceList, PointField >::pointEdges(), List< 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 616 of file snappySnapDriver.C.
References motionSmootherAlgo::correct(), cpuTime::cpuTimeIncrement(), Foam::endl(), forAll, Foam::Info, meshRefinement::MESH, meshRefinement::mesh(), meshRefinement::name(), primitiveMesh::nFaces(), Foam::nl, snapParameters::nSmoothPatch(), snapParameters::nSnap(), Time::path(), motionSmootherAlgo::scaleMesh(), motionSmootherAlgo::setDisplacement(), motionSmootherAlgo::setErrorReduction(), List< T >::setSize(), fvMesh::time(), meshRefinement::write(), meshRefinement::writeLevel(), and meshRefinement::WRITEMESH.
|
static |
Get points both on patch and facezone.
Definition at line 712 of file snappySnapDriver.C.
References HashTableCore::end(), Foam::exit(), f(), polyMesh::faces(), polyMesh::faceZones(), Foam::FatalError, FatalErrorInFunction, HashTable< T, Key, Hash >::find(), PtrListDictionary< T >::findIndex(), Foam::findIndices(), forAll, PrimitivePatch< FaceList, PointField >::meshPointMap(), and PrimitivePatch< FaceList, PointField >::nPoints().
|
static |
Helper: calculate average cell centre per point.
Definition at line 759 of file snappySnapDriver.C.
References UIndirectList< T >::addressing(), primitiveMesh::cellCentres(), polyMesh::faceOwner(), forAll, PrimitivePatch< FaceList, PointField >::localPoints(), PrimitivePatch< FaceList, PointField >::meshPoints(), pFaces, PrimitivePatch< FaceList, PointField >::pointFaces(), tmp< T >::ref(), List< T >::size(), syncTools::syncPointList(), VectorSpace< Form, Cmpt, Ncmpts >::zero, and Foam::Zero.
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 817 of file snappySnapDriver.C.
References meshRefinement::ATTRACTION, Foam::endl(), refinementSurfaces::findNearestIntersection(), forAll, meshRefinement::getMasterPoints(), surfaceZonesInfo::getNamedSurfaces(), surfaceZonesInfo::getUnnamedSurfaces(), Foam::Info, PrimitivePatch< FaceList, PointField >::localPoints(), fvMesh::mesh(), PrimitivePatch< FaceList, PointField >::meshPoints(), fileName::name(), PrimitivePatch< FaceList, PointField >::nPoints(), Time::path(), autoPtr< T >::reset(), Foam::returnReduce(), refinementSurfaces::surfaces(), refinementSurfaces::surfZones(), fvMesh::time(), and autoPtr< T >::valid().
|
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 1415 of file snappySnapDriver.C.
References cpuTime::cpuTimeIncrement(), Foam::endl(), refinementSurfaces::findNearest(), refinementSurfaces::findNearestRegion(), forAll, meshRefinement::gAverage(), meshRefinement::getMasterPoints(), surfaceZonesInfo::getNamedSurfaces(), surfaceZonesInfo::getUnnamedSurfaces(), Foam::gMax(), Foam::gMin(), Foam::Info, PrimitivePatch< FaceList, PointField >::localPoints(), Foam::mag(), meshRefinement::mesh(), PrimitivePatch< FaceList, PointField >::meshPoints(), Foam::min(), Foam::nl, Foam::Pout, Foam::returnReduce(), List< T >::size(), Foam::sqr(), meshRefinement::surfaces(), refinementSurfaces::surfZones(), syncTools::syncPointList(), fvMesh::time(), WarningInFunction, and Foam::Zero.
void smoothDisplacement | ( | const snapParameters & | snapParams, |
motionSmoother & | meshMover | ||
) | const |
Smooth the displacement field to the internal.
Definition at line 1667 of file snappySnapDriver.C.
References cpuTime::cpuTimeIncrement(), motionSmootherData::displacement(), Foam::endl(), Foam::Info, PrimitivePatch< FaceList, PointField >::localPoints(), Foam::mag(), fvMesh::mesh(), meshRefinement::MESH, PrimitivePatch< FaceList, PointField >::meshPoints(), fileName::name(), Foam::nl, snapParameters::nSmoothDispl(), motionSmootherAlgo::patch(), Time::path(), motionSmootherAlgo::pMesh(), motionSmootherAlgo::smooth(), fvMesh::time(), regIOobject::write(), 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 1736 of file snappySnapDriver.C.
References cpuTime::cpuTimeIncrement(), motionSmootherData::displacement(), Foam::endl(), Foam::identityMap(), Foam::Info, Foam::mag(), fvMesh::mesh(), meshRefinement::MESH, primitiveMesh::nFaces(), Foam::nl, snapParameters::nSnap(), motionSmootherAlgo::scaleMesh(), motionSmootherAlgo::setErrorReduction(), fvMesh::time(), fvMesh::write(), and regIOobject::write().
Foam::autoPtr< Foam::polyTopoChangeMap > repatchToSurface | ( | const snapParameters & | snapParams, |
const labelList & | adaptPatchIDs, | ||
const labelList & | preserveFaces | ||
) |
Repatch faces according to surface nearest the face centre.
+ calculate face-wise snap distance as max of point-wise + calculate face-wise nearest surface point + repatch face according to patch for surface point.
Definition at line 1797 of file snappySnapDriver.C.
References UIndirectList< T >::addressing(), polyMesh::boundaryMesh(), cpuTime::cpuTimeIncrement(), Foam::endl(), f(), primitiveMesh::faceCentres(), polyMesh::faceZones(), refinementSurfaces::findNearestRegion(), forAll, PackedList< nBits >::get(), surfaceZonesInfo::getNamedSurfaces(), surfaceZonesInfo::getUnnamedSurfaces(), refinementSurfaces::globalRegion(), Foam::Info, PrimitivePatch< FaceList, PointField >::localFaces(), meshRefinement::makePatch(), Foam::max(), fvMesh::mesh(), primitiveMesh::nFaces(), Foam::nl, patches, patchi, Foam::returnReduce(), PackedBoolList::set(), UIndirectList< T >::size(), Foam::sqr(), polyPatch::start(), refinementSurfaces::surfaces(), refinementSurfaces::surfZones(), and fvMesh::time().
void doSnap | ( | const dictionary & | snapDict, |
const dictionary & | motionDict, | ||
const scalar | featureCos, | ||
const scalar | planarAngle, | ||
const snapParameters & | snapParams | ||
) |
Only if in feature attraction mode:
Nearest feature
Definition at line 2061 of file snappySnapDriver.C.
References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), meshRefinement::ATTRACTION, surfaceZonesInfo::BAFFLE, surfaceZonesInfo::BOUNDARY, Foam::meshCheck::checkMesh(), motionSmootherAlgo::correct(), Foam::cos(), cpuTime::cpuTimeIncrement(), snapParameters::detectNearSurfacesSnap(), motionSmootherData::displacement(), Foam::endl(), f(), Foam::faceMap(), polyMesh::faces(), polyMesh::faceZones(), PtrListDictionary< T >::findIndex(), Pair< Type >::first(), forAll, Foam::Info, PrimitivePatch< FaceList, PointField >::localPoints(), Foam::mag(), meshRefinement::makeDisplacementField(), meshRefinement::makePatch(), VectorSpace< Form, Cmpt, Ncmpts >::max, fvMesh::mesh(), meshRefinement::MESH, OSstream::name(), fileName::name(), Foam::name(), refinementSurfaces::names(), DemandDrivenMeshObject< polyMesh, RepatchableMeshObject, pointMesh >::New(), primitiveMesh::nFaces(), snapParameters::nFeatureSnap(), Foam::nl, primitiveMesh::nPoints(), PrimitivePatch< FaceList, PointField >::nPoints(), Time::path(), Foam::Pout, Foam::returnReduce(), Pair< Type >::second(), motionSmootherAlgo::setDisplacement(), List< T >::setSize(), HashTable< T, Key, Hash >::size(), List< T >::size(), refinementSurfaces::surfaces(), refinementSurfaces::surfZones(), syncTools::syncFaceList(), syncTools::syncPointList(), fvMesh::time(), List< T >::transfer(), meshRefinement::updateList(), autoPtr< T >::valid(), WarningInFunction, regIOobject::write(), Ostream::write(), meshRefinement::writeLevel(), meshRefinement::WRITEMESH, and Foam::Zero.
|
delete |
Disallow default bitwise assignment.