snappySnapDriver.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2015 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::snappySnapDriver
29 
30 Description
31  All to do with snapping to surface
32 
33 SourceFiles
34  snappySnapDriver.C
35  snappySnapDriverFeature.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef snappySnapDriver_H
40 #define snappySnapDriver_H
41 
42 #include "meshRefinement.H"
43 #include "DynamicField.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 // Forward declaration of classes
51 class motionSmoother;
52 class refinementParameters;
53 class snapParameters;
54 class pointConstraint;
55 
56 /*---------------------------------------------------------------------------*\
57  Class snappySnapDriver Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 class snappySnapDriver
61 {
62  // Private data
63 
64  //- Mesh+surface
65  meshRefinement& meshRefiner_;
66 
67  //- From global surface region to master side patch
68  const labelList globalToMasterPatch_;
69 
70  //- From global surface region to slave side patch
71  const labelList globalToSlavePatch_;
72 
73  //- Are we operating in test mode?
74  const bool dryRun_;
75 
76 
77  // Private Member Functions
78 
79 
80  // Snapping
81 
82  //- Calculates (geometric) shared points
83  // Requires bitSet to be sized and initialised
84  static label getCollocatedPoints
85  (
86  const scalar tol,
87  const pointField&,
88  bitSet&
89  );
90 
91  //- Calculate displacement (over all mesh points) to move points
92  // to average of connected cell centres
93  static tmp<pointField> smoothInternalDisplacement
94  (
95  const meshRefinement& meshRefiner,
96  const motionSmoother&
97  );
98 
99  //- Calculate displacement per patch point to smooth out patch.
100  // Quite complicated in determining which points to move where.
101  static tmp<pointField> smoothPatchDisplacement
102  (
103  const motionSmoother&,
104  const List<labelPair>&
105  );
106 
107  static tmp<pointField> avg
108  (
109  const indirectPrimitivePatch&,
110  const pointField&
111  );
112 
113  //- Calculate displacement per patch point. Wip.
114  static pointField smoothLambdaMuPatchDisplacement
115  (
116  const motionSmoother& meshMover,
117  const List<labelPair>& baffles
118  );
119 
120 
121  //- Check that face zones are synced
122  void checkCoupledFaceZones() const;
123 
124  //- Per edge distance to patch
125  static tmp<scalarField> edgePatchDist
126  (
127  const pointMesh&,
129  );
130 
131  //- Write displacement as .obj file.
132  static void dumpMove
133  (
134  const fileName&,
135  const pointField&,
136  const pointField&
137  );
138 
139  //- Check displacement is outwards pointing
140  static bool outwardsDisplacement
141  (
142  const indirectPrimitivePatch&,
143  const vectorField&
144  );
145 
146  //- Freeze points on pointZone or (inside of) faceZone
147  static void freezeExposedPoints
148  (
149  const meshRefinement& meshRefiner,
150  const word& fzName, // faceZone name
151  const word& pzName, // pointZone name
152  const indirectPrimitivePatch& outside,
153  vectorField& patchDisp
154  );
155 
156  //- Detect warpage
157  void detectWarpedFaces
158  (
159  const scalar featureCos,
160  const indirectPrimitivePatch& pp,
161 
162  DynamicList<label>& splitFaces,
163  DynamicList<labelPair>& splits
164  ) const;
165 
166  //- Get per face -1 or label of opposite face if on internal/baffle
167  // faceZone
168  labelList getInternalOrBaffleDuplicateFace() const;
169 
170  //- Get points both on patch and facezone.
171  static void getZoneSurfacePoints
172  (
173  const fvMesh& mesh,
174  const indirectPrimitivePatch&,
175  const word& zoneName,
176 
177  bitSet& pointOnZone
178  );
179 
180  //- Get points both on patch and facezone.
181  template<class FaceList>
182  static labelList getFacePoints
183  (
184  const indirectPrimitivePatch& pp,
185  const FaceList& faces
186  );
187 
188  //- Per patch point calculate point on nearest surface.
189  // Return displacement of patch points.
190  static void calcNearestSurface
191  (
192  const refinementSurfaces& surfaces,
193 
194  const labelList& surfacesToTest,
195  const labelListList& regionsToTest,
196 
197  const pointField& localPoints,
198  const labelList& zonePointIndices,
199 
200  scalarField& minSnapDist,
201  labelList& snapSurf,
202  vectorField& patchDisp,
203 
204  // Optional: nearest point, normal
205  pointField& nearestPoint,
206  vectorField& nearestNormal
207  );
208 
209 
210  // Feature line snapping
211 
212  //- Is point on two feature edges that make a largish angle?
213  bool isFeaturePoint
214  (
215  const scalar featureCos,
216  const indirectPrimitivePatch& pp,
217  const bitSet& isFeatureEdge,
218  const label pointi
219  ) const;
220 
221  void smoothAndConstrain
222  (
223  const bitSet& isMasterEdge,
224  const indirectPrimitivePatch& pp,
225  const labelList& meshEdges,
226  const List<pointConstraint>& constraints,
227  vectorField& disp
228  ) const;
229  //void smoothAndConstrain2
230  //(
231  // const bool applyConstraints,
232  // const indirectPrimitivePatch& pp,
233  // const List<pointConstraint>& constraints,
234  // vectorField& disp
235  //) const;
236  void calcNearest
237  (
238  const label iter,
239  const indirectPrimitivePatch& pp,
240  vectorField& pointDisp,
241  vectorField& pointSurfaceNormal,
242  vectorField& pointRotation
243  ) const;
244  void calcNearestFace
245  (
246  const label iter,
247  const indirectPrimitivePatch& pp,
248  const scalarField& faceSnapDist,
249  vectorField& faceDisp,
250  vectorField& faceSurfaceNormal,
251  labelList& faceSurfaceRegion
252  //vectorField& faceRotation
253  ) const;
254  void calcNearestFacePointProperties
255  (
256  const label iter,
257  const indirectPrimitivePatch& pp,
258 
259  const vectorField& faceDisp,
260  const vectorField& faceSurfaceNormal,
261  const labelList& faceSurfaceRegion,
262 
263  List<List<point>>& pointFaceSurfNormals,
264  List<List<point>>& pointFaceDisp,
265  List<List<point>>& pointFaceCentres,
266  List<labelList>& pointFacePatchID
267  ) const;
268  void correctAttraction
269  (
270  const DynamicList<point>& surfacePoints,
271  const DynamicList<label>& surfaceCounts,
272  const point& edgePt,
273  const vector& edgeNormal, // normalised normal
274  const point& pt,
275  vector& edgeOffset // offset from pt to point on edge
276  ) const;
277 
278 
279  //- For any reverse (so from feature back to mesh) attraction:
280  // add attraction if diagonal points on face attracted
281  void stringFeatureEdges
282  (
283  const label iter,
284  const scalar featureCos,
285 
286  const indirectPrimitivePatch& pp,
287  const scalarField& snapDist,
288 
289  const vectorField& rawPatchAttraction,
290  const List<pointConstraint>& rawPatchConstraints,
291 
292  vectorField& patchAttraction,
293  List<pointConstraint>& patchConstraints
294  ) const;
295 
296  //- Remove constraints of points next to multi-patch points
297  // to give a bit more freedom of the mesh to conform to the
298  // multi-patch points. Bit dodgy for simple cases.
299  void releasePointsNextToMultiPatch
300  (
301  const label iter,
302  const scalar featureCos,
303 
304  const indirectPrimitivePatch& pp,
305  const scalarField& snapDist,
306 
307  const List<List<point>>& pointFaceCentres,
308  const labelListList& pointFacePatchID,
309 
310  const vectorField& rawPatchAttraction,
311  const List<pointConstraint>& rawPatchConstraints,
312 
313  vectorField& patchAttraction,
314  List<pointConstraint>& patchConstraints
315  ) const;
316 
317  //- Detect any diagonal attraction. Returns indices in face
318  // or (-1, -1) if none
319  labelPair findDiagonalAttraction
320  (
321  const indirectPrimitivePatch& pp,
322  const vectorField& patchAttraction,
323  const List<pointConstraint>& patchConstraints,
324  const label facei
325  ) const;
326 
327  scalar pyrVol
328  (
329  const indirectPrimitivePatch& pp,
330  const vectorField& featureAttraction,
331  const face& localF,
332  const point& cc
333  ) const;
334  void facePoints
335  (
336  const indirectPrimitivePatch& pp,
337  const vectorField& featureAttraction,
338  const vectorField& nearestAttraction,
339  const face& f,
341  ) const;
342  scalar pyrVol
343  (
344  const indirectPrimitivePatch& pp,
345  const vectorField& featureAttraction,
346  const vectorField& nearestAttraction,
347  const face& localF,
348  const point& cc
349  ) const;
350  Tuple2<point, vector> centreAndNormal
351  (
352  const indirectPrimitivePatch& pp,
353  const vectorField& featureAttraction,
354  const vectorField& nearestAttraction,
355  const face& localF
356  ) const;
357  bool isSplitAlignedWithFeature
358  (
359  const scalar featureCos,
360  const point& newPt0,
361  const pointConstraint& pc0,
362  const point& newPt1,
363  const pointConstraint& pc1
364  ) const;
365  bool isConcave
366  (
367  const point& c0,
368  const vector& area0,
369  const point& c1,
370  const vector& area1,
371  const scalar concaveCos
372  ) const;
373  labelPair findDiagonalAttraction
374  (
375  const scalar featureCos,
376  const scalar concaveCos,
377  const scalar minAreaFraction,
378  const indirectPrimitivePatch& pp,
379  const vectorField& patchAttraction,
380  const List<pointConstraint>& patchConstraints,
381  const vectorField& nearestAttraction,
382  const vectorField& nearestNormal,
383  const label faceI,
384 
386  DynamicField<point>& points1
387  ) const;
388 
389  //- Do all logic on whether to add face cut to diagonal
390  // attraction
391  void splitDiagonals
392  (
393  const scalar featureCos,
394  const scalar concaveCos,
395  const scalar minAreaFraction,
396 
397  const indirectPrimitivePatch& pp,
398  const vectorField& nearestAttraction,
399  const vectorField& nearestNormal,
400 
401  vectorField& patchAttraction,
402  List<pointConstraint>& patchConstraints,
403  DynamicList<label>& splitFaces,
404  DynamicList<labelPair>& splits
405  ) const;
406 
407  //- Avoid attraction across face diagonal since would
408  // cause face squeeze
409  void avoidDiagonalAttraction
410  (
411  const label iter,
412  const scalar featureCos,
413  const indirectPrimitivePatch& pp,
414  vectorField& patchAttraction,
415  List<pointConstraint>& patchConstraints
416  ) const;
417 
418  //- Write some stats about constraints
419  void writeStats
420  (
421  const indirectPrimitivePatch& pp,
422  const bitSet& isMasterPoint,
423  const List<pointConstraint>& patchConstraints
424  ) const;
425 
426  //- Return hit if on multiple points
427  pointIndexHit findMultiPatchPoint
428  (
429  const point& pt,
430  const labelList& patchIDs,
431  const List<point>& faceCentres
432  ) const;
433 
434  //- Return hit if faces-on-the-same-normalplane are on multiple
435  // patches
436  pointIndexHit findMultiPatchPoint
437  (
438  const point& pt,
439  const labelList& pfPatchID,
440  const DynamicList<vector>& surfaceNormals,
441  const labelList& faceToNormalBin
442  ) const;
443 
444  //- Return index of similar normal
445  label findNormal
446  (
447  const scalar featureCos,
448  const vector& faceSurfaceNormal,
449  const DynamicList<vector>& surfaceNormals
450  ) const;
451 
452  //- Determine attraction and constraints for single point
453  // using sampled surrounding of the point
454  void featureAttractionUsingReconstruction
455  (
456  const label iter,
457  const scalar featureCos,
458 
459  const indirectPrimitivePatch& pp,
460  const scalarField& snapDist,
461  const vectorField& nearestDisp,
462  const label pointi,
463 
464  const List<List<point>>& pointFaceSurfNormals,
465  const List<List<point>>& pointFaceDisp,
466  const List<List<point>>& pointFaceCentres,
467  const labelListList& pointFacePatchID,
468 
469  DynamicList<point>& surfacePoints,
470  DynamicList<vector>& surfaceNormals,
471  labelList& faceToNormalBin,
472 
473  vector& patchAttraction,
474  pointConstraint& patchConstraint
475  ) const;
476 
477  //- Determine attraction and constraints for all points
478  // using sampled surrounding of the point
479  void featureAttractionUsingReconstruction
480  (
481  const label iter,
482  const scalar featureCos,
483  const indirectPrimitivePatch& pp,
484  const scalarField& snapDist,
485  const vectorField& nearestDisp,
486 
487  const List<List<point>>& pointFaceSurfNormals,
488  const List<List<point>>& pointFaceDisp,
489  const List<List<point>>& pointFaceCentres,
490  const labelListList& pointFacePatchID,
491 
492  vectorField& patchAttraction,
493  List<pointConstraint>& patchConstraints
494  ) const;
495 
496  //- Determine geometric features and attraction to equivalent
497  // surface features
498  void determineFeatures
499  (
500  const label iter,
501  const scalar featureCos,
502  const bool multiRegionFeatureSnap,
503 
504  const indirectPrimitivePatch&,
505  const scalarField& snapDist,
506  const vectorField& nearestDisp,
507 
508  const List<List<point>>& pointFaceSurfNormals,
509  const List<List<point>>& pointFaceDisp,
510  const List<List<point>>& pointFaceCentres,
511  const labelListList& pointFacePatchID,
512 
513  List<labelList>& pointAttractor,
515  // Feature-edge to pp point
516  List<List<DynamicList<point>>>& edgeAttractors,
517  List<List<DynamicList<pointConstraint>>>& edgeConstraints,
518  vectorField& patchAttraction,
519  List<pointConstraint>& patchConstraints
520  ) const;
521 
522  //- Determine features originating from bafles and
523  // and add attraction to equivalent surface features
524  void determineBaffleFeatures
525  (
526  const label iter,
527  const bool baffleFeaturePoints,
528  const scalar featureCos,
529 
530  const indirectPrimitivePatch& pp,
531  const scalarField& snapDist,
532 
533  // Feature-point to pp point
534  List<labelList>& pointAttractor,
536  // Feature-edge to pp point
537  List<List<DynamicList<point>>>& edgeAttractors,
538  List<List<DynamicList<pointConstraint>>>& edgeConstraints,
539  // pp point to nearest feature
540  vectorField& patchAttraction,
541  List<pointConstraint>& patchConstraints
542  ) const;
543  void reverseAttractMeshPoints
544  (
545  const label iter,
546 
547  const indirectPrimitivePatch& pp,
548  const scalarField& snapDist,
549 
550  // Feature-point to pp point
551  const List<labelList>& pointAttractor,
553  // Feature-edge to pp point
554  const List<List<DynamicList<point>>>& edgeAttractors,
556 
557  const vectorField& rawPatchAttraction,
558  const List<pointConstraint>& rawPatchConstraints,
559 
560  // pp point to nearest feature
561  vectorField& patchAttraction,
562  List<pointConstraint>& patchConstraints
563  ) const;
564 
565  //- Find point on nearest feature edge (within searchDist).
566  // Return point and feature
567  // and store feature-edge to mesh-point and vice versa
568  Tuple2<label, pointIndexHit> findNearFeatureEdge
569  (
570  const bool isRegionEdge,
571 
572  const indirectPrimitivePatch& pp,
573  const scalarField& snapDist,
574  const label pointi,
575  const point& estimatedPt,
576 
579  vectorField&,
581  ) const;
582 
583  //- Find nearest feature point (within searchDist).
584  // Return feature point
585  // and store feature-point to mesh-point and vice versa.
586  // If another mesh point already referring to this feature
587  // point and further away, reset that one to a near feature
588  // edge (using findNearFeatureEdge above)
589  Tuple2<label, pointIndexHit> findNearFeaturePoint
590  (
591  const bool isRegionEdge,
592 
593  const indirectPrimitivePatch& pp,
594  const scalarField& snapDist,
595  const label pointi,
596  const point& estimatedPt,
597 
598  // Feature-point to pp point
599  List<labelList>& pointAttractor,
601  // Feature-edge to pp point
602  List<List<DynamicList<point>>>& edgeAttractors,
603  List<List<DynamicList<pointConstraint>>>& edgeConstraints,
604  // pp point to nearest feature
605  vectorField& patchAttraction,
606  List<pointConstraint>& patchConstraints
607  ) const;
608 
609  void featureAttractionUsingFeatureEdges
610  (
611  const label iter,
612  const bool multiRegionFeatureSnap,
613 
614  const bool detectBaffles,
615  const bool baffleFeaturePoints,
616  const bool releasePoints,
617  const bool stringFeatures,
618  const bool avoidDiagonal,
619 
620  const scalar featureCos,
621 
622  const indirectPrimitivePatch& pp,
623  const scalarField& snapDist,
624  const vectorField& nearestDisp,
625  const vectorField& nearestNormal,
626 
627  const List<List<point>>& pointFaceSurfNormals,
628  const List<List<point>>& pointFaceDisp,
629  const List<List<point>>& pointFaceCentres,
630  const labelListList& pointFacePatchID,
631 
632  vectorField& patchAttraction,
633  List<pointConstraint>& patchConstraints
634  ) const;
635 
636  void preventFaceSqueeze
637  (
638  const label iter,
639  const scalar featureCos,
640  const indirectPrimitivePatch& pp,
641  const scalarField& snapDist,
642  const vectorField& nearestAttraction,
643 
644  vectorField& patchAttraction,
645  List<pointConstraint>& patchConstraints
646  ) const;
647 
648  //- Top level feature attraction routine. Gets given
649  // displacement to nearest surface in nearestDisp
650  // and calculates new displacement taking into account
651  // features
652  vectorField calcNearestSurfaceFeature
653  (
654  const snapParameters& snapParams,
655  const bool alignMeshEdges,
656  const label iter,
657  const scalar featureCos,
658  const scalar featureAttract,
659  const scalarField& snapDist,
660  const vectorField& nearestDisp,
661  const vectorField& nearestNormal,
662  motionSmoother& meshMover,
663  vectorField& patchAttraction,
664  List<pointConstraint>& patchConstraints,
665 
666  DynamicList<label>& splitFaces,
667  DynamicList<labelPair>& splits
668  ) const;
669 
670 
671  //- No copy construct
672  snappySnapDriver(const snappySnapDriver&) = delete;
673 
674  //- No copy assignment
675  void operator=(const snappySnapDriver&) = delete;
676 
677 
678 public:
679 
680  //- Runtime type information
681  ClassName("snappySnapDriver");
682 
683 
684  // Constructors
685 
686  //- Construct from components
688  (
689  meshRefinement& meshRefiner,
690  const labelList& globalToMasterPatch,
691  const labelList& globalToSlavePatch,
692  const bool dryRun = false
693  );
694 
695 
696  // Member Functions
697 
698  // Snapping
699 
700  //- Merge baffles.
702 
703  //- Calculate edge length per patch point.
705  (
706  const fvMesh& mesh,
707  const snapParameters& snapParams,
709  );
710 
711  //- Smooth the mesh (patch and internal) to increase visibility
712  // of surface points (on castellated mesh) w.r.t. surface.
713  static void preSmoothPatch
714  (
715  const meshRefinement& meshRefiner,
716  const snapParameters& snapParams,
717  const label nInitErrors,
718  const List<labelPair>& baffles,
720  );
721 
722  //- Helper: calculate average cell centre per point
724  (
725  const fvMesh& mesh,
727  );
728 
729  //- Per patch point override displacement if in gap situation
730  void detectNearSurfaces
731  (
732  const scalar planarCos,
733  const indirectPrimitivePatch&,
734  const pointField& nearestPoint,
735  const vectorField& nearestNormal,
736  vectorField& disp
737  ) const;
738 
739  //- Per patch point calculate point on nearest surface. Set as
740  // boundary conditions of motionSmoother displacement field. Return
741  // displacement of patch points.
742  static vectorField calcNearestSurface
743  (
744  const bool strictRegionSnap,
745  const meshRefinement& meshRefiner,
746  const labelList& globalToMasterPatch,
747  const labelList& globalToSlavePatch,
748  const scalarField& snapDist,
749  const indirectPrimitivePatch&,
750  pointField& nearestPoint,
751  vectorField& nearestNormal
752  );
753 
757  //static vectorField calcNearestLocalSurface
758  //(
759  // const meshRefinement& meshRefiner,
760  // const scalarField& snapDist,
761  // const indirectPrimitivePatch&
762  //);
763 
764  //- Smooth the displacement field to the internal.
765  void smoothDisplacement
766  (
767  const snapParameters& snapParams,
769  ) const;
770 
771  //- Do the hard work: move the mesh according to displacement,
772  // locally relax the displacement. Return true if ended up with
773  // correct mesh, false if not.
774  bool scaleMesh
775  (
776  const snapParameters& snapParams,
777  const label nInitErrors,
778  const List<labelPair>& baffles,
780  );
781 
782  //- Repatch faces according to surface nearest the face centre
783  // - calculate face-wise snap distance as max of point-wise
784  // - calculate face-wise nearest surface point
785  // - repatch face according to patch for surface point.
787  (
788  const snapParameters& snapParams,
789  const labelList& adaptPatchIDs,
790  const labelList& preserveFaces
791  );
792 
793  void doSnap
794  (
795  const dictionary& snapDict,
796  const dictionary& motionDict,
797  const meshRefinement::FaceMergeType mergeType,
798  const scalar featureCos,
799  const scalar planarAngle,
800  const snapParameters& snapParams
801  );
802 };
803 
804 
805 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
806 
807 } // End namespace Foam
808 
809 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
810 
811 #ifdef NoRepository
812 # include "snappySnapDriverTemplates.C"
813 #endif
814 
815 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
816 
817 #endif
818 
819 // ************************************************************************* //
Given a displacement moves the mesh by scaling the displacement back until there are no more mesh err...
const labelList patchIDs(pbm.indices(polyPatchNames, true))
A class for handling file names.
Definition: fileName.H:72
bool scaleMesh(const snapParameters &snapParams, const label nInitErrors, const List< labelPair > &baffles, motionSmoother &)
Do the hard work: move the mesh according to displacement,.
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:68
void doSnap(const dictionary &snapDict, const dictionary &motionDict, const meshRefinement::FaceMergeType mergeType, const scalar featureCos, const scalar planarAngle, const snapParameters &snapParams)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
Definition: stringOps.H:54
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.
This class describes the interaction of an object (often a face) and a point. It carries the info of ...
Definition: pointIndexHit.H:44
Container for data on surfaces used for surface-driven refinement. Contains all the data about the le...
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:45
Application of (multi-)patch point constraints.
A list of faces which address into the list of points.
ClassName("snappySnapDriver")
Runtime type information.
FaceMergeType
Enumeration for what to do with co-planar patch faces on a single.
dynamicFvMesh & mesh
const pointField & points
A class for handling words, derived from Foam::string.
Definition: word.H:63
Simple container to keep together snap specific information.
autoPtr< mapPolyMesh > repatchToSurface(const snapParameters &snapParams, const labelList &adaptPatchIDs, const labelList &preserveFaces)
Repatch faces according to surface nearest the face centre.
void smoothDisplacement(const snapParameters &snapParams, motionSmoother &) const
Smooth the displacement field to the internal.
Dynamically sized Field.
Definition: DynamicField.H:45
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.
Accumulates point constraints through successive applications of the applyConstraint function...
static scalarField calcSnapDistance(const fvMesh &mesh, const snapParameters &snapParams, const indirectPrimitivePatch &)
Calculate edge length per patch point.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
static tmp< pointField > avgCellCentres(const fvMesh &mesh, const indirectPrimitivePatch &)
Helper: calculate average cell centre per point.
labelList f(nPoints)
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
All to do with snapping to surface.
pointField points0(pointIOField(IOobject("points", mesh.time().constant(), polyMesh::meshSubDir, mesh, IOobject::MUST_READ, IOobject::NO_WRITE, IOobject::NO_REGISTER)))
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:59
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
autoPtr< mapPolyMesh > mergeZoneBaffles(const List< labelPair > &)
Merge baffles.
const dimensionedScalar c1
First radiation constant: default SI units: [W/m2].
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
A class for managing temporary objects.
Definition: HashPtrTable.H:50
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
Namespace for OpenFOAM.