39#ifndef snappySnapDriver_H
40#define snappySnapDriver_H
87 void doSnapBufferLayers
92 const scalar featureCos,
93 const scalar planarAngle,
99 static label getCollocatedPoints
125 const bitSet& isMasterPoint,
141 const scalar cellSizeFraction
149 const word& allEdgePatchName,
150 const word& allPointPatchName
180 void checkCoupledFaceZones()
const;
198 static bool outwardsDisplacement
205 static void freezeExposedPoints
215 void detectWarpedFaces
217 const scalar featureCos,
226 labelList getInternalOrBaffleDuplicateFace()
const;
229 static void getZoneSurfacePoints
233 const word& zoneName,
239 template<
class FaceList>
243 const FaceList& faces
248 static void calcNearestSurface
273 const scalar featureCos,
275 const bitSet& isFeatureEdge,
279 void smoothAndConstrain
281 const bitSet& isMasterEdge,
313 void calcNearestFacePointProperties
328 void correctAttraction
341 void stringFeatureEdges
344 const scalar featureCos,
360 void releasePointsNextToMultiPatch
363 const scalar featureCos,
419 bool isSplitAlignedWithFeature
421 const scalar featureCos,
433 const scalar concaveCos
437 const scalar featureCos,
438 const scalar concaveCos,
439 const scalar minAreaFraction,
456 const scalar featureCos,
457 const scalar concaveCos,
458 const scalar minAreaFraction,
475 void avoidDiagonalAttraction
478 const scalar featureCos,
489 const bitSet& isMasterPoint,
514 const scalar featureCos,
515 const vector& faceSurfaceNormal,
521 void featureAttractionUsingReconstruction
524 const scalar featureCos,
547 void featureAttractionUsingReconstruction
550 const scalar featureCos,
567 void determineFeatures
570 const scalar featureCos,
571 const bool multiRegionFeatureSnap,
572 const bool strictRegionFeatureSnap,
595 void determineBaffleFeatures
598 const bool baffleFeaturePoints,
599 const scalar featureCos,
615 void reverseAttractMeshPoints
643 const bool isRegionEdge,
649 const point& estimatedPt,
665 const bool isRegionEdge,
671 const point& estimatedPt,
684 void featureAttractionUsingFeatureEdges
687 const bool multiRegionFeatureSnap,
688 const bool strictRegionFeatureSnap,
690 const bool detectBaffles,
691 const bool baffleFeaturePoints,
692 const bool releasePoints,
693 const bool stringFeatures,
694 const bool avoidDiagonal,
696 const scalar featureCos,
713 void preventFaceSqueeze
716 const scalar featureCos,
733 const bool alignMeshEdges,
734 const bool strictRegionFeatureSnap,
736 const scalar featureCos,
737 const scalar featureAttract,
753 snappySnapDriver(
const snappySnapDriver&) =
delete;
756 void operator=(
const snappySnapDriver&) =
delete;
773 const bool dryRun =
false
798 const label nInitErrors,
813 const scalar planarCos,
826 const bool strictRegionSnap,
860 const label nInitErrors,
882 const scalar featureCos,
883 const scalar planarAngle,
Info<< nl;Info<< "Write faMesh in vtk format:"<< nl;{ vtk::uindirectPatchWriter writer(aMesh.patch(), fileName(aMesh.time().globalPath()/vtkBaseFileName));writer.writeGeometry();globalIndex procAddr(aMesh.nFaces());labelList cellIDs;if(UPstream::master()) { cellIDs.resize(procAddr.totalSize());for(const labelRange &range :procAddr.ranges()) { auto slice=cellIDs.slice(range);slice=identity(range);} } writer.beginCellData(4);writer.writeProcIDs();writer.write("cellID", cellIDs);writer.write("area", aMesh.S().field());writer.write("normal", aMesh.faceAreaNormals());writer.beginPointData(1);writer.write("normal", aMesh.pointAreaNormals());Info<< " "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.time().globalPath()/(vtkBaseFileName+"-edges")));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
Dynamically sized Field. Similar to DynamicList, but inheriting from a Field instead of a List.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Adds layers of cells to outside (or inside) of polyMesh. Can optionally create stand-alone extruded m...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Virtual base class for displacement motion solver.
A face is a list of labels corresponding to mesh vertices.
A class for handling file names.
Mesh data needed to do the Finite Volume discretisation.
Simple container to keep together layer specific information.
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
FaceMergeType
Enumeration for what to do with co-planar patch faces on a single.
Given a displacement moves the mesh by scaling the displacement back until there are no more mesh err...
Accumulates point constraints through successive applications of the applyConstraint function.
Application of (multi-)patch point constraints.
Mesh representing a set of points created from polyMesh.
Mesh consisting of general polyhedral cells.
Simple container to keep together refinement specific information.
Container for data on surfaces used for surface-driven refinement. Contains all the data about the le...
Simple container to keep together snap specific information.
void detectNearSurfaces(const scalar planarCos, const indirectPrimitivePatch &pp, const pointField &ppLocalPoints, const pointField &nearestPoint, const vectorField &nearestNormal, vectorField &disp) const
Per patch point override displacement if in gap situation.
autoPtr< mapPolyMesh > mergeZoneBaffles(const List< labelPair > &)
Merge baffles.
bool scaleMesh(const snapParameters &snapParams, const label nInitErrors, const List< labelPair > &baffles, motionSmoother &)
Do the hard work: move the mesh according to displacement,.
ClassName("snappySnapDriver")
Runtime type information.
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.
static tmp< pointField > avgCellCentres(const fvMesh &mesh, const indirectPrimitivePatch &)
Helper: calculate average cell centre per point.
void doSnap(const dictionary &snapDict, const dictionary &motionDict, const meshRefinement::FaceMergeType mergeType, const scalar featureCos, const scalar planarAngle, const snapParameters &snapParams)
Snap onto surface & features.
void smoothDisplacement(const snapParameters &snapParams, motionSmoother &) const
Smooth the displacement field to the internal.
autoPtr< mapPolyMesh > repatchToSurface(const snapParameters &snapParams, const labelList &adaptPatchIDs, const labelList &preserveFaces)
Repatch faces according to surface nearest the face centre.
static scalarField calcSnapDistance(const fvMesh &mesh, const snapParameters &snapParams, const indirectPrimitivePatch &)
Calculate edge length per patch point.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Pair< label > labelPair
A pair of labels.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
List< pointConstraint > pointConstraintList
List of pointConstraint.
GeometricField< vector, pointPatchField, pointMesh > pointVectorField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
PrimitivePatch< IndirectList< face >, const pointField & > indirectPrimitivePatch
A PrimitivePatch with an IndirectList for the faces, const reference for the point field.
Field< vector > vectorField
Specialisation of Field<T> for vector.
vector point
Point is a vector.
vectorField pointField
pointField is a vectorField.
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
pointField points0(pointIOField(IOobject("points", mesh.time().constant(), polyMesh::meshSubDir, mesh, IOobject::MUST_READ, IOobject::NO_WRITE, IOobject::NO_REGISTER)))