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-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::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 // 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  //- Remove cells. Put exposedFaces into exposedPatchIDs.
248  autoPtr<mapPolyMesh> doRemoveCells
249  (
250  const labelList& cellsToRemove,
251  const labelList& exposedFaces,
252  const labelList& exposedPatchIDs,
253  removeCells& cellRemover
254  );
255 
256  //- Get cells which are inside any closed surface. Note that
257  // all closed surfaces
258  // will have already been oriented to have keepPoint outside.
259  labelList getInsideCells(const word&) const;
260 
261  //- Do all to remove inside cells
262  autoPtr<mapPolyMesh> removeInsideCells
263  (
264  const string& msg,
265  const label exposedPatchi
266  );
267 
268 
269  // Refinement candidate selection
270 
271  //- Mark cell for refinement (if not already marked). Return false
272  // if refinelimit hit. Keeps running count (in nRefine) of cells
273  // marked for refinement
274  static bool markForRefine
275  (
276  const label markValue,
277  const label nAllowRefine,
278  label& cellValue,
279  label& nRefine
280  );
281 
282  //- Mark every cell with level of feature passing through it
283  // (or -1 if not passed through). Uses tracking.
284  void markFeatureCellLevel
285  (
286  const pointField& keepPoints,
287  labelList& maxFeatureLevel
288  ) const;
289 
290  //- Calculate list of cells to refine based on intersection of
291  // features.
292  label markFeatureRefinement
293  (
294  const pointField& keepPoints,
295  const label nAllowRefine,
296 
298  label& nRefine
299  ) const;
300 
301  //- Mark cells for distance-to-feature based refinement.
302  label markInternalDistanceToFeatureRefinement
303  (
304  const label nAllowRefine,
306  label& nRefine
307  ) const;
308 
309  //- Mark cells for refinement-shells based refinement.
310  label markInternalRefinement
311  (
312  const label nAllowRefine,
314  label& nRefine
315  ) const;
316 
317  //- Unmark cells for refinement based on limit-shells. Return number
318  // of limited cells.
319  label unmarkInternalRefinement
320  (
322  label& nRefine
323  ) const;
324 
325  //- Collect faces that are intersected and whose neighbours aren't
326  // yet marked for refinement.
327  labelList getRefineCandidateFaces
328  (
329  const labelList& refineCell
330  ) const;
331 
332  //- Mark cells for surface intersection based refinement.
333  label markSurfaceRefinement
334  (
335  const label nAllowRefine,
336  const labelList& neiLevel,
337  const pointField& neiCc,
339  label& nRefine
340  ) const;
341 
342  //- Collect cells intersected by the surface that are candidates
343  // for gap checking. Used inside markSurfaceGapRefinement
344  void collectGapCandidates
345  (
346  const shellSurfaces& shells,
347  const labelList& testFaces,
348  const labelList& neiLevel,
349  const pointField& neiCc,
350  labelList& cellToCompact,
351  labelList& bFaceToCompact,
352  List<FixedList<label, 3>>& shellGapInfo,
353  List<volumeType>& shellGapMode
354  ) const;
355  void collectGapCells
356  (
357  const scalar planarCos,
358 
359  const List<FixedList<label, 3>>& extendedGapLevel,
360  const List<volumeType>& extendedGapMode,
361  const labelList& testFaces,
362  const pointField& start,
363  const pointField& end,
364 
365  const labelList& cellToCompact,
366  const labelList& bFaceToCompact,
367  const List<FixedList<label, 3>>& shellGapInfo,
368  const List<volumeType>& shellGapMode,
369 
370  const label nAllowRefine,
371  const labelList& neiLevel,
372  const pointField& neiCc,
373 
375  label& nRefine
376  ) const;
377 
378 
379  //- Mark cells intersected by the surface if they are inside
380  // close gaps
381  label markSurfaceGapRefinement
382  (
383  const scalar planarCos,
384  const label nAllowRefine,
385  const labelList& neiLevel,
386  const pointField& neiCc,
387 
389  label& nRefine
390  ) const;
391 
392  //- Generate single ray from nearPoint in direction of nearNormal
393  label generateRays
394  (
395  const point& nearPoint,
396  const vector& nearNormal,
397  const FixedList<label, 3>& gapInfo,
398  const volumeType& mode,
399 
400  const label cLevel,
401 
402  DynamicField<point>& start,
404  ) const;
405 
406  //- Generate pairs of rays through cell centre
407  // Each ray pair has start, end, and expected gap size
408  label generateRays
409  (
410  const bool useSurfaceNormal,
411 
412  const point& nearPoint,
413  const vector& nearNormal,
414  const FixedList<label, 3>& gapInfo,
415  const volumeType& mode,
416 
417  const point& cc,
418  const label cLevel,
419 
420  DynamicField<point>& start,
422  DynamicField<scalar>& gapSize,
423 
424  DynamicField<point>& start2,
425  DynamicField<point>& end2,
426  DynamicField<scalar>& gapSize2
427  ) const;
428 
429  //- Select candidate cells (cells inside a shell with gapLevel
430  // specified)
431  void selectGapCandidates
432  (
433  const labelList& refineCell,
434  const label nRefine,
435 
436  labelList& cellMap,
437  labelList& gapShell,
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 global region of the surface and the orientation
601  // w.r.t. surface
602  void getIntersections
603  (
604  const labelList& surfacesToTest,
605  const pointField& neiCc,
606  const labelList& testFaces,
607 
608  labelList& namedSurfaceRegion,
609  bitSet& posOrientation
610  ) const;
611 
612  //- Determine patches for baffles
613  void getBafflePatches
614  (
615  const label nErodeCellZones,
616  const labelList& globalToMasterPatch,
617  const pointField& locationsInMesh,
618  const wordList& regionsInMesh,
619 
620  const labelList& neiLevel,
621  const pointField& neiCc,
622  labelList& ownPatch,
623  labelList& neiPatch
624  ) const;
625 
626  autoPtr<mapPolyMesh> splitMesh
627  (
628  const label nBufferLayers,
629  const labelList& globalToMasterPatch,
630  const labelList& globalToSlavePatch,
631  labelList& cellRegion,
632  labelList& ownPatch,
633  labelList& neiPatch
634  );
635 
636  //- Repatches external face or creates baffle for internal face
637  // with user specified patches (might be different for both sides).
638  // Returns label of added face.
639  label createBaffle
640  (
641  const label facei,
642  const label ownPatch,
643  const label neiPatch,
644  polyTopoChange& meshMod
645  ) const;
646 
647  // Problem cell handling
648 
649  //- Helper function to mark face as being on 'boundary'. Used by
650  // markFacesOnProblemCells
651  void markBoundaryFace
652  (
653  const label facei,
654  boolList& isBoundaryFace,
655  boolList& isBoundaryEdge,
656  boolList& isBoundaryPoint
657  ) const;
658 
659  void findNearest
660  (
661  const labelList& meshFaces,
662  List<pointIndexHit>& nearestInfo,
663  labelList& nearestSurface,
664  labelList& nearestRegion,
665  vectorField& nearestNormal
666  ) const;
667 
668  Map<label> findEdgeConnectedProblemCells
669  (
670  const scalarField& perpendicularAngle,
671  const labelList&
672  ) const;
673 
674  bool isCollapsedFace
675  (
676  const pointField&,
677  const pointField& neiCc,
678  const scalar minFaceArea,
679  const scalar maxNonOrtho,
680  const label facei
681  ) const;
682 
683  bool isCollapsedCell
684  (
685  const pointField&,
686  const scalar volFraction,
687  const label celli
688  ) const;
689 
690  //- Returns list with for every internal face -1 or the patch
691  // they should be baffled into. If removeEdgeConnectedCells is set
692  // removes cells based on perpendicularAngle.
693  labelList markFacesOnProblemCells
694  (
695  const dictionary& motionDict,
696  const bool removeEdgeConnectedCells,
697  const scalarField& perpendicularAngle,
698  const labelList& globalToMasterPatch
699  ) const;
700 
701  //- Returns list with for every face the label of the nearest
702  // patch. Any unreached face (disconnected mesh?) becomes
703  // adaptPatchIDs[0]
704  labelList nearestPatch(const labelList& adaptPatchIDs) const;
705 
706  //- Returns list with for every face the label of the nearest
707  // (global) region. Any unreached face (disconnected mesh?) becomes
708  // defaultRegion
709  labelList nearestIntersection
710  (
711  const labelList& surfacesToTest,
712  const label defaultRegion
713  ) const;
714 
715  //- Returns list with for every internal face -1 or the patch
716  // they should be baffled into.
717  labelList markFacesOnProblemCellsGeometric
718  (
719  const snapParameters& snapParams,
720  const dictionary& motionDict,
721  const labelList& globalToMasterPatch,
722  const labelList& globalToSlavePatch
723  ) const;
724 
725 
726  // Baffle merging
727 
728  //- Extract those baffles (duplicate) faces that are on the edge
729  // of a baffle region. These are candidates for merging.
730  List<labelPair> freeStandingBaffles
731  (
732  const List<labelPair>&,
733  const scalar freeStandingAngle
734  ) const;
735 
736 
737  // Zone handling
738 
739  //- Finds zone per cell for cells inside closed named surfaces.
740  // (uses geometric test for insideness)
741  // Adapts namedSurfaceRegion so all faces on boundary of cellZone
742  // have corresponding faceZone.
743  void findCellZoneGeometric
744  (
745  const pointField& neiCc,
746  const labelList& closedNamedSurfaces,
747  labelList& namedSurfaceRegion,
748  const labelList& surfaceToCellZone,
749  labelList& cellToZone
750  ) const;
751 
752  //- Finds zone per cell for cells inside region for which name
753  // is specified.
754  void findCellZoneInsideWalk
755  (
756  const pointField& locationsInMesh,
757  const labelList& zonesInMesh,
758  const labelList& blockedFace, // per face -1 or some index >= 0
759  labelList& cellToZone
760  ) const;
761 
762  //- Finds zone per cell for cells inside region for which name
763  // is specified.
764  void findCellZoneInsideWalk
765  (
766  const pointField& locationsInMesh,
767  const wordList& zoneNamesInMesh,
768  const labelList& faceToZone, // per face -1 or some index >= 0
769  labelList& cellToZone
770  ) const;
771 
772  //- Determines cell zone from cell region information.
773  bool calcRegionToZone
774  (
775  const label backgroundZoneID,
776  const label surfZoneI,
777  const label ownRegion,
778  const label neiRegion,
779 
780  labelList& regionToCellZone
781  ) const;
782 
783  //- Finds zone per cell. Uses topological walk with all faces
784  // marked in unnamedSurfaceRegion (intersections with unnamed
785  // surfaces) and namedSurfaceRegion (intersections with named
786  // surfaces) regarded as blocked.
787  void findCellZoneTopo
788  (
789  const label backgroundZoneID,
790  const pointField& locationsInMesh,
791  const labelList& unnamedSurfaceRegion,
792  const labelList& namedSurfaceRegion,
793  const labelList& surfaceToCellZone,
794  labelList& cellToZone
795  ) const;
796 
797  //- Opposite of findCellTopo: finds assigned cell connected to
798  // an unassigned one and puts it in the background zone.
799  void erodeCellZone
800  (
801  const label nErodeCellZones,
802  const label backgroundZoneID,
803  const labelList& unnamedSurfaceRegion,
804  const labelList& namedSurfaceRegion,
805  labelList& cellToZone
806  ) const;
807 
808  //- Variation of findCellZoneTopo: walks from cellZones but ignores
809  // face intersections (unnamedSurfaceRegion). WIP
810  void growCellZone
811  (
812  const label nGrowCellZones,
813  const label backgroundZoneID,
814  labelList& unnamedSurfaceRegion1,
815  labelList& unnamedSurfaceRegion2,
816  labelList& namedSurfaceRegion,
817  labelList& cellToZone
818  ) const;
819 
820  //- Make namedSurfaceRegion consistent with cellToZone
821  // - clear out any blocked faces inbetween same cell zone.
822  void makeConsistentFaceIndex
823  (
824  const labelList& zoneToNamedSurface,
825  const labelList& cellToZone,
826  labelList& namedSurfaceRegion
827  ) const;
828 
829  //- Calculate cellZone allocation
830  void zonify
831  (
832  const bool allowFreeStandingZoneFaces,
833  const label nErodeCellZones,
834  const label backgroundZoneID,
835  const pointField& locationsInMesh,
836  const wordList& zonesInMesh,
837 
838  labelList& cellToZone,
839  labelList& unnamedRegion1,
840  labelList& unnamedRegion2,
841  labelList& namedSurfaceRegion,
842  bitSet& posOrientation
843  ) const;
844 
845  //- Put cells into cellZone, faces into faceZone
846  void zonify
847  (
848  const bitSet& isMasterFace,
849  const labelList& cellToZone,
850  const labelList& neiCellZone,
851  const labelList& faceToZone,
852  const bitSet& meshFlipMap,
853  polyTopoChange& meshMod
854  ) const;
855 
856  //- Allocate faceZoneName
857  void allocateInterRegionFaceZone
858  (
859  const label ownZone,
860  const label neiZone,
861  wordPairHashTable& zonesToFaceZone,
862  LabelPairMap<word>& zoneIDsToFaceZone
863  ) const;
864 
865  //- Remove any loose standing cells
866  void handleSnapProblems
867  (
868  const snapParameters& snapParams,
869  const bool useTopologicalSnapDetection,
870  const bool removeEdgeConnectedCells,
871  const scalarField& perpendicularAngle,
872  const dictionary& motionDict,
873  Time& runTime,
874  const labelList& globalToMasterPatch,
875  const labelList& globalToSlavePatch
876  );
877 
878 
879  // Some patch utilities
880 
881  //- Get all faces in faceToZone that have no cellZone on
882  // either side.
883  labelList freeStandingBaffleFaces
884  (
885  const labelList& faceToZone,
886  const labelList& cellToZone,
887  const labelList& neiCellZone
888  ) const;
889 
890  //- Determine per patch edge the number of master faces. Used
891  // to detect non-manifold situations.
892  void calcPatchNumMasterFaces
893  (
894  const bitSet& isMasterFace,
896  labelList& nMasterFaces
897  ) const;
898 
899  //- Determine per patch face the (singly-) connected zone it
900  // is in. Return overall number of zones.
901  label markPatchZones
902  (
904  const labelList& nMasterFaces,
905  labelList& faceToZone
906  ) const;
907 
908  //- Make faces consistent.
909  void consistentOrientation
910  (
911  const bitSet& isMasterFace,
913  const labelList& nMasterFaces,
914  const labelList& faceToZone,
915  const Map<label>& zoneToOrientation,
916  bitSet& meshFlipMap
917  ) const;
918 
919 
920  //- No copy construct
921  meshRefinement(const meshRefinement&) = delete;
922 
923  //- No copy assignment
924  void operator=(const meshRefinement&) = delete;
925 
926 public:
927 
928  //- Runtime type information
929  ClassName("meshRefinement");
930 
931 
932  // Constructors
933 
934  //- Construct from components
936  (
937  fvMesh& mesh,
938  const scalar mergeDistance,
939  const bool overwrite,
940  const refinementSurfaces&,
941  const refinementFeatures&,
942  const shellSurfaces&, // omnidirectional refinement
943  const shellSurfaces&, // limit refinement
944  const labelUList& checkFaces, // initial faces to check
945  const bool dryRun
946  );
947 
948 
949  // Member Functions
950 
951  // Access
952 
953  //- Reference to mesh
954  const fvMesh& mesh() const
955  {
956  return mesh_;
957  }
958  fvMesh& mesh()
959  {
960  return mesh_;
961  }
962 
963  scalar mergeDistance() const
964  {
965  return mergeDistance_;
966  }
967 
968  //- Overwrite the mesh?
969  bool overwrite() const
970  {
971  return overwrite_;
972  }
973 
974  //- (points)instance of mesh upon construction
975  const word& oldInstance() const
976  {
977  return oldInstance_;
978  }
979 
980  //- Reference to surface search engines
981  const refinementSurfaces& surfaces() const
982  {
983  return surfaces_;
984  }
985 
986  //- Reference to feature edge mesh
987  const refinementFeatures& features() const
988  {
989  return features_;
990  }
991 
992  //- Reference to refinement shells (regions)
993  const shellSurfaces& shells() const
994  {
995  return shells_;
996  }
997 
998  //- Reference to limit shells (regions)
999  const shellSurfaces& limitShells() const
1000  {
1001  return limitShells_;
1002  }
1003 
1004  //- Reference to meshcutting engine
1005  const hexRef8& meshCutter() const
1006  {
1007  return meshCutter_;
1008  }
1009 
1010  //- Per start-end edge the index of the surface hit
1011  const labelList& surfaceIndex() const;
1012 
1014 
1015  //- For faces originating from processor faces store the original
1016  // patch
1017  const Map<label>& faceToCoupledPatch() const
1018  {
1019  return faceToCoupledPatch_;
1020  }
1021 
1022  //- Additional face data that is maintained across
1023  // topo changes. Every entry is a list over all faces.
1024  // Bit of a hack. Additional flag to say whether to maintain master
1025  // only (false) or increase set to account for face-from-face.
1027  {
1028  return userFaceData_;
1029  }
1032  {
1033  return userFaceData_;
1034  }
1035 
1036 
1037  // Other
1038 
1039  //- Count number of intersections (local)
1040  label countHits() const;
1041 
1042  //- Redecompose according to cell count
1043  // keepZoneFaces : find all faceZones from zoned surfaces and keep
1044  // owner and neighbour together
1045  // keepBaffles : find all baffles and keep them together
1047  (
1048  const bool keepZoneFaces,
1049  const bool keepBaffles,
1050  const scalarField& cellWeights,
1051  decompositionMethod& decomposer,
1052  fvMeshDistribute& distributor
1053  );
1054 
1055  //- Get faces with intersection.
1056  labelList intersectedFaces() const;
1057 
1058  //- Get points on surfaces with intersection and boundary faces.
1059  labelList intersectedPoints() const;
1060 
1061  //- Create patch from set of patches
1063  (
1064  const polyMesh&,
1065  const labelList&
1066  );
1067 
1068  //- Helper function to make a pointVectorField with correct
1069  // bcs for mesh movement:
1070  // - adaptPatchIDs : fixedValue
1071  // - processor : calculated (so free to move)
1072  // - cyclic/wedge/symmetry : slip
1073  // - other : slip
1075  (
1076  const pointMesh& pMesh,
1077  const labelList& adaptPatchIDs
1078  );
1079 
1080  //- Helper function: check that face zones are synced
1081  static void checkCoupledFaceZones(const polyMesh&);
1082 
1083  //- Helper: calculate edge weights (1/length)
1084  static void calculateEdgeWeights
1085  (
1086  const polyMesh& mesh,
1087  const bitSet& isMasterEdge,
1088  const labelList& meshPoints,
1089  const edgeList& edges,
1090  scalarField& edgeWeights,
1091  scalarField& invSumWeight
1092  );
1093 
1094  //- Helper: weighted sum (over all subset of mesh points) by
1095  // summing contribution from (master) edges
1096  template<class Type>
1097  static void weightedSum
1098  (
1099  const polyMesh& mesh,
1100  const bitSet& isMasterEdge,
1101  const labelList& meshPoints,
1102  const edgeList& edges,
1103  const scalarField& edgeWeights,
1104  const Field<Type>& data,
1105  Field<Type>& sum
1106  );
1107 
1108 
1109  // Refinement
1110 
1111  //- Is local topology a small gap?
1112  bool isGap
1113  (
1114  const scalar,
1115  const vector&,
1116  const vector&,
1117  const vector&,
1118  const vector&
1119  ) const;
1120 
1121  //- Is local topology a small gap normal to the test vector
1122  bool isNormalGap
1123  (
1124  const scalar planarCos,
1125  const label level0,
1126  const vector& point0,
1127  const vector& normal0,
1128  const label level1,
1129  const vector& point1,
1130  const vector& normal1
1131  ) const;
1132 
1133  //- Calculate list of cells to refine.
1135  (
1136  const pointField& keepPoints,
1137  const scalar curvature,
1138  const scalar planarAngle,
1139 
1140  const bool featureRefinement,
1141  const bool featureDistanceRefinement,
1142  const bool internalRefinement,
1143  const bool surfaceRefinement,
1144  const bool curvatureRefinement,
1145  const bool smallFeatureRefinement,
1146  const bool gapRefinement,
1147  const bool bigGapRefinement,
1148  const bool spreadGapSize,
1149  const label maxGlobalCells,
1150  const label maxLocalCells
1151  ) const;
1152 
1153 
1154  // Blocking cells
1155 
1156  //- Mark faces on interface between set and rest
1157  // (and same cell level)
1158  void markOutsideFaces
1159  (
1160  const labelList& cellLevel,
1161  const labelList& neiLevel,
1162  const labelList& refineCell,
1163  bitSet& isOutsideFace
1164  ) const;
1165 
1166  //- Count number of faces on cell that are in set
1167  label countFaceDirs
1168  (
1169  const bitSet& isOutsideFace,
1170  const label celli
1171  ) const;
1172 
1173  //- Add one layer of cells to set
1174  void growSet
1175  (
1176  const labelList& neiLevel,
1177  const bitSet& isOutsideFace,
1179  label& nRefine
1180  ) const;
1181 
1182  //- Detect gapRefinement cells and remove them
1184  (
1185  const scalar planarAngle,
1186  const labelList& minSurfaceLevel,
1187  const labelList& globalToMasterPatch,
1188  const label growIter
1189  );
1190 
1191  //- Refine some cells
1192  autoPtr<mapPolyMesh> refine(const labelList& cellsToRefine);
1193 
1194  //- Refine some cells and rebalance
1196  (
1197  const string& msg,
1198  decompositionMethod& decomposer,
1199  fvMeshDistribute& distributor,
1200  const labelList& cellsToRefine,
1201  const scalar maxLoadUnbalance
1202  );
1203 
1204  //- Balance before refining some cells
1206  (
1207  const string& msg,
1208  decompositionMethod& decomposer,
1209  fvMeshDistribute& distributor,
1210  const labelList& cellsToRefine,
1211  const scalar maxLoadUnbalance
1212  );
1213 
1214  //- Calculate list of cells to directionally refine
1216  (
1217  const label maxGlobalCells,
1218  const label maxLocalCells,
1219  const labelList& currentLevel,
1220  const direction dir
1221  ) const;
1222 
1223  //- Directionally refine in direction cmpt
1225  (
1226  const string& msg,
1227  const direction cmpt,
1228  const labelList& cellsToRefine
1229  );
1230 
1231 
1232  // Baffle handling
1233 
1234  //- Split off unreachable areas of mesh.
1235  void baffleAndSplitMesh
1236  (
1237  const bool handleSnapProblems,
1238 
1239  // How to remove problem snaps
1240  const snapParameters& snapParams,
1241  const bool useTopologicalSnapDetection,
1242  const bool removeEdgeConnectedCells,
1243  const scalarField& perpendicularAngle,
1244  const label nErodeCellZones,
1245  const dictionary& motionDict,
1246  Time& runTime,
1247  const labelList& globalToMasterPatch,
1248  const labelList& globalToSlavePatch,
1249  const pointField& locationsInMesh,
1250  const wordList& regionsInMesh,
1251  const pointField& locationsOutsideMesh,
1252  const writer<scalar>& leakPathFormatter
1253  );
1254 
1255  //- Merge free-standing baffles
1257  (
1258  const snapParameters& snapParams,
1259  const bool useTopologicalSnapDetection,
1260  const bool removeEdgeConnectedCells,
1261  const scalarField& perpendicularAngle,
1262  const scalar planarAngle,
1263  const dictionary& motionDict,
1264  Time& runTime,
1265  const labelList& globalToMasterPatch,
1266  const labelList& globalToSlavePatch,
1267  const pointField& locationsInMesh,
1268  const pointField& locationsOutsideMesh,
1269  const writer<scalar>& leakPathFormatter
1270  );
1271 
1272  //- Split off (with optional buffer layers) unreachable areas
1273  // of mesh. Does not introduce baffles.
1274  autoPtr<mapPolyMesh> splitMesh
1275  (
1276  const label nBufferLayers,
1277  const label nErodeCellZones,
1278  const labelList& globalToMasterPatch,
1279  const labelList& globalToSlavePatch,
1280 
1281  const pointField& locationsInMesh,
1282  const wordList& regionsInMesh,
1283  const pointField& locationsOutsideMesh,
1284  const writer<scalar>& leakPathFormatter
1285  );
1286 
1287  //- Remove cells from limitRegions if level -1
1289  (
1290  const label nBufferLayers,
1291  const label nErodeCellZones,
1292  const labelList& globalToMasterPatch,
1293  const labelList& globalToSlavePatch,
1294  const pointField& locationsInMesh,
1295  const wordList& regionsInMesh
1296  );
1297 
1298  //- Find boundary points that connect to more than one cell
1299  // region and split them.
1301 
1302  //- Find boundary points that connect to more than one cell
1303  // region and split them.
1305 
1306  //- Find boundary points that are on faceZones of type boundary
1307  // and duplicate them
1309 
1310  //- Merge duplicate points
1312  (
1313  const labelList& pointToDuplicate
1314  );
1315 
1316  //- Create baffle for every internal face where ownPatch != -1.
1317  // External faces get repatched according to ownPatch (neiPatch
1318  // should be -1 for these)
1320  (
1321  const labelList& ownPatch,
1322  const labelList& neiPatch
1323  );
1324 
1325  //- Get zones of given type
1327  (
1329  ) const;
1330 
1331  //- Subset baffles according to zones
1333  (
1334  const polyMesh& mesh,
1335  const labelList& zoneIDs,
1336  const List<labelPair>& baffles
1337  );
1338 
1339  //- Create baffles for faces on faceZones. Return created baffles
1340  // (= pairs of faces) and corresponding faceZone
1342  (
1343  const labelList& zoneIDs,
1344  List<labelPair>& baffles,
1345  labelList& originatingFaceZone
1346  );
1347 
1348  //- Merge baffles. Gets pairs of faces and boundary faces to move
1349  // onto (coupled) patches
1351  (
1352  const List<labelPair>&,
1353  const Map<label>& faceToPatch
1354  );
1355 
1356  //- Merge all baffles on faceZones
1358  (
1359  const bool doInternalZones,
1360  const bool doBaffleZones
1361  );
1362 
1363  //- Put faces/cells into zones according to surface specification.
1364  // Returns null if no zone surfaces present. Regions containing
1365  // locationsInMesh/regionsInMesh will be put in corresponding
1366  // cellZone. keepPoints is for backwards compatibility and sets
1367  // all yet unassigned cells to be non-zoned (zone = -1)
1368  autoPtr<mapPolyMesh> zonify
1369  (
1370  const bool allowFreeStandingZoneFaces,
1371  const label nErodeCellZones,
1372  const pointField& locationsInMesh,
1373  const wordList& regionsInMesh,
1374  wordPairHashTable& zonesToFaceZone
1375  );
1376 
1377 
1378  // Other topo changes
1379 
1380  //- Helper:append patch to end of mesh.
1381  static label appendPatch
1382  (
1383  fvMesh&,
1384  const label insertPatchi,
1385  const word&,
1386  const dictionary&
1387  );
1388 
1389  //- Helper:add patch to mesh. Update all registered fields.
1390  // Used by addMeshedPatch to add patches originating from surfaces.
1391  static label addPatch(fvMesh&, const word& name, const dictionary&);
1392 
1393  //- Add patch originating from meshing. Update meshedPatches_.
1394  label addMeshedPatch(const word& name, const dictionary&);
1395 
1396  //- Get patchIDs for patches added in addMeshedPatch.
1397  labelList meshedPatches() const;
1398 
1399  //- Add/lookup faceZone and update information. Return index of
1400  // faceZone
1401  label addFaceZone
1402  (
1403  const word& fzName,
1404  const word& masterPatch,
1405  const word& slavePatch,
1406  const surfaceZonesInfo::faceZoneType& fzType
1407  );
1408 
1409  //- Lookup faceZone information. Return false if no information
1410  // for faceZone
1411  bool getFaceZoneInfo
1412  (
1413  const word& fzName,
1414  label& masterPatchID,
1415  label& slavePatchID,
1417  ) const;
1418 
1419  //- Select coupled faces that are not collocated
1421 
1422  //- Find any intersection of surface. Store in surfaceIndex_.
1423  void updateIntersections(const labelList& changedFaces);
1424 
1425  //- Find region point is in. Uses optional perturbation to re-test.
1426  static label findRegion
1427  (
1428  const polyMesh&,
1429  const labelList& cellRegion,
1430  const vector& perturbVec,
1431  const point& p
1432  );
1433 
1434  //- Find regions points are in.
1435  // \return number of cells to be removed
1436  static label findRegions
1437  (
1438  const polyMesh&,
1439  const vector& perturbVec,
1440  const pointField& locationsInMesh,
1441  const pointField& locationsOutsideMesh,
1442  const bool exitIfLeakPath,
1443  const writer<scalar>& leakPathFormatter,
1444  const label nRegions,
1445  labelList& cellRegion,
1446  const boolList& blockedFace
1447  );
1448 
1449  //- Split mesh. Keep part containing point. Return empty map if
1450  // no cells removed.
1452  (
1453  const labelList& globalToMasterPatch,
1454  const labelList& globalToSlavePatch,
1455  const pointField& locationsInMesh,
1456  const pointField& locationsOutsideMesh,
1457  const bool exitIfLeakPath,
1458  const writer<scalar>& leakPathFormatter
1459  );
1460 
1461  //- Split faces into two
1462  void doSplitFaces
1463  (
1464  const labelList& splitFaces,
1465  const labelPairList& splits,
1466  polyTopoChange& meshMod
1467  ) const;
1468 
1469  //- Split faces along diagonal. Maintain mesh quality. Return
1470  // total number of faces split.
1471  label splitFacesUndo
1472  (
1473  const labelList& splitFaces,
1474  const labelPairList& splits,
1475  const dictionary& motionDict,
1476 
1477  labelList& duplicateFace,
1478  List<labelPair>& baffles
1479  );
1480 
1481  //- Update local numbering for mesh redistribution
1482  void distribute(const mapDistributePolyMesh&);
1483 
1484  //- Update for external change to mesh. changedFaces are in new mesh
1485  // face labels.
1486  void updateMesh
1487  (
1488  const mapPolyMesh&,
1489  const labelList& changedFaces
1490  );
1491 
1492  //- Helper: reorder list according to map.
1493  template<class T>
1494  static void updateList
1495  (
1496  const labelList& newToOld,
1497  const T& nullValue,
1498  List<T>& elems
1499  );
1500 
1501 
1502  // Restoring : is where other processes delete and reinsert data.
1503 
1504  //- Signal points/face/cells for which to store data
1505  void storeData
1506  (
1507  const labelList& pointsToStore,
1508  const labelList& facesToStore,
1509  const labelList& cellsToStore
1510  );
1511 
1512  //- Update local numbering + undo
1513  // Data to restore given as new pointlabel + stored pointlabel
1514  // (i.e. what was in pointsToStore)
1515  void updateMesh
1516  (
1517  const mapPolyMesh&,
1518  const labelList& changedFaces,
1519  const Map<label>& pointsToRestore,
1520  const Map<label>& facesToRestore,
1521  const Map<label>& cellsToRestore
1522  );
1523 
1524  // Merging coplanar faces and edges
1525 
1526  //- Merge coplanar faces if sets are of size mergeSize
1527  // (usually 4)
1528  label mergePatchFaces
1529  (
1530  const scalar minCos,
1531  const scalar concaveCos,
1532  const label mergeSize,
1533  const labelList& patchIDs,
1534  const meshRefinement::FaceMergeType mergeType
1535  );
1536 
1537  //- Merge coplanar faces. preserveFaces is != -1 for faces
1538  // to be preserved
1539  label mergePatchFacesUndo
1540  (
1541  const scalar minCos,
1542  const scalar concaveCos,
1543  const labelList& patchIDs,
1544  const dictionary& motionDict,
1545  const labelList& preserveFaces,
1546  const meshRefinement::FaceMergeType mergeType
1547  );
1548 
1550  (
1551  removePoints& pointRemover,
1552  const boolList& pointCanBeDeleted
1553  );
1554 
1556  (
1557  removePoints& pointRemover,
1558  const labelList& facesToRestore
1559  );
1560 
1562  (
1563  const labelList& candidateFaces,
1564  const labelHashSet& set
1565  ) const;
1566 
1567  // Pick up faces of cells of faces in set.
1569  (
1570  const labelUList& set
1571  ) const;
1572 
1573  // Pick up faces of cells of faces in set.
1575  (
1576  const labelHashSet& set
1577  ) const;
1578 
1579  //- Merge edges, maintain mesh quality. Return global number
1580  // of edges merged
1581  label mergeEdgesUndo
1582  (
1583  const scalar minCos,
1584  const dictionary& motionDict
1585  );
1586 
1587 
1588  // Debug/IO
1589 
1590  //- Debugging: check that all faces still obey start()>end()
1591  void checkData();
1592 
1593  static void testSyncPointList
1594  (
1595  const string& msg,
1596  const polyMesh& mesh,
1597  const List<scalar>& fld
1598  );
1599 
1600  static void testSyncPointList
1601  (
1602  const string& msg,
1603  const polyMesh& mesh,
1604  const List<point>& fld
1605  );
1606 
1607  //- Compare two lists over all boundary faces
1608  template<class T>
1610  (
1611  const scalar mergeDistance,
1612  const string&,
1613  const UList<T>&,
1614  const UList<T>&
1615  ) const;
1616 
1617  //- Print list according to (collected and) sorted coordinate
1618  template<class T>
1619  static void collectAndPrint
1620  (
1621  const UList<point>& points,
1622  const UList<T>& data
1623  );
1624 
1625  //- Determine master point for subset of points. If coupled
1626  // chooses only one
1627  static bitSet getMasterPoints
1628  (
1629  const polyMesh& mesh,
1630  const labelList& meshPoints
1631  );
1632 
1633  //- Determine master edge for subset of edges. If coupled
1634  // chooses only one
1635  static bitSet getMasterEdges
1636  (
1637  const polyMesh& mesh,
1638  const labelList& meshEdges
1639  );
1640 
1641  //- Print some mesh stats.
1642  void printMeshInfo(const bool, const string&) const;
1643 
1644  //- Replacement for Time::timeName() that returns oldInstance
1645  //- (if overwrite_)
1646  word timeName() const;
1647 
1648  //- Set instance of all local IOobjects
1649  void setInstance(const fileName&);
1650 
1651  //- Write mesh and all data
1652  bool write() const;
1653 
1654  //- Write refinement level as volScalarFields for postprocessing
1655  void dumpRefinementLevel() const;
1656 
1657  //- Debug: Write intersection information to OBJ format
1658  void dumpIntersections(const fileName& prefix) const;
1659 
1660  //- Do any one of above IO functions
1661  void write
1662  (
1663  const debugType debugFlags,
1664  const writeType writeFlags,
1665  const fileName&
1666  ) const;
1667 
1668  //- Helper: remove all relevant files from mesh instance
1669  static void removeFiles(const polyMesh&);
1670 
1671  //- Helper: calculate average
1672  template<class T>
1673  static T gAverage
1674  (
1675  const bitSet& isMasterElem,
1676  const UList<T>& values
1677  );
1678 
1679  //- Get/set write level
1680  static writeType writeLevel();
1681  static void writeLevel(const writeType);
1682 
1684  //static outputType outputLevel();
1685  //static void outputLevel(const outputType);
1686 
1687 
1688  //- Helper: convert wordList into bit pattern using provided Enum
1689  template<class EnumContainer>
1690  static int readFlags
1691  (
1692  const EnumContainer& namedEnum,
1693  const wordList& words
1694  );
1695 
1696  //- Wrapper around dictionary::get which does not exit
1697  template<class Type>
1698  static Type get
1699  (
1700  const dictionary& dict,
1701  const word& keyword,
1702  const bool noExit,
1703  enum keyType::option matchOpt = keyType::REGEX,
1704  const Type& deflt = Zero
1705  );
1706 
1707  //- Wrapper around dictionary::subDict which does not exit
1708  static const dictionary& subDict
1709  (
1710  const dictionary& dict,
1711  const word& keyword,
1712  const bool noExit,
1713  enum keyType::option matchOpt = keyType::REGEX
1714  );
1715 
1716  //- Wrapper around dictionary::lookup which does not exit
1717  static ITstream& lookup
1718  (
1719  const dictionary& dict,
1720  const word& keyword,
1721  const bool noExit,
1722  enum keyType::option matchOpt = keyType::REGEX
1723  );
1724 };
1725 
1726 
1727 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1728 
1729 } // End namespace Foam
1730 
1731 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1732 
1733 #ifdef NoRepository
1734  #include "meshRefinementTemplates.C"
1735 #endif
1736 
1737 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1738 
1739 #endif
1740 
1741 // ************************************************************************* //
Foam::meshRefinement::shells
const shellSurfaces & shells() const
Reference to refinement shells (regions)
Definition: meshRefinement.H:992
Foam::meshRefinement::mergePoints
autoPtr< mapPolyMesh > mergePoints(const labelList &pointToDuplicate)
Merge duplicate points.
Definition: meshRefinementBaffles.C:4846
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: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:1025
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:1030
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: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:3315
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: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::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:2774
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:2475
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:59
Foam::meshRefinement::intersectedPoints
labelList intersectedPoints() const
Get points on surfaces with intersection and boundary faces.
Definition: meshRefinement.C:1833
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:3496
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:3440
Foam::meshRefinement::intersectedFaces
labelList intersectedFaces() const
Get faces with intersection.
Definition: meshRefinement.C:1805
Foam::meshRefinement::printMeshInfo
void printMeshInfo(const bool, const string &) const
Print some mesh stats.
Definition: meshRefinement.C:3189
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:2396
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:75
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:1534
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:3465
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:1094
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:974
Foam::HashSet< label, Hash< label > >
Foam::meshRefinement::mesh
const fvMesh & mesh() const
Reference to mesh.
Definition: meshRefinement.H:953
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:4693
Foam::meshRefinement::removeFiles
static void removeFiles(const polyMesh &)
Helper: remove all relevant files from mesh instance.
Definition: meshRefinement.C:3416
Foam::meshRefinement::addPatch
static label addPatch(fvMesh &, const word &name, const dictionary &)
Helper:add patch to mesh. Update all registered fields.
Definition: meshRefinement.C:2241
Foam::meshRefinement::doSplitFaces
void doSplitFaces(const labelList &splitFaces, const labelPairList &splits, polyTopoChange &meshMod) const
Split faces into two.
Definition: meshRefinement.C:975
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:3154
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:2087
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:3242
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:1999
Foam::ITstream
An input stream of tokens.
Definition: ITstream.H:55
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::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:1511
Foam::meshRefinement::appendPatch
static label appendPatch(fvMesh &, const label insertPatchi, const word &, const dictionary &)
Helper:append patch to end of mesh.
Definition: meshRefinement.C:2143
Foam::meshRefinement::faceToCoupledPatch
const Map< label > & faceToCoupledPatch() const
For faces originating from processor faces store the original.
Definition: meshRefinement.H:1016
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:2512
Foam::meshRefinement::meshedPatches
labelList meshedPatches() const
Get patchIDs for patches added in addMeshedPatch.
Definition: meshRefinement.C:2369
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:2881
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:1333
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:1904
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:84
Foam::meshRefinement::mergeDistance
scalar mergeDistance() const
Definition: meshRefinement.H:962
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:2943
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:1555
Foam::meshRefinement::setInstance
void setInstance(const fileName &)
Set instance of all local IOobjects.
Definition: meshRefinement.C:907
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:2448
Foam::meshRefinement::features
const refinementFeatures & features() const
Reference to feature edge mesh.
Definition: meshRefinement.H:986
Foam::meshRefinement::meshCutter
const hexRef8 & meshCutter() const
Reference to meshcutting engine.
Definition: meshRefinement.H:1004
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:4110
Foam::meshRefinement::dupNonManifoldBoundaryPoints
autoPtr< mapPolyMesh > dupNonManifoldBoundaryPoints()
Find boundary points that are on faceZones of type boundary.
Definition: meshRefinementBaffles.C:4915
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:4293
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:957
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:1153
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: HashTable.H:102
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:700
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:719
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:3082
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:2319
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:2955
Foam::meshRefinement::limitShells
const shellSurfaces & limitShells() const
Reference to limit shells (regions)
Definition: meshRefinement.H:998
Foam::meshRefinement::testSyncPointList
static void testSyncPointList(const string &msg, const polyMesh &mesh, const List< scalar > &fld)
Definition: meshRefinement.C:607
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: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:304
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:4836
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:1946
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:73
Foam::data
Database for solution data, solver performance and other reduced data.
Definition: data.H:54
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:3118
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:2420
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:968
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatch.H:85
Foam::meshRefinement::dumpRefinementLevel
void dumpRefinementLevel() const
Write refinement level as volScalarFields for postprocessing.
Definition: meshRefinement.C:3253
Foam::meshRefinement::surfaces
const refinementSurfaces & surfaces() const
Reference to surface search engines.
Definition: meshRefinement.H:980
Foam::meshRefinement::debugType
debugType
Enumeration for what to debug. Used as a bit-pattern.
Definition: meshRefinement.H:92
autoPtr.H