meshRefinement.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-2017 OpenFOAM Foundation
9  Copyright (C) 2015-2019 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::meshRefinement
29 
30 Description
31  Helper class which maintains intersections of (changing) mesh with
32  (static) surfaces.
33 
34  Maintains
35  - per face any intersections of the cc-cc segment with any of the surfaces
36 
37 SourceFiles
38  meshRefinement.C
39  meshRefinementBaffles.C
40  meshRefinementGapRefine.C
41  meshRefinementMerge.C
42  meshRefinementProblemCells.C
43  meshRefinementRefine.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef meshRefinement_H
48 #define meshRefinement_H
49 
50 #include "hexRef8.H"
51 #include "mapPolyMesh.H"
52 #include "autoPtr.H"
53 #include "labelPairHashes.H"
54 #include "indirectPrimitivePatch.H"
55 #include "pointFieldsFwd.H"
56 #include "Tuple2.H"
57 #include "pointIndexHit.H"
58 #include "wordPairHashTable.H"
59 #include "surfaceZonesInfo.H"
60 #include "volumeType.H"
61 #include "DynamicField.H"
62 #include "writer.H"
63 
64 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 
66 namespace Foam
67 {
68 
69 // Class forward declarations
70 class fvMesh;
71 class mapDistributePolyMesh;
72 class decompositionMethod;
73 class refinementSurfaces;
74 class refinementFeatures;
75 class shellSurfaces;
76 class removeCells;
77 class fvMeshDistribute;
78 class removePoints;
79 class localPointRegion;
80 class snapParameters;
81 
82 
83 /*---------------------------------------------------------------------------*\
84  Class meshRefinement Declaration
85 \*---------------------------------------------------------------------------*/
86 
87 class meshRefinement
88 {
89 public:
90 
91  // Public data types
92 
93  //- Enumeration for what to debug. Used as a bit-pattern.
94  enum debugType
95  {
96  MESH = (1 << 0),
97  OBJINTERSECTIONS = (1 << 1),
98  FEATURESEEDS = (1 << 2),
99  ATTRACTION = (1 << 3),
100  LAYERINFO = (1 << 4)
101  };
102 
103  static const Enum<debugType> debugTypeNames;
104 
106  //enum outputType
107  //{
108  // OUTPUTLAYERINFO = (1 << 0)
109  //};
110  //
111  //static const Enum<outputType> outputTypeNames;
112 
113  //- Enumeration for what to write. Used as a bit-pattern.
114  enum writeType
115  {
116  WRITEMESH = (1 << 0),
117  NOWRITEREFINEMENT = (1 << 1),
118  WRITELEVELS = (1 << 2),
119  WRITELAYERSETS = (1 << 3),
120  WRITELAYERFIELDS = (1 << 4)
121  };
122 
123  static const Enum<writeType> writeTypeNames;
124 
125  //- Enumeration for how userdata is to be mapped upon refinement.
126  enum mapType
127  {
129  KEEPALL = 2,
130  REMOVE = 4
131  };
132 
133  //- Enumeration for what to do with co-planar patch faces on a single
134  // cell
135  enum FaceMergeType
136  {
137  NONE, // no merging
138  GEOMETRIC, // use feature angle
139  IGNOREPATCH // use feature angle, allow merging of different
140  // patches
141  };
142 
143 
144 private:
145 
146  // Static data members
147 
148  //- Control of writing level
149  static writeType writeLevel_;
150 
152  //static outputType outputLevel_;
153 
154 
155  // Private data
156 
157  //- Reference to mesh
158  fvMesh& mesh_;
159 
160  //- Tolerance used for sorting coordinates (used in 'less' routine)
161  const scalar mergeDistance_;
162 
163  //- Overwrite the mesh?
164  const bool overwrite_;
165 
166  //- Instance of mesh upon construction. Used when in overwrite_ mode.
167  const word oldInstance_;
168 
169  //- All surface-intersection interaction
170  const refinementSurfaces& surfaces_;
171 
172  //- All feature-edge interaction
173  const refinementFeatures& features_;
174 
175  //- All shell-refinement interaction
176  const shellSurfaces& shells_;
177 
178  //- All limit-refinement interaction
179  const shellSurfaces& limitShells_;
180 
181  //- Are we operating in test mode?
182  const bool dryRun_;
183 
184  //- Refinement engine
185  hexRef8 meshCutter_;
186 
187  //- Per cc-cc vector the index of the surface hit
188  labelIOList surfaceIndex_;
189 
190 
191  // For baffle merging
192 
193  //- Original patch for baffle faces that used to be on
194  // coupled patches
195  Map<label> faceToCoupledPatch_;
196 
197 
198  //- User supplied face based data.
199  List<Tuple2<mapType, labelList>> userFaceData_;
200 
201  //- Meshed patches - are treated differently. Stored as wordList since
202  // order changes.
203  wordList meshedPatches_;
204 
205  //- FaceZone to master patch name
206  HashTable<word> faceZoneToMasterPatch_;
207 
208  //- FaceZone to slave patch name
209  HashTable<word> faceZoneToSlavePatch_;
210 
211  //- FaceZone to method to handle faces
213 
214 
215  // Private Member Functions
216 
217  //- Add patchfield of given type to all fields on mesh
218  template<class GeoField>
219  static void addPatchFields(fvMesh&, const word& patchFieldType);
220 
221  //- Reorder patchfields of all fields on mesh
222  template<class GeoField>
223  static void reorderPatchFields(fvMesh&, const labelList& oldToNew);
224 
225  //- Find out which faces have changed given cells (old mesh labels)
226  // that were marked for refinement.
227  static labelList getChangedFaces
228  (
229  const mapPolyMesh&,
230  const labelList& oldCellsToRefine
231  );
232 
233  //- Calculate coupled boundary end vector and refinement level
234  void calcNeighbourData(labelList& neiLevel, pointField& neiCc) const;
235 
236  //- Calculate rays from cell-centre to cell-centre and corresponding
237  // min cell refinement level
238  void calcCellCellRays
239  (
240  const pointField& neiCc,
241  const labelList& neiLevel,
242  const labelList& testFaces,
243  pointField& start,
244  pointField& end,
245  labelList& minLevel
246  ) const;
247 
248  //- Remove cells. Put exposedFaces into exposedPatchIDs.
249  autoPtr<mapPolyMesh> doRemoveCells
250  (
251  const labelList& cellsToRemove,
252  const labelList& exposedFaces,
253  const labelList& exposedPatchIDs,
254  removeCells& cellRemover
255  );
256 
257  //- Get cells which are inside any closed surface. Note that
258  // all closed surfaces
259  // will have already been oriented to have keepPoint outside.
260  labelList getInsideCells(const word&) const;
261 
262  //- Do all to remove inside cells
263  autoPtr<mapPolyMesh> removeInsideCells
264  (
265  const string& msg,
266  const label exposedPatchi
267  );
268 
269 
270  // Refinement candidate selection
271 
272  //- Mark cell for refinement (if not already marked). Return false
273  // if refinelimit hit. Keeps running count (in nRefine) of cells
274  // marked for refinement
275  static bool markForRefine
276  (
277  const label markValue,
278  const label nAllowRefine,
279  label& cellValue,
280  label& nRefine
281  );
282 
283  //- Mark every cell with level of feature passing through it
284  // (or -1 if not passed through). Uses tracking.
285  void markFeatureCellLevel
286  (
287  const pointField& keepPoints,
288  labelList& maxFeatureLevel
289  ) const;
290 
291  //- Calculate list of cells to refine based on intersection of
292  // features.
293  label markFeatureRefinement
294  (
295  const pointField& keepPoints,
296  const label nAllowRefine,
297 
299  label& nRefine
300  ) const;
301 
302  //- Mark cells for distance-to-feature based refinement.
303  label markInternalDistanceToFeatureRefinement
304  (
305  const label nAllowRefine,
307  label& nRefine
308  ) const;
309 
310  //- Mark cells for refinement-shells based refinement.
311  label markInternalRefinement
312  (
313  const label nAllowRefine,
315  label& nRefine
316  ) const;
317 
318  //- Unmark cells for refinement based on limit-shells. Return number
319  // of limited cells.
320  label unmarkInternalRefinement
321  (
323  label& nRefine
324  ) const;
325 
326  //- Collect faces that are intersected and whose neighbours aren't
327  // yet marked for refinement.
328  labelList getRefineCandidateFaces
329  (
330  const labelList& refineCell
331  ) const;
332 
333  //- Mark cells for surface intersection based refinement.
334  label markSurfaceRefinement
335  (
336  const label nAllowRefine,
337  const labelList& neiLevel,
338  const pointField& neiCc,
340  label& nRefine
341  ) const;
342 
343  //- Collect cells intersected by the surface that are candidates
344  // for gap checking. Used inside markSurfaceGapRefinement
345  void collectGapCandidates
346  (
347  const shellSurfaces& shells,
348  const labelList& testFaces,
349  const labelList& neiLevel,
350  const pointField& neiCc,
351  labelList& cellToCompact,
352  labelList& bFaceToCompact,
353  List<FixedList<label, 3>>& shellGapInfo,
354  List<volumeType>& shellGapMode
355  ) const;
356  void collectGapCells
357  (
358  const scalar planarCos,
359 
360  const List<FixedList<label, 3>>& extendedGapLevel,
361  const List<volumeType>& extendedGapMode,
362  const labelList& testFaces,
363  const pointField& start,
364  const pointField& end,
365 
366  const labelList& cellToCompact,
367  const labelList& bFaceToCompact,
368  const List<FixedList<label, 3>>& shellGapInfo,
369  const List<volumeType>& shellGapMode,
370 
371  const label nAllowRefine,
372  const labelList& neiLevel,
373  const pointField& neiCc,
374 
376  label& nRefine
377  ) const;
378 
379 
380  //- Mark cells intersected by the surface if they are inside
381  // close gaps
382  label markSurfaceGapRefinement
383  (
384  const scalar planarCos,
385  const label nAllowRefine,
386  const labelList& neiLevel,
387  const pointField& neiCc,
388 
390  label& nRefine
391  ) const;
392 
393  //- Generate single ray from nearPoint in direction of nearNormal
394  label generateRays
395  (
396  const point& nearPoint,
397  const vector& nearNormal,
398  const FixedList<label, 3>& gapInfo,
399  const volumeType& mode,
400 
401  const label cLevel,
402 
405  ) const;
406 
407  //- Generate pairs of rays through cell centre
408  // Each ray pair has start, end, and expected gap size
409  label generateRays
410  (
411  const bool useSurfaceNormal,
412 
413  const point& nearPoint,
414  const vector& nearNormal,
415  const FixedList<label, 3>& gapInfo,
416  const volumeType& mode,
417 
418  const point& cc,
419  const label cLevel,
420 
423  DynamicField<scalar>& gapSize,
424 
425  DynamicField<point>& start2,
426  DynamicField<point>& end2,
427  DynamicField<scalar>& gapSize2
428  ) const;
429 
430  //- Select candidate cells (cells inside a shell with gapLevel
431  // specified)
432  void selectGapCandidates
433  (
434  const labelList& refineCell,
435  const label nRefine,
436 
437  labelList& cellMap,
438  List<FixedList<label, 3>>& shellGapInfo,
439  List<volumeType>& shellGapMode
440  ) const;
441 
442  //- Merge gap information coming from shell and from surface
443  // (surface wins)
444  void mergeGapInfo
445  (
446  const FixedList<label, 3>& shellGapInfo,
447  const volumeType shellGapMode,
448  const FixedList<label, 3>& surfGapInfo,
449  const volumeType surfGapMode,
450  FixedList<label, 3>& gapInfo,
451  volumeType& gapMode
452  ) const;
453 
454  //- Mark cells for non-surface intersection based gap refinement
455  label markInternalGapRefinement
456  (
457  const scalar planarCos,
458  const bool spreadGapSize,
459  const label nAllowRefine,
461  label& nRefine,
462  labelList& numGapCells,
463  scalarField& gapSize
464  ) const;
465 
466  //- Refine cells containing small gaps
467  label markSmallFeatureRefinement
468  (
469  const scalar planarCos,
470  const label nAllowRefine,
471  const labelList& neiLevel,
472  const pointField& neiCc,
473 
475  label& nRefine
476  ) const;
477 
478  //- Helper: count number of normals1 that are in normals2
479  label countMatches
480  (
481  const List<point>& normals1,
482  const List<point>& normals2,
483  const scalar tol = 1e-6
484  ) const;
485 
486  //- Mark cells for surface curvature based refinement. Marks if
487  // local curvature > curvature or if on different regions
488  // (markDifferingRegions)
489  label markSurfaceCurvatureRefinement
490  (
491  const scalar curvature,
492  const label nAllowRefine,
493  const labelList& neiLevel,
494  const pointField& neiCc,
496  label& nRefine
497  ) const;
498 
499  //- Mark cell if local a gap topology or
500  bool checkProximity
501  (
502  const scalar planarCos,
503  const label nAllowRefine,
504 
505  const label surfaceLevel,
506  const vector& surfaceLocation,
507  const vector& surfaceNormal,
508 
509  const label celli,
510 
511  label& cellMaxLevel,
512  vector& cellMaxLocation,
513  vector& cellMaxNormal,
514 
516  label& nRefine
517  ) const;
518 
519  //- Mark cells for surface proximity based refinement.
520  label markProximityRefinement
521  (
522  const scalar curvature,
523 
524  // Per region the min and max cell level
525  const labelList& surfaceMinLevel,
526  const labelList& surfaceMaxLevel,
527 
528  const label nAllowRefine,
529  const labelList& neiLevel,
530  const pointField& neiCc,
531 
533  label& nRefine
534  ) const;
535 
536  void markMultiRegionCell
537  (
538  const label celli,
539  //const label globalRegion,
540  //const label zonei,
541  const FixedList<label, 3>& surface,
542 
543  Map<FixedList<label, 3>>& cellToRegions,
544  bitSet& isMultiRegion
545  ) const;
546 
547  void detectMultiRegionCells
548  (
549  const labelListList& faceZones,
550  const labelList& testFaces,
551 
552  const labelList& surface1,
553  const List<pointIndexHit>& hit1,
554  const labelList& region1,
555 
556  const labelList& surface2,
557  const List<pointIndexHit>& hit2,
558  const labelList& region2,
559 
560  bitSet& isMultiRegion
561  ) const;
562 
563  //- Mark cells for surface proximity based refinement.
564  label markProximityRefinementWave
565  (
566  const scalar planarCos,
567  const labelList& blockedSurfaces,
568  const label nAllowRefine,
569  const labelList& neiLevel,
570  const pointField& neiCc,
571 
573  label& nRefine
574  ) const;
575 
576 
577  // Baffle handling
578 
579  //- Get faces to repatch. Returns map from face to patch.
580  Map<labelPair> getZoneBafflePatches
581  (
582  const bool allowBoundary,
583  const labelList& globalToMasterPatch,
584  const labelList& globalToSlavePatch
585  ) const;
586 
587  //- Calculate intersections. Return per face -1 or the global
588  // surface region
589  void getIntersections
590  (
591  const labelList& surfacesToTest,
592  const pointField& neiCc,
593  const labelList& testFaces,
594 
595  labelList& globalRegion1,
596  labelList& globalRegion2
597  ) const;
598 
599  //- Calculate intersections on zoned faces. Return per face -1
600  // or the index of the surface and the orientation w.r.t. surface
601  void getIntersections
602  (
603  const labelList& surfacesToTest,
604  const pointField& neiCc,
605  const labelList& testFaces,
606 
607  labelList& namedSurfaceIndex,
608  bitSet& posOrientation
609  ) const;
610 
611  //- Determine patches for baffles
612  void getBafflePatches
613  (
614  const label nErodeCellZones,
615  const labelList& globalToMasterPatch,
616  const pointField& locationsInMesh,
617  const wordList& regionsInMesh,
618 
619  const labelList& neiLevel,
620  const pointField& neiCc,
621  labelList& ownPatch,
622  labelList& neiPatch
623  ) const;
624 
625  autoPtr<mapPolyMesh> splitMesh
626  (
627  const label nBufferLayers,
628  const labelList& globalToMasterPatch,
629  const labelList& globalToSlavePatch,
630  labelList& cellRegion,
631  labelList& ownPatch,
632  labelList& neiPatch
633  );
634 
635  //- Repatches external face or creates baffle for internal face
636  // with user specified patches (might be different for both sides).
637  // Returns label of added face.
638  label createBaffle
639  (
640  const label facei,
641  const label ownPatch,
642  const label neiPatch,
643  polyTopoChange& meshMod
644  ) const;
645 
646  // Problem cell handling
647 
648  //- Helper function to mark face as being on 'boundary'. Used by
649  // markFacesOnProblemCells
650  void markBoundaryFace
651  (
652  const label facei,
653  boolList& isBoundaryFace,
654  boolList& isBoundaryEdge,
655  boolList& isBoundaryPoint
656  ) const;
657 
658  void findNearest
659  (
660  const labelList& meshFaces,
661  List<pointIndexHit>& nearestInfo,
662  labelList& nearestSurface,
663  labelList& nearestRegion,
664  vectorField& nearestNormal
665  ) const;
666 
667  Map<label> findEdgeConnectedProblemCells
668  (
669  const scalarField& perpendicularAngle,
670  const labelList&
671  ) const;
672 
673  bool isCollapsedFace
674  (
675  const pointField&,
676  const pointField& neiCc,
677  const scalar minFaceArea,
678  const scalar maxNonOrtho,
679  const label facei
680  ) const;
681 
682  bool isCollapsedCell
683  (
684  const pointField&,
685  const scalar volFraction,
686  const label celli
687  ) const;
688 
689  //- Returns list with for every internal face -1 or the patch
690  // they should be baffled into. If removeEdgeConnectedCells is set
691  // removes cells based on perpendicularAngle.
692  labelList markFacesOnProblemCells
693  (
694  const dictionary& motionDict,
695  const bool removeEdgeConnectedCells,
696  const scalarField& perpendicularAngle,
697  const labelList& globalToMasterPatch
698  ) const;
699 
700  //- Returns list with for every face the label of the nearest
701  // patch. Any unreached face (disconnected mesh?) becomes
702  // adaptPatchIDs[0]
703  labelList nearestPatch(const labelList& adaptPatchIDs) const;
704 
705  //- Returns list with for every face the label of the nearest
706  // (global) region. Any unreached face (disconnected mesh?) becomes
707  // defaultRegion
708  labelList nearestIntersection
709  (
710  const labelList& surfacesToTest,
711  const label defaultRegion
712  ) const;
713 
714  //- Returns list with for every internal face -1 or the patch
715  // they should be baffled into.
716  labelList markFacesOnProblemCellsGeometric
717  (
718  const snapParameters& snapParams,
719  const dictionary& motionDict,
720  const labelList& globalToMasterPatch,
721  const labelList& globalToSlavePatch
722  ) const;
723 
724 
725  // Baffle merging
726 
727  //- Extract those baffles (duplicate) faces that are on the edge
728  // of a baffle region. These are candidates for merging.
729  List<labelPair> freeStandingBaffles
730  (
731  const List<labelPair>&,
732  const scalar freeStandingAngle
733  ) const;
734 
735 
736  // Zone handling
737 
738  //- Finds zone per cell for cells inside closed named surfaces.
739  // (uses geometric test for insideness)
740  // Adapts namedSurfaceIndex so all faces on boundary of cellZone
741  // have corresponding faceZone.
742  void findCellZoneGeometric
743  (
744  const pointField& neiCc,
745  const labelList& closedNamedSurfaces,
746  labelList& namedSurfaceIndex,
747  const labelList& surfaceToCellZone,
748  labelList& cellToZone
749  ) const;
750 
751  //- Finds zone per cell for cells inside region for which name
752  // is specified.
753  void findCellZoneInsideWalk
754  (
755  const pointField& locationsInMesh,
756  const labelList& zonesInMesh,
757  const labelList& blockedFace, // per face -1 or some index >= 0
758  labelList& cellToZone
759  ) const;
760 
761  //- Finds zone per cell for cells inside region for which name
762  // is specified.
763  void findCellZoneInsideWalk
764  (
765  const pointField& locationsInMesh,
766  const wordList& zoneNamesInMesh,
767  const labelList& faceToZone, // per face -1 or some index >= 0
768  labelList& cellToZone
769  ) const;
770 
771  //- Determines cell zone from cell region information.
772  bool calcRegionToZone
773  (
774  const label backgroundZoneID,
775  const label surfZoneI,
776  const label ownRegion,
777  const label neiRegion,
778 
779  labelList& regionToCellZone
780  ) const;
781 
782  //- Finds zone per cell. Uses topological walk with all faces
783  // marked in unnamedSurfaceRegion (intersections with unnamed
784  // surfaces) and namedSurfaceIndex (intersections with named
785  // surfaces) regarded as blocked.
786  void findCellZoneTopo
787  (
788  const label backgroundZoneID,
789  const pointField& locationsInMesh,
790  const labelList& unnamedSurfaceRegion,
791  const labelList& namedSurfaceIndex,
792  const labelList& surfaceToCellZone,
793  labelList& cellToZone
794  ) const;
795 
796  //- Opposite of findCellTopo: finds assigned cell connected to
797  // an unassigned one and puts it in the background zone.
798  void erodeCellZone
799  (
800  const label nErodeCellZones,
801  const label backgroundZoneID,
802  const labelList& unnamedSurfaceRegion,
803  const labelList& namedSurfaceIndex,
804  labelList& cellToZone
805  ) const;
806 
807  //- Make namedSurfaceIndex consistent with cellToZone
808  // - clear out any blocked faces inbetween same cell zone.
809  void makeConsistentFaceIndex
810  (
811  const labelList& zoneToNamedSurface,
812  const labelList& cellToZone,
813  labelList& namedSurfaceIndex
814  ) const;
815 
816  //- Calculate cellZone allocation
817  void zonify
818  (
819  const bool allowFreeStandingZoneFaces,
820  const label nErodeCellZones,
821  const label backgroundZoneID,
822  const pointField& locationsInMesh,
823  const wordList& zonesInMesh,
824 
825  labelList& cellToZone,
826  labelList& unnamedRegion1,
827  labelList& unnamedRegion2,
828  labelList& namedSurfaceIndex,
829  bitSet& posOrientation
830  ) const;
831 
832  //- Put cells into cellZone, faces into faceZone
833  void zonify
834  (
835  const bitSet& isMasterFace,
836  const labelList& cellToZone,
837  const labelList& neiCellZone,
838  const labelList& faceToZone,
839  const bitSet& meshFlipMap,
840  polyTopoChange& meshMod
841  ) const;
842 
843  //- Allocate faceZoneName
844  void allocateInterRegionFaceZone
845  (
846  const label ownZone,
847  const label neiZone,
848  wordPairHashTable& zonesToFaceZone,
849  LabelPairMap<word>& zoneIDsToFaceZone
850  ) const;
851 
852  //- Remove any loose standing cells
853  void handleSnapProblems
854  (
855  const snapParameters& snapParams,
856  const bool useTopologicalSnapDetection,
857  const bool removeEdgeConnectedCells,
858  const scalarField& perpendicularAngle,
859  const dictionary& motionDict,
860  Time& runTime,
861  const labelList& globalToMasterPatch,
862  const labelList& globalToSlavePatch
863  );
864 
865 
866  // Some patch utilities
867 
868  //- Get all faces in faceToZone that have no cellZone on
869  // either side.
870  labelList freeStandingBaffleFaces
871  (
872  const labelList& faceToZone,
873  const labelList& cellToZone,
874  const labelList& neiCellZone
875  ) const;
876 
877  //- Determine per patch edge the number of master faces. Used
878  // to detect non-manifold situations.
879  void calcPatchNumMasterFaces
880  (
881  const bitSet& isMasterFace,
883  labelList& nMasterFaces
884  ) const;
885 
886  //- Determine per patch face the (singly-) connected zone it
887  // is in. Return overall number of zones.
888  label markPatchZones
889  (
891  const labelList& nMasterFaces,
892  labelList& faceToZone
893  ) const;
894 
895  //- Make faces consistent.
896  void consistentOrientation
897  (
898  const bitSet& isMasterFace,
900  const labelList& nMasterFaces,
901  const labelList& faceToZone,
902  const Map<label>& zoneToOrientation,
903  bitSet& meshFlipMap
904  ) const;
905 
906 
907  //- No copy construct
908  meshRefinement(const meshRefinement&) = delete;
909 
910  //- No copy assignment
911  void operator=(const meshRefinement&) = delete;
912 
913 public:
914 
915  //- Runtime type information
916  ClassName("meshRefinement");
917 
918 
919  // Constructors
920 
921  //- Construct from components
923  (
924  fvMesh& mesh,
925  const scalar mergeDistance,
926  const bool overwrite,
927  const refinementSurfaces&,
928  const refinementFeatures&,
929  const shellSurfaces&, // omnidirectional refinement
930  const shellSurfaces&, // limit refinement
931  const labelUList& checkFaces, // initial faces to check
932  const bool dryRun
933  );
934 
935 
936  // Member Functions
937 
938  // Access
939 
940  //- Reference to mesh
941  const fvMesh& mesh() const
942  {
943  return mesh_;
944  }
945  fvMesh& mesh()
946  {
947  return mesh_;
948  }
949 
950  scalar mergeDistance() const
951  {
952  return mergeDistance_;
953  }
954 
955  //- Overwrite the mesh?
956  bool overwrite() const
957  {
958  return overwrite_;
959  }
960 
961  //- (points)instance of mesh upon construction
962  const word& oldInstance() const
963  {
964  return oldInstance_;
965  }
966 
967  //- Reference to surface search engines
968  const refinementSurfaces& surfaces() const
969  {
970  return surfaces_;
971  }
972 
973  //- Reference to feature edge mesh
974  const refinementFeatures& features() const
975  {
976  return features_;
977  }
978 
979  //- Reference to refinement shells (regions)
980  const shellSurfaces& shells() const
981  {
982  return shells_;
983  }
984 
985  //- Reference to limit shells (regions)
986  const shellSurfaces& limitShells() const
987  {
988  return limitShells_;
989  }
990 
991  //- Reference to meshcutting engine
992  const hexRef8& meshCutter() const
993  {
994  return meshCutter_;
995  }
996 
997  //- Per start-end edge the index of the surface hit
998  const labelList& surfaceIndex() const;
999 
1001 
1002  //- For faces originating from processor faces store the original
1003  // patch
1004  const Map<label>& faceToCoupledPatch() const
1005  {
1006  return faceToCoupledPatch_;
1007  }
1008 
1009  //- Additional face data that is maintained across
1010  // topo changes. Every entry is a list over all faces.
1011  // Bit of a hack. Additional flag to say whether to maintain master
1012  // only (false) or increase set to account for face-from-face.
1014  {
1015  return userFaceData_;
1016  }
1019  {
1020  return userFaceData_;
1021  }
1022 
1023 
1024  // Other
1025 
1026  //- Count number of intersections (local)
1027  label countHits() const;
1028 
1029  //- Redecompose according to cell count
1030  // keepZoneFaces : find all faceZones from zoned surfaces and keep
1031  // owner and neighbour together
1032  // keepBaffles : find all baffles and keep them together
1034  (
1035  const bool keepZoneFaces,
1036  const bool keepBaffles,
1037  const scalarField& cellWeights,
1038  decompositionMethod& decomposer,
1039  fvMeshDistribute& distributor
1040  );
1041 
1042  //- Get faces with intersection.
1043  labelList intersectedFaces() const;
1044 
1045  //- Get points on surfaces with intersection and boundary faces.
1046  labelList intersectedPoints() const;
1047 
1048  //- Create patch from set of patches
1050  (
1051  const polyMesh&,
1052  const labelList&
1053  );
1054 
1055  //- Helper function to make a pointVectorField with correct
1056  // bcs for mesh movement:
1057  // - adaptPatchIDs : fixedValue
1058  // - processor : calculated (so free to move)
1059  // - cyclic/wedge/symmetry : slip
1060  // - other : slip
1062  (
1063  const pointMesh& pMesh,
1064  const labelList& adaptPatchIDs
1065  );
1066 
1067  //- Helper function: check that face zones are synced
1068  static void checkCoupledFaceZones(const polyMesh&);
1069 
1070  //- Helper: calculate edge weights (1/length)
1071  static void calculateEdgeWeights
1072  (
1073  const polyMesh& mesh,
1074  const bitSet& isMasterEdge,
1075  const labelList& meshPoints,
1076  const edgeList& edges,
1077  scalarField& edgeWeights,
1078  scalarField& invSumWeight
1079  );
1080 
1081  //- Helper: weighted sum (over all subset of mesh points) by
1082  // summing contribution from (master) edges
1083  template<class Type>
1084  static void weightedSum
1085  (
1086  const polyMesh& mesh,
1087  const bitSet& isMasterEdge,
1088  const labelList& meshPoints,
1089  const edgeList& edges,
1090  const scalarField& edgeWeights,
1091  const Field<Type>& data,
1092  Field<Type>& sum
1093  );
1094 
1095 
1096  // Refinement
1097 
1098  //- Is local topology a small gap?
1099  bool isGap
1100  (
1101  const scalar,
1102  const vector&,
1103  const vector&,
1104  const vector&,
1105  const vector&
1106  ) const;
1107 
1108  //- Is local topology a small gap normal to the test vector
1109  bool isNormalGap
1110  (
1111  const scalar planarCos,
1112  const label level0,
1113  const vector& point0,
1114  const vector& normal0,
1115  const label level1,
1116  const vector& point1,
1117  const vector& normal1
1118  ) const;
1119 
1120  //- Calculate list of cells to refine.
1122  (
1123  const pointField& keepPoints,
1124  const scalar curvature,
1125  const scalar planarAngle,
1126 
1127  const bool featureRefinement,
1128  const bool featureDistanceRefinement,
1129  const bool internalRefinement,
1130  const bool surfaceRefinement,
1131  const bool curvatureRefinement,
1132  const bool smallFeatureRefinement,
1133  const bool gapRefinement,
1134  const bool bigGapRefinement,
1135  const bool spreadGapSize,
1136  const label maxGlobalCells,
1137  const label maxLocalCells
1138  ) const;
1139 
1140 
1141  // Blocking cells
1142 
1143  //- Mark faces on interface between set and rest
1144  // (and same cell level)
1145  void markOutsideFaces
1146  (
1147  const labelList& cellLevel,
1148  const labelList& neiLevel,
1149  const labelList& refineCell,
1150  bitSet& isOutsideFace
1151  ) const;
1152 
1153  //- Count number of faces on cell that are in set
1155  (
1156  const bitSet& isOutsideFace,
1157  const label celli
1158  ) const;
1159 
1160  //- Add one layer of cells to set
1161  void growSet
1162  (
1163  const labelList& neiLevel,
1164  const bitSet& isOutsideFace,
1166  label& nRefine
1167  ) const;
1168 
1169  //- Detect gapRefinement cells and remove them
1171  (
1172  const scalar planarAngle,
1173  const labelList& minSurfaceLevel,
1174  const labelList& globalToMasterPatch,
1175  const label growIter
1176  );
1177 
1178  //- Refine some cells
1179  autoPtr<mapPolyMesh> refine(const labelList& cellsToRefine);
1180 
1181  //- Refine some cells and rebalance
1183  (
1184  const string& msg,
1185  decompositionMethod& decomposer,
1186  fvMeshDistribute& distributor,
1187  const labelList& cellsToRefine,
1188  const scalar maxLoadUnbalance
1189  );
1190 
1191  //- Balance before refining some cells
1193  (
1194  const string& msg,
1195  decompositionMethod& decomposer,
1196  fvMeshDistribute& distributor,
1197  const labelList& cellsToRefine,
1198  const scalar maxLoadUnbalance
1199  );
1200 
1201  //- Calculate list of cells to directionally refine
1203  (
1204  const label maxGlobalCells,
1205  const label maxLocalCells,
1206  const labelList& currentLevel,
1207  const direction dir
1208  ) const;
1209 
1210  //- Directionally refine in direction cmpt
1212  (
1213  const string& msg,
1214  const direction cmpt,
1215  const labelList& cellsToRefine
1216  );
1217 
1218 
1219  // Baffle handling
1220 
1221  //- Split off unreachable areas of mesh.
1222  void baffleAndSplitMesh
1223  (
1224  const bool handleSnapProblems,
1225 
1226  // How to remove problem snaps
1227  const snapParameters& snapParams,
1228  const bool useTopologicalSnapDetection,
1229  const bool removeEdgeConnectedCells,
1230  const scalarField& perpendicularAngle,
1231  const label nErodeCellZones,
1232  const dictionary& motionDict,
1233  Time& runTime,
1234  const labelList& globalToMasterPatch,
1235  const labelList& globalToSlavePatch,
1236  const pointField& locationsInMesh,
1237  const wordList& regionsInMesh,
1238  const pointField& locationsOutsideMesh,
1239  const writer<scalar>& leakPathFormatter
1240  );
1241 
1242  //- Merge free-standing baffles
1244  (
1245  const snapParameters& snapParams,
1246  const bool useTopologicalSnapDetection,
1247  const bool removeEdgeConnectedCells,
1248  const scalarField& perpendicularAngle,
1249  const scalar planarAngle,
1250  const dictionary& motionDict,
1251  Time& runTime,
1252  const labelList& globalToMasterPatch,
1253  const labelList& globalToSlavePatch,
1254  const pointField& locationsInMesh,
1255  const pointField& locationsOutsideMesh,
1256  const writer<scalar>& leakPathFormatter
1257  );
1258 
1259  //- Split off (with optional buffer layers) unreachable areas
1260  // of mesh. Does not introduce baffles.
1261  autoPtr<mapPolyMesh> splitMesh
1262  (
1263  const label nBufferLayers,
1264  const label nErodeCellZones,
1265  const labelList& globalToMasterPatch,
1266  const labelList& globalToSlavePatch,
1267 
1268  const pointField& locationsInMesh,
1269  const wordList& regionsInMesh,
1270  const pointField& locationsOutsideMesh,
1271  const writer<scalar>& leakPathFormatter
1272  );
1273 
1274  //- Remove cells from limitRegions if level -1
1276  (
1277  const label nBufferLayers,
1278  const label nErodeCellZones,
1279  const labelList& globalToMasterPatch,
1280  const labelList& globalToSlavePatch,
1281  const pointField& locationsInMesh,
1282  const wordList& regionsInMesh
1283  );
1284 
1285  //- Find boundary points that connect to more than one cell
1286  // region and split them.
1288 
1289  //- Find boundary points that connect to more than one cell
1290  // region and split them.
1292 
1293  //- Find boundary points that are on faceZones of type boundary
1294  // and duplicate them
1296 
1297  //- Merge duplicate points
1299  (
1300  const labelList& pointToDuplicate
1301  );
1302 
1303  //- Create baffle for every internal face where ownPatch != -1.
1304  // External faces get repatched according to ownPatch (neiPatch
1305  // should be -1 for these)
1307  (
1308  const labelList& ownPatch,
1309  const labelList& neiPatch
1310  );
1311 
1312  //- Get zones of given type
1314  (
1316  ) const;
1317 
1318  //- Subset baffles according to zones
1320  (
1321  const polyMesh& mesh,
1322  const labelList& zoneIDs,
1323  const List<labelPair>& baffles
1324  );
1325 
1326  //- Create baffles for faces on faceZones. Return created baffles
1327  // (= pairs of faces) and corresponding faceZone
1329  (
1330  const labelList& zoneIDs,
1331  List<labelPair>& baffles,
1332  labelList& originatingFaceZone
1333  );
1334 
1335  //- Merge baffles. Gets pairs of faces and boundary faces to move
1336  // onto (coupled) patches
1338  (
1339  const List<labelPair>&,
1340  const Map<label>& faceToPatch
1341  );
1342 
1343  //- Merge all baffles on faceZones
1345  (
1346  const bool doInternalZones,
1347  const bool doBaffleZones
1348  );
1349 
1350  //- Put faces/cells into zones according to surface specification.
1351  // Returns null if no zone surfaces present. Regions containing
1352  // locationsInMesh/regionsInMesh will be put in corresponding
1353  // cellZone. keepPoints is for backwards compatibility and sets
1354  // all yet unassigned cells to be non-zoned (zone = -1)
1355  autoPtr<mapPolyMesh> zonify
1356  (
1357  const bool allowFreeStandingZoneFaces,
1358  const label nErodeCellZones,
1359  const pointField& locationsInMesh,
1360  const wordList& regionsInMesh,
1361  wordPairHashTable& zonesToFaceZone
1362  );
1363 
1364 
1365  // Other topo changes
1366 
1367  //- Helper:append patch to end of mesh.
1368  static label appendPatch
1369  (
1370  fvMesh&,
1371  const label insertPatchi,
1372  const word&,
1373  const dictionary&
1374  );
1375 
1376  //- Helper:add patch to mesh. Update all registered fields.
1377  // Used by addMeshedPatch to add patches originating from surfaces.
1378  static label addPatch(fvMesh&, const word& name, const dictionary&);
1379 
1380  //- Add patch originating from meshing. Update meshedPatches_.
1381  label addMeshedPatch(const word& name, const dictionary&);
1382 
1383  //- Get patchIDs for patches added in addMeshedPatch.
1384  labelList meshedPatches() const;
1385 
1386  //- Add/lookup faceZone and update information. Return index of
1387  // faceZone
1389  (
1390  const word& fzName,
1391  const word& masterPatch,
1392  const word& slavePatch,
1393  const surfaceZonesInfo::faceZoneType& fzType
1394  );
1395 
1396  //- Lookup faceZone information. Return false if no information
1397  // for faceZone
1398  bool getFaceZoneInfo
1399  (
1400  const word& fzName,
1401  label& masterPatchID,
1402  label& slavePatchID,
1404  ) const;
1405 
1406  //- Select coupled faces that are not collocated
1408 
1409  //- Find any intersection of surface. Store in surfaceIndex_.
1410  void updateIntersections(const labelList& changedFaces);
1411 
1412  //- Find region point is in. Uses optional perturbation to re-test.
1413  static label findRegion
1414  (
1415  const polyMesh&,
1416  const labelList& cellRegion,
1417  const vector& perturbVec,
1418  const point& p
1419  );
1420 
1421  //- Find regions points are in.
1422  // \return number of cells to be removed
1423  static label findRegions
1424  (
1425  const polyMesh&,
1426  const vector& perturbVec,
1427  const pointField& locationsInMesh,
1428  const pointField& locationsOutsideMesh,
1429  const writer<scalar>& leakPathFormatter,
1430  const label nRegions,
1431  labelList& cellRegion,
1432  const boolList& blockedFace
1433  );
1434 
1435  //- Split mesh. Keep part containing point. Return empty map if
1436  // no cells removed.
1438  (
1439  const labelList& globalToMasterPatch,
1440  const labelList& globalToSlavePatch,
1441  const pointField& locationsInMesh,
1442  const pointField& locationsOutsideMesh,
1443  const writer<scalar>& leakPathFormatter
1444  );
1445 
1446  //- Split faces into two
1447  void doSplitFaces
1448  (
1449  const labelList& splitFaces,
1450  const labelPairList& splits,
1451  polyTopoChange& meshMod
1452  ) const;
1453 
1454  //- Split faces along diagonal. Maintain mesh quality. Return
1455  // total number of faces split.
1457  (
1458  const labelList& splitFaces,
1459  const labelPairList& splits,
1460  const dictionary& motionDict,
1461 
1462  labelList& duplicateFace,
1463  List<labelPair>& baffles
1464  );
1465 
1466  //- Update local numbering for mesh redistribution
1467  void distribute(const mapDistributePolyMesh&);
1468 
1469  //- Update for external change to mesh. changedFaces are in new mesh
1470  // face labels.
1471  void updateMesh
1472  (
1473  const mapPolyMesh&,
1474  const labelList& changedFaces
1475  );
1476 
1477  //- Helper: reorder list according to map.
1478  template<class T>
1479  static void updateList
1480  (
1481  const labelList& newToOld,
1482  const T& nullValue,
1483  List<T>& elems
1484  );
1485 
1486 
1487  // Restoring : is where other processes delete and reinsert data.
1488 
1489  //- Signal points/face/cells for which to store data
1490  void storeData
1491  (
1492  const labelList& pointsToStore,
1493  const labelList& facesToStore,
1494  const labelList& cellsToStore
1495  );
1496 
1497  //- Update local numbering + undo
1498  // Data to restore given as new pointlabel + stored pointlabel
1499  // (i.e. what was in pointsToStore)
1500  void updateMesh
1501  (
1502  const mapPolyMesh&,
1503  const labelList& changedFaces,
1504  const Map<label>& pointsToRestore,
1505  const Map<label>& facesToRestore,
1506  const Map<label>& cellsToRestore
1507  );
1508 
1509  // Merging coplanar faces and edges
1510 
1511  //- Merge coplanar faces if sets are of size mergeSize
1512  // (usually 4)
1514  (
1515  const scalar minCos,
1516  const scalar concaveCos,
1517  const label mergeSize,
1518  const labelList& patchIDs,
1519  const meshRefinement::FaceMergeType mergeType
1520  );
1521 
1522  //- Merge coplanar faces. preserveFaces is != -1 for faces
1523  // to be preserved
1525  (
1526  const scalar minCos,
1527  const scalar concaveCos,
1528  const labelList& patchIDs,
1529  const dictionary& motionDict,
1530  const labelList& preserveFaces,
1531  const meshRefinement::FaceMergeType mergeType
1532  );
1533 
1535  (
1536  removePoints& pointRemover,
1537  const boolList& pointCanBeDeleted
1538  );
1539 
1541  (
1542  removePoints& pointRemover,
1543  const labelList& facesToRestore
1544  );
1545 
1547  (
1548  const labelList& candidateFaces,
1549  const labelHashSet& set
1550  ) const;
1551 
1552  // Pick up faces of cells of faces in set.
1554  (
1555  const labelUList& set
1556  ) const;
1557 
1558  // Pick up faces of cells of faces in set.
1560  (
1561  const labelHashSet& set
1562  ) const;
1563 
1564  //- Merge edges, maintain mesh quality. Return global number
1565  // of edges merged
1567  (
1568  const scalar minCos,
1569  const dictionary& motionDict
1570  );
1571 
1572 
1573  // Debug/IO
1574 
1575  //- Debugging: check that all faces still obey start()>end()
1576  void checkData();
1577 
1578  static void testSyncPointList
1579  (
1580  const string& msg,
1581  const polyMesh& mesh,
1582  const List<scalar>& fld
1583  );
1584 
1585  static void testSyncPointList
1586  (
1587  const string& msg,
1588  const polyMesh& mesh,
1589  const List<point>& fld
1590  );
1591 
1592  //- Compare two lists over all boundary faces
1593  template<class T>
1595  (
1596  const scalar mergeDistance,
1597  const string&,
1598  const UList<T>&,
1599  const UList<T>&
1600  ) const;
1601 
1602  //- Print list according to (collected and) sorted coordinate
1603  template<class T>
1604  static void collectAndPrint
1605  (
1606  const UList<point>& points,
1607  const UList<T>& data
1608  );
1609 
1610  //- Determine master point for subset of points. If coupled
1611  // chooses only one
1612  static bitSet getMasterPoints
1613  (
1614  const polyMesh& mesh,
1615  const labelList& meshPoints
1616  );
1617 
1618  //- Determine master edge for subset of edges. If coupled
1619  // chooses only one
1620  static bitSet getMasterEdges
1621  (
1622  const polyMesh& mesh,
1623  const labelList& meshEdges
1624  );
1625 
1626  //- Print some mesh stats.
1627  void printMeshInfo(const bool, const string&) const;
1628 
1629  //- Replacement for Time::timeName() that returns oldInstance
1630  //- (if overwrite_)
1631  word timeName() const;
1632 
1633  //- Set instance of all local IOobjects
1634  void setInstance(const fileName&);
1635 
1636  //- Write mesh and all data
1637  bool write() const;
1638 
1639  //- Write refinement level as volScalarFields for postprocessing
1640  void dumpRefinementLevel() const;
1641 
1642  //- Debug: Write intersection information to OBJ format
1643  void dumpIntersections(const fileName& prefix) const;
1644 
1645  //- Do any one of above IO functions
1646  void write
1647  (
1648  const debugType debugFlags,
1649  const writeType writeFlags,
1650  const fileName&
1651  ) const;
1652 
1653  //- Helper: remove all relevant files from mesh instance
1654  static void removeFiles(const polyMesh&);
1655 
1656  //- Helper: calculate average
1657  template<class T>
1658  static T gAverage
1659  (
1660  const bitSet& isMasterElem,
1661  const UList<T>& values
1662  );
1663 
1664  //- Get/set write level
1665  static writeType writeLevel();
1666  static void writeLevel(const writeType);
1667 
1669  //static outputType outputLevel();
1670  //static void outputLevel(const outputType);
1671 
1672 
1673  //- Helper: convert wordList into bit pattern using provided Enum
1674  template<class EnumContainer>
1675  static int readFlags
1676  (
1677  const EnumContainer& namedEnum,
1678  const wordList& words
1679  );
1680 
1681  //- Wrapper around dictionary::get which does not exit
1682  template<class Type>
1683  static Type get
1684  (
1685  const dictionary& dict,
1686  const word& keyword,
1687  const bool noExit,
1688  enum keyType::option matchOpt = keyType::REGEX,
1689  const Type& defaultValue = Zero
1690  );
1691 
1692  //- Wrapper around dictionary::subDict which does not exit
1693  static const dictionary& subDict
1694  (
1695  const dictionary& dict,
1696  const word& keyword,
1697  const bool noExit
1698  );
1699 
1700  //- Wrapper around dictionary::lookup which does not exit
1701  static ITstream& lookup
1702  (
1703  const dictionary& dict,
1704  const word& keyword,
1705  const bool noExit
1706  );
1707 };
1708 
1709 
1710 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1711 
1712 } // End namespace Foam
1713 
1714 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1715 
1716 #ifdef NoRepository
1717  #include "meshRefinementTemplates.C"
1718 #endif
1719 
1720 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1721 
1722 #endif
1723 
1724 // ************************************************************************* //
Foam::meshRefinement::shells
const shellSurfaces & shells() const
Reference to refinement shells (regions)
Definition: meshRefinement.H:979
Foam::meshRefinement::mergePoints
autoPtr< mapPolyMesh > mergePoints(const labelList &pointToDuplicate)
Merge duplicate points.
Definition: meshRefinementBaffles.C:4285
Foam::meshRefinement::removeGapCells
autoPtr< mapPolyMesh > removeGapCells(const scalar planarAngle, const labelList &minSurfaceLevel, const labelList &globalToMasterPatch, const label growIter)
Detect gapRefinement cells and remove them.
Definition: meshRefinementBlock.C:928
Foam::meshRefinement::WRITELEVELS
Definition: meshRefinement.H:117
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::meshRefinement::userFaceData
const List< Tuple2< mapType, labelList > > & userFaceData() const
Additional face data that is maintained across.
Definition: meshRefinement.H:1012
Foam::meshRefinement::mergePatchFacesUndo
label mergePatchFacesUndo(const scalar minCos, const scalar concaveCos, const labelList &patchIDs, const dictionary &motionDict, const labelList &preserveFaces, const meshRefinement::FaceMergeType mergeType)
Merge coplanar faces. preserveFaces is != -1 for faces.
Definition: meshRefinementMerge.C:250
Foam::meshRefinement::userFaceData
List< Tuple2< mapType, labelList > > & userFaceData()
Definition: meshRefinement.H:1017
Foam::meshRefinement::weightedSum
static void weightedSum(const polyMesh &mesh, const bitSet &isMasterEdge, const labelList &meshPoints, const edgeList &edges, const scalarField &edgeWeights, const Field< Type > &data, Field< Type > &sum)
Helper: weighted sum (over all subset of mesh points) by.
Definition: meshRefinementTemplates.C:271
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::meshRefinement::growFaceCellFace
labelList growFaceCellFace(const labelUList &set) const
Definition: meshRefinementMerge.C:817
Foam::Enum< debugType >
pointIndexHit.H
Foam::localPointRegion
Takes mesh with 'baffles' (= boundary faces sharing points). Determines for selected points on bounda...
Definition: localPointRegion.H:69
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::meshRefinement::gAverage
static T gAverage(const bitSet &isMasterElem, const UList< T > &values)
Helper: calculate average.
Definition: meshRefinementTemplates.C:62
Foam::meshRefinement::WRITEMESH
Definition: meshRefinement.H:115
Foam::surfaceZonesInfo::faceZoneType
faceZoneType
What to do with faceZone faces.
Definition: surfaceZonesInfo.H:76
Foam::meshRefinement::dumpIntersections
void dumpIntersections(const fileName &prefix) const
Debug: Write intersection information to OBJ format.
Definition: meshRefinement.C:3270
Foam::meshRefinement::createBaffles
autoPtr< mapPolyMesh > createBaffles(const labelList &ownPatch, const labelList &neiPatch)
Create baffle for every internal face where ownPatch != -1.
Definition: meshRefinementBaffles.C:481
Foam::meshRefinement::isNormalGap
bool isNormalGap(const scalar planarCos, const label level0, const vector &point0, const vector &normal0, const label level1, const vector &point1, const vector &normal1) const
Is local topology a small gap normal to the test vector.
Definition: meshRefinementRefine.C:1575
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::bitSet
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:64
Foam::meshRefinement::findRegion
static label findRegion(const polyMesh &, const labelList &cellRegion, const vector &perturbVec, const point &p)
Find region point is in. Uses optional perturbation to re-test.
Definition: meshRefinement.C:2445
Foam::meshRefinement::NONE
Definition: meshRefinement.H:136
Foam::removePoints
Removes selected points from mesh and updates faces using these points.
Definition: removePoints.H:60
Tuple2.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::meshRefinement::intersectedPoints
labelList intersectedPoints() const
Get points on surfaces with intersection and boundary faces.
Definition: meshRefinement.C:1803
Foam::Zero
static constexpr const zero Zero
Global zero.
Definition: zero.H:128
Foam::removeCells
Given list of cells to remove, insert all the topology changes.
Definition: removeCells.H:63
Foam::HashTableOps::values
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Definition: HashOps.H:149
Foam::meshRefinement::collectFaces
labelList collectFaces(const labelList &candidateFaces, const labelHashSet &set) const
Definition: meshRefinementMerge.C:754
mapPolyMesh.H
Foam::meshRefinement::writeLevel
static writeType writeLevel()
Get/set write level.
Definition: meshRefinement.C:3395
Foam::meshRefinement::intersectedFaces
labelList intersectedFaces() const
Get faces with intersection.
Definition: meshRefinement.C:1775
Foam::meshRefinement::printMeshInfo
void printMeshInfo(const bool, const string &) const
Print some mesh stats.
Definition: meshRefinement.C:3144
Foam::meshRefinement::addFaceZone
label addFaceZone(const word &fzName, const word &masterPatch, const word &slavePatch, const surfaceZonesInfo::faceZoneType &fzType)
Add/lookup faceZone and update information. Return index of.
Definition: meshRefinement.C:2366
Foam::meshRefinement::countFaceDirs
label countFaceDirs(const bitSet &isOutsideFace, const label celli) const
Count number of faces on cell that are in set.
Definition: meshRefinementBlock.C:222
Foam::meshRefinement::REMOVE
set value to -1 any face that was refined
Definition: meshRefinement.H:129
Foam::meshRefinement::getZones
labelList getZones(const List< surfaceZonesInfo::faceZoneType > &fzTypes) const
Get zones of given type.
Definition: meshRefinementBaffles.C:656
Foam::meshRefinement::ATTRACTION
Definition: meshRefinement.H:98
Foam::surfaceLocation
Contains information about location on a triSurface.
Definition: surfaceLocation.H:75
Foam::polyTopoChange
Direct mesh changes based on v1.3 polyTopoChange syntax.
Definition: polyTopoChange.H:100
Foam::meshRefinement::countHits
label countHits() const
Count number of intersections (local)
Definition: meshRefinement.C:1504
Foam::Map< label >
Foam::meshRefinement::splitFacesUndo
label splitFacesUndo(const labelList &splitFaces, const labelPairList &splits, const dictionary &motionDict, labelList &duplicateFace, List< labelPair > &baffles)
Split faces along diagonal. Maintain mesh quality. Return.
Definition: meshRefinement.C:1064
Foam::meshRefinement::balanceAndRefine
autoPtr< mapDistributePolyMesh > balanceAndRefine(const string &msg, decompositionMethod &decomposer, fvMeshDistribute &distributor, const labelList &cellsToRefine, const scalar maxLoadUnbalance)
Balance before refining some cells.
Definition: meshRefinementRefine.C:2483
Foam::meshRefinement::mergePatchFaces
label mergePatchFaces(const scalar minCos, const scalar concaveCos, const label mergeSize, const labelList &patchIDs, const meshRefinement::FaceMergeType mergeType)
Merge coplanar faces if sets are of size mergeSize.
Definition: meshRefinementMerge.C:42
Foam::meshRefinement::refineAndBalance
autoPtr< mapDistributePolyMesh > refineAndBalance(const string &msg, decompositionMethod &decomposer, fvMeshDistribute &distributor, const labelList &cellsToRefine, const scalar maxLoadUnbalance)
Refine some cells and rebalance.
Definition: meshRefinementRefine.C:2382
Foam::meshRefinement::oldInstance
const word & oldInstance() const
(points)instance of mesh upon construction
Definition: meshRefinement.H:961
Foam::HashSet< label, Hash< label > >
Foam::meshRefinement::mesh
const fvMesh & mesh() const
Reference to mesh.
Definition: meshRefinement.H:940
Foam::meshRefinement::removeLimitShells
autoPtr< mapPolyMesh > removeLimitShells(const label nBufferLayers, const label nErodeCellZones, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const pointField &locationsInMesh, const wordList &regionsInMesh)
Remove cells from limitRegions if level -1.
Definition: meshRefinementBaffles.C:4132
Foam::meshRefinement::removeFiles
static void removeFiles(const polyMesh &)
Helper: remove all relevant files from mesh instance.
Definition: meshRefinement.C:3371
Foam::meshRefinement::addPatch
static label addPatch(fvMesh &, const word &name, const dictionary &)
Helper:add patch to mesh. Update all registered fields.
Definition: meshRefinement.C:2211
Foam::meshRefinement::doSplitFaces
void doSplitFaces(const labelList &splitFaces, const labelPairList &splits, polyTopoChange &meshMod) const
Split faces into two.
Definition: meshRefinement.C:945
zoneIDs
const labelIOList & zoneIDs
Definition: correctPhi.H:59
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::meshRefinement::updateList
static void updateList(const labelList &newToOld, const T &nullValue, List< T > &elems)
Helper: reorder list according to map.
Definition: meshRefinementTemplates.C:38
Foam::meshRefinement::NOWRITEREFINEMENT
Definition: meshRefinement.H:116
Foam::meshRefinement::subsetBaffles
static List< labelPair > subsetBaffles(const polyMesh &mesh, const labelList &zoneIDs, const List< labelPair > &baffles)
Subset baffles according to zones.
Definition: meshRefinementBaffles.C:683
Foam::meshRefinement::FaceMergeType
FaceMergeType
Enumeration for what to do with co-planar patch faces on a single.
Definition: meshRefinement.H:134
Foam::meshRefinement::getMasterEdges
static bitSet getMasterEdges(const polyMesh &mesh, const labelList &meshEdges)
Determine master edge for subset of edges. If coupled.
Definition: meshRefinement.C:3109
Foam::meshRefinement::refineCandidates
labelList refineCandidates(const pointField &keepPoints, const scalar curvature, const scalar planarAngle, const bool featureRefinement, const bool featureDistanceRefinement, const bool internalRefinement, const bool surfaceRefinement, const bool curvatureRefinement, const bool smallFeatureRefinement, const bool gapRefinement, const bool bigGapRefinement, const bool spreadGapSize, const label maxGlobalCells, const label maxLocalCells) const
Calculate list of cells to refine.
Definition: meshRefinementRefine.C:2032
Foam::meshRefinement::growSet
void growSet(const labelList &neiLevel, const bitSet &isOutsideFace, labelList &refineCell, label &nRefine) const
Add one layer of cells to set.
Definition: meshRefinementBlock.C:273
Foam::DynamicField
Dynamically sized Field.
Definition: DynamicField.H:51
Foam::meshRefinement::calculateEdgeWeights
static void calculateEdgeWeights(const polyMesh &mesh, const bitSet &isMasterEdge, const labelList &meshPoints, const edgeList &edges, scalarField &edgeWeights, scalarField &invSumWeight)
Helper: calculate edge weights (1/length)
Definition: meshRefinement.C:2057
Foam::mode
mode_t mode(const fileName &name, const bool followLink=true)
Return the file mode, normally following symbolic links.
Definition: MSwindows.C:564
Foam::meshRefinement::findRegions
static label findRegions(const polyMesh &, const vector &perturbVec, const pointField &locationsInMesh, const pointField &locationsOutsideMesh, const writer< scalar > &leakPathFormatter, const label nRegions, labelList &cellRegion, const boolList &blockedFace)
Find regions points are in.
Definition: meshRefinement.C:2482
Foam::snapParameters
Simple container to keep together snap specific information.
Definition: snapParameters.H:52
Foam::meshRefinement::OBJINTERSECTIONS
Definition: meshRefinement.H:96
Foam::meshRefinement::FEATURESEEDS
Definition: meshRefinement.H:97
Foam::shellSurfaces
Encapsulates queries for volume refinement ('refine all cells within shell').
Definition: shellSurfaces.H:57
volumeType.H
labelPairHashes.H
A HashTable to objects of type <T> with a labelPair key. The hashing is based on labelPair (FixedList...
Foam::meshRefinement::timeName
word timeName() const
Definition: meshRefinement.C:3197
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:62
Foam::volumeType
An enumeration wrapper for classification of a location as being inside/outside of a volume.
Definition: volumeType.H:60
Foam::Field< vector >
Foam::meshRefinement::checkCoupledFaceZones
static void checkCoupledFaceZones(const polyMesh &)
Helper function: check that face zones are synced.
Definition: meshRefinement.C:1969
Foam::ITstream
An input stream of tokens.
Definition: ITstream.H:55
Foam::meshRefinement::LAYERINFO
Definition: meshRefinement.H:99
Foam::meshRefinement::readFlags
static int readFlags(const EnumContainer &namedEnum, const wordList &words)
Helper: convert wordList into bit pattern using provided Enum.
Definition: meshRefinementTemplates.C:253
Foam::meshRefinement::directionalRefine
autoPtr< mapPolyMesh > directionalRefine(const string &msg, const direction cmpt, const labelList &cellsToRefine)
Directionally refine in direction cmpt.
Definition: meshRefinementRefine.C:2743
Foam::meshRefinement::mapType
mapType
Enumeration for how userdata is to be mapped upon refinement.
Definition: meshRefinement.H:125
hexRef8.H
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::meshRefinement::surfaceIndex
const labelList & surfaceIndex() const
Per start-end edge the index of the surface hit.
Definition: meshRefinement.C:1481
Foam::meshRefinement::appendPatch
static label appendPatch(fvMesh &, const label insertPatchi, const word &, const dictionary &)
Helper:append patch to end of mesh.
Definition: meshRefinement.C:2113
Foam::meshRefinement::faceToCoupledPatch
const Map< label > & faceToCoupledPatch() const
For faces originating from processor faces store the original.
Definition: meshRefinement.H:1003
Foam::meshRefinement::meshedPatches
labelList meshedPatches() const
Get patchIDs for patches added in addMeshedPatch.
Definition: meshRefinement.C:2339
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::meshRefinement::doRemovePoints
autoPtr< mapPolyMesh > doRemovePoints(removePoints &pointRemover, const boolList &pointCanBeDeleted)
Definition: meshRefinementMerge.C:622
Foam::meshRefinement::directionalRefineCandidates
labelList directionalRefineCandidates(const label maxGlobalCells, const label maxLocalCells, const labelList &currentLevel, const direction dir) const
Calculate list of cells to directionally refine.
Definition: meshRefinementRefine.C:2643
Foam::meshRefinement::ClassName
ClassName("meshRefinement")
Runtime type information.
fld
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Definition: gmvOutputLagrangian.H:23
Foam::meshRefinement::mergeEdgesUndo
label mergeEdgesUndo(const scalar minCos, const dictionary &motionDict)
Merge edges, maintain mesh quality. Return global number.
Definition: meshRefinementMerge.C:864
Foam::meshRefinement::distribute
void distribute(const mapDistributePolyMesh &)
Update local numbering for mesh redistribution.
Definition: meshRefinement.C:2836
meshRefinementTemplates.C
indirectPrimitivePatch.H
Foam::meshRefinement::collectAndPrint
static void collectAndPrint(const UList< point > &points, const UList< T > &data)
Print list according to (collected and) sorted coordinate.
Definition: meshRefinementTemplates.C:162
surfaceZonesInfo.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::meshRefinement::writeTypeNames
static const Enum< writeType > writeTypeNames
Definition: meshRefinement.H:122
Foam::meshRefinement::mergeZoneBaffles
autoPtr< mapPolyMesh > mergeZoneBaffles(const bool doInternalZones, const bool doBaffleZones)
Merge all baffles on faceZones.
Definition: meshRefinementBaffles.C:1330
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::meshRefinement::makePatch
static autoPtr< indirectPrimitivePatch > makePatch(const polyMesh &, const labelList &)
Create patch from set of patches.
Definition: meshRefinement.C:1874
Foam::decompositionMethod
Abstract base class for domain decomposition.
Definition: decompositionMethod.H:51
stdFoam::end
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
Definition: stdFoam.H:115
Foam::writer< scalar >
Foam::meshRefinement::testSyncBoundaryFaceList
void testSyncBoundaryFaceList(const scalar mergeDistance, const string &, const UList< T > &, const UList< T > &) const
Compare two lists over all boundary faces.
Definition: meshRefinementTemplates.C:105
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam::meshRefinement::mergeDistance
scalar mergeDistance() const
Definition: meshRefinement.H:949
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::pointMesh
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:50
Foam::meshRefinement::updateMesh
void updateMesh(const mapPolyMesh &, const labelList &changedFaces)
Update for external change to mesh. changedFaces are in new mesh.
Definition: meshRefinement.C:2898
Foam::meshRefinement::balance
autoPtr< mapDistributePolyMesh > balance(const bool keepZoneFaces, const bool keepBaffles, const scalarField &cellWeights, decompositionMethod &decomposer, fvMeshDistribute &distributor)
Redecompose according to cell count.
Definition: meshRefinement.C:1525
Foam::meshRefinement::setInstance
void setInstance(const fileName &)
Set instance of all local IOobjects.
Definition: meshRefinement.C:877
Foam::HashTable
A HashTable similar to std::unordered_map.
Definition: HashTable.H:105
Foam::meshRefinement::WRITELAYERFIELDS
Definition: meshRefinement.H:119
Foam::meshRefinement::selectSeparatedCoupledFaces
void selectSeparatedCoupledFaces(boolList &) const
Select coupled faces that are not collocated.
Definition: meshRefinement.C:2418
Foam::meshRefinement::features
const refinementFeatures & features() const
Reference to feature edge mesh.
Definition: meshRefinement.H:973
Foam::meshRefinement::meshCutter
const hexRef8 & meshCutter() const
Reference to meshcutting engine.
Definition: meshRefinement.H:991
Foam::meshRefinement::isGap
bool isGap(const scalar, const vector &, const vector &, const vector &, const vector &) const
Is local topology a small gap?
Definition: meshRefinementRefine.C:1528
wordPairHashTable.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::meshRefinement::baffleAndSplitMesh
void baffleAndSplitMesh(const bool handleSnapProblems, const snapParameters &snapParams, const bool useTopologicalSnapDetection, const bool removeEdgeConnectedCells, const scalarField &perpendicularAngle, const label nErodeCellZones, const dictionary &motionDict, Time &runTime, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const pointField &locationsInMesh, const wordList &regionsInMesh, const pointField &locationsOutsideMesh, const writer< scalar > &leakPathFormatter)
Split off unreachable areas of mesh.
Definition: meshRefinementBaffles.C:3553
Foam::meshRefinement::dupNonManifoldBoundaryPoints
autoPtr< mapPolyMesh > dupNonManifoldBoundaryPoints()
Find boundary points that are on faceZones of type boundary.
Definition: meshRefinementBaffles.C:4354
Foam::meshRefinement::mergeFreeStandingBaffles
void mergeFreeStandingBaffles(const snapParameters &snapParams, const bool useTopologicalSnapDetection, const bool removeEdgeConnectedCells, const scalarField &perpendicularAngle, const scalar planarAngle, const dictionary &motionDict, Time &runTime, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const pointField &locationsInMesh, const pointField &locationsOutsideMesh, const writer< scalar > &leakPathFormatter)
Merge free-standing baffles.
Definition: meshRefinementBaffles.C:3734
Foam::refineCell
Container with cells to refine. Refinement given as single direction.
Definition: refineCell.H:58
DynamicField.H
Foam::meshRefinement::mesh
fvMesh & mesh()
Definition: meshRefinement.H:944
Foam::meshRefinement::lookup
static ITstream & lookup(const dictionary &dict, const word &keyword, const bool noExit)
Wrapper around dictionary::lookup which does not exit.
Definition: meshRefinement.C:3456
Foam::hexRef8
Refinement of (split) hexes using polyTopoChange.
Definition: hexRef8.H:67
Foam::meshRefinement::mergeBaffles
autoPtr< mapPolyMesh > mergeBaffles(const List< labelPair > &, const Map< label > &faceToPatch)
Merge baffles. Gets pairs of faces and boundary faces to move.
Definition: meshRefinementBaffles.C:1150
Foam::refinementFeatures
Encapsulates queries for features.
Definition: refinementFeatures.H:53
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::Vector< scalar >
Foam::meshRefinement::writeType
writeType
Enumeration for what to write. Used as a bit-pattern.
Definition: meshRefinement.H:113
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:102
Foam::meshRefinement::splitMeshRegions
autoPtr< mapPolyMesh > splitMeshRegions(const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const pointField &locationsInMesh, const pointField &locationsOutsideMesh, const writer< scalar > &leakPathFormatter)
Split mesh. Keep part containing point. Return empty map if.
Definition: meshRefinement.C:2731
Foam::start
label ListType::const_reference const label start
Definition: ListOps.H:408
Foam::FixedList< label, 3 >
pointFieldsFwd.H
Forwards and collection of common point field types.
Foam::meshRefinement::checkData
void checkData()
Debugging: check that all faces still obey start()>end()
Definition: meshRefinement.C:670
Foam::meshRefinement
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
Definition: meshRefinement.H:86
Foam::UList< label >
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::meshRefinement::createZoneBaffles
autoPtr< mapPolyMesh > createZoneBaffles(const labelList &zoneIDs, List< labelPair > &baffles, labelList &originatingFaceZone)
Create baffles for faces on faceZones. Return created baffles.
Definition: meshRefinementBaffles.C:716
Foam::constant::electromagnetic::e
const dimensionedScalar e
Elementary charge.
Definition: createFields.H:11
Foam::meshRefinement::write
bool write() const
Write mesh and all data.
Definition: meshRefinement.C:3037
Foam::keyType::REGEX
Regular expression.
Definition: keyType.H:74
Foam::IOList< label >
Foam::sum
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
Definition: DimensionedFieldFunctions.C:327
Foam::direction
uint8_t direction
Definition: direction.H:47
Foam::meshRefinement::addMeshedPatch
label addMeshedPatch(const word &name, const dictionary &)
Add patch originating from meshing. Update meshedPatches_.
Definition: meshRefinement.C:2289
Foam::meshRefinement::storeData
void storeData(const labelList &pointsToStore, const labelList &facesToStore, const labelList &cellsToStore)
Signal points/face/cells for which to store data.
Definition: meshRefinement.C:2910
Foam::meshRefinement::limitShells
const shellSurfaces & limitShells() const
Reference to limit shells (regions)
Definition: meshRefinement.H:985
Foam::meshRefinement::testSyncPointList
static void testSyncPointList(const string &msg, const polyMesh &mesh, const List< scalar > &fld)
Definition: meshRefinement.C:577
Foam::meshRefinement::KEEPALL
have slaves (upon refinement) from master
Definition: meshRefinement.H:128
Foam::meshRefinement::MASTERONLY
maintain master only
Definition: meshRefinement.H:127
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:160
Foam::meshRefinement::doRestorePoints
autoPtr< mapPolyMesh > doRestorePoints(removePoints &pointRemover, const labelList &facesToRestore)
Definition: meshRefinementMerge.C:680
Foam::meshRefinement::refine
autoPtr< mapPolyMesh > refine(const labelList &cellsToRefine)
Refine some cells.
Definition: meshRefinementRefine.C:2340
Foam::meshRefinement::updateIntersections
void updateIntersections(const labelList &changedFaces)
Find any intersection of surface. Store in surfaceIndex_.
Definition: meshRefinement.C:274
Foam::meshRefinement::markOutsideFaces
void markOutsideFaces(const labelList &cellLevel, const labelList &neiLevel, const labelList &refineCell, bitSet &isOutsideFace) const
Mark faces on interface between set and rest.
Definition: meshRefinementBlock.C:164
Foam::mapDistributePolyMesh
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Definition: mapDistributePolyMesh.H:66
writer.H
Foam::meshRefinement::debugTypeNames
static const Enum< debugType > debugTypeNames
Definition: meshRefinement.H:102
Foam::meshRefinement::dupNonManifoldPoints
autoPtr< mapPolyMesh > dupNonManifoldPoints()
Find boundary points that connect to more than one cell.
Definition: meshRefinementBaffles.C:4275
Foam::meshRefinement::WRITELAYERSETS
Definition: meshRefinement.H:118
Foam::refinementSurfaces
Container for data on surfaces used for surface-driven refinement. Contains all the data about the le...
Definition: refinementSurfaces.H:63
Foam::meshRefinement::subDict
static const dictionary & subDict(const dictionary &dict, const word &keyword, const bool noExit)
Wrapper around dictionary::subDict which does not exit.
Definition: meshRefinement.C:3420
Foam::meshRefinement::IGNOREPATCH
Definition: meshRefinement.H:138
Foam::meshRefinement::makeDisplacementField
static tmp< pointVectorField > makeDisplacementField(const pointMesh &pMesh, const labelList &adaptPatchIDs)
Helper function to make a pointVectorField with correct.
Definition: meshRefinement.C:1916
Foam::meshRefinement::GEOMETRIC
Definition: meshRefinement.H:137
Foam::fvMeshDistribute
Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.
Definition: fvMeshDistribute.H:73
Foam::data
Database for solution data, solver performance and other reduced data.
Definition: data.H:54
Foam::meshRefinement::MESH
Definition: meshRefinement.H:95
Foam::meshRefinement::getMasterPoints
static bitSet getMasterPoints(const polyMesh &mesh, const labelList &meshPoints)
Determine master point for subset of points. If coupled.
Definition: meshRefinement.C:3073
Foam::meshRefinement::get
static Type get(const dictionary &dict, const word &keyword, const bool noExit, enum keyType::option matchOpt=keyType::REGEX, const Type &defaultValue=Zero)
Wrapper around dictionary::get which does not exit.
Definition: meshRefinementTemplates.C:330
Foam::meshRefinement::getFaceZoneInfo
bool getFaceZoneInfo(const word &fzName, label &masterPatchID, label &slavePatchID, surfaceZonesInfo::faceZoneType &fzType) const
Lookup faceZone information. Return false if no information.
Definition: meshRefinement.C:2390
Foam::keyType::option
option
Enumeration for the data type and search/match modes (bitmask)
Definition: keyType.H:70
Foam::meshRefinement::overwrite
bool overwrite() const
Overwrite the mesh?
Definition: meshRefinement.H:955
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatch.H:90
Foam::meshRefinement::dumpRefinementLevel
void dumpRefinementLevel() const
Write refinement level as volScalarFields for postprocessing.
Definition: meshRefinement.C:3208
Foam::meshRefinement::surfaces
const refinementSurfaces & surfaces() const
Reference to surface search engines.
Definition: meshRefinement.H:967
Foam::meshRefinement::debugType
debugType
Enumeration for what to debug. Used as a bit-pattern.
Definition: meshRefinement.H:93
autoPtr.H