All to do with snapping to surface. More...
Public Member Functions | |
ClassName ("autoSnapDriver") | |
Runtime type information. More... | |
autoSnapDriver (meshRefinement &meshRefiner, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch) | |
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 bool mergePatchFaces, 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... | |
Private Member Functions | |
void | checkCoupledFaceZones () const |
Check that face zones are synced. More... | |
void | detectWarpedFaces (const scalar featureCos, const indirectPrimitivePatch &pp, DynamicList< label > &splitFaces, DynamicList< labelPair > &splits) const |
Detect warpage. More... | |
labelList | getInternalOrBaffleDuplicateFace () const |
Get per face -1 or label of opposite face if on internal/baffle. More... | |
bool | isFeaturePoint (const scalar featureCos, const indirectPrimitivePatch &pp, const PackedBoolList &isFeatureEdge, const label pointI) const |
Is point on two feature edges that make a largish angle? More... | |
void | smoothAndConstrain (const PackedBoolList &isMasterEdge, const indirectPrimitivePatch &pp, const labelList &meshEdges, const List< pointConstraint > &constraints, vectorField &disp) const |
void | calcNearest (const label iter, const indirectPrimitivePatch &pp, vectorField &pointDisp, vectorField &pointSurfaceNormal, vectorField &pointRotation) const |
void | calcNearestFace (const label iter, const indirectPrimitivePatch &pp, const scalarField &faceSnapDist, vectorField &faceDisp, vectorField &faceSurfaceNormal, labelList &faceSurfaceRegion) const |
void | calcNearestFacePointProperties (const label iter, const indirectPrimitivePatch &pp, const vectorField &faceDisp, const vectorField &faceSurfaceNormal, const labelList &faceSurfaceRegion, List< List< point > > &pointFaceSurfNormals, List< List< point > > &pointFaceDisp, List< List< point > > &pointFaceCentres, List< labelList > &pointFacePatchID) const |
void | correctAttraction (const DynamicList< point > &surfacePoints, const DynamicList< label > &surfaceCounts, const point &edgePt, const vector &edgeNormal, const point &pt, vector &edgeOffset) const |
void | stringFeatureEdges (const label iter, const scalar featureCos, const indirectPrimitivePatch &pp, const scalarField &snapDist, const vectorField &rawPatchAttraction, const List< pointConstraint > &rawPatchConstraints, vectorField &patchAttraction, List< pointConstraint > &patchConstraints) const |
For any reverse (so from feature back to mesh) attraction: More... | |
void | releasePointsNextToMultiPatch (const label iter, const scalar featureCos, const indirectPrimitivePatch &pp, const scalarField &snapDist, const List< List< point > > &pointFaceCentres, const labelListList &pointFacePatchID, const vectorField &rawPatchAttraction, const List< pointConstraint > &rawPatchConstraints, vectorField &patchAttraction, List< pointConstraint > &patchConstraints) const |
Remove constraints of points next to multi-patch points. More... | |
labelPair | findDiagonalAttraction (const indirectPrimitivePatch &pp, const vectorField &patchAttraction, const List< pointConstraint > &patchConstraints, const label faceI) const |
Detect any diagonal attraction. Returns indices in face. More... | |
scalar | pyrVol (const indirectPrimitivePatch &pp, const vectorField &featureAttraction, const face &localF, const point &cc) const |
void | facePoints (const indirectPrimitivePatch &pp, const vectorField &featureAttraction, const vectorField &nearestAttraction, const face &f, DynamicField< point > &points) const |
scalar | pyrVol (const indirectPrimitivePatch &pp, const vectorField &featureAttraction, const vectorField &nearestAttraction, const face &localF, const point &cc) const |
Tuple2< point, vector > | centreAndNormal (const indirectPrimitivePatch &pp, const vectorField &featureAttraction, const vectorField &nearestAttraction, const face &localF) const |
bool | isSplitAlignedWithFeature (const scalar featureCos, const point &newPt0, const pointConstraint &pc0, const point &newPt1, const pointConstraint &pc1) const |
bool | isConcave (const point &c0, const vector &area0, const point &c1, const vector &area1, const scalar concaveCos) const |
labelPair | findDiagonalAttraction (const scalar featureCos, const scalar concaveCos, const scalar minAreaFraction, const indirectPrimitivePatch &pp, const vectorField &patchAttraction, const List< pointConstraint > &patchConstraints, const vectorField &nearestAttraction, const vectorField &nearestNormal, const label faceI, DynamicField< point > &points0, DynamicField< point > &points1) const |
void | splitDiagonals (const scalar featureCos, const scalar concaveCos, const scalar minAreaFraction, const indirectPrimitivePatch &pp, const vectorField &nearestAttraction, const vectorField &nearestNormal, vectorField &patchAttraction, List< pointConstraint > &patchConstraints, DynamicList< label > &splitFaces, DynamicList< labelPair > &splits) const |
Do all logic on whether to add face cut to diagonal. More... | |
void | avoidDiagonalAttraction (const label iter, const scalar featureCos, const indirectPrimitivePatch &pp, vectorField &patchAttraction, List< pointConstraint > &patchConstraints) const |
Avoid attraction across face diagonal since would. More... | |
void | writeStats (const indirectPrimitivePatch &pp, const PackedBoolList &isMasterPoint, const List< pointConstraint > &patchConstraints) const |
Write some stats about constraints. More... | |
pointIndexHit | findMultiPatchPoint (const point &pt, const labelList &patchIDs, const List< point > &faceCentres) const |
Return hit if on multiple points. More... | |
pointIndexHit | findMultiPatchPoint (const point &pt, const labelList &pfPatchID, const DynamicList< vector > &surfaceNormals, const labelList &faceToNormalBin) const |
Return hit if faces-on-the-same-normalplane are on multiple. More... | |
label | findNormal (const scalar featureCos, const vector &faceSurfaceNormal, const DynamicList< vector > &surfaceNormals) const |
Return index of similar normal. More... | |
void | featureAttractionUsingReconstruction (const label iter, const scalar featureCos, const indirectPrimitivePatch &pp, const scalarField &snapDist, const vectorField &nearestDisp, const label pointI, const List< List< point > > &pointFaceSurfNormals, const List< List< point > > &pointFaceDisp, const List< List< point > > &pointFaceCentres, const labelListList &pointFacePatchID, DynamicList< point > &surfacePoints, DynamicList< vector > &surfaceNormals, labelList &faceToNormalBin, vector &patchAttraction, pointConstraint &patchConstraint) const |
Determine attraction and constraints for single point. More... | |
void | featureAttractionUsingReconstruction (const label iter, const scalar featureCos, const indirectPrimitivePatch &pp, const scalarField &snapDist, const vectorField &nearestDisp, const List< List< point > > &pointFaceSurfNormals, const List< List< point > > &pointFaceDisp, const List< List< point > > &pointFaceCentres, const labelListList &pointFacePatchID, vectorField &patchAttraction, List< pointConstraint > &patchConstraints) const |
Determine attraction and constraints for all points. More... | |
void | determineFeatures (const label iter, const scalar featureCos, const bool multiRegionFeatureSnap, const indirectPrimitivePatch &, const scalarField &snapDist, const vectorField &nearestDisp, const List< List< point > > &pointFaceSurfNormals, const List< List< point > > &pointFaceDisp, const List< List< point > > &pointFaceCentres, const labelListList &pointFacePatchID, List< labelList > &pointAttractor, List< List< pointConstraint > > &pointConstraints, List< List< DynamicList< point > > > &edgeAttractors, List< List< DynamicList< pointConstraint > > > &edgeConstraints, vectorField &patchAttraction, List< pointConstraint > &patchConstraints) const |
Determine geometric features and attraction to equivalent. More... | |
void | determineBaffleFeatures (const label iter, const bool baffleFeaturePoints, const scalar featureCos, const indirectPrimitivePatch &pp, const scalarField &snapDist, List< labelList > &pointAttractor, List< List< pointConstraint > > &pointConstraints, List< List< DynamicList< point > > > &edgeAttractors, List< List< DynamicList< pointConstraint > > > &edgeConstraints, vectorField &patchAttraction, List< pointConstraint > &patchConstraints) const |
Determine features originating from bafles and. More... | |
void | reverseAttractMeshPoints (const label iter, const indirectPrimitivePatch &pp, const scalarField &snapDist, const List< labelList > &pointAttractor, const List< List< pointConstraint > > &pointConstraints, const List< List< DynamicList< point > > > &edgeAttractors, const List< List< DynamicList< pointConstraint > > > &, const vectorField &rawPatchAttraction, const List< pointConstraint > &rawPatchConstraints, vectorField &patchAttraction, List< pointConstraint > &patchConstraints) const |
Tuple2< label, pointIndexHit > | findNearFeatureEdge (const bool isRegionEdge, const indirectPrimitivePatch &pp, const scalarField &snapDist, const label pointI, const point &estimatedPt, List< List< DynamicList< point > > > &, List< List< DynamicList< pointConstraint > > > &, vectorField &, List< pointConstraint > &) const |
Find point on nearest feature edge (within searchDist). More... | |
Tuple2< label, pointIndexHit > | findNearFeaturePoint (const bool isRegionEdge, const indirectPrimitivePatch &pp, const scalarField &snapDist, const label pointI, const point &estimatedPt, List< labelList > &pointAttractor, List< List< pointConstraint > > &pointConstraints, List< List< DynamicList< point > > > &edgeAttractors, List< List< DynamicList< pointConstraint > > > &edgeConstraints, vectorField &patchAttraction, List< pointConstraint > &patchConstraints) const |
Find nearest feature point (within searchDist). More... | |
void | featureAttractionUsingFeatureEdges (const label iter, const bool multiRegionFeatureSnap, const bool detectBaffles, const bool baffleFeaturePoints, const bool releasePoints, const bool stringFeatures, const bool avoidDiagonal, const scalar featureCos, const indirectPrimitivePatch &pp, const scalarField &snapDist, const vectorField &nearestDisp, const vectorField &nearestNormal, const List< List< point > > &pointFaceSurfNormals, const List< List< point > > &pointFaceDisp, const List< List< point > > &pointFaceCentres, const labelListList &pointFacePatchID, vectorField &patchAttraction, List< pointConstraint > &patchConstraints) const |
void | preventFaceSqueeze (const label iter, const scalar featureCos, const indirectPrimitivePatch &pp, const scalarField &snapDist, const vectorField &nearestAttraction, vectorField &patchAttraction, List< pointConstraint > &patchConstraints) const |
vectorField | calcNearestSurfaceFeature (const snapParameters &snapParams, const bool alignMeshEdges, const label iter, const scalar featureCos, const scalar featureAttract, const scalarField &snapDist, const vectorField &nearestDisp, const vectorField &nearestNormal, motionSmoother &meshMover, vectorField &patchAttraction, List< pointConstraint > &patchConstraints, DynamicList< label > &splitFaces, DynamicList< labelPair > &splits) const |
Top level feature attraction routine. Gets given. More... | |
autoSnapDriver (const autoSnapDriver &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const autoSnapDriver &) |
Disallow default bitwise assignment. More... | |
Static Private Member Functions | |
static label | getCollocatedPoints (const scalar tol, const pointField &, PackedBoolList &) |
Calculates (geometric) shared points. More... | |
static tmp< pointField > | smoothInternalDisplacement (const meshRefinement &meshRefiner, const motionSmoother &) |
Calculate displacement (over all mesh points) to move points. More... | |
static tmp< pointField > | smoothPatchDisplacement (const motionSmoother &, const List< labelPair > &) |
Calculate displacement per patch point to smooth out patch. More... | |
static tmp< pointField > | avg (const indirectPrimitivePatch &, const pointField &) |
static pointField | smoothLambdaMuPatchDisplacement (const motionSmoother &meshMover, const List< labelPair > &baffles) |
Calculate displacement per patch point. Wip. More... | |
static tmp< scalarField > | edgePatchDist (const pointMesh &, const indirectPrimitivePatch &) |
Per edge distance to patch. More... | |
static void | dumpMove (const fileName &, const pointField &, const pointField &) |
Write displacement as .obj file. More... | |
static bool | outwardsDisplacement (const indirectPrimitivePatch &, const vectorField &) |
Check displacement is outwards pointing. More... | |
static labelList | getZoneSurfacePoints (const fvMesh &mesh, const indirectPrimitivePatch &, const word &zoneName) |
Get points both on patch and facezone. More... | |
template<class FaceList > | |
static labelList | getFacePoints (const indirectPrimitivePatch &pp, const FaceList &faces) |
Get points both on patch and facezone. More... | |
static void | calcNearestSurface (const refinementSurfaces &surfaces, const labelList &surfacesToTest, const labelListList ®ionsToTest, const pointField &localPoints, const labelList &zonePointIndices, scalarField &minSnapDist, labelList &snapSurf, vectorField &patchDisp, pointField &nearestPoint, vectorField &nearestNormal) |
Per patch point calculate point on nearest surface. More... | |
Private Attributes | |
meshRefinement & | meshRefiner_ |
Mesh+surface. More... | |
const labelList | globalToMasterPatch_ |
From global surface region to master side patch. More... | |
const labelList | globalToSlavePatch_ |
From global surface region to slave side patch. More... | |
|
private |
Disallow default bitwise copy construct.
autoSnapDriver | ( | meshRefinement & | meshRefiner, |
const labelList & | globalToMasterPatch, | ||
const labelList & | globalToSlavePatch | ||
) |
Construct from components.
Definition at line 772 of file autoSnapDriver.C.
|
staticprivate |
Calculates (geometric) shared points.
Definition at line 64 of file autoSnapDriver.C.
References forAll, Foam::mergePoints(), points, Foam::returnReduce(), and PackedBoolList::set().
|
staticprivate |
Calculate displacement (over all mesh points) to move points.
to average of connected cell centres
Definition at line 124 of file autoSnapDriver.C.
References hexRef8::cellLevel(), Foam::endl(), f(), forAll, Foam::Info, mesh, motionSmootherAlgo::mesh(), meshRefinement::meshCutter(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), motionSmootherAlgo::patch(), and Foam::reduce().
|
staticprivate |
Calculate displacement per patch point to smooth out patch.
Quite complicated in determining which points to move where.
Definition at line 304 of file autoSnapDriver.C.
References Foam::abort(), Foam::endl(), f(), f1, polyPatch::faceCentres(), Foam::FatalError, FatalErrorInFunction, forAll, PackedList::get(), Foam::Info, PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), mesh, motionSmootherAlgo::mesh(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), motionSmootherAlgo::patch(), patches, pFaces, PrimitivePatch< Face, FaceList, PointField, PointType >::pointFaces(), points, PrimitivePatch< Face, FaceList, PointField, PointType >::points(), List::setSize(), List::size(), and PackedBoolList::unset().
|
staticprivate |
|
staticprivate |
Calculate displacement per patch point. Wip.
|
private |
Check that face zones are synced.
|
staticprivate |
Per edge distance to patch.
Definition at line 654 of file autoSnapDriver.C.
References forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), scalarField(), and Foam::sqrt().
|
staticprivate |
Write displacement as .obj file.
Definition at line 700 of file autoSnapDriver.C.
References Foam::endl(), forAll, Foam::Info, Foam::nl, and writeOBJ().
|
staticprivate |
Check displacement is outwards pointing.
Definition at line 729 of file autoSnapDriver.C.
References Foam::endl(), PrimitivePatch< Face, FaceList, PointField, PointType >::faceNormals(), forAll, Foam::mag(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), pFaces, PrimitivePatch< Face, FaceList, PointField, PointType >::pointFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::points(), Foam::meshTools::visNormal(), and Foam::Warning.
|
private |
Detect warpage.
Definition at line 2400 of file autoSnapDriver.C.
References DynamicList::append(), DynamicList::clear(), f(), f1, forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::mag(), mesh, face::normal(), DynamicList::setCapacity(), List::setSize(), and List::size().
|
private |
Get per face -1 or label of opposite face if on internal/baffle.
Definition at line 2493 of file autoSnapDriver.C.
References surfaceZonesInfo::BAFFLE, localPointRegion::findDuplicateFacePairs(), forAll, meshRefinement::getZones(), surfaceZonesInfo::INTERNAL, mesh, meshRefinement::mesh(), autoSnapDriver::meshRefiner_, p, and meshRefinement::subsetBaffles().
|
staticprivate |
Get points both on patch and facezone.
Definition at line 943 of file autoSnapDriver.C.
References Foam::exit(), f(), Foam::FatalError, FatalErrorInFunction, Foam::findIndices(), forAll, mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPointMap(), and PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints().
|
staticprivate |
Get points both on patch and facezone.
|
staticprivate |
Per patch point calculate point on nearest surface.
Return displacement of patch points.
Definition at line 1692 of file autoSnapDriver.C.
References refinementSurfaces::findNearest(), refinementSurfaces::findNearestRegion(), forAll, Foam::mag(), scalarField(), and Foam::sqr().
|
private |
Is point on two feature edges that make a largish angle?
Definition at line 69 of file autoSnapDriverFeature.C.
References PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::mag(), edge::otherVertex(), p, PrimitivePatch< Face, FaceList, PointField, PointType >::pointEdges(), points, and List::size().
|
private |
Definition at line 130 of file autoSnapDriverFeature.C.
References PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), forAll, mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), and PrimitivePatch< Face, FaceList, PointField, PointType >::pointEdges().
|
private |
|
private |
Definition at line 221 of file autoSnapDriverFeature.C.
References DynamicList::append(), Foam::endl(), Foam::exit(), PrimitivePatch< Face, FaceList, PointField, PointType >::faceCentres(), Foam::FatalError, FatalErrorInFunction, refinementSurfaces::findNearestRegion(), forAll, refinementSurfaces::globalRegion(), mesh, List::setSize(), List::size(), Foam::sqr(), refinementSurfaces::surfaces(), refinementSurfaces::surfZones(), and WarningInFunction.
|
private |
Definition at line 447 of file autoSnapDriverFeature.C.
References List::append(), polyPatch::coupled(), Foam::constant::electromagnetic::e, PrimitivePatch< Face, FaceList, PointField, PointType >::edgeFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), f(), PrimitivePatch< Face, FaceList, PointField, PointType >::faceCentres(), forAll, Foam::mag(), mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), polyBoundaryMesh::patchID(), pFaces, PrimitivePatch< Face, FaceList, PointField, PointType >::pointFaces(), List::setSize(), List::size(), Foam::sortedOrder(), and polyPatch::start().
|
private |
Definition at line 691 of file autoSnapDriverFeature.C.
References Foam::mag(), and Foam::sortedOrder().
|
private |
For any reverse (so from feature back to mesh) attraction:
add attraction if diagonal points on face attracted
Definition at line 1213 of file autoSnapDriverFeature.C.
References Foam::constant::electromagnetic::e, PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), Foam::endl(), forAll, Foam::Info, PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::mag(), Foam::magSqr(), PrimitivePatch< Face, FaceList, PointField, PointType >::pointEdges(), and Foam::reduce().
|
private |
Remove constraints of points next to multi-patch points.
to give a bit more freedom of the mesh to conform to the multi-patch points. Bit dodgy for simple cases.
Definition at line 1402 of file autoSnapDriverFeature.C.
References Foam::endl(), f(), forAll, PointIndexHit< Point >::hit(), Foam::Info, PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::name(), Foam::reduce(), autoPtr::reset(), and autoPtr::valid().
|
private |
Detect any diagonal attraction. Returns indices in face.
or (-1, -1) if none
Definition at line 1533 of file autoSnapDriverFeature.C.
References f(), and PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces().
|
private |
|
private |
|
private |
|
private |
|
private |
Definition at line 1576 of file autoSnapDriverFeature.C.
References Tuple2::first(), Foam::mag(), and Tuple2::second().
|
private |
Definition at line 1616 of file autoSnapDriverFeature.C.
References Foam::constant::physicoChemical::c1, and Foam::mag().
|
private |
Definition at line 1666 of file autoSnapDriverFeature.C.
References DynamicField::append(), face::centre(), DynamicField::clear(), f1, Tuple2::first(), Foam::identity(), PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), face::normal(), List::setSize(), and List::size().
|
private |
Do all logic on whether to add face cut to diagonal.
attraction
Definition at line 1885 of file autoSnapDriverFeature.C.
References DynamicList::append(), DynamicList::clear(), f(), forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), DynamicList::setCapacity(), and List::size().
|
private |
Avoid attraction across face diagonal since would.
cause face squeeze
Definition at line 1970 of file autoSnapDriverFeature.C.
References Foam::diag(), f(), forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::mag(), and Foam::magSqr().
|
private |
Write some stats about constraints.
Definition at line 866 of file autoSnapDriverFeature.C.
References Foam::endl(), forAll, Foam::Info, Foam::nl, and Foam::reduce().
|
private |
Return hit if on multiple points.
Definition at line 729 of file autoSnapDriverFeature.C.
References Foam::labelMax, and List::size().
|
private |
Return hit if faces-on-the-same-normalplane are on multiple.
patches
Definition at line 786 of file autoSnapDriverFeature.C.
References forAll, and List::size().
|
private |
Return index of similar normal.
Definition at line 753 of file autoSnapDriverFeature.C.
|
private |
Determine attraction and constraints for single point.
using sampled surrounding of the point
Bins of differing normals:
two normals : geometric feature edge
From face to above normals bin
Definition at line 914 of file autoSnapDriverFeature.C.
References DynamicList::append(), pointConstraint::applyConstraint(), DynamicList::clear(), plane::ray::dir(), forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::mag(), Foam::magSqr(), n, plane::planeIntersect(), plane::planePlaneIntersect(), plane::ray::refPoint(), List::setSize(), List::size(), Foam::sqr(), and Foam::sqrt().
|
private |
Determine attraction and constraints for all points.
using sampled surrounding of the point
Definition at line 1107 of file autoSnapDriverFeature.C.
References Foam::endl(), Tuple2::first(), forAll, Foam::Info, PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::magSqr(), Foam::name(), autoPtr::reset(), and autoPtr::valid().
|
private |
Determine geometric features and attraction to equivalent.
surface features
Definition at line 2242 of file autoSnapDriverFeature.C.
References Foam::endl(), Tuple2::first(), forAll, PointIndexHit< Point >::hit(), PointIndexHit< Point >::hitPoint(), PointIndexHit< Point >::index(), Foam::Info, PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::magSqr(), Foam::name(), autoPtr::reset(), Tuple2::second(), and autoPtr::valid().
|
private |
Determine features originating from bafles and.
and add attraction to equivalent surface features
Baffle edges will be too ragged to sensibly determine feature points
forAll(pp.pointEdges(), pointI) { if ( isFeaturePoint ( featureCos, pp, isBaffleEdge, pointI ) ) { Pout<< "Detected feature point:" << pp.localPoints()[pointI] << endl; -TEMPORARILY DISABLED: pointStatus[pointI] = 1; } }
MEJ:
2: optionally override with nearest feature point. On baffles we don't have enough normals to construct a feature point so assume all feature edges are close to feature points
Definition at line 2784 of file autoSnapDriverFeature.C.
References Foam::cos(), Foam::degToRad(), Foam::constant::electromagnetic::e, PrimitivePatch< Face, FaceList, PointField, PointType >::edgeFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), Foam::endl(), PrimitivePatch< Face, FaceList, PointField, PointType >::faceNormals(), refinementFeatures::findNearestPoint(), Tuple2::first(), forAll, Foam::Info, PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::magSqr(), mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::meshEdges(), Foam::name(), PrimitivePatch< Face, FaceList, PointField, PointType >::nEdges(), Foam::nl, PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), Foam::reduce(), autoPtr::reset(), Foam::returnReduce(), scalarField(), Tuple2::second(), List::setSize(), List::size(), Foam::sqr(), and autoPtr::valid().
|
private |
Definition at line 3112 of file autoSnapDriverFeature.C.
References DynamicList::append(), Foam::constant::electromagnetic::e, Foam::endl(), treeBoundBox::extend(), f(), indexedOctree::findNearest(), forAll, Foam::Info, PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::magSqr(), boundBox::max(), mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), boundBox::min(), PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), Foam::returnReduce(), rndGen(), List::setSize(), indexedOctree::shapes(), Foam::sqr(), and WarningInFunction.
|
private |
Find point on nearest feature edge (within searchDist).
Return point and feature and store feature-edge to mesh-point and vice versa
Definition at line 2069 of file autoSnapDriverFeature.C.
References List::append(), Foam::constant::universal::c, refinementFeatures::findNearestEdge(), refinementFeatures::findNearestRegionEdge(), PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), scalarField(), and Foam::sqr().
|
private |
Find nearest feature point (within searchDist).
Return feature point and store feature-point to mesh-point and vice versa. If another mesh point already referring to this feature point and further away, reset that one to a near feature edge (using findNearFeatureEdge above)
Definition at line 2136 of file autoSnapDriverFeature.C.
References refinementFeatures::findNearestPoint(), PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::magSqr(), scalarField(), and Foam::sqr().
|
private |
Definition at line 3373 of file autoSnapDriverFeature.C.
References Foam::endl(), forAll, Foam::Info, PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), OFstream::name(), Foam::name(), PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), List::setSize(), PtrList::size(), OBJstream::write(), and writeStats().
|
private |
Definition at line 3671 of file autoSnapDriverFeature.C.
References Foam::endl(), f(), forAll, Foam::Info, PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), face::mag(), Foam::magSqr(), Foam::name(), points, autoPtr::reset(), s(), List::setSize(), and autoPtr::valid().
|
private |
Top level feature attraction routine. Gets given.
displacement to nearest surface in nearestDisp and calculates new displacement taking into account features
Definition at line 3807 of file autoSnapDriverFeature.C.
References snapParameters::avoidDiagonal(), snapParameters::baffleFeaturePoints(), snapParameters::concaveAngle(), Foam::cos(), Foam::degToRad(), snapParameters::detectBaffles(), Foam::endl(), snapParameters::explicitFeatureSnap(), f(), forAll, Foam::gAverage(), Foam::gMaxMagSqr(), snapParameters::implicitFeatureSnap(), Foam::indent(), Foam::Info, PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::max(), mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::meshEdges(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), snapParameters::minAreaRatio(), snapParameters::multiRegionFeatureSnap(), Foam::name(), Foam::nl, motionSmootherAlgo::patch(), relax(), snapParameters::releasePoints(), List::setSize(), snapParameters::stringFeatures(), and writeStats().
|
private |
Disallow default bitwise assignment.
ClassName | ( | "autoSnapDriver" | ) |
Runtime type information.
autoPtr<mapPolyMesh> mergeZoneBaffles | ( | const List< labelPair > & | ) |
Merge baffles.
|
static |
Calculate edge length per patch point.
Definition at line 787 of file autoSnapDriver.C.
References Foam::constant::electromagnetic::e, PrimitivePatch< Face, FaceList, PointField, PointType >::edges(), forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::max(), mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), PrimitivePatch< Face, FaceList, PointField, PointType >::pointEdges(), scalarField(), and snapParameters::snapTol().
|
static |
Smooth the mesh (patch and internal) to increase visibility.
of surface points (on castellated mesh) w.r.t. surface.
Definition at line 827 of file autoSnapDriver.C.
References motionSmootherAlgo::correct(), Foam::endl(), forAll, Foam::Info, GeometricField::internalField(), mesh, MESH, meshRefinement::mesh(), Foam::nl, snapParameters::nSmoothInternal(), snapParameters::nSmoothPatch(), snapParameters::nSnap(), motionSmootherAlgo::pointDisplacement(), motionSmootherAlgo::scaleMesh(), motionSmootherAlgo::setDisplacement(), motionSmootherAlgo::setErrorReduction(), List::setSize(), meshRefinement::timeName(), and meshRefinement::write().
|
static |
Helper: calculate average cell centre per point.
Definition at line 990 of file autoSnapDriver.C.
References forAll, mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), pFaces, PrimitivePatch< Face, FaceList, PointField, PointType >::pointFaces(), and List::size().
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 1094 of file autoSnapDriver.C.
References Foam::endl(), refinementSurfaces::findNearestIntersection(), forAll, Foam::Info, PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), mesh, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), autoPtr::reset(), Foam::returnReduce(), refinementSurfaces::surfaces(), refinementSurfaces::surfZones(), and autoPtr::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 1772 of file autoSnapDriver.C.
References Foam::endl(), refinementSurfaces::findNearest(), refinementSurfaces::findNearestRegion(), forAll, Foam::gAverage(), refinementSurfaces::geometry(), refinementSurfaces::globalRegion(), Foam::gMax(), Foam::gMin(), Foam::identity(), Foam::Info, PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::mag(), mesh, meshRefinement::mesh(), PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), Foam::nl, Foam::Pout, Foam::returnReduce(), PtrList::size(), Foam::sqr(), refinementSurfaces::surfaces(), meshRefinement::surfaces(), refinementSurfaces::surfZones(), and WarningInFunction.
void smoothDisplacement | ( | const snapParameters & | snapParams, |
motionSmoother & | meshMover | ||
) | const |
Smooth the displacement field to the internal.
Definition at line 2095 of file autoSnapDriver.C.
References motionSmootherData::displacement(), Foam::endl(), Foam::Info, PrimitivePatch< Face, FaceList, PointField, PointType >::localPoints(), Foam::mag(), mesh, MESH, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPoints(), Foam::nl, snapParameters::nSmoothDispl(), motionSmootherAlgo::patch(), motionSmootherAlgo::pMesh(), motionSmootherAlgo::smooth(), and Ostream::write().
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 2164 of file autoSnapDriver.C.
References motionSmootherData::displacement(), Foam::endl(), Foam::identity(), Foam::Info, Foam::mag(), mesh, MESH, Foam::nl, snapParameters::nSnap(), motionSmootherAlgo::scaleMesh(), and motionSmootherAlgo::setErrorReduction().
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 2230 of file autoSnapDriver.C.
References Foam::endl(), f(), refinementSurfaces::findNearestRegion(), forAll, PackedList::get(), refinementSurfaces::globalRegion(), Foam::Info, PrimitivePatch< Face, FaceList, PointField, PointType >::localFaces(), Foam::max(), mesh, Foam::nl, patches, Foam::returnReduce(), PackedBoolList::set(), Foam::sqr(), polyPatch::start(), refinementSurfaces::surfaces(), and refinementSurfaces::surfZones().
void doSnap | ( | const dictionary & | snapDict, |
const dictionary & | motionDict, | ||
const bool | mergePatchFaces, | ||
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 2528 of file autoSnapDriver.C.
References DynamicList::append(), meshRefinement::ATTRACTION, motionSmootherAlgo::checkMesh(), autoPtr::clear(), DynamicList::clear(), motionSmootherAlgo::correct(), Foam::cos(), cpuTime::cpuTimeIncrement(), 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< Face, FaceList, PointField, PointType >::localPoints(), Foam::mag(), meshRefinement::makeDisplacementField(), meshRefinement::makePatch(), Vector< scalar >::max, Foam::help::mergePatchFaces(), mesh, meshRefinement::MESH, Foam::name(), MeshObject< polyMesh, UpdateableMeshObject, pointMesh >::New(), primitiveMesh::nFaces(), snapParameters::nFaceSplitInterval(), snapParameters::nFeatureSnap(), Foam::nl, PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints(), p, Time::path(), autoPtr::reset(), Foam::returnReduce(), motionSmootherAlgo::setDisplacement(), HashTable::size(), snapParameters::strictRegionSnap(), fvMesh::time(), autoPtr::valid(), WarningInFunction, Ostream::write(), meshRefinement::writeLevel(), meshRefinement::WRITEMESH, DynamicList::xfer(), and Vector< scalar >::zero.
Referenced by main().
Foam::labelList getFacePoints | ( | const indirectPrimitivePatch & | pp, |
const FaceList & | faces | ||
) |
Definition at line 32 of file autoSnapDriverTemplates.C.
References f(), Foam::findIndices(), forAll, PrimitivePatch< Face, FaceList, PointField, PointType >::meshPointMap(), and PrimitivePatch< Face, FaceList, PointField, PointType >::nPoints().
|
private |
Mesh+surface.
Definition at line 61 of file autoSnapDriver.H.
Referenced by autoSnapDriver::getInternalOrBaffleDuplicateFace().
|
private |
From global surface region to master side patch.
Definition at line 64 of file autoSnapDriver.H.
|
private |
From global surface region to slave side patch.
Definition at line 67 of file autoSnapDriver.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.