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