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 | Copyright (C) 2011-2015 OpenFOAM Foundation
6  \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::meshRefinement
26 
27 Description
28  Helper class which maintains intersections of (changing) mesh with
29  (static) surfaces.
30 
31  Maintains
32  - per face any intersections of the cc-cc segment with any of the surfaces
33 
34 SourceFiles
35  meshRefinement.C
36  meshRefinementBaffles.C
37  meshRefinementGapRefine.C
38  meshRefinementMerge.C
39  meshRefinementProblemCells.C
40  meshRefinementRefine.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef meshRefinement_H
45 #define meshRefinement_H
46 
47 #include "hexRef8.H"
48 #include "mapPolyMesh.H"
49 #include "autoPtr.H"
50 #include "labelPair.H"
51 #include "indirectPrimitivePatch.H"
52 #include "pointFieldsFwd.H"
53 #include "Tuple2.H"
54 #include "pointIndexHit.H"
55 #include "wordPairHashTable.H"
56 #include "surfaceZonesInfo.H"
57 #include "volumeType.H"
58 #include "DynamicField.H"
59 
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 
62 namespace Foam
63 {
64 
65 // Class forward declarations
66 class fvMesh;
67 class mapDistributePolyMesh;
68 class decompositionMethod;
69 class refinementSurfaces;
70 class refinementFeatures;
71 class shellSurfaces;
72 class removeCells;
73 class fvMeshDistribute;
74 class removePoints;
75 class localPointRegion;
76 class snapParameters;
77 
78 
79 /*---------------------------------------------------------------------------*\
80  Class meshRefinement Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 class meshRefinement
84 {
85 
86 public:
87 
88  // Public data types
89 
90  //- Enumeration for what to debug
91  enum IOdebugType
92  {
93  IOMESH,
94  //IOSCALARLEVELS,
99  };
101  enum debugType
102  {
103  MESH = 1<<IOMESH,
104  //SCALARLEVELS = 1<<IOSCALARLEVELS,
109  };
110 
111  //- Enumeration for what to output
112  enum IOoutputType
113  {
115  };
117  enum outputType
118  {
120  };
121 
122  //- Enumeration for what to write
123  enum IOwriteType
124  {
129  };
131  enum writeType
132  {
137  };
138 
139  //- Enumeration for how the userdata is to be mapped upon refinement.
140  enum mapType
141  {
143  KEEPALL = 2,
144  REMOVE = 4
145  };
146 
147 
148 private:
149 
150  // Static data members
151 
152  //- Control of writing level
153  static writeType writeLevel_;
154 
155  //- Control of output/log level
156  static outputType outputLevel_;
157 
158 
159  // Private data
160 
161  //- Reference to mesh
162  fvMesh& mesh_;
163 
164  //- Tolerance used for sorting coordinates (used in 'less' routine)
165  const scalar mergeDistance_;
166 
167  //- Overwrite the mesh?
168  const bool overwrite_;
169 
170  //- Instance of mesh upon construction. Used when in overwrite_ mode.
171  const word oldInstance_;
172 
173  //- All surface-intersection interaction
175 
176  //- All feature-edge interaction
178 
179  //- All shell-refinement interaction
180  const shellSurfaces& shells_;
181 
182  //- All limit-refinement interaction
184 
185  //- Refinement engine
187 
188  //- Per cc-cc vector the index of the surface hit
190 
191 
192  // For baffle merging
193 
194  //- Original patch for baffle faces that used to be on
195  // coupled patches
197 
198 
199  //- User supplied face based data.
201 
202  //- Meshed patches - are treated differently. Stored as wordList since
203  // order changes.
205 
206  //- FaceZone to master patch name
208 
209  //- FaceZone to slave patch name
211 
212  //- FaceZone to method to handle faces
214 
215 
216  // Private Member Functions
217 
218  //- Add patchfield of given type to all fields on mesh
219  template<class GeoField>
220  static void addPatchFields(fvMesh&, const word& patchFieldType);
221 
222  //- Reorder patchfields of all fields on mesh
223  template<class GeoField>
224  static void reorderPatchFields(fvMesh&, const labelList& oldToNew);
225 
226  //- Find out which faces have changed given cells (old mesh labels)
227  // that were marked for refinement.
229  (
230  const mapPolyMesh&,
231  const labelList& oldCellsToRefine
232  );
233 
234  //- Calculate coupled boundary end vector and refinement level
235  void calcNeighbourData(labelList& neiLevel, pointField& neiCc) const;
236 
237  //- Calculate rays from cell-centre to cell-centre and corresponding
238  // min cell refinement level
239  void calcCellCellRays
240  (
241  const pointField& neiCc,
242  const labelList& neiLevel,
243  const labelList& testFaces,
244  pointField& start,
245  pointField& end,
246  labelList& minLevel
247  ) const;
248 
249  //- Remove cells. Put exposedFaces into exposedPatchIDs.
251  (
252  const labelList& cellsToRemove,
253  const labelList& exposedFaces,
254  const labelList& exposedPatchIDs,
255  removeCells& cellRemover
256  );
257 
258  //- Get cells which are inside any closed surface. Note that
259  // all closed surfaces
260  // will have already been oriented to have keepPoint outside.
261  labelList getInsideCells(const word&) const;
262 
263  //- Do all to remove inside cells
265  (
266  const string& msg,
267  const label exposedPatchI
268  );
269 
270 
271  // Refinement candidate selection
272 
273  //- Mark cell for refinement (if not already marked). Return false
274  // if refinelimit hit. Keeps running count (in nRefine) of cells
275  // marked for refinement
276  static bool markForRefine
277  (
278  const label markValue,
279  const label nAllowRefine,
280  label& cellValue,
281  label& nRefine
282  );
283 
284  //- Mark every cell with level of feature passing through it
285  // (or -1 if not passed through). Uses tracking.
287  (
288  const pointField& keepPoints,
289  labelList& maxFeatureLevel
290  ) const;
291 
292  //- Calculate list of cells to refine based on intersection of
293  // features.
295  (
296  const pointField& keepPoints,
297  const label nAllowRefine,
298 
300  label& nRefine
301  ) const;
302 
303  //- Mark cells for distance-to-feature based refinement.
305  (
306  const label nAllowRefine,
308  label& nRefine
309  ) const;
310 
311  //- Mark cells for refinement-shells based refinement.
313  (
314  const label nAllowRefine,
316  label& nRefine
317  ) const;
318 
319  //- Unmark cells for refinement based on limit-shells. Return number
320  // of limited cells.
322  (
324  label& nRefine
325  ) const;
326 
327  //- Collect faces that are intersected and whose neighbours aren't
328  // yet marked for refinement.
330  (
331  const labelList& refineCell
332  ) const;
333 
334  //- Mark cells for surface intersection based refinement.
336  (
337  const label nAllowRefine,
338  const labelList& neiLevel,
339  const pointField& neiCc,
341  label& nRefine
342  ) const;
343 
344  //- Mark cells intersected by the surface if they are inside
345  // close gaps
347  (
348  const scalar planarCos,
349  const label nAllowRefine,
350  const labelList& neiLevel,
351  const pointField& neiCc,
352 
354  label& nRefine
355  ) const;
356 
357  //- Generate single ray from nearPoint in direction of nearNormal
359  (
360  const point& nearPoint,
361  const vector& nearNormal,
362  const FixedList<label, 3>& gapInfo,
363  const volumeType& mode,
364 
365  const label cLevel,
366 
367  DynamicField<point>& start,
369  ) const;
370 
371  //- Generate pairs of rays through cell centre
372  // Each ray pair has start, end, and expected gap size
374  (
375  const bool useSurfaceNormal,
376 
377  const point& nearPoint,
378  const vector& nearNormal,
379  const FixedList<label, 3>& gapInfo,
380  const volumeType& mode,
381 
382  const point& cc,
383  const label cLevel,
384 
385  DynamicField<point>& start,
386  DynamicField<point>& end,
387  DynamicField<scalar>& gapSize,
388 
389  DynamicField<point>& start2,
390  DynamicField<point>& end2,
391  DynamicField<scalar>& gapSize2
392  ) const;
393 
394  //- Select candidate cells (cells inside a shell with gapLevel
395  // specified)
397  (
398  const labelList& refineCell,
399  const label nRefine,
400 
401  labelList& cellMap,
402  List<FixedList<label, 3> >& shellGapInfo,
403  List<volumeType>& shellGapMode
404  ) const;
405 
406  //- Merge gap information coming from shell and from surface
407  // (surface wins)
408  void mergeGapInfo
409  (
410  const FixedList<label, 3>& shellGapInfo,
411  const volumeType shellGapMode,
412  const FixedList<label, 3>& surfGapInfo,
413  const volumeType surfGapMode,
414  FixedList<label, 3>& gapInfo,
415  volumeType& gapMode
416  ) const;
417 
418  //- Mark cells for non-surface intersection based gap refinement
420  (
421  const scalar planarCos,
422  const bool spreadGapSize,
423  const label nAllowRefine,
425  label& nRefine,
426  labelList& numGapCells,
427  scalarField& gapSize
428  ) const;
429 
430  //- Refine cells containing small gaps
432  (
433  const scalar planarCos,
434  const label nAllowRefine,
435  const labelList& neiLevel,
436  const pointField& neiCc,
437 
439  label& nRefine
440  ) const;
441 
442  //- Helper: count number of normals1 that are in normals2
444  (
445  const List<point>& normals1,
446  const List<point>& normals2,
447  const scalar tol = 1e-6
448  ) const;
449 
450  //- Mark cells for surface curvature based refinement. Marks if
451  // local curvature > curvature or if on different regions
452  // (markDifferingRegions)
454  (
455  const scalar curvature,
456  const label nAllowRefine,
457  const labelList& neiLevel,
458  const pointField& neiCc,
460  label& nRefine
461  ) const;
462 
463  //- Mark cell if local a gap topology or
464  bool checkProximity
465  (
466  const scalar planarCos,
467  const label nAllowRefine,
468 
469  const label surfaceLevel,
470  const vector& surfaceLocation,
471  const vector& surfaceNormal,
472 
473  const label cellI,
474 
475  label& cellMaxLevel,
476  vector& cellMaxLocation,
477  vector& cellMaxNormal,
478 
480  label& nRefine
481  ) const;
482 
483  //- Mark cells for surface proximity based refinement.
485  (
486  const scalar curvature,
487  const label nAllowRefine,
488  const labelList& neiLevel,
489  const pointField& neiCc,
490 
492  label& nRefine
493  ) const;
494 
495  // Baffle handling
496 
497  //- Get faces to repatch. Returns map from face to patch.
499  (
500  const bool allowBoundary,
501  const labelList& globalToMasterPatch,
502  const labelList& globalToSlavePatch
503  ) const;
504 
505  //- Calculate intersections. Return per face -1 or the global
506  // surface region
507  void getIntersections
508  (
509  const labelList& surfacesToTest,
510  const pointField& neiCc,
511  const labelList& testFaces,
512 
513  labelList& globalRegion1,
514  labelList& globalRegion2
515  ) const;
516 
517  //- Calculate intersections on zoned faces. Return per face -1
518  // or the index of the surface and the orientation w.r.t. surface
519  void getIntersections
520  (
521  const labelList& surfacesToTest,
522  const pointField& neiCc,
523  const labelList& testFaces,
524 
525  labelList& namedSurfaceIndex,
526  PackedBoolList& posOrientation
527  ) const;
528 
529  //- Determine patches for baffles
530  void getBafflePatches
531  (
532  const labelList& globalToMasterPatch,
533  const pointField& locationsInMesh,
534  const wordList& regionsInMesh,
535 
536  const labelList& neiLevel,
537  const pointField& neiCc,
538  labelList& ownPatch,
539  labelList& neiPatch
540  ) const;
541 
542  //- Repatches external face or creates baffle for internal face
543  // with user specified patches (might be different for both sides).
544  // Returns label of added face.
546  (
547  const label faceI,
548  const label ownPatch,
549  const label neiPatch,
550  polyTopoChange& meshMod
551  ) const;
552 
553  // Problem cell handling
554 
555  //- Helper function to mark face as being on 'boundary'. Used by
556  // markFacesOnProblemCells
557  void markBoundaryFace
558  (
559  const label faceI,
560  boolList& isBoundaryFace,
561  boolList& isBoundaryEdge,
562  boolList& isBoundaryPoint
563  ) const;
564 
565  void findNearest
566  (
567  const labelList& meshFaces,
568  List<pointIndexHit>& nearestInfo,
569  labelList& nearestSurface,
570  labelList& nearestRegion,
571  vectorField& nearestNormal
572  ) const;
573 
575  (
576  const scalarField& perpendicularAngle,
577  const labelList&
578  ) const;
579 
580  bool isCollapsedFace
581  (
582  const pointField&,
583  const pointField& neiCc,
584  const scalar minFaceArea,
585  const scalar maxNonOrtho,
586  const label faceI
587  ) const;
588 
589  bool isCollapsedCell
590  (
591  const pointField&,
592  const scalar volFraction,
593  const label cellI
594  ) const;
595 
596  //- Returns list with for every internal face -1 or the patch
597  // they should be baffled into. If removeEdgeConnectedCells is set
598  // removes cells based on perpendicularAngle.
600  (
601  const dictionary& motionDict,
602  const bool removeEdgeConnectedCells,
603  const scalarField& perpendicularAngle,
604  const labelList& globalToMasterPatch
605  ) const;
606 
607  //- Returns list with for every face the label of the nearest
608  // patch. Any unreached face (disconnected mesh?) becomes
609  // adaptPatchIDs[0]
610  labelList nearestPatch(const labelList& adaptPatchIDs) const;
611 
612  //- Returns list with for every internal face -1 or the patch
613  // they should be baffled into.
615  (
616  const snapParameters& snapParams,
617  const dictionary& motionDict,
618  const labelList& globalToMasterPatch,
619  const labelList& globalToSlavePatch
620  ) const;
621 
622 
623  // Baffle merging
624 
625  //- Extract those baffles (duplicate) faces that are on the edge
626  // of a baffle region. These are candidates for merging.
628  (
629  const List<labelPair>&,
630  const scalar freeStandingAngle
631  ) const;
632 
633 
634  // Zone handling
635 
636  //- Finds zone per cell for cells inside closed named surfaces.
637  // (uses geometric test for insideness)
638  // Adapts namedSurfaceIndex so all faces on boundary of cellZone
639  // have corresponding faceZone.
641  (
642  const pointField& neiCc,
643  const labelList& closedNamedSurfaces,
644  labelList& namedSurfaceIndex,
645  const labelList& surfaceToCellZone,
646  labelList& cellToZone
647  ) const;
648 
649  //- Finds zone per cell for cells inside region for which name
650  // is specified.
652  (
653  const pointField& locationsInMesh,
654  const labelList& zonesInMesh,
655  const labelList& blockedFace, // per face -1 or some index >= 0
656  labelList& cellToZone
657  ) const;
658 
659  //- Finds zone per cell for cells inside region for which name
660  // is specified.
662  (
663  const pointField& locationsInMesh,
664  const wordList& zoneNamesInMesh,
665  const labelList& faceToZone, // per face -1 or some index >= 0
666  labelList& cellToZone
667  ) const;
668 
669  //- Determines cell zone from cell region information.
670  bool calcRegionToZone
671  (
672  const label surfZoneI,
673  const label ownRegion,
674  const label neiRegion,
675 
676  labelList& regionToCellZone
677  ) const;
678 
679  //- Finds zone per cell. Uses topological walk with all faces
680  // marked in namedSurfaceIndex regarded as blocked.
681  void findCellZoneTopo
682  (
683  const pointField& locationsInMesh,
684  const labelList& allSurfaceIndex,
685  const labelList& namedSurfaceIndex,
686  const labelList& surfaceToCellZone,
687  labelList& cellToZone
688  ) const;
689 
690  //- Make namedSurfaceIndex consistent with cellToZone
691  // - clear out any blocked faces inbetween same cell zone.
693  (
694  const labelList& zoneToNamedSurface,
695  const labelList& cellToZone,
696  labelList& namedSurfaceIndex
697  ) const;
698 
699  //- Calculate cellZone allocation
700  void zonify
701  (
702  const bool allowFreeStandingZoneFaces,
703  const pointField& locationsInMesh,
704  const wordList& zonesInMesh,
705 
706  labelList& cellToZone,
707  labelList& namedSurfaceIndex,
708  PackedBoolList& posOrientation
709  ) const;
710 
711  //- Put cells into cellZone, faces into faceZone
712  void zonify
713  (
714  const PackedBoolList& isMasterFace,
715  const labelList& cellToZone,
716  const labelList& neiCellZone,
717  const labelList& faceToZone,
718  const PackedBoolList& meshFlipMap,
719  polyTopoChange& meshMod
720  ) const;
721 
722  //- Allocate faceZoneName
724  (
725  const label ownZone,
726  const label neiZone,
727  wordPairHashTable& zonesToFaceZone,
728  HashTable<word, labelPair, labelPair::Hash<> >&
729  ) const;
730 
731  //- Remove any loose standing cells
732  void handleSnapProblems
733  (
734  const snapParameters& snapParams,
735  const bool useTopologicalSnapDetection,
736  const bool removeEdgeConnectedCells,
737  const scalarField& perpendicularAngle,
738  const dictionary& motionDict,
739  Time& runTime,
740  const labelList& globalToMasterPatch,
741  const labelList& globalToSlavePatch
742  );
743 
744 
745  // Some patch utilities
746 
747  //- Get all faces in faceToZone that have no cellZone on
748  // either side.
750  (
751  const labelList& faceToZone,
752  const labelList& cellToZone,
753  const labelList& neiCellZone
754  ) const;
755 
756  //- Determine per patch edge the number of master faces. Used
757  // to detect non-manifold situations.
759  (
760  const PackedBoolList& isMasterFace,
761  const indirectPrimitivePatch& patch,
762  labelList& nMasterFaces
763  ) const;
764 
765  //- Determine per patch face the (singly-) connected zone it
766  // is in. Return overall number of zones.
768  (
769  const indirectPrimitivePatch& patch,
770  const labelList& nMasterFaces,
771  labelList& faceToZone
772  ) const;
773 
774  //- Make faces consistent.
776  (
777  const PackedBoolList& isMasterFace,
778  const indirectPrimitivePatch& patch,
779  const labelList& nMasterFaces,
780  const labelList& faceToZone,
781  const Map<label>& zoneToOrientation,
782  PackedBoolList& meshFlipMap
783  ) const;
784 
785 
786  //- Disallow default bitwise copy construct
788 
789  //- Disallow default bitwise assignment
790  void operator=(const meshRefinement&);
791 
792 public:
793 
794  //- Runtime type information
795  ClassName("meshRefinement");
796 
797 
798  // Constructors
799 
800  //- Construct from components
802  (
803  fvMesh& mesh,
804  const scalar mergeDistance,
805  const bool overwrite,
806  const refinementSurfaces&,
807  const refinementFeatures&,
808  const shellSurfaces&,
809  const shellSurfaces&
810  );
811 
812 
813  // Member Functions
814 
815  // Access
816 
817  //- Reference to mesh
818  const fvMesh& mesh() const
819  {
820  return mesh_;
821  }
822  fvMesh& mesh()
823  {
824  return mesh_;
825  }
826 
827  scalar mergeDistance() const
828  {
829  return mergeDistance_;
830  }
831 
832  //- Overwrite the mesh?
833  bool overwrite() const
834  {
835  return overwrite_;
836  }
837 
838  //- (points)instance of mesh upon construction
839  const word& oldInstance() const
840  {
841  return oldInstance_;
842  }
843 
844  //- Reference to surface search engines
845  const refinementSurfaces& surfaces() const
846  {
847  return surfaces_;
848  }
849 
850  //- Reference to feature edge mesh
851  const refinementFeatures& features() const
852  {
853  return features_;
854  }
855 
856  //- Reference to refinement shells (regions)
857  const shellSurfaces& shells() const
858  {
859  return shells_;
860  }
861 
862  //- Reference to meshcutting engine
863  const hexRef8& meshCutter() const
864  {
865  return meshCutter_;
866  }
867 
868  //- Per start-end edge the index of the surface hit
869  const labelList& surfaceIndex() const
870  {
871  return surfaceIndex_;
872  }
873 
875  {
876  return surfaceIndex_;
877  }
878 
879  //- For faces originating from processor faces store the original
880  // patch
881  const Map<label>& faceToCoupledPatch() const
882  {
883  return faceToCoupledPatch_;
884  }
885 
886  //- Additional face data that is maintained across
887  // topo changes. Every entry is a list over all faces.
888  // Bit of a hack. Additional flag to say whether to maintain master
889  // only (false) or increase set to account for face-from-face.
891  {
892  return userFaceData_;
893  }
894 
896  {
897  return userFaceData_;
898  }
899 
900 
901  // Other
902 
903  //- Count number of intersections (local)
904  label countHits() const;
905 
906  //- Redecompose according to cell count
907  // keepZoneFaces : find all faceZones from zoned surfaces and keep
908  // owner and neighbour together
909  // keepBaffles : find all baffles and keep them together
911  (
912  const bool keepZoneFaces,
913  const bool keepBaffles,
914  const scalarField& cellWeights,
915  decompositionMethod& decomposer,
916  fvMeshDistribute& distributor
917  );
918 
919  //- Get faces with intersection.
920  labelList intersectedFaces() const;
921 
922  //- Get points on surfaces with intersection and boundary faces.
924 
925  //- Create patch from set of patches
927  (
928  const polyMesh&,
929  const labelList&
930  );
931 
932  //- Helper function to make a pointVectorField with correct
933  // bcs for mesh movement:
934  // - adaptPatchIDs : fixedValue
935  // - processor : calculated (so free to move)
936  // - cyclic/wedge/symmetry : slip
937  // - other : slip
939  (
940  const pointMesh& pMesh,
941  const labelList& adaptPatchIDs
942  );
943 
944  //- Helper function: check that face zones are synced
945  static void checkCoupledFaceZones(const polyMesh&);
946 
947  //- Helper: calculate edge weights (1/length)
948  static void calculateEdgeWeights
949  (
950  const polyMesh& mesh,
951  const PackedBoolList& isMasterEdge,
952  const labelList& meshPoints,
953  const edgeList& edges,
954  scalarField& edgeWeights,
955  scalarField& invSumWeight
956  );
957 
958  //- Helper: weighted sum (over all subset of mesh points) by
959  // summing contribution from (master) edges
960  template<class Type>
961  static void weightedSum
962  (
963  const polyMesh& mesh,
964  const PackedBoolList& isMasterEdge,
965  const labelList& meshPoints,
966  const edgeList& edges,
967  const scalarField& edgeWeights,
968  const Field<Type>& data,
970  );
971 
972 
973  // Refinement
974 
975  //- Is local topology a small gap?
976  bool isGap
977  (
978  const scalar,
979  const vector&,
980  const vector&,
981  const vector&,
982  const vector&
983  ) const;
984 
985  //- Is local topology a small gap normal to the test vector
986  bool isNormalGap
987  (
988  const scalar,
989  const vector&,
990  const vector&,
991  const vector&,
992  const vector&
993  ) const;
994 
995  //- Calculate list of cells to refine.
997  (
998  const pointField& keepPoints,
999  const scalar curvature,
1000  const scalar planarAngle,
1001 
1002  const bool featureRefinement,
1003  const bool featureDistanceRefinement,
1004  const bool internalRefinement,
1005  const bool surfaceRefinement,
1006  const bool curvatureRefinement,
1007  const bool smallFeatureRefinement,
1008  const bool gapRefinement,
1009  const bool bigGapRefinement,
1010  const bool spreadGapSize,
1011  const label maxGlobalCells,
1012  const label maxLocalCells
1013  ) const;
1014 
1015  //- Refine some cells
1016  autoPtr<mapPolyMesh> refine(const labelList& cellsToRefine);
1017 
1018  //- Refine some cells and rebalance
1020  (
1021  const string& msg,
1022  decompositionMethod& decomposer,
1023  fvMeshDistribute& distributor,
1024  const labelList& cellsToRefine,
1025  const scalar maxLoadUnbalance
1026  );
1027 
1028  //- Balance before refining some cells
1030  (
1031  const string& msg,
1032  decompositionMethod& decomposer,
1033  fvMeshDistribute& distributor,
1034  const labelList& cellsToRefine,
1035  const scalar maxLoadUnbalance
1036  );
1037 
1038 
1039  // Baffle handling
1040 
1041  //- Split off unreachable areas of mesh.
1042  void baffleAndSplitMesh
1043  (
1044  const bool handleSnapProblems,
1045 
1046  // How to remove problem snaps
1047  const snapParameters& snapParams,
1048  const bool useTopologicalSnapDetection,
1049  const bool removeEdgeConnectedCells,
1050  const scalarField& perpendicularAngle,
1051  const dictionary& motionDict,
1052  Time& runTime,
1053  const labelList& globalToMasterPatch,
1054  const labelList& globalToSlavePatch,
1055  const pointField& locationsInMesh,
1056  const wordList& regionsInMesh,
1057  const pointField& locationsOutsideMesh
1058  );
1059 
1060  //- Merge free-standing baffles
1062  (
1063  const snapParameters& snapParams,
1064  const bool useTopologicalSnapDetection,
1065  const bool removeEdgeConnectedCells,
1066  const scalarField& perpendicularAngle,
1067  const scalar planarAngle,
1068  const dictionary& motionDict,
1069  Time& runTime,
1070  const labelList& globalToMasterPatch,
1071  const labelList& globalToSlavePatch,
1072  const pointField& locationsInMesh,
1073  const pointField& locationsOutsideMesh
1074  );
1075 
1076  //- Split off (with optional buffer layers) unreachable areas
1077  // of mesh. Does not introduce baffles.
1079  (
1080  const label nBufferLayers,
1081  const labelList& globalToMasterPatch,
1082  const labelList& globalToSlavePatch,
1083 
1084  const pointField& locationsInMesh,
1085  const wordList& regionsInMesh,
1086  const pointField& locationsOutsideMesh
1087  );
1088 
1089  //- Find boundary points that connect to more than one cell
1090  // region and split them.
1092 
1093  //- Find boundary points that connect to more than one cell
1094  // region and split them.
1096 
1097  //- Find boundary points that are on faceZones of type boundary
1098  // and duplicate them
1100 
1101  //- Merge duplicate points
1103  (
1104  const labelList& pointToDuplicate
1105  );
1106 
1107  //- Create baffle for every internal face where ownPatch != -1.
1108  // External faces get repatched according to ownPatch (neiPatch
1109  // should be -1 for these)
1111  (
1112  const labelList& ownPatch,
1113  const labelList& neiPatch
1114  );
1115 
1116  //- Get zones of given type
1118  (
1120  ) const;
1121 
1122  //- Subset baffles according to zones
1124  (
1125  const polyMesh& mesh,
1126  const labelList& zoneIDs,
1127  const List<labelPair>& baffles
1128  );
1129 
1130  //- Create baffles for faces on faceZones. Return created baffles
1131  // (= pairs of faces) and corresponding faceZone
1133  (
1134  const labelList& zoneIDs,
1135  List<labelPair>& baffles,
1136  labelList& originatingFaceZone
1137  );
1138 
1139  //- Merge baffles. Gets pairs of faces and boundary faces to move
1140  // onto (coupled) patches
1142  (
1143  const List<labelPair>&,
1144  const Map<label>& faceToPatch
1145  );
1146 
1147  //- Merge all baffles on faceZones
1149  (
1150  const bool doInternalZones,
1151  const bool doBaffleZones
1152  );
1153 
1154  //- Put faces/cells into zones according to surface specification.
1155  // Returns null if no zone surfaces present. Regions containing
1156  // locationsInMesh/regionsInMesh will be put in corresponding
1157  // cellZone. keepPoints is for backwards compatibility and sets
1158  // all yet unassigned cells to be non-zoned (zone = -1)
1160  (
1161  const bool allowFreeStandingZoneFaces,
1162  const pointField& locationsInMesh,
1163  const wordList& regionsInMesh,
1164  wordPairHashTable& zonesToFaceZone
1165  );
1166 
1167 
1168  // Other topo changes
1169 
1170  //- Helper:append patch to end of mesh.
1171  static label appendPatch
1172  (
1173  fvMesh&,
1174  const label insertPatchI,
1175  const word&,
1176  const dictionary&
1177  );
1178 
1179  //- Helper:add patch to mesh. Update all registered fields.
1180  // Used by addMeshedPatch to add patches originating from surfaces.
1181  static label addPatch(fvMesh&, const word& name, const dictionary&);
1182 
1183  //- Add patch originating from meshing. Update meshedPatches_.
1184  label addMeshedPatch(const word& name, const dictionary&);
1185 
1186  //- Get patchIDs for patches added in addMeshedPatch.
1187  labelList meshedPatches() const;
1188 
1189  //- Add/lookup faceZone and update information. Return index of
1190  // faceZone
1192  (
1193  const word& fzName,
1194  const word& masterPatch,
1195  const word& slavePatch,
1196  const surfaceZonesInfo::faceZoneType& fzType
1197  );
1198 
1199  //- Lookup faceZone information. Return false if no information
1200  // for faceZone
1201  bool getFaceZoneInfo
1202  (
1203  const word& fzName,
1204  label& masterPatchID,
1205  label& slavePatchID,
1207  ) const;
1208 
1209  //- Select coupled faces that are not collocated
1211 
1212  //- Find any intersection of surface. Store in surfaceIndex_.
1213  void updateIntersections(const labelList& changedFaces);
1214 
1215  //- Find region point is in. Uses optional perturbation to re-test.
1216  static label findRegion
1217  (
1218  const polyMesh&,
1219  const labelList& cellRegion,
1220  const vector& perturbVec,
1221  const point& p
1222  );
1223 
1224  static void findRegions
1225  (
1226  const polyMesh&,
1227  const vector& perturbVec,
1228  const pointField& locationsInMesh,
1229  const pointField& locationsOutsideMesh,
1230  const label nRegions,
1231  labelList& cellRegion
1232  );
1233 
1234  //- Split mesh. Keep part containing point. Return empty map if
1235  // no cells removed.
1237  (
1238  const labelList& globalToMasterPatch,
1239  const labelList& globalToSlavePatch,
1240  const pointField& locationsInMesh,
1241  const pointField& locationsOutsideMesh
1242  );
1243 
1244  //- Split faces into two
1245  void doSplitFaces
1246  (
1247  const labelList& splitFaces,
1248  const labelPairList& splits,
1249  polyTopoChange& meshMod
1250  ) const;
1251 
1252  //- Split faces along diagonal. Maintain mesh quality. Return
1253  // total number of faces split.
1255  (
1256  const labelList& splitFaces,
1257  const labelPairList& splits,
1258  const dictionary& motionDict,
1259 
1260  labelList& duplicateFace,
1261  List<labelPair>& baffles
1262  );
1263 
1264  //- Update local numbering for mesh redistribution
1265  void distribute(const mapDistributePolyMesh&);
1266 
1267  //- Update for external change to mesh. changedFaces are in new mesh
1268  // face labels.
1269  void updateMesh
1270  (
1271  const mapPolyMesh&,
1272  const labelList& changedFaces
1273  );
1274 
1275  //- Helper: reorder list according to map.
1276  template<class T>
1277  static void updateList
1278  (
1279  const labelList& newToOld,
1280  const T& nullValue,
1281  List<T>& elems
1282  );
1283 
1284 
1285  // Restoring : is where other processes delete and reinsert data.
1286 
1287  //- Signal points/face/cells for which to store data
1288  void storeData
1289  (
1290  const labelList& pointsToStore,
1291  const labelList& facesToStore,
1292  const labelList& cellsToStore
1293  );
1294 
1295  //- Update local numbering + undo
1296  // Data to restore given as new pointlabel + stored pointlabel
1297  // (i.e. what was in pointsToStore)
1298  void updateMesh
1299  (
1300  const mapPolyMesh&,
1301  const labelList& changedFaces,
1302  const Map<label>& pointsToRestore,
1303  const Map<label>& facesToRestore,
1304  const Map<label>& cellsToRestore
1305  );
1306 
1307  // Merging coplanar faces and edges
1308 
1309  //- Merge coplanar faces if sets are of size mergeSize
1310  // (usually 4)
1312  (
1313  const scalar minCos,
1314  const scalar concaveCos,
1315  const label mergeSize,
1316  const labelList& patchIDs
1317  );
1318 
1319  //- Merge coplanar faces. preserveFaces is != -1 for faces
1320  // to be preserved
1322  (
1323  const scalar minCos,
1324  const scalar concaveCos,
1325  const labelList& patchIDs,
1326  const dictionary& motionDict,
1327  const labelList& preserveFaces
1328  );
1329 
1331  (
1332  removePoints& pointRemover,
1333  const boolList& pointCanBeDeleted
1334  );
1335 
1337  (
1338  removePoints& pointRemover,
1339  const labelList& facesToRestore
1340  );
1341 
1343  (
1344  const labelList& candidateFaces,
1345  const labelHashSet& set
1346  ) const;
1347 
1348  // Pick up faces of cells of faces in set.
1350  (
1351  const labelHashSet& set
1352  ) const;
1353 
1354  //- Merge edges, maintain mesh quality. Return global number
1355  // of edges merged
1357  (
1358  const scalar minCos,
1359  const dictionary& motionDict
1360  );
1361 
1362 
1363  // Debug/IO
1364 
1365  //- Debugging: check that all faces still obey start()>end()
1366  void checkData();
1367 
1368  static void testSyncPointList
1369  (
1370  const string& msg,
1371  const polyMesh& mesh,
1372  const List<scalar>& fld
1373  );
1374 
1375  static void testSyncPointList
1376  (
1377  const string& msg,
1378  const polyMesh& mesh,
1379  const List<point>& fld
1380  );
1381 
1382  //- Compare two lists over all boundary faces
1383  template<class T>
1385  (
1386  const scalar mergeDistance,
1387  const string&,
1388  const UList<T>&,
1389  const UList<T>&
1390  ) const;
1391 
1392  //- Print list according to (collected and) sorted coordinate
1393  template<class T>
1394  static void collectAndPrint
1395  (
1396  const UList<point>& points,
1397  const UList<T>& data
1398  );
1399 
1400  //- Determine master point for subset of points. If coupled
1401  // chooses only one
1403  (
1404  const polyMesh& mesh,
1405  const labelList& meshPoints
1406  );
1407 
1408  //- Determine master edge for subset of edges. If coupled
1409  // chooses only one
1411  (
1412  const polyMesh& mesh,
1413  const labelList& meshEdges
1414  );
1415 
1416  //- Print some mesh stats.
1417  void printMeshInfo(const bool, const string&) const;
1418 
1419  //- Replacement for Time::timeName() : return oldInstance (if
1420  // overwrite_)
1421  word timeName() const;
1422 
1423  //- Set instance of all local IOobjects
1424  void setInstance(const fileName&);
1425 
1426  //- Write mesh and all data
1427  bool write() const;
1428 
1429  //- Write refinement level as volScalarFields for postprocessing
1430  void dumpRefinementLevel() const;
1431 
1432  //- Debug: Write intersection information to OBJ format
1433  void dumpIntersections(const fileName& prefix) const;
1434 
1435  //- Do any one of above IO functions
1436  void write
1437  (
1438  const debugType debugFlags,
1439  const writeType writeFlags,
1440  const fileName&
1441  ) const;
1442 
1443  //- Helper: calculate average
1444  template<class T>
1445  static T gAverage
1446  (
1447  const PackedBoolList& isMasterElem,
1448  const UList<T>& values
1449  );
1450 
1451  //- Get/set write level
1452  static writeType writeLevel();
1453  static void writeLevel(const writeType);
1454 
1455  //- Get/set output level
1456  static outputType outputLevel();
1457  static void outputLevel(const outputType);
1458 
1459 
1460  //- Helper: convert wordList into bit pattern using provided
1461  // NamedEnum
1462  template<class Enum>
1463  static int readFlags(const Enum& namedEnum, const wordList&);
1464 
1465 };
1466 
1467 
1468 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1469 
1470 } // End namespace Foam
1471 
1472 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1473 
1474 #ifdef NoRepository
1475 # include "meshRefinementTemplates.C"
1476 #endif
1477 
1478 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1479 
1480 #endif
1481 
1482 // ************************************************************************* //
Foam::meshRefinement::writeLevel_
static writeType writeLevel_
Control of writing level.
Definition: meshRefinement.H:152
Foam::meshRefinement::isNormalGap
bool isNormalGap(const scalar, const vector &, const vector &, const vector &, const vector &) const
Is local topology a small gap normal to the test vector.
Definition: meshRefinementRefine.C:1600
Foam::meshRefinement::shells
const shellSurfaces & shells() const
Reference to refinement shells (regions)
Definition: meshRefinement.H:856
Foam::meshRefinement::mergePoints
autoPtr< mapPolyMesh > mergePoints(const labelList &pointToDuplicate)
Merge duplicate points.
Definition: meshRefinementBaffles.C:4045
Foam::meshRefinement::WRITELEVELS
@ WRITELEVELS
Definition: meshRefinement.H:133
Foam::meshRefinement::findCellZoneInsideWalk
void findCellZoneInsideWalk(const pointField &locationsInMesh, const labelList &zonesInMesh, const labelList &blockedFace, labelList &cellToZone) const
Finds zone per cell for cells inside region for which name.
Definition: meshRefinementBaffles.C:1667
Foam::meshRefinement::userFaceData
const List< Tuple2< mapType, labelList > > & userFaceData() const
Additional face data that is maintained across.
Definition: meshRefinement.H:889
Foam::meshRefinement::baffleAndSplitMesh
void baffleAndSplitMesh(const bool handleSnapProblems, const snapParameters &snapParams, const bool useTopologicalSnapDetection, const bool removeEdgeConnectedCells, const scalarField &perpendicularAngle, const dictionary &motionDict, Time &runTime, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const pointField &locationsInMesh, const wordList &regionsInMesh, const pointField &locationsOutsideMesh)
Split off unreachable areas of mesh.
Definition: meshRefinementBaffles.C:3431
Foam::meshRefinement::calcRegionToZone
bool calcRegionToZone(const label surfZoneI, const label ownRegion, const label neiRegion, labelList &regionToCellZone) const
Determines cell zone from cell region information.
Definition: meshRefinementBaffles.C:1814
Foam::meshRefinement::markPatchZones
label markPatchZones(const indirectPrimitivePatch &patch, const labelList &nMasterFaces, labelList &faceToZone) const
Determine per patch face the (singly-) connected zone it.
Definition: meshRefinementBaffles.C:2819
Foam::PackedBoolList
A bit-packed bool list.
Definition: PackedBoolList.H:63
Foam::meshRefinement::userFaceData
List< Tuple2< mapType, labelList > > & userFaceData()
Definition: meshRefinement.H:894
pointIndexHit.H
Foam::localPointRegion
Takes mesh with 'baffles' (= boundary faces sharing points). Determines for selected points on bounda...
Definition: localPointRegion.H:67
Foam::meshRefinement::splitMesh
autoPtr< mapPolyMesh > splitMesh(const label nBufferLayers, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const pointField &locationsInMesh, const wordList &regionsInMesh, const pointField &locationsOutsideMesh)
Split off (with optional buffer layers) unreachable areas.
Definition: meshRefinementBaffles.C:3699
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
Foam::meshRefinement::WRITEMESH
@ WRITEMESH
Definition: meshRefinement.H:132
Foam::surfaceZonesInfo::faceZoneType
faceZoneType
What to do with faceZone faces.
Definition: surfaceZonesInfo.H:73
Foam::meshRefinement::dumpIntersections
void dumpIntersections(const fileName &prefix) const
Debug: Write intersection information to OBJ format.
Definition: meshRefinement.C:2963
Foam::meshRefinement::IOOUTPUTLAYERINFO
@ IOOUTPUTLAYERINFO
Definition: meshRefinement.H:113
Foam::meshRefinement::isCollapsedCell
bool isCollapsedCell(const pointField &, const scalar volFraction, const label cellI) const
Definition: meshRefinementProblemCells.C:358
Foam::meshRefinement::findRegions
static void findRegions(const polyMesh &, const vector &perturbVec, const pointField &locationsInMesh, const pointField &locationsOutsideMesh, const label nRegions, labelList &cellRegion)
Definition: meshRefinement.C:2321
Foam::meshRefinement::isCollapsedFace
bool isCollapsedFace(const pointField &, const pointField &neiCc, const scalar minFaceArea, const scalar maxNonOrtho, const label faceI) const
Definition: meshRefinementProblemCells.C:287
Foam::meshRefinement::createBaffles
autoPtr< mapPolyMesh > createBaffles(const labelList &ownPatch, const labelList &neiPatch)
Create baffle for every internal face where ownPatch != -1.
Definition: meshRefinementBaffles.C:532
p
p
Definition: pEqn.H:62
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::meshRefinement::IOATTRACTION
@ IOATTRACTION
Definition: meshRefinement.H:96
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::meshRefinement::getIntersections
void getIntersections(const labelList &surfacesToTest, const pointField &neiCc, const labelList &testFaces, labelList &globalRegion1, labelList &globalRegion2) const
Calculate intersections. Return per face -1 or the global.
Definition: meshRefinementBaffles.C:173
Foam::meshRefinement::calcCellCellRays
void calcCellCellRays(const pointField &neiCc, const labelList &neiLevel, const labelList &testFaces, pointField &start, pointField &end, labelList &minLevel) const
Calculate rays from cell-centre to cell-centre and corresponding.
Definition: meshRefinement.C:219
Foam::meshRefinement::calcPatchNumMasterFaces
void calcPatchNumMasterFaces(const PackedBoolList &isMasterFace, const indirectPrimitivePatch &patch, labelList &nMasterFaces) const
Determine per patch edge the number of master faces. Used.
Definition: meshRefinementBaffles.C:2783
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:2224
Foam::meshRefinement::IOLAYERINFO
@ IOLAYERINFO
Definition: meshRefinement.H:97
Foam::removePoints
Removes selected points from mesh and updates faces using these points.
Definition: removePoints.H:58
Tuple2.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::meshRefinement::intersectedPoints
labelList intersectedPoints() const
Get points on surfaces with intersection and boundary faces.
Definition: meshRefinement.C:1575
Foam::meshRefinement::IOoutputType
IOoutputType
Enumeration for what to output.
Definition: meshRefinement.H:111
Foam::removeCells
Given list of cells to remove insert all the topology changes.
Definition: removeCells.H:59
Foam::meshRefinement::markFeatureRefinement
label markFeatureRefinement(const pointField &keepPoints, const label nAllowRefine, labelList &refineCell, label &nRefine) const
Calculate list of cells to refine based on intersection of.
Definition: meshRefinementRefine.C:656
Foam::meshRefinement::mergeDistance_
const scalar mergeDistance_
Tolerance used for sorting coordinates (used in 'less' routine)
Definition: meshRefinement.H:164
Foam::meshRefinement::collectFaces
labelList collectFaces(const labelList &candidateFaces, const labelHashSet &set) const
Definition: meshRefinementMerge.C:763
mapPolyMesh.H
Foam::meshRefinement::handleSnapProblems
void handleSnapProblems(const snapParameters &snapParams, const bool useTopologicalSnapDetection, const bool removeEdgeConnectedCells, const scalarField &perpendicularAngle, const dictionary &motionDict, Time &runTime, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch)
Remove any loose standing cells.
Definition: meshRefinementBaffles.C:2625
Foam::meshRefinement::writeLevel
static writeType writeLevel()
Get/set write level.
Definition: meshRefinement.C:3065
Foam::meshRefinement::markBoundaryFace
void markBoundaryFace(const label faceI, boolList &isBoundaryFace, boolList &isBoundaryEdge, boolList &isBoundaryPoint) const
Helper function to mark face as being on 'boundary'. Used by.
Definition: meshRefinementProblemCells.C:49
Foam::meshRefinement::intersectedFaces
labelList intersectedFaces() const
Get faces with intersection.
Definition: meshRefinement.C:1548
Foam::meshRefinement::markFeatureCellLevel
void markFeatureCellLevel(const pointField &keepPoints, labelList &maxFeatureLevel) const
Mark every cell with level of feature passing through it.
Definition: meshRefinementRefine.C:316
Foam::meshRefinement::printMeshInfo
void printMeshInfo(const bool, const string &) const
Print some mesh stats.
Definition: meshRefinement.C:2820
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:2145
Foam::meshRefinement::REMOVE
@ REMOVE
Definition: meshRefinement.H:143
Foam::meshRefinement::getZones
labelList getZones(const List< surfaceZonesInfo::faceZoneType > &fzTypes) const
Get zones of given type.
Definition: meshRefinementBaffles.C:712
Foam::meshRefinement::OUTPUTLAYERINFO
@ OUTPUTLAYERINFO
Definition: meshRefinement.H:118
Foam::meshRefinement::markInternalGapRefinement
label markInternalGapRefinement(const scalar planarCos, const bool spreadGapSize, const label nAllowRefine, labelList &refineCell, label &nRefine, labelList &numGapCells, scalarField &gapSize) const
Mark cells for non-surface intersection based gap refinement.
Definition: meshRefinementGapRefine.C:1091
Foam::meshRefinement::IOMESH
@ IOMESH
Definition: meshRefinement.H:92
Foam::meshRefinement::ATTRACTION
@ ATTRACTION
Definition: meshRefinement.H:106
Foam::surfaceLocation
Contains information about location on a triSurface:
Definition: surfaceLocation.H:60
Foam::polyTopoChange
Direct mesh changes based on v1.3 polyTopoChange syntax.
Definition: polyTopoChange.H:97
Foam::meshRefinement::countHits
label countHits() const
Count number of intersections (local)
Definition: meshRefinement.C:1273
Foam::meshRefinement::surfaceIndex
const labelList & surfaceIndex() const
Per start-end edge the index of the surface hit.
Definition: meshRefinement.H:868
Foam::meshRefinement::markProximityRefinement
label markProximityRefinement(const scalar curvature, const label nAllowRefine, const labelList &neiLevel, const pointField &neiCc, labelList &refineCell, label &nRefine) const
Mark cells for surface proximity based refinement.
Definition: meshRefinementRefine.C:1740
Foam::meshRefinement::faceZoneToType_
HashTable< surfaceZonesInfo::faceZoneType, word > faceZoneToType_
FaceZone to method to handle faces.
Definition: meshRefinement.H:212
Foam::meshRefinement::IOdebugType
IOdebugType
Enumeration for what to debug.
Definition: meshRefinement.H:90
Foam::meshRefinement::checkProximity
bool checkProximity(const scalar planarCos, const label nAllowRefine, const label surfaceLevel, const vector &surfaceLocation, const vector &surfaceNormal, const label cellI, label &cellMaxLevel, vector &cellMaxLocation, vector &cellMaxNormal, labelList &refineCell, label &nRefine) const
Mark cell if local a gap topology or.
Definition: meshRefinementRefine.C:1657
Foam::Map< label >
Foam::meshRefinement::IOoutputTypeNames
static const NamedEnum< IOoutputType, 1 > IOoutputTypeNames
Definition: meshRefinement.H:115
Foam::meshRefinement::appendPatch
static label appendPatch(fvMesh &, const label insertPatchI, const word &, const dictionary &)
Helper:append patch to end of mesh.
Definition: meshRefinement.C:1891
Foam::meshRefinement::markSmallFeatureRefinement
label markSmallFeatureRefinement(const scalar planarCos, const label nAllowRefine, const labelList &neiLevel, const pointField &neiCc, labelList &refineCell, label &nRefine) const
Refine cells containing small gaps.
Definition: meshRefinementGapRefine.C:1464
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:855
Foam::meshRefinement::oldInstance_
const word oldInstance_
Instance of mesh upon construction. Used when in overwrite_ mode.
Definition: meshRefinement.H:170
Foam::meshRefinement::IOwriteTypeNames
static const NamedEnum< IOwriteType, 4 > IOwriteTypeNames
Definition: meshRefinement.H:129
Foam::meshRefinement::markFacesOnProblemCellsGeometric
labelList markFacesOnProblemCellsGeometric(const snapParameters &snapParams, const dictionary &motionDict, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch) const
Returns list with for every internal face -1 or the patch.
Definition: meshRefinementProblemCells.C:1086
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:2489
Foam::meshRefinement::calculateEdgeWeights
static void calculateEdgeWeights(const polyMesh &mesh, const PackedBoolList &isMasterEdge, const labelList &meshPoints, const edgeList &edges, scalarField &edgeWeights, scalarField &invSumWeight)
Helper: calculate edge weights (1/length)
Definition: meshRefinement.C:1835
Foam::meshRefinement::IOwriteType
IOwriteType
Enumeration for what to write.
Definition: meshRefinement.H:122
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:2388
Foam::meshRefinement::oldInstance
const word & oldInstance() const
(points)instance of mesh upon construction
Definition: meshRefinement.H:838
Foam::HashSet< label, Hash< label > >
Foam::meshRefinement::overwrite_
const bool overwrite_
Overwrite the mesh?
Definition: meshRefinement.H:167
Foam::meshRefinement::mesh
const fvMesh & mesh() const
Reference to mesh.
Definition: meshRefinement.H:817
Foam::meshRefinement::unmarkInternalRefinement
label unmarkInternalRefinement(labelList &refineCell, label &nRefine) const
Unmark cells for refinement based on limit-shells. Return number.
Definition: meshRefinementRefine.C:873
Foam::meshRefinement::addPatch
static label addPatch(fvMesh &, const word &name, const dictionary &)
Helper:add patch to mesh. Update all registered fields.
Definition: meshRefinement.C:1990
Foam::meshRefinement::doSplitFaces
void doSplitFaces(const labelList &splitFaces, const labelPairList &splits, polyTopoChange &meshMod) const
Split faces into two.
Definition: meshRefinement.C:740
Foam::meshRefinement::getChangedFaces
static labelList getChangedFaces(const mapPolyMesh &, const labelList &oldCellsToRefine)
Find out which faces have changed given cells (old mesh labels)
Definition: meshRefinementRefine.C:117
Foam::mode
mode_t mode(const fileName &)
Return the file mode.
Definition: POSIX.C:573
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::meshRefinement::updateList
static void updateList(const labelList &newToOld, const T &nullValue, List< T > &elems)
Helper: reorder list according to map.
Definition: meshRefinementTemplates.C:35
Foam::meshRefinement::IOOBJINTERSECTIONS
@ IOOBJINTERSECTIONS
Definition: meshRefinement.H:94
Foam::meshRefinement::IOdebugTypeNames
static const NamedEnum< IOdebugType, 5 > IOdebugTypeNames
Definition: meshRefinement.H:99
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:739
Foam::meshRefinement::markInternalRefinement
label markInternalRefinement(const label nAllowRefine, labelList &refineCell, label &nRefine) const
Mark cells for refinement-shells based refinement.
Definition: meshRefinementRefine.C:796
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:2045
Foam::meshRefinement::surfaces_
const refinementSurfaces & surfaces_
All surface-intersection interaction.
Definition: meshRefinement.H:173
Foam::meshRefinement::nearestPatch
labelList nearestPatch(const labelList &adaptPatchIDs) const
Returns list with for every face the label of the nearest.
Definition: meshRefinementProblemCells.C:378
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:680
Foam::meshRefinement::makeConsistentFaceIndex
void makeConsistentFaceIndex(const labelList &zoneToNamedSurface, const labelList &cellToZone, labelList &namedSurfaceIndex) const
Make namedSurfaceIndex consistent with cellToZone.
Definition: meshRefinementBaffles.C:2077
Foam::meshRefinement::findCellZoneGeometric
void findCellZoneGeometric(const pointField &neiCc, const labelList &closedNamedSurfaces, labelList &namedSurfaceIndex, const labelList &surfaceToCellZone, labelList &cellToZone) const
Finds zone per cell for cells inside closed named surfaces.
Definition: meshRefinementBaffles.C:1426
Foam::meshRefinement::markSurfaceGapRefinement
label markSurfaceGapRefinement(const scalar planarCos, const label nAllowRefine, const labelList &neiLevel, const pointField &neiCc, labelList &refineCell, label &nRefine) const
Mark cells intersected by the surface if they are inside.
Definition: meshRefinementGapRefine.C:43
Foam::meshRefinement::limitShells_
const shellSurfaces & limitShells_
All limit-refinement interaction.
Definition: meshRefinement.H:182
Foam::snapParameters
Simple container to keep together snap specific information.
Definition: snapParameters.H:50
Foam::meshRefinement::splitMeshRegions
autoPtr< mapPolyMesh > splitMeshRegions(const labelList &globalToMasterPatch, const labelList &globalToSlavePatch, const pointField &locationsInMesh, const pointField &locationsOutsideMesh)
Split mesh. Keep part containing point. Return empty map if.
Definition: meshRefinement.C:2403
Foam::meshRefinement::OBJINTERSECTIONS
@ OBJINTERSECTIONS
Definition: meshRefinement.H:104
Foam::meshRefinement::FEATURESEEDS
@ FEATURESEEDS
Definition: meshRefinement.H:105
Foam::shellSurfaces
Encapsulates queries for volume refinement ('refine all cells within shell').
Definition: shellSurfaces.H:52
volumeType.H
Foam::meshRefinement::findCellZoneTopo
void findCellZoneTopo(const pointField &locationsInMesh, const labelList &allSurfaceIndex, const labelList &namedSurfaceIndex, const labelList &surfaceToCellZone, labelList &cellToZone) const
Finds zone per cell. Uses topological walk with all faces.
Definition: meshRefinementBaffles.C:1872
Foam::meshRefinement::surfaceIndex_
labelIOList surfaceIndex_
Per cc-cc vector the index of the surface hit.
Definition: meshRefinement.H:188
Foam::meshRefinement::timeName
word timeName() const
Replacement for Time::timeName() : return oldInstance (if.
Definition: meshRefinement.C:2888
Foam::meshRefinement::meshedPatches_
wordList meshedPatches_
Meshed patches - are treated differently. Stored as wordList since.
Definition: meshRefinement.H:203
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::volumeType
Definition: volumeType.H:54
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::meshRefinement::markSurfaceRefinement
label markSurfaceRefinement(const label nAllowRefine, const labelList &neiLevel, const pointField &neiCc, labelList &refineCell, label &nRefine) const
Mark cells for surface intersection based refinement.
Definition: meshRefinementRefine.C:965
Foam::meshRefinement::checkCoupledFaceZones
static void checkCoupledFaceZones(const polyMesh &)
Helper function: check that face zones are synced.
Definition: meshRefinement.C:1747
Foam::meshRefinement::LAYERINFO
@ LAYERINFO
Definition: meshRefinement.H:107
Foam::meshRefinement::mapType
mapType
Enumeration for how the userdata is to be mapped upon refinement.
Definition: meshRefinement.H:139
hexRef8.H
Foam::meshRefinement::reorderPatchFields
static void reorderPatchFields(fvMesh &, const labelList &oldToNew)
Reorder patchfields of all fields on mesh.
Definition: meshRefinementTemplates.C:239
Foam::meshRefinement::faceToCoupledPatch
const Map< label > & faceToCoupledPatch() const
For faces originating from processor faces store the original.
Definition: meshRefinement.H:880
Foam::meshRefinement::markInternalDistanceToFeatureRefinement
label markInternalDistanceToFeatureRefinement(const label nAllowRefine, labelList &refineCell, label &nRefine) const
Mark cells for distance-to-feature based refinement.
Definition: meshRefinementRefine.C:712
Foam::meshRefinement::meshedPatches
labelList meshedPatches() const
Get patchIDs for patches added in addMeshedPatch.
Definition: meshRefinement.C:2118
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)
Merge free-standing baffles.
Definition: meshRefinementBaffles.C:3606
Foam::meshRefinement::markForRefine
static bool markForRefine(const label markValue, const label nAllowRefine, label &cellValue, label &nRefine)
Mark cell for refinement (if not already marked). Return false.
Definition: meshRefinementRefine.C:297
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:55
Foam::meshRefinement::doRemovePoints
autoPtr< mapPolyMesh > doRemovePoints(removePoints &pointRemover, const boolList &pointCanBeDeleted)
Definition: meshRefinementMerge.C:632
Foam::meshRefinement::findEdgeConnectedProblemCells
Map< label > findEdgeConnectedProblemCells(const scalarField &perpendicularAngle, const labelList &) const
Definition: meshRefinementProblemCells.C:139
Foam::meshRefinement::ClassName
ClassName("meshRefinement")
Runtime type information.
Foam::meshRefinement::freeStandingBaffleFaces
labelList freeStandingBaffleFaces(const labelList &faceToZone, const labelList &cellToZone, const labelList &neiCellZone) const
Get all faces in faceToZone that have no cellZone on.
Definition: meshRefinementBaffles.C:2719
Foam::meshRefinement::IOWRITELAYERFIELDS
@ IOWRITELAYERFIELDS
Definition: meshRefinement.H:127
Foam::meshRefinement::freeStandingBaffles
List< labelPair > freeStandingBaffles(const List< labelPair > &, const scalar freeStandingAngle) const
Extract those baffles (duplicate) faces that are on the edge.
Definition: meshRefinementBaffles.C:944
Foam::meshRefinement::meshCutter_
hexRef8 meshCutter_
Refinement engine.
Definition: meshRefinement.H:185
Foam::meshRefinement::mergeEdgesUndo
label mergeEdgesUndo(const scalar minCos, const dictionary &motionDict)
Merge edges, maintain mesh quality. Return global number.
Definition: meshRefinementMerge.C:837
Foam::meshRefinement::IOFEATURESEEDS
@ IOFEATURESEEDS
Definition: meshRefinement.H:95
Foam::meshRefinement::distribute
void distribute(const mapDistributePolyMesh &)
Update local numbering for mesh redistribution.
Definition: meshRefinement.C:2505
meshRefinementTemplates.C
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:159
surfaceZonesInfo.H
Foam::meshRefinement::allocateInterRegionFaceZone
void allocateInterRegionFaceZone(const label ownZone, const label neiZone, wordPairHashTable &zonesToFaceZone, HashTable< word, labelPair, labelPair::Hash<> > &) const
Allocate faceZoneName.
Definition: meshRefinementBaffles.C:3364
Foam::meshRefinement::getRefineCandidateFaces
labelList getRefineCandidateFaces(const labelList &refineCell) const
Collect faces that are intersected and whose neighbours aren't.
Definition: meshRefinementRefine.C:925
Foam::meshRefinement::mergeZoneBaffles
autoPtr< mapPolyMesh > mergeZoneBaffles(const bool doInternalZones, const bool doBaffleZones)
Merge all baffles on faceZones.
Definition: meshRefinementBaffles.C:1386
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::meshRefinement::makePatch
static autoPtr< indirectPrimitivePatch > makePatch(const polyMesh &, const labelList &)
Create patch from set of patches.
Definition: meshRefinement.C:1644
Foam::meshRefinement::readFlags
static int readFlags(const Enum &namedEnum, const wordList &)
Helper: convert wordList into bit pattern using provided.
Definition: meshRefinementTemplates.C:261
fld
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Foam::decompositionMethod
Abstract base class for decomposition.
Definition: decompositionMethod.H:48
Foam::meshRefinement::addPatchFields
static void addPatchFields(fvMesh &, const word &patchFieldType)
Add patchfield of given type to all fields on mesh.
Definition: meshRefinementTemplates.C:205
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:102
Foam::meshRefinement::calcNeighbourData
void calcNeighbourData(labelList &neiLevel, pointField &neiCc) const
Calculate coupled boundary end vector and refinement level.
Definition: meshRefinement.C:125
Foam::meshRefinement::weightedSum
static void weightedSum(const polyMesh &mesh, const PackedBoolList &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:280
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam::meshRefinement::countMatches
label countMatches(const List< point > &normals1, const List< point > &normals2, const scalar tol=1e-6) const
Helper: count number of normals1 that are in normals2.
Definition: meshRefinementRefine.C:1097
Foam::meshRefinement::mergeDistance
scalar mergeDistance() const
Definition: meshRefinement.H:826
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::pointMesh
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:48
Foam::meshRefinement::mesh_
fvMesh & mesh_
Reference to mesh.
Definition: meshRefinement.H:161
Foam::meshRefinement::markSurfaceCurvatureRefinement
label markSurfaceCurvatureRefinement(const scalar curvature, const label nAllowRefine, const labelList &neiLevel, const pointField &neiCc, labelList &refineCell, label &nRefine) const
Mark cells for surface curvature based refinement. Marks if.
Definition: meshRefinementRefine.C:1127
Foam::e
const double e
Elementary charge.
Definition: doubleFloat.H:94
Foam::meshRefinement::updateMesh
void updateMesh(const mapPolyMesh &, const labelList &changedFaces)
Update for external change to mesh. changedFaces are in new mesh.
Definition: meshRefinement.C:2568
Foam::meshRefinement::userFaceData_
List< Tuple2< mapType, labelList > > userFaceData_
User supplied face based data.
Definition: meshRefinement.H:199
Foam::meshRefinement::features_
const refinementFeatures & features_
All feature-edge interaction.
Definition: meshRefinement.H:176
Foam::meshRefinement::getMasterEdges
static PackedBoolList getMasterEdges(const polyMesh &mesh, const labelList &meshEdges)
Determine master edge for subset of edges. If coupled.
Definition: meshRefinement.C:2784
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:1292
Foam::meshRefinement::zonify
void zonify(const bool allowFreeStandingZoneFaces, const pointField &locationsInMesh, const wordList &zonesInMesh, labelList &cellToZone, labelList &namedSurfaceIndex, PackedBoolList &posOrientation) const
Calculate cellZone allocation.
Definition: meshRefinementBaffles.C:2310
Foam::meshRefinement::faceZoneToMasterPatch_
HashTable< word, word > faceZoneToMasterPatch_
FaceZone to master patch name.
Definition: meshRefinement.H:206
Foam::meshRefinement::mergeGapInfo
void mergeGapInfo(const FixedList< label, 3 > &shellGapInfo, const volumeType shellGapMode, const FixedList< label, 3 > &surfGapInfo, const volumeType surfGapMode, FixedList< label, 3 > &gapInfo, volumeType &gapMode) const
Merge gap information coming from shell and from surface.
Definition: meshRefinementGapRefine.C:1057
Foam::meshRefinement::meshRefinement
meshRefinement(const meshRefinement &)
Disallow default bitwise copy construct.
Foam::meshRefinement::setInstance
void setInstance(const fileName &)
Set instance of all local IOobjects.
Definition: meshRefinement.C:670
Foam::meshRefinement::mergePatchFaces
label mergePatchFaces(const scalar minCos, const scalar concaveCos, const label mergeSize, const labelList &patchIDs)
Merge coplanar faces if sets are of size mergeSize.
Definition: meshRefinementMerge.C:39
Foam::meshRefinement::selectGapCandidates
void selectGapCandidates(const labelList &refineCell, const label nRefine, labelList &cellMap, List< FixedList< label, 3 > > &shellGapInfo, List< volumeType > &shellGapMode) const
Select candidate cells (cells inside a shell with gapLevel.
Definition: meshRefinementGapRefine.C:995
Foam::HashTable
An STL-conforming hash table.
Definition: HashTable.H:61
Foam::meshRefinement::WRITELAYERFIELDS
@ WRITELAYERFIELDS
Definition: meshRefinement.H:135
Foam::meshRefinement::selectSeparatedCoupledFaces
void selectSeparatedCoupledFaces(boolList &) const
Select coupled faces that are not collocated.
Definition: meshRefinement.C:2197
Foam::meshRefinement::features
const refinementFeatures & features() const
Reference to feature edge mesh.
Definition: meshRefinement.H:850
Foam::meshRefinement::gAverage
static T gAverage(const PackedBoolList &isMasterElem, const UList< T > &values)
Helper: calculate average.
Definition: meshRefinementTemplates.C:59
Foam::meshRefinement::IOWRITEMESH
@ IOWRITEMESH
Definition: meshRefinement.H:124
Foam::meshRefinement::meshCutter
const hexRef8 & meshCutter() const
Reference to meshcutting engine.
Definition: meshRefinement.H:862
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:1543
wordPairHashTable.H
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::meshRefinement::dupNonManifoldBoundaryPoints
autoPtr< mapPolyMesh > dupNonManifoldBoundaryPoints()
Find boundary points that are on faceZones of type boundary.
Definition: meshRefinementBaffles.C:4113
Foam::refineCell
Container with cells to refine. Refinement given as single direction.
Definition: refineCell.H:52
Foam::meshRefinement::getMasterPoints
static PackedBoolList getMasterPoints(const polyMesh &mesh, const labelList &meshPoints)
Determine master point for subset of points. If coupled.
Definition: meshRefinement.C:2747
DynamicField.H
Foam::meshRefinement::getInsideCells
labelList getInsideCells(const word &) const
Get cells which are inside any closed surface. Note that.
Foam::meshRefinement::mesh
fvMesh & mesh()
Definition: meshRefinement.H:821
Foam::Pair
An ordered pair of two objects of type <T> with first() and second() elements.
Definition: contiguous.H:49
Foam::meshRefinement::getZoneBafflePatches
Map< labelPair > getZoneBafflePatches(const bool allowBoundary, const labelList &globalToMasterPatch, const labelList &globalToSlavePatch) const
Get faces to repatch. Returns map from face to patch.
Definition: meshRefinementBaffles.C:467
Foam::hexRef8
Refinement of (split) hexes using polyTopoChange.
Definition: hexRef4.H:64
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:1207
Foam::meshRefinement::mergePatchFacesUndo
label mergePatchFacesUndo(const scalar minCos, const scalar concaveCos, const labelList &patchIDs, const dictionary &motionDict, const labelList &preserveFaces)
Merge coplanar faces. preserveFaces is != -1 for faces.
Definition: meshRefinementMerge.C:253
Foam::refinementFeatures
Encapsulates queries for features.
Definition: refinementFeatures.H:51
Foam::Vector< scalar >
Foam::meshRefinement::writeType
writeType
Definition: meshRefinement.H:130
Foam::meshRefinement::createBaffle
label createBaffle(const label faceI, const label ownPatch, const label neiPatch, polyTopoChange &meshMod) const
Repatches external face or creates baffle for internal face.
Definition: meshRefinementBaffles.C:60
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:59
Foam::meshRefinement::findNearest
void findNearest(const labelList &meshFaces, List< pointIndexHit > &nearestInfo, labelList &nearestSurface, labelList &nearestRegion, vectorField &nearestNormal) const
Definition: meshRefinementProblemCells.C:75
Foam::FixedList< label, 3 >
pointFieldsFwd.H
Foam::meshRefinement::checkData
void checkData()
Debugging: check that all faces still obey start()>end()
Definition: meshRefinement.C:466
Foam::meshRefinement
Helper class which maintains intersections of (changing) mesh with (static) surfaces.
Definition: meshRefinement.H:82
Foam::UList< T >
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:773
Foam::meshRefinement::write
bool write() const
Write mesh and all data.
Definition: meshRefinement.C:2707
Foam::IOList< label >
Foam::sum
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
Definition: DimensionedFieldFunctions.C:333
Foam::meshRefinement::addMeshedPatch
label addMeshedPatch(const word &name, const dictionary &)
Add patch originating from meshing. Update meshedPatches_.
Definition: meshRefinement.C:2068
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:2580
Foam::meshRefinement::testSyncPointList
static void testSyncPointList(const string &msg, const polyMesh &mesh, const List< scalar > &fld)
Definition: meshRefinement.C:373
Foam::meshRefinement::KEEPALL
@ KEEPALL
Definition: meshRefinement.H:142
Foam::meshRefinement::MASTERONLY
@ MASTERONLY
Definition: meshRefinement.H:141
Foam::meshRefinement::outputLevel
static outputType outputLevel()
Get/set output level.
Definition: meshRefinement.C:3077
Foam::meshRefinement::IOWRITELAYERSETS
@ IOWRITELAYERSETS
Definition: meshRefinement.H:126
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
Foam::meshRefinement::doRestorePoints
autoPtr< mapPolyMesh > doRestorePoints(removePoints &pointRemover, const labelList &facesToRestore)
Definition: meshRefinementMerge.C:690
List
Definition: Test.C:19
Foam::meshRefinement::getBafflePatches
void getBafflePatches(const labelList &globalToMasterPatch, const pointField &locationsInMesh, const wordList &regionsInMesh, const labelList &neiLevel, const pointField &neiCc, labelList &ownPatch, labelList &neiPatch) const
Determine patches for baffles.
Definition: meshRefinementBaffles.C:283
Foam::meshRefinement::refine
autoPtr< mapPolyMesh > refine(const labelList &cellsToRefine)
Refine some cells.
Definition: meshRefinementRefine.C:2347
Foam::meshRefinement::updateIntersections
void updateIntersections(const labelList &changedFaces)
Find any intersection of surface. Store in surfaceIndex_.
Definition: meshRefinement.C:269
Foam::meshRefinement::operator=
void operator=(const meshRefinement &)
Disallow default bitwise assignment.
Foam::meshRefinement::outputType
outputType
Definition: meshRefinement.H:116
Foam::mapDistributePolyMesh
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Definition: mapDistributePolyMesh.H:57
Foam::meshRefinement::consistentOrientation
void consistentOrientation(const PackedBoolList &isMasterFace, const indirectPrimitivePatch &patch, const labelList &nMasterFaces, const labelList &faceToZone, const Map< label > &zoneToOrientation, PackedBoolList &meshFlipMap) const
Make faces consistent.
Definition: meshRefinementBaffles.C:2974
Foam::meshRefinement::shells_
const shellSurfaces & shells_
All shell-refinement interaction.
Definition: meshRefinement.H:179
Foam::meshRefinement::dupNonManifoldPoints
autoPtr< mapPolyMesh > dupNonManifoldPoints()
Find boundary points that connect to more than one cell.
Definition: meshRefinementBaffles.C:4035
Foam::meshRefinement::WRITELAYERSETS
@ WRITELAYERSETS
Definition: meshRefinement.H:134
Foam::refinementSurfaces
Container for data on surfaces used for surface-driven refinement. Contains all the data about the le...
Definition: refinementSurfaces.H:60
Foam::meshRefinement::removeInsideCells
autoPtr< mapPolyMesh > removeInsideCells(const string &msg, const label exposedPatchI)
Do all to remove inside cells.
Foam::meshRefinement::outputLevel_
static outputType outputLevel_
Control of output/log level.
Definition: meshRefinement.H:155
Foam::meshRefinement::makeDisplacementField
static tmp< pointVectorField > makeDisplacementField(const pointMesh &pMesh, const labelList &adaptPatchIDs)
Helper function to make a pointVectorField with correct.
Definition: meshRefinement.C:1690
Foam::fvMeshDistribute
Sends/receives parts of mesh+fvfields to neighbouring processors. Used in load balancing.
Definition: fvMeshDistribute.H:70
Foam::meshRefinement::faceZoneToSlavePatch_
HashTable< word, word > faceZoneToSlavePatch_
FaceZone to slave patch name.
Definition: meshRefinement.H:209
Foam::data
Database for solution data, solver performance and other reduced data.
Definition: data.H:52
Foam::meshRefinement::growFaceCellFace
labelList growFaceCellFace(const labelHashSet &set) const
Definition: meshRefinementMerge.C:795
Foam::meshRefinement::faceToCoupledPatch_
Map< label > faceToCoupledPatch_
Original patch for baffle faces that used to be on.
Definition: meshRefinement.H:195
Foam::meshRefinement::generateRays
label generateRays(const point &nearPoint, const vector &nearNormal, const FixedList< label, 3 > &gapInfo, const volumeType &mode, const label cLevel, DynamicField< point > &start, DynamicField< point > &end) const
Generate single ray from nearPoint in direction of nearNormal.
Definition: meshRefinementGapRefine.C:686
Foam::name
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
Foam::meshRefinement::MESH
@ MESH
Definition: meshRefinement.H:102
Foam::meshRefinement::IOWRITELEVELS
@ IOWRITELEVELS
Definition: meshRefinement.H:125
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:2169
Foam::NamedEnum< IOdebugType, 5 >
Foam::meshRefinement::markFacesOnProblemCells
labelList markFacesOnProblemCells(const dictionary &motionDict, const bool removeEdgeConnectedCells, const scalarField &perpendicularAngle, const labelList &globalToMasterPatch) const
Returns list with for every internal face -1 or the patch.
Definition: meshRefinementProblemCells.C:472
Foam::meshRefinement::overwrite
bool overwrite() const
Overwrite the mesh?
Definition: meshRefinement.H:832
labelPair.H
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatchTemplate.H:88
Foam::meshRefinement::surfaceIndex
labelList & surfaceIndex()
Definition: meshRefinement.H:873
Foam::meshRefinement::dumpRefinementLevel
void dumpRefinementLevel() const
Write refinement level as volScalarFields for postprocessing.
Definition: meshRefinement.C:2901
Foam::meshRefinement::surfaces
const refinementSurfaces & surfaces() const
Reference to surface search engines.
Definition: meshRefinement.H:844
Foam::meshRefinement::debugType
debugType
Definition: meshRefinement.H:100
autoPtr.H