conformalVoronoiMesh.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) 2012-2015 OpenFOAM Foundation
6  \\/ M anipulation |
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::conformalVoronoiMesh
26 
27 Description
28 
29 SourceFiles
30  conformalVoronoiMeshI.H
31  conformalVoronoiMesh.C
32  conformalVoronoiMeshZones.C
33  conformalVoronoiMeshIO.C
34  conformalVoronoiMeshConformToSurface.C
35  conformalVoronoiMeshFeaturePoints.C
36  conformalVoronoiMeshCalcDualMesh.C
37  conformalVoronoiMeshTemplates.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef conformalVoronoiMesh_H
42 #define conformalVoronoiMesh_H
43 
44 // Include uint.H before CGAL headers to define __STDC_LIMIT_MACROS
45 #include "uint.H"
47 #include "searchableSurfaces.H"
48 #include "conformationSurfaces.H"
49 #include "cellShapeControl.H"
50 #include "cvControls.H"
51 #include "DynamicList.H"
52 #include "PackedBoolList.H"
53 #include "Time.H"
54 #include "polyMesh.H"
55 #include "plane.H"
56 #include "SortableList.H"
57 #include "meshTools.H"
58 #include "dynamicIndexedOctree.H"
59 #include "dynamicTreeDataPoint.H"
60 #include "indexedOctree.H"
61 #include "treeDataPoint.H"
62 #include "unitConversion.H"
63 #include "transform.H"
64 #include "volFields.H"
65 #include "fvMesh.H"
66 #include "labelPair.H"
67 #include "HashSet.H"
68 #include "memInfo.H"
69 #include "point.H"
70 #include "cellSet.H"
71 #include "wallPolyPatch.H"
72 #include "processorPolyPatch.H"
74 #include "globalIndex.H"
75 #include "pointFeatureEdgesTypes.H"
76 #include "pointConversion.H"
77 #include "Pair.H"
79 #include "featurePointConformer.H"
80 #include "pointPairs.H"
81 
82 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83 
84 namespace Foam
85 {
86 
87 // Forward declaration of classes
88 class initialPointsMethod;
89 class relaxationModel;
90 class faceAreaWeightModel;
91 class backgroundMeshDecomposition;
92 class OBJstream;
93 
94 /*---------------------------------------------------------------------------*\
95  Class conformalVoronoiMesh Declaration
96 \*---------------------------------------------------------------------------*/
97 
99 :
100  public DistributedDelaunayMesh<Delaunay>
101 {
102 public:
103 
104  typedef Delaunay::Vertex_handle Vertex_handle;
105  typedef Delaunay::Cell_handle Cell_handle;
106  typedef Delaunay::Edge Edge;
107  typedef Delaunay::Facet Facet;
108  typedef Delaunay::Point Point;
109 
111 
115 
116  // Static data
117 
118  enum dualMeshPointType
119  {
120  internal = 0,
121  surface = 1,
124  constrained = 4
125  };
126 
128 
129 
130 private:
131 
132  // Static data
133 
134  static const scalar searchConeAngle;
135 
136  static const scalar searchAngleOppositeSurface;
137 
138 
139  // Private data
140 
141  //- The time registry of the application
142  const Time& runTime_;
143 
144  //- Random number generator
145  mutable Random rndGen_;
146 
147  //- Controls for the conformal Voronoi meshing process
149 
150  //- All geometry of the meshing process, including surfaces to be
151  // conformed to and those to be used for refinement
153 
154  //- The surfaces to conform to
156 
157  //- Background mesh decomposition, only available in parallel.
159 
160  //- The cell shape control object
162 
163  //- Limiting bound box before infinity begins
165 
167 
169 
170  //- Search tree for edge point locations
173 
175 
176  //- Search tree for surface point locations
179 
181 
182  //- Store the surface and feature edge conformation locations to be
183  // reinserted
185 
186  //- Method for inserting initial points. Runtime selectable.
188 
189  //- Relaxation coefficient model. Runtime selectable.
191 
192  //- Face area weight function. Runtime selectable.
194 
195 
196  // Private Member Functions
197 
198  inline scalar defaultCellSize() const;
199 
200  //- Return the local target cell size at the given location. Takes
201  // boolean argument to allow speed-up of queries if the point is going
202  // to be on a surface.
203  inline scalar targetCellSize(const Foam::point& pt) const;
204 
205  //- Return the target cell size from that stored on a pair of
206  // Delaunay vertices, including the possibility that one of
207  // them is not an internalOrBoundaryPoint, and so will not
208  // have valid data.
209  inline scalar averageAnyCellSize
210  (
211  const Vertex_handle& vA,
212  const Vertex_handle& vB
213  ) const;
214 
215  //- The average target cell size of a Delaunay facet, i.e., of
216  // a dual edge
217  inline scalar averageAnyCellSize
218  (
219  const Delaunay::Finite_facets_iterator& fit
220  ) const;
221 
222  //- Insert Delaunay vertices using the CGAL range insertion method,
223  // optionally check processor occupancy and distribute to other
224  // processors
226  (
228  const bool distribute = false
229  );
230 
232  (
233  List<Vb>& vertices,
234  bool distribute,
235  bool reIndex
236  );
237 
238  //- Create a point-pair at a ppDist distance either side of
239  // surface point surfPt, in the direction n
240  inline void createPointPair
241  (
242  const scalar ppDist,
243  const Foam::point& surfPt,
244  const vector& n,
245  const bool ptPair,
246  DynamicList<Vb>& pts
247  ) const;
248 
249  inline Foam::point perturbPoint(const Foam::point& pt) const;
250 
251  //- Create a point-pair at a ppDist distance either side of
252  // surface point surfPt, in the direction n
253  inline void createBafflePointPair
254  (
255  const scalar ppDist,
256  const Foam::point& surfPt,
257  const vector& n,
258  const bool ptPair,
259  DynamicList<Vb>& pts
260  ) const;
261 
262  //- Check internal point is completely inside the meshable region
263  inline bool internalPointIsInside(const Foam::point& pt) const;
264 
265  //- Insert pairs of points on the surface with the given normals, at the
266  // specified spacing
268  (
269  const pointIndexHitAndFeatureList& surfaceHits,
270  const fileName fName,
271  DynamicList<Vb>& pts
272  );
273 
274  //- Insert groups of points to conform to an edge given a list of
275  // pointIndexHits specifying the location and edge index of the point
276  // to be conformed to on the corresponding entry in featureHit
278  (
279  const pointIndexHitAndFeatureList& edgeHits,
280  const fileName fName,
281  DynamicList<Vb>& pts
282  );
283 
285  (
286  const extendedFeatureEdgeMesh& feMesh,
287  const pointIndexHit& edHit,
288  DynamicList<Vb>& pts
289  ) const;
290 
291  bool meshableRegion
292  (
293  const plane::side side,
295  ) const;
296 
297  bool regionIsInside
298  (
300  const vector& normalA,
302  const vector& normalB,
303  const vector& masterPtVec
304  ) const;
305 
306  //- Create points to conform to an external edge
308  (
309  const extendedFeatureEdgeMesh& feMesh,
310  const pointIndexHit& edHit,
311  DynamicList<Vb>& pts
312  ) const;
313 
314  //- Create points to conform to an internal edge
316  (
317  const extendedFeatureEdgeMesh& feMesh,
318  const pointIndexHit& edHit,
319  DynamicList<Vb>& pts
320  ) const;
321 
322  //- Create points to conform to a flat edge
324  (
325  const extendedFeatureEdgeMesh& feMesh,
326  const pointIndexHit& edHit,
327  DynamicList<Vb>& pts
328  ) const;
329 
330  //- Create points to conform to an open edge
332  (
333  const extendedFeatureEdgeMesh& feMesh,
334  const pointIndexHit& edHit,
335  DynamicList<Vb>& pts
336  ) const;
337 
338  //- Create points to conform to multiply connected edge
340  (
341  const extendedFeatureEdgeMesh& feMesh,
342  const pointIndexHit& edHit,
343  DynamicList<Vb>& pts
344  ) const;
345 
346  //- Determine and insert point groups at the feature points
347  void insertFeaturePoints(bool distribute = false);
348 
349  //- Check if a location is in exclusion range around a feature point
350  bool nearFeaturePt(const Foam::point& pt) const;
351 
352  //- Check if a surface point is in exclusion range around a feature edge
353  bool surfacePtNearFeatureEdge(const Foam::point& pt) const;
354 
355  //- Insert the initial points into the triangulation, based on the
356  // initialPointsMethod
357  void insertInitialPoints();
358 
359  //- In parallel redistribute the backgroundMeshDecomposition and
360  // vertices to balance the number of vertices on each processor.
361  // Returns true if the background mesh changes as this removes all
362  // referred vertices, so the parallel interface may need rebuilt.
363  template<class Triangulation>
364  bool distributeBackground(const Triangulation& mesh);
365 
366  // Test for full containment
367  void cellSizeMeshOverlapsBackground() const;
368 
369  //-
370  void distribute();
371 
373 
374  //- Set the size and alignment data for each vertex
376 
377  //- Builds a dual face by circulating around the supplied edge.
379  (
380  const Delaunay::Finite_edges_iterator& eit
381  ) const;
382 
384  (
385  const Delaunay::Finite_edges_iterator& eit
386  ) const;
387 
388  //- Finds the maximum filterCount of the dual vertices
389  // (Delaunay cells) that form the dual face produced by the
390  // supplied edge
392  (
393  const Delaunay::Finite_edges_iterator& eit
394  ) const;
395 
396  //- Determines the owner and neighbour labels for dual cells
397  // corresponding to the dual face formed by the supplied
398  // Delaunay vertices. If the dual face is a boundary face
399  // then neighbour = -1. Returns true if the dual face
400  // created by vA -> vB needs to be reversed to be correctly
401  // orientated.
402  bool ownerAndNeighbour
403  (
404  Vertex_handle vA,
405  Vertex_handle vB,
406  label& owner,
407  label& neighbour
408  ) const;
409 
410  //- Insert the necessary point pairs to conform to the surface, either
411  // from stored results, or trigger a re-conformation
412  void conformToSurface();
413 
414  //- Decision making function for when to rebuild the surface
415  // conformation
416  bool reconformToSurface() const;
417 
418  //- Determines geometrically whether a vertex is close to a surface
419  // This is an optimisation
421 
422  //- Create and insert the necessary point pairs to conform to the
423  // surface, then store the result
425 
427  (
428  const DynamicList<label>& edgeToTreeShape,
429  pointIndexHitAndFeatureList& featureEdgeHits
430  );
431 
433  (
434  const DynamicList<label>& surfaceToTreeShape,
435  pointIndexHitAndFeatureList& surfaceHits
436  );
437 
439  (
440  const pointIndexHitAndFeature& info
441  ) const;
442 
443  //- Check to see if dual cell specified by given vertex iterator
444  // intersects the boundary and hence reqires a point-pair
446  (
447  const Delaunay::Finite_vertices_iterator& vit
448  ) const;
449 
450  //- Return all intersections
452  (
453  const Delaunay::Finite_vertices_iterator& vit,
455  ) const;
456 
457  //- Return false if the line is entirely outside the current processor
458  // domain, true is either point is inside, or the processor domain
459  // bounadry is intersected (i.e. the points are box outside but the
460  // line cuts. The points will be moved onto the box where they
461  // intersect.
462  bool clipLineToProc
463  (
464  const Foam::point& pt,
465  Foam::point& a,
466  Foam::point& b
467  ) const;
468 
469  //- Find the "worst" protrusion of a dual cell through the surface,
470  // subject to the maxSurfaceProtrusion tolerance
472  (
473  const Delaunay::Finite_vertices_iterator& vit,
474  pointIndexHit& surfHit,
475  label& hitSurface
476  ) const;
477 
479  (
480  const Delaunay::Finite_vertices_iterator& vit,
481  pointIndexHit& surfHit,
482  label& hitSurface
483  ) const;
484 
485  //- Write out vertex-processor occupancy information for debugging
487 
488  //- Write out debugging information about the surface conformation
489  // quality
490 // void reportSurfaceConformationQuality();
491 
492  //- Limit the displacement of a point so that it doesn't penetrate the
493  // surface to be meshed or come too close to it
494  void limitDisplacement
495  (
496  const Delaunay::Finite_vertices_iterator& vit,
497  vector& displacement,
498  label callCount = 0
499  ) const;
500 
501  //- Find angle between the normals of two close surface points.
503 
504  //- Check if a surface point is near another.
505  bool nearSurfacePoint
506  (
508  ) const;
509 
510  //- Append a point to the surface point tree and the existing list
512  (
513  const Foam::point& pt
514  ) const;
515 
516  //- Append a point to the edge location tree and the existing list
518  (
519  const Foam::point& pt
520  ) const;
521 
522  //- Return a list of the nearest feature edge locations
524  (
525  const Foam::point& pt
526  ) const;
527 
528  //- Check if a point is near any feature edge points.
529  bool pointIsNearFeatureEdgeLocation(const Foam::point& pt) const;
530 
532  (
533  const Foam::point& pt,
534  pointIndexHit& info
535  ) const;
536 
537  //- Check if a point is near any surface conformation points.
538  bool pointIsNearSurfaceLocation(const Foam::point& pt) const;
539 
541  (
542  const Foam::point& pt,
543  pointIndexHit& info
544  ) const;
545 
546  //- Check if a location is in the exclusion range of an existing feature
547  // edge conformation location
549  (
550  const pointIndexHit& pHit,
551  pointIndexHit& nearestEdgeHit
552  ) const;
553 
554  //- Build or rebuild the edge location tree
556  (
557  const DynamicList<Foam::point>& existingEdgeLocations
558  ) const;
559 
560  //- Build or rebuild the surface point location tree
562  (
563  const DynamicList<Foam::point>& existingSurfacePtLocations
564  ) const;
565 
566  //- Process the surface conformation locations to decide which surface
567  // and edge conformation locations to add
569  (
570  const Foam::point& vit,
571  const pointIndexHitAndFeatureDynList& surfaceIntersections,
572  scalar surfacePtReplaceDistCoeffSqr,
573  scalar edgeSearchDistCoeffSqr,
574  pointIndexHitAndFeatureDynList& surfaceHits,
575  pointIndexHitAndFeatureDynList& featureEdgeHits,
576  DynamicList<label>& surfaceToTreeShape,
577  DynamicList<label>& edgeToTreeShape,
578  Map<scalar>& surfacePtToEdgePtDist,
579  bool firstPass
580  ) const;
581 
582  //- Store the surface conformation with the indices offset to be
583  // relative to zero
585 
586  //- Reinsert the surface conformation re-offsetting indices to be
587  // relative to new number of internal vertices
589 
590  void checkCells();
591 
592  void checkDuals();
593 
594  void checkVertices();
595 
596  void checkCoPlanarCells() const;
597 
598  //- Dual calculation
599  void calcDualMesh
600  (
602  labelList& boundaryPts,
603  faceList& faces,
604  labelList& owner,
605  labelList& neighbour,
608  pointField& cellCentres,
609  labelList& cellToDelaunayVertex,
610  labelListList& patchToDelaunayVertex,
611  PackedBoolList& boundaryFacesToRemove
612  );
613 
615  (
616  const polyMesh& mesh,
617  const pointField& cellCentres,
618  pointField& neiCc
619  ) const;
620 
622  (
623  const polyMesh& mesh,
624  boolList& selected
625  ) const;
626 
627  //- From meshRefinementBaffles.C. Use insidePoint for a surface to
628  // determine the cell zone.
630  (
631  const polyMesh& mesh,
632  const labelList& locationSurfaces,
633  const labelList& faceToSurface,
634  labelList& cellToSurface
635  ) const;
636 
637  //- Calculate the cell zones from cellCentres using all closed surfaces
638  labelList calcCellZones(const pointField& cellCentres) const;
639 
640  //- Calculate the face zones
641  void calcFaceZones
642  (
643  const polyMesh& mesh,
644  const pointField& cellCentres,
645  const labelList& cellToSurface,
646  labelList& faceToSurface,
647  boolList& flipMap
648  ) const;
649 
650  //- Add zones to the polyMesh
651  void addZones(polyMesh& mesh, const pointField& cellCentres) const;
652 
653  //- Tet mesh calculation
654  void calcTetMesh
655  (
657  labelList& pointToDelaunayVertex,
658  faceList& faces,
659  labelList& owner,
660  labelList& neighbour,
663  );
664 
665  //- Determines if the dual face constructed by the Delaunay
666  // edge is a boundary face
667  inline bool isBoundaryDualFace
668  (
669  const Delaunay::Finite_edges_iterator& eit
670  ) const;
671 
672  //- Which processors are attached to the dual edge represented by this
673  // Delaunay facet
675  (
676  const Delaunay::Finite_facets_iterator& fit
677  ) const;
678 
679  //- Determines if the edge constructed from the face is on
680  // a processor patch
681  inline bool isParallelDualEdge
682  (
683  const Delaunay::Finite_facets_iterator& fit
684  ) const;
685 
686  //- Determines if the dual face constructed by the Delaunay
687  // edge is a processor boundary face
688  inline bool isProcBoundaryEdge
689  (
690  const Delaunay::Finite_edges_iterator& eit
691  ) const;
692 
693  //- Merge vertices that are identical
695  (
696  const pointField& pts,
697  labelList& boundaryPts
698  );
699 
701  (
702  const pointField& pts,
703  Map<label>& dualPtIndexMap
704  ) const;
705 
706  //- Identify the face labels of the deferred collapse faces
708  (
709  labelList& owner,
710  labelList& neighbour,
711  const HashSet<labelPair, labelPair::Hash<> >& deferredCollapseFaces
712  ) const;
713 
714  //- Check whether the cell sizes are fine enough. Creates a polyMesh.
715  void checkCellSizing();
716 
717  //- Find all cells with a patch face that is not near the surface. The
718  // allowed offset is the fraction of the target cell size.
720  (
721  const polyMesh& mesh,
722  const scalar allowedOffset
723  ) const;
724 
725  //- Create a polyMesh and check its quality, reports which
726  // elements damage the mesh quality, allowing backtracking.
727  labelHashSet checkPolyMeshQuality(const pointField& pts) const;
728 
730 
731  //- Index all of the the Delaunay cells and calculate their dual points
732  void indexDualVertices
733  (
734  pointField& pts,
735  labelList& boundaryPts
736  );
737 
738  //- Re-index all of the Delaunay cells
740  (
741  const Map<label>& dualPtIndexMap,
742  labelList& boundaryPts
743  );
744 
746  (
749  ) const;
750 
752 
754 
755  //- Create all of the internal and boundary faces
757  (
758  const pointField& pts,
759  faceList& faces,
760  labelList& owner,
761  labelList& neighbour,
764  labelListList& patchPointPairSlaves,
765  PackedBoolList& boundaryFacesToRemove,
766  bool includeEmptyPatches = false
767  ) const;
768 
769  //- Sort the faces, owner and neighbour lists into
770  // upper-triangular order. For internal faces only, use
771  // before adding patch faces
772  void sortFaces
773  (
774  faceList& faces,
775  labelList& owner,
776  labelList& neighbour
777  ) const;
778 
779  //- Sort the processor patches so that the faces are in the same order
780  // on both processors
781  void sortProcPatches
782  (
784  List<DynamicList<label> >& patchOwners,
785  List<DynamicList<label> >& patchPointPairSlaves,
786  labelPairPairDynListList& patchSortingIndices
787  ) const;
788 
789  //- Add the faces and owner information for the patches
790  void addPatches
791  (
792  const label nInternalFaces,
793  faceList& faces,
794  labelList& owner,
796  PackedBoolList& boundaryFacesToRemove,
798  const List<DynamicList<label> >& patchOwners,
799  const List<DynamicList<bool> >& indirectPatchFace
800  ) const;
801 
802  //- Remove points that are no longer used by any faces
803  void removeUnusedPoints
804  (
805  faceList& faces,
806  pointField& pts,
807  labelList& boundaryPts
808  ) const;
809 
810  //- Remove dual cells that are not used by any faces. Return compaction
811  // map.
813  (
814  labelList& owner,
815  labelList& neighbour
816  ) const;
817 
818  //- Create an empty fvMesh
820  (
821  const IOobject& io,
822  const wordList& patchNames,
824  ) const;
825 
826  //- Create a polyMesh from points.
828 
830  (
832  ) const;
833 
834  void reorderPoints
835  (
837  labelList& boundaryPts,
838  faceList& faces,
839  const label nInternalFaces
840  ) const;
841 
842  //- Rotate the faces on processor patches if necessary
844  (
845  const word& meshName,
846  const fileName& instance,
847  const pointField& points,
848  faceList& faces,
849  const wordList& patchNames,
851  ) const;
852 
853  void writePointPairs(const fileName& fName) const;
854 
855  //- Disallow default bitwise copy construct
857 
858  //- Disallow default bitwise assignment
859  void operator=(const conformalVoronoiMesh&);
860 
861 
862 public:
863 
864  //- Runtime type information
865  ClassName("conformalVoronoiMesh");
866 
867 
868  // Constructors
869 
870  //- Construct from Time and foamyHexMeshDict
872  (
873  const Time& runTime,
874  const dictionary& foamyHexMeshDict,
875  const fileName& decompDictFile = ""
876  );
877 
878 
879  //- Destructor
881 
882 
883  // Member Functions
884 
885  void initialiseForMotion();
886 
888 
889  //- Move the vertices according to the controller, re-conforming to the
890  // surface as required
891  void move();
892 
893 // //- Which other processors does each sphere overlap
894 // labelListList overlapsProc
895 // (
896 // const List<Foam::point>& centres,
897 // const List<scalar>& radiusSqrs
898 // ) const;
899 
900 
901  // Access
902 
903  //- Return the Time object
904  inline const Time& time() const;
905 
906  //- Return the random number generator
907  inline Random& rndGen() const;
908 
909  //- Return the allGeometry object
910  inline const searchableSurfaces& allGeometry() const;
911 
912  //- Return the conformationSurfaces object
913  inline const conformationSurfaces& geometryToConformTo() const;
914 
915  //- Return the backgroundMeshDecomposition
916  inline const backgroundMeshDecomposition& decomposition() const;
917 
918  //- Return the cellShapeControl object
919  inline const cellShapeControl& cellShapeControls() const;
920 
921  //- Return the foamyHexMeshControls object
922  inline const cvControls& foamyHexMeshControls() const;
923 
924 
925  // Query
926 
927  //- Return the local point pair separation at the given location
928  inline scalar pointPairDistance(const Foam::point& pt) const;
929 
930  //- Return the local mixed feature point placement distance
931  inline scalar mixedFeaturePointDistance
932  (
933  const Foam::point& pt
934  ) const;
935 
936  //- Return the square of the local feature point exclusion distance
938  (
939  const Foam::point& pt
940  ) const;
941 
942  //- Return the square of the local feature edge exclusion distance
943  inline scalar featureEdgeExclusionDistanceSqr
944  (
945  const Foam::point& pt
946  ) const;
947 
948  //- Return the square of the local surface point exclusion distance
949  inline scalar surfacePtExclusionDistanceSqr
950  (
951  const Foam::point& pt
952  ) const;
953 
954  //- Return the square of the local surface search distance
955  inline scalar surfaceSearchDistanceSqr(const Foam::point& pt) const;
956 
957  //- Return the local maximum surface protrusion distance
958  inline scalar maxSurfaceProtrusion(const Foam::point& pt) const;
959 
960  //- Call the appropriate function to conform to an edge
962  (
963  const extendedFeatureEdgeMesh& feMesh,
964  const pointIndexHit& edHit,
965  DynamicList<Vb>& pts
966  ) const;
967 
968 
969  // Write
970 
971  //- Write the elapsedCpuTime and memory usage, with an optional
972  // description
973  static void timeCheck
974  (
975  const Time& runTime,
976  const string& description = string::null,
977  const bool check = true
978  );
979 
980  void timeCheck
981  (
982  const string& description = string::null
983  ) const;
984 
985  //- Prepare data and call writeMesh for polyMesh and
986  // tetDualMesh
987  void writeMesh(const fileName& instance);
988 
989  //- Write mesh to disk
990  void writeMesh
991  (
992  const word& meshName,
993  const fileName& instance,
995  labelList& boundaryPts,
996  faceList& faces,
997  labelList& owner,
998  labelList& neighbour,
999  const wordList& patchNames,
1001  const pointField& cellCentres,
1002  PackedBoolList& boundaryFacesToRemove
1003  ) const;
1004 
1005  //- Calculate and write a field of the target cell size,
1006  // target cell volume, actual cell volume and equivalent
1007  // actual cell size (cbrt(actual cell volume)).
1008  void writeCellSizes(const fvMesh& mesh) const;
1009 
1010  void writeCellAlignments(const fvMesh& mesh) const;
1011 
1012  //- Calculate and write the cell centres.
1013  void writeCellCentres(const fvMesh& mesh) const;
1014 
1015  //- Find the cellSet of the boundary cells which have points that
1016  // protrude out of the surface beyond a tolerance.
1018 };
1019 
1020 
1021 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1022 
1023 } // End namespace Foam
1024 
1025 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1026 
1027 #include "conformalVoronoiMeshI.H"
1028 
1029 #ifdef NoRepository
1031 #endif
1032 
1033 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1034 
1035 #endif
1036 
1037 // ************************************************************************* //
Foam::conformalVoronoiMesh::cellShapeControls
const cellShapeControl & cellShapeControls() const
Return the cellShapeControl object.
Definition: conformalVoronoiMeshI.H:571
Foam::conformalVoronoiMesh::cellSizeMeshOverlapsBackground
void cellSizeMeshOverlapsBackground() const
volFields.H
dynamicTreeDataPoint.H
Foam::conformalVoronoiMesh::isProcBoundaryEdge
bool isProcBoundaryEdge(const Delaunay::Finite_edges_iterator &eit) const
Determines if the dual face constructed by the Delaunay.
Definition: conformalVoronoiMeshI.H:501
Foam::conformalVoronoiMesh::findOffsetPatchFaces
labelHashSet findOffsetPatchFaces(const polyMesh &mesh, const scalar allowedOffset) const
Find all cells with a patch face that is not near the surface. The.
Foam::conformalVoronoiMesh
Definition: conformalVoronoiMesh.H:97
Foam::conformalVoronoiMesh::calcNeighbourCellCentres
void calcNeighbourCellCentres(const polyMesh &mesh, const pointField &cellCentres, pointField &neiCc) const
Foam::Random
Simple random number generator.
Definition: Random.H:49
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::conformalVoronoiMesh::selectSeparatedCoupledFaces
void selectSeparatedCoupledFaces(const polyMesh &mesh, boolList &selected) const
meshTools.H
Foam::PackedBoolList
A bit-packed bool list.
Definition: PackedBoolList.H:63
Foam::cvControls
Controls for the conformalVoronoiMesh mesh generator.
Definition: cvControls.H:53
Foam::conformalVoronoiMesh::nearFeaturePt
bool nearFeaturePt(const Foam::point &pt) const
Check if a location is in exclusion range around a feature point.
Foam::conformalVoronoiMesh::Edge
Delaunay::Edge Edge
Definition: conformalVoronoiMesh.H:105
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
pointConversion.H
Foam::conformalVoronoiMesh::defaultCellSize
scalar defaultCellSize() const
Definition: conformalVoronoiMeshI.H:31
cellShapeControl.H
Foam::conformalVoronoiMesh::nearSurfacePoint
bool nearSurfacePoint(pointIndexHitAndFeature &pHit) const
Check if a surface point is near another.
Foam::conformalVoronoiMesh::createOpenEdgePointGroup
void createOpenEdgePointGroup(const extendedFeatureEdgeMesh &feMesh, const pointIndexHit &edHit, DynamicList< Vb > &pts) const
Create points to conform to an open edge.
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::conformalVoronoiMesh::ftPtConformer_
featurePointConformer ftPtConformer_
Definition: conformalVoronoiMesh.H:167
Foam::conformalVoronoiMesh::ClassName
ClassName("conformalVoronoiMesh")
Runtime type information.
Foam::conformalVoronoiMesh::appendToEdgeLocationTree
bool appendToEdgeLocationTree(const Foam::point &pt) const
Append a point to the edge location tree and the existing list.
Foam::conformalVoronoiMesh::writeCellCentres
void writeCellCentres(const fvMesh &mesh) const
Calculate and write the cell centres.
Foam::conformalVoronoiMesh::pointIndexHitAndFeatureList
List< pointIndexHitAndFeature > pointIndexHitAndFeatureList
Definition: conformalVoronoiMesh.H:112
Foam::conformalVoronoiMesh::addSurfaceAndEdgeHits
void addSurfaceAndEdgeHits(const Foam::point &vit, const pointIndexHitAndFeatureDynList &surfaceIntersections, scalar surfacePtReplaceDistCoeffSqr, scalar edgeSearchDistCoeffSqr, pointIndexHitAndFeatureDynList &surfaceHits, pointIndexHitAndFeatureDynList &featureEdgeHits, DynamicList< label > &surfaceToTreeShape, DynamicList< label > &edgeToTreeShape, Map< scalar > &surfacePtToEdgePtDist, bool firstPass) const
Process the surface conformation locations to decide which surface.
Foam::conformalVoronoiMesh::createMultipleEdgePointGroup
void createMultipleEdgePointGroup(const extendedFeatureEdgeMesh &feMesh, const pointIndexHit &edHit, DynamicList< Vb > &pts) const
Create points to conform to multiply connected edge.
Foam::conformalVoronoiMesh::relaxationModel_
autoPtr< relaxationModel > relaxationModel_
Relaxation coefficient model. Runtime selectable.
Definition: conformalVoronoiMesh.H:189
Foam::conformalVoronoiMesh::featurePoint
@ featurePoint
Definition: conformalVoronoiMesh.H:122
Foam::conformalVoronoiMesh::checkPolyMeshQuality
labelHashSet checkPolyMeshQuality(const pointField &pts) const
Create a polyMesh and check its quality, reports which.
Foam::conformalVoronoiMesh::insertFeaturePoints
void insertFeaturePoints(bool distribute=false)
Determine and insert point groups at the feature points.
Foam::conformalVoronoiMesh::calcFaceZones
void calcFaceZones(const polyMesh &mesh, const pointField &cellCentres, const labelList &cellToSurface, labelList &faceToSurface, boolList &flipMap) const
Calculate the face zones.
Foam::conformalVoronoiMesh::createPolyMeshFromPoints
autoPtr< polyMesh > createPolyMeshFromPoints(const pointField &pts) const
Create a polyMesh from points.
Foam::DynamicList
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:56
Foam::conformalVoronoiMesh::pointIsNearFeatureEdgeLocation
bool pointIsNearFeatureEdgeLocation(const Foam::point &pt) const
Check if a point is near any feature edge points.
Foam::conformalVoronoiMesh::surfaceSearchDistanceSqr
scalar surfaceSearchDistanceSqr(const Foam::point &pt) const
Return the square of the local surface search distance.
Definition: conformalVoronoiMeshI.H:199
Foam::conformalVoronoiMesh::Vertex_handle
Delaunay::Vertex_handle Vertex_handle
Definition: conformalVoronoiMesh.H:103
Foam::conformalVoronoiMesh::writeMesh
void writeMesh(const fileName &instance)
Prepare data and call writeMesh for polyMesh and.
Foam::conformalVoronoiMesh::allGeometry_
searchableSurfaces allGeometry_
All geometry of the meshing process, including surfaces to be.
Definition: conformalVoronoiMesh.H:151
point.H
Foam::conformalVoronoiMesh::pointPairDistance
scalar pointPairDistance(const Foam::point &pt) const
Return the local point pair separation at the given location.
Definition: conformalVoronoiMeshI.H:137
Foam::conformalVoronoiMesh::searchConeAngle
static const scalar searchConeAngle
Definition: conformalVoronoiMesh.H:133
globalIndex.H
Foam::conformalVoronoiMesh::nearestFeatureEdgeLocations
List< pointIndexHit > nearestFeatureEdgeLocations(const Foam::point &pt) const
Return a list of the nearest feature edge locations.
Foam::conformalVoronoiMesh::limitBounds_
treeBoundBox limitBounds_
Limiting bound box before infinity begins.
Definition: conformalVoronoiMesh.H:163
Foam::treeBoundBox
Standard boundBox + extra functionality for use in octree.
Definition: treeBoundBox.H:75
Foam::conformalVoronoiMesh::findRemainingProtrusionSet
labelHashSet findRemainingProtrusionSet(const polyMesh &mesh) const
Find the cellSet of the boundary cells which have points that.
Foam::conformalVoronoiMesh::createEdgePointGroup
void createEdgePointGroup(const extendedFeatureEdgeMesh &feMesh, const pointIndexHit &edHit, DynamicList< Vb > &pts) const
Call the appropriate function to conform to an edge.
Foam::conformalVoronoiMesh::timeCheck
static void timeCheck(const Time &runTime, const string &description=string::null, const bool check=true)
Write the elapsedCpuTime and memory usage, with an optional.
Foam::conformalVoronoiMesh::calcCellZones
labelList calcCellZones(const pointField &cellCentres) const
Calculate the cell zones from cellCentres using all closed surfaces.
indexedOctree.H
cvControls.H
Foam::conformalVoronoiMesh::Cell_handle
Delaunay::Cell_handle Cell_handle
Definition: conformalVoronoiMesh.H:104
Foam::conformalVoronoiMesh::buildDualFace
face buildDualFace(const Delaunay::Finite_edges_iterator &eit) const
Builds a dual face by circulating around the supplied edge.
Foam::conformalVoronoiMesh::geometryToConformTo_
conformationSurfaces geometryToConformTo_
The surfaces to conform to.
Definition: conformalVoronoiMesh.H:154
Foam::conformalVoronoiMesh::conformalVoronoiMesh
conformalVoronoiMesh(const conformalVoronoiMesh &)
Disallow default bitwise copy construct.
wallPolyPatch.H
Foam::conformalVoronoiMesh::geometryToConformTo
const conformationSurfaces & geometryToConformTo() const
Return the conformationSurfaces object.
Definition: conformalVoronoiMeshI.H:550
Foam::conformalVoronoiMesh::~conformalVoronoiMesh
~conformalVoronoiMesh()
Destructor.
Foam::conformalVoronoiMesh::meshableRegion
bool meshableRegion(const plane::side side, const extendedFeatureEdgeMesh::sideVolumeType volType) const
Foam::conformalVoronoiMesh::buildSurfaceConformation
void buildSurfaceConformation()
Create and insert the necessary point pairs to conform to the.
Foam::conformalVoronoiMesh::move
void move()
Move the vertices according to the controller, re-conforming to the.
Foam::conformalVoronoiMesh::decomposition_
autoPtr< backgroundMeshDecomposition > decomposition_
Background mesh decomposition, only available in parallel.
Definition: conformalVoronoiMesh.H:157
Foam::Map< label >
unitConversion.H
Unit conversion functions.
Foam::conformalVoronoiMesh::surfacePtNearFeatureEdge
bool surfacePtNearFeatureEdge(const Foam::point &pt) const
Check if a surface point is in exclusion range around a feature edge.
Foam::conformalVoronoiMesh::foamyHexMeshControls_
cvControls foamyHexMeshControls_
Controls for the conformal Voronoi meshing process.
Definition: conformalVoronoiMesh.H:147
Foam::conformalVoronoiMesh::removeUnusedPoints
void removeUnusedPoints(faceList &faces, pointField &pts, labelList &boundaryPts) const
Remove points that are no longer used by any faces.
Foam::conformalVoronoiMesh::insertPointPairs
Map< label > insertPointPairs(List< Vb > &vertices, bool distribute, bool reIndex)
Pair.H
Foam::conformalVoronoiMesh::boundaryDualFace
bool boundaryDualFace(Cell_handle c1, Cell_handle c2) const
Foam::conformalVoronoiMesh::classifyBoundaryPoint
label classifyBoundaryPoint(Cell_handle cit) const
Foam::conformalVoronoiMesh::maxFilterCount
label maxFilterCount(const Delaunay::Finite_edges_iterator &eit) const
Finds the maximum filterCount of the dual vertices.
Foam::conformalVoronoiMesh::createInternalEdgePointGroup
void createInternalEdgePointGroup(const extendedFeatureEdgeMesh &feMesh, const pointIndexHit &edHit, DynamicList< Vb > &pts) const
Create points to conform to an internal edge.
Foam::conformalVoronoiMesh::mixedFeaturePointDistance
scalar mixedFeaturePointDistance(const Foam::point &pt) const
Return the local mixed feature point placement distance.
Definition: conformalVoronoiMeshI.H:146
Foam::conformalVoronoiMesh::rndGen
Random & rndGen() const
Return the random number generator.
Definition: conformalVoronoiMeshI.H:536
Foam::conformalVoronoiMesh::createDummyMesh
autoPtr< fvMesh > createDummyMesh(const IOobject &io, const wordList &patchNames, const PtrList< dictionary > &patchDicts) const
Create an empty fvMesh.
Foam::conformalVoronoiMesh::pointIndexHitAndFeature
Tuple2< pointIndexHit, label > pointIndexHitAndFeature
Definition: conformalVoronoiMesh.H:111
Foam::conformalVoronoiMesh::perturbPoint
Foam::point perturbPoint(const Foam::point &pt) const
Definition: conformalVoronoiMeshI.H:285
Foam::conformalVoronoiMesh::removeUnusedCells
labelList removeUnusedCells(labelList &owner, labelList &neighbour) const
Remove dual cells that are not used by any faces. Return compaction.
Foam::conformalVoronoiMesh::calcTetMesh
void calcTetMesh(pointField &points, labelList &pointToDelaunayVertex, faceList &faces, labelList &owner, labelList &neighbour, wordList &patchNames, PtrList< dictionary > &patchDicts)
Tet mesh calculation.
polyMesh.H
patchFaces
labelList patchFaces(const polyBoundaryMesh &patches, const wordList &names)
Definition: extrudeMesh.C:148
Foam::HashSet
A HashTable with keys but without contents.
Definition: HashSet.H:59
Foam::conformalVoronoiMesh::checkDuals
void checkDuals()
Foam::conformalVoronoiMesh::edgeLocationTreePtr_
autoPtr< dynamicIndexedOctree< dynamicTreeDataPoint > > edgeLocationTreePtr_
Search tree for edge point locations.
Definition: conformalVoronoiMesh.H:171
Foam::conformalVoronoiMesh::addPatches
void addPatches(const label nInternalFaces, faceList &faces, labelList &owner, PtrList< dictionary > &patchDicts, PackedBoolList &boundaryFacesToRemove, const List< DynamicList< face > > &patchFaces, const List< DynamicList< label > > &patchOwners, const List< DynamicList< bool > > &indirectPatchFace) const
Add the faces and owner information for the patches.
Foam::conformationSurfaces
Definition: conformationSurfaces.H:53
Foam::conformalVoronoiMesh::calcDualMesh
void calcDualMesh(pointField &points, labelList &boundaryPts, faceList &faces, labelList &owner, labelList &neighbour, wordList &patchNames, PtrList< dictionary > &patchDicts, pointField &cellCentres, labelList &cellToDelaunayVertex, labelListList &patchToDelaunayVertex, PackedBoolList &boundaryFacesToRemove)
Dual calculation.
Foam::conformalVoronoiMesh::deferredCollapseFaceSet
void deferredCollapseFaceSet(labelList &owner, labelList &neighbour, const HashSet< labelPair, labelPair::Hash<> > &deferredCollapseFaces) const
Identify the face labels of the deferred collapse faces.
Foam::conformalVoronoiMesh::isBoundaryDualFace
bool isBoundaryDualFace(const Delaunay::Finite_edges_iterator &eit) const
Determines if the dual face constructed by the Delaunay.
Definition: conformalVoronoiMeshI.H:367
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::conformalVoronoiMesh::checkVertices
void checkVertices()
Foam::conformalVoronoiMesh::insertInitialPoints
void insertInitialPoints()
Insert the initial points into the triangulation, based on the.
Foam::conformalVoronoiMesh::dualFaceBoundaryPoints
boolList dualFaceBoundaryPoints(const Delaunay::Finite_edges_iterator &eit) const
Definition: conformalVoronoiMeshI.H:409
patchDicts
PtrList< dictionary > patchDicts
Definition: readKivaGrid.H:537
Foam::conformalVoronoiMesh::buildCellSizeAndAlignmentMesh
void buildCellSizeAndAlignmentMesh()
Foam::conformalVoronoiMesh::writeCellSizes
void writeCellSizes(const fvMesh &mesh) const
Calculate and write a field of the target cell size,.
Foam::conformalVoronoiMesh::synchroniseSurfaceTrees
label synchroniseSurfaceTrees(const DynamicList< label > &surfaceToTreeShape, pointIndexHitAndFeatureList &surfaceHits)
Foam::conformalVoronoiMesh::dualCellSurfaceAnyIntersection
bool dualCellSurfaceAnyIntersection(const Delaunay::Finite_vertices_iterator &vit) const
Check to see if dual cell specified by given vertex iterator.
searchableSurfaces.H
n
label n
Definition: TABSMDCalcMethod2.H:31
SortableList.H
Foam::conformalVoronoiMesh::surfaceConformationVertices_
List< Vb > surfaceConformationVertices_
Store the surface and feature edge conformation locations to be.
Definition: conformalVoronoiMesh.H:183
dynamicIndexedOctree.H
Foam::PointIndexHit
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
Definition: PointIndexHit.H:53
Foam::conformalVoronoiMesh::checkCells
void checkCells()
Foam::constant::physicoChemical::c1
const dimensionedScalar c1
First radiation constant: default SI units: [W/m2].
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::plane::side
side
Side of the plane.
Definition: plane.H:65
Foam::constant::physicoChemical::b
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:28
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
treeDataPoint.H
plane.H
Foam::conformalVoronoiMesh::initialiseForConformation
void initialiseForConformation()
Foam::conformalVoronoiMesh::createEdgePointGroupByCirculating
void createEdgePointGroupByCirculating(const extendedFeatureEdgeMesh &feMesh, const pointIndexHit &edHit, DynamicList< Vb > &pts) const
Foam::conformalVoronoiMesh::runTime_
const Time & runTime_
The time registry of the application.
Definition: conformalVoronoiMesh.H:141
Foam::conformalVoronoiMesh::buildEdgeLocationTree
void buildEdgeLocationTree(const DynamicList< Foam::point > &existingEdgeLocations) const
Build or rebuild the edge location tree.
Foam::conformalVoronoiMesh::decomposition
const backgroundMeshDecomposition & decomposition() const
Return the backgroundMeshDecomposition.
Definition: conformalVoronoiMeshI.H:557
Foam::pointPairs< Delaunay >
PackedBoolList.H
Foam::extendedEdgeMesh::sideVolumeType
sideVolumeType
Normals point to the outside.
Definition: extendedEdgeMesh.H:115
Foam::conformalVoronoiMesh::sortFaces
void sortFaces(faceList &faces, labelList &owner, labelList &neighbour) const
Sort the faces, owner and neighbour lists into.
conformationSurfaces.H
Foam::conformalVoronoiMesh::dualCellLargestSurfaceIncursion
void dualCellLargestSurfaceIncursion(const Delaunay::Finite_vertices_iterator &vit, pointIndexHit &surfHit, label &hitSurface) const
conformalVoronoiMeshI.H
DistributedDelaunayMesh.H
Foam::conformalVoronoiMesh::constrained
@ constrained
Definition: conformalVoronoiMesh.H:123
Foam::DistributedDelaunayMesh
Definition: DistributedDelaunayMesh.H:56
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
Foam::conformalVoronoiMesh::faceAreaWeightModel_
autoPtr< faceAreaWeightModel > faceAreaWeightModel_
Face area weight function. Runtime selectable.
Definition: conformalVoronoiMesh.H:192
patchNames
wordList patchNames(nPatches)
Foam::conformalVoronoiMesh::dualMeshPointType
dualMeshPointType
Definition: conformalVoronoiMesh.H:117
featurePointConformer.H
Foam::conformalVoronoiMesh::pointIndexHitAndFeatureDynList
DynamicList< pointIndexHitAndFeature > pointIndexHitAndFeatureDynList
Definition: conformalVoronoiMesh.H:113
pointPairs.H
Foam::conformalVoronoiMesh::findVerticesNearBoundaries
label findVerticesNearBoundaries()
Determines geometrically whether a vertex is close to a surface.
Foam::conformalVoronoiMesh::synchroniseEdgeTrees
label synchroniseEdgeTrees(const DynamicList< label > &edgeToTreeShape, pointIndexHitAndFeatureList &featureEdgeHits)
conformalVoronoiMeshTemplates.C
Foam::conformalVoronoiMesh::regionIsInside
bool regionIsInside(const extendedFeatureEdgeMesh::sideVolumeType volTypeA, const vector &normalA, const extendedFeatureEdgeMesh::sideVolumeType volTypeB, const vector &normalB, const vector &masterPtVec) const
Foam::conformalVoronoiMesh::writePointPairs
void writePointPairs(const fileName &fName) const
HashSet.H
Foam::conformalVoronoiMesh::reorderPoints
void reorderPoints(pointField &points, labelList &boundaryPts, faceList &faces, const label nInternalFaces) const
Foam::conformalVoronoiMesh::createPointPair
void createPointPair(const scalar ppDist, const Foam::point &surfPt, const vector &n, const bool ptPair, DynamicList< Vb > &pts) const
Create a point-pair at a ppDist distance either side of.
Definition: conformalVoronoiMeshI.H:224
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
processorPolyPatch.H
Foam::conformalVoronoiMesh::pointIsNearSurfaceLocation
bool pointIsNearSurfaceLocation(const Foam::point &pt) const
Check if a point is near any surface conformation points.
Foam::cellShapeControl
Definition: cellShapeControl.H:62
Foam::conformalVoronoiMesh::initialPointsMethod_
autoPtr< initialPointsMethod > initialPointsMethod_
Method for inserting initial points. Runtime selectable.
Definition: conformalVoronoiMesh.H:186
Foam::string::null
static const string null
An empty string.
Definition: string.H:86
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam::featurePointConformer
The Delaunay vertices required to conform to a feature point can be determined upon initialisation be...
Definition: featurePointConformer.H:65
Foam::conformalVoronoiMesh::calcSharedPatchNormal
vector calcSharedPatchNormal(Cell_handle c1, Cell_handle c2) const
Foam::conformalVoronoiMesh::cellShapeControl_
cellShapeControl cellShapeControl_
The cell shape control object.
Definition: conformalVoronoiMesh.H:160
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
fvMesh.H
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::conformalVoronoiMesh::createPatchInfo
label createPatchInfo(wordList &patchNames, PtrList< dictionary > &patchDicts) const
Foam::constant::physicoChemical::c2
const dimensionedScalar c2
Second radiation constant: default SI units: [m.K].
Foam::conformalVoronoiMesh::createBafflePointPair
void createBafflePointPair(const scalar ppDist, const Foam::point &surfPt, const vector &n, const bool ptPair, DynamicList< Vb > &pts) const
Create a point-pair at a ppDist distance either side of.
Definition: conformalVoronoiMeshI.H:305
uint.H
System uinteger.
Foam::conformalVoronoiMesh::createExternalEdgePointGroup
void createExternalEdgePointGroup(const extendedFeatureEdgeMesh &feMesh, const pointIndexHit &edHit, DynamicList< Vb > &pts) const
Create points to conform to an external edge.
Foam::conformalVoronoiMesh::reportProcessorOccupancy
void reportProcessorOccupancy()
Write out vertex-processor occupancy information for debugging.
Foam::conformalVoronoiMesh::createFlatEdgePointGroup
void createFlatEdgePointGroup(const extendedFeatureEdgeMesh &feMesh, const pointIndexHit &edHit, DynamicList< Vb > &pts) const
Create points to conform to a flat edge.
Foam::conformalVoronoiMesh::mergeIdenticalDualVertices
void mergeIdenticalDualVertices(const pointField &pts, labelList &boundaryPts)
Merge vertices that are identical.
Foam::conformalVoronoiMesh::averageAnyCellSize
scalar averageAnyCellSize(const Vertex_handle &vA, const Vertex_handle &vB) const
Return the target cell size from that stored on a pair of.
Definition: conformalVoronoiMeshI.H:47
Foam::conformalVoronoiMesh::Point
Delaunay::Point Point
Definition: conformalVoronoiMesh.H:107
Foam::conformalVoronoiMesh::isParallelDualEdge
bool isParallelDualEdge(const Delaunay::Finite_facets_iterator &fit) const
Determines if the edge constructed from the face is on.
Definition: conformalVoronoiMeshI.H:484
memInfo.H
Foam::conformalVoronoiMesh::surfaceLocationConformsToInside
bool surfaceLocationConformsToInside(const pointIndexHitAndFeature &info) const
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::conformalVoronoiMesh::foamyHexMeshControls
const cvControls & foamyHexMeshControls() const
Return the foamyHexMeshControls object.
Definition: conformalVoronoiMeshI.H:578
Foam::conformalVoronoiMesh::time
const Time & time() const
Return the Time object.
Definition: conformalVoronoiMeshI.H:530
pointFeatureEdgesTypes.H
Foam::conformalVoronoiMesh::surfacePtExclusionDistanceSqr
scalar surfacePtExclusionDistanceSqr(const Foam::point &pt) const
Return the square of the local surface point exclusion distance.
Definition: conformalVoronoiMeshI.H:185
Foam::conformalVoronoiMesh::featureEdgeExclusionDistanceSqr
scalar featureEdgeExclusionDistanceSqr(const Foam::point &pt) const
Return the square of the local feature edge exclusion distance.
Definition: conformalVoronoiMeshI.H:171
Foam::conformalVoronoiMesh::processorsAttached
List< label > processorsAttached(const Delaunay::Finite_facets_iterator &fit) const
Which processors are attached to the dual edge represented by this.
Definition: conformalVoronoiMeshI.H:452
Foam::conformalVoronoiMesh::insertSurfacePointPairs
void insertSurfacePointPairs(const pointIndexHitAndFeatureList &surfaceHits, const fileName fName, DynamicList< Vb > &pts)
Insert pairs of points on the surface with the given normals, at the.
Foam::conformalVoronoiMesh::existingSurfacePtLocations_
DynamicList< Foam::point > existingSurfacePtLocations_
Definition: conformalVoronoiMesh.H:179
Foam::conformalVoronoiMesh::reindexDualVertices
void reindexDualVertices(const Map< label > &dualPtIndexMap, labelList &boundaryPts)
Re-index all of the Delaunay cells.
Foam::Pair
An ordered pair of two objects of type <T> with first() and second() elements.
Definition: contiguous.H:49
Foam::conformalVoronoiMesh::conformToSurface
void conformToSurface()
Insert the necessary point pairs to conform to the surface, either.
Foam::conformalVoronoiMesh::insertEdgePointGroups
void insertEdgePointGroups(const pointIndexHitAndFeatureList &edgeHits, const fileName fName, DynamicList< Vb > &pts)
Insert groups of points to conform to an edge given a list of.
Foam::conformalVoronoiMesh::Facet
Delaunay::Facet Facet
Definition: conformalVoronoiMesh.H:106
Foam::conformalVoronoiMesh::dualCellLargestSurfaceProtrusion
void dualCellLargestSurfaceProtrusion(const Delaunay::Finite_vertices_iterator &vit, pointIndexHit &surfHit, label &hitSurface) const
Find the "worst" protrusion of a dual cell through the surface,.
Foam::Vector< scalar >
Foam::conformalVoronoiMesh::writeCellAlignments
void writeCellAlignments(const fvMesh &mesh) const
Foam::conformalVoronoiMesh::internalPointIsInside
bool internalPointIsInside(const Foam::point &pt) const
Check internal point is completely inside the meshable region.
Definition: conformalVoronoiMeshI.H:349
Foam::conformalVoronoiMesh::targetCellSize
scalar targetCellSize(const Foam::point &pt) const
Return the local target cell size at the given location. Takes.
Definition: conformalVoronoiMeshI.H:38
Foam::conformalVoronoiMesh::labelPairPairDynListList
List< DynamicList< Pair< labelPair > > > labelPairPairDynListList
Definition: conformalVoronoiMesh.H:109
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::searchableSurfaces
Container for searchableSurfaces.
Definition: searchableSurfaces.H:53
Foam::conformalVoronoiMesh::angleBetweenSurfacePoints
scalar angleBetweenSurfacePoints(Foam::point pA, Foam::point pB) const
Find angle between the normals of two close surface points.
Foam::backgroundMeshDecomposition
Store a background polyMesh to use for the decomposition of space and queries for parallel conformalV...
Definition: backgroundMeshDecomposition.H:92
Foam::conformalVoronoiMesh::surfacePtLocationTreePtr_
autoPtr< dynamicIndexedOctree< dynamicTreeDataPoint > > surfacePtLocationTreePtr_
Search tree for surface point locations.
Definition: conformalVoronoiMesh.H:177
Foam::conformalVoronoiMesh::existingEdgeLocations_
DynamicList< Foam::point > existingEdgeLocations_
Definition: conformalVoronoiMesh.H:173
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::conformalVoronoiMesh::maxSurfaceProtrusion
scalar maxSurfaceProtrusion(const Foam::point &pt) const
Return the local maximum surface protrusion distance.
Definition: conformalVoronoiMeshI.H:213
Foam::conformalVoronoiMesh::nearFeatureEdgeLocation
bool nearFeatureEdgeLocation(const pointIndexHit &pHit, pointIndexHit &nearestEdgeHit) const
Check if a location is in the exclusion range of an existing feature.
Foam::surface
Definition: surface.H:55
Foam::conformalVoronoiMesh::storeSurfaceConformation
void storeSurfaceConformation()
Store the surface conformation with the indices offset to be.
Foam::conformalVoronoiMesh::featurePointExclusionDistanceSqr
scalar featurePointExclusionDistanceSqr(const Foam::point &pt) const
Return the square of the local feature point exclusion distance.
Definition: conformalVoronoiMeshI.H:157
Foam::conformalVoronoiMesh::clipLineToProc
bool clipLineToProc(const Foam::point &pt, Foam::point &a, Foam::point &b) const
Return false if the line is entirely outside the current processor.
Foam::conformalVoronoiMesh::limitDisplacement
void limitDisplacement(const Delaunay::Finite_vertices_iterator &vit, vector &displacement, label callCount=0) const
Write out debugging information about the surface conformation.
meshName
static char meshName[]
Definition: globalFoam.H:7
Foam::conformalVoronoiMesh::checkCellSizing
void checkCellSizing()
Check whether the cell sizes are fine enough. Creates a polyMesh.
Point
CGAL::Point_3< K > Point
Definition: CGALIndexedPolyhedron.H:51
Foam::conformalVoronoiMesh::dualCellSurfaceAllIntersections
bool dualCellSurfaceAllIntersections(const Delaunay::Finite_vertices_iterator &vit, pointIndexHitAndFeatureDynList &info) const
Return all intersections.
Foam::conformalVoronoiMesh::findCellZoneInsideWalk
void findCellZoneInsideWalk(const polyMesh &mesh, const labelList &locationSurfaces, const labelList &faceToSurface, labelList &cellToSurface) const
From meshRefinementBaffles.C. Use insidePoint for a surface to.
Foam::extendedFeatureEdgeMesh
extendedEdgeMesh + IO.
Definition: extendedFeatureEdgeMesh.H:52
Foam::conformalVoronoiMesh::operator=
void operator=(const conformalVoronoiMesh &)
Disallow default bitwise assignment.
Foam::conformalVoronoiMesh::insertInternalPoints
void insertInternalPoints(List< Point > &points, const bool distribute=false)
Insert Delaunay vertices using the CGAL range insertion method,.
Foam::face
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:75
DynamicList.H
Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
void createFacesOwnerNeighbourAndPatches(const pointField &pts, faceList &faces, labelList &owner, labelList &neighbour, wordList &patchNames, PtrList< dictionary > &patchDicts, labelListList &patchPointPairSlaves, PackedBoolList &boundaryFacesToRemove, bool includeEmptyPatches=false) const
Create all of the internal and boundary faces.
Foam::conformalVoronoiMesh::featureEdge
@ featureEdge
Definition: conformalVoronoiMesh.H:121
cellSet.H
Foam::conformalVoronoiMesh::buildSurfacePtLocationTree
void buildSurfacePtLocationTree(const DynamicList< Foam::point > &existingSurfacePtLocations) const
Build or rebuild the surface point location tree.
transform.H
3D tensor transformation operations.
Foam::conformalVoronoiMesh::appendToSurfacePtTree
bool appendToSurfacePtTree(const Foam::point &pt) const
Append a point to the surface point tree and the existing list.
Foam::Tuple2
A 2-tuple for storing two objects of different types.
Definition: Tuple2.H:47
Foam::conformalVoronoiMesh::ownerAndNeighbour
bool ownerAndNeighbour(Vertex_handle vA, Vertex_handle vB, label &owner, label &neighbour) const
Determines the owner and neighbour labels for dual cells.
Foam::conformalVoronoiMesh::initialiseForMotion
void initialiseForMotion()
Foam::conformalVoronoiMesh::setVertexSizeAndAlignment
void setVertexSizeAndAlignment()
Set the size and alignment data for each vertex.
Foam::conformalVoronoiMesh::allGeometry
const searchableSurfaces & allGeometry() const
Return the allGeometry object.
Definition: conformalVoronoiMeshI.H:543
Foam::conformalVoronoiMesh::distributeBackground
bool distributeBackground(const Triangulation &mesh)
In parallel redistribute the backgroundMeshDecomposition and.
Foam::conformalVoronoiMesh::rndGen_
Random rndGen_
Random number generator.
Definition: conformalVoronoiMesh.H:144
CGALTriangulation3Ddefs.H
CGAL data structures used for 3D Delaunay meshing.
zeroGradientFvPatchFields.H
Foam::conformalVoronoiMesh::reconformToSurface
bool reconformToSurface() const
Decision making function for when to rebuild the surface.
Foam::conformalVoronoiMesh::ptPairs_
pointPairs< Delaunay > ptPairs_
Definition: conformalVoronoiMesh.H:165
Foam::conformalVoronoiMesh::checkCoPlanarCells
void checkCoPlanarCells() const
Foam::conformalVoronoiMesh::checkProcessorPatchesMatch
void checkProcessorPatchesMatch(const PtrList< dictionary > &patchDicts) const
Foam::conformalVoronoiMesh::searchAngleOppositeSurface
static const scalar searchAngleOppositeSurface
Definition: conformalVoronoiMesh.H:135
Foam::conformalVoronoiMesh::reinsertSurfaceConformation
void reinsertSurfaceConformation()
Reinsert the surface conformation re-offsetting indices to be.
Foam::conformalVoronoiMesh::reorderProcessorPatches
void reorderProcessorPatches(const word &meshName, const fileName &instance, const pointField &points, faceList &faces, const wordList &patchNames, const PtrList< dictionary > &patchDicts) const
Rotate the faces on processor patches if necessary.
Foam::NamedEnum< dualMeshPointType, 5 >
Foam::conformalVoronoiMesh::distribute
void distribute()
labelPair.H
Foam::conformalVoronoiMesh::addZones
void addZones(polyMesh &mesh, const pointField &cellCentres) const
Add zones to the polyMesh.
Foam::conformalVoronoiMesh::sortProcPatches
void sortProcPatches(List< DynamicList< face > > &patchFaces, List< DynamicList< label > > &patchOwners, List< DynamicList< label > > &patchPointPairSlaves, labelPairPairDynListList &patchSortingIndices) const
Sort the processor patches so that the faces are in the same order.
Foam::conformalVoronoiMesh::indexDualVertices
void indexDualVertices(pointField &pts, labelList &boundaryPts)
Index all of the the Delaunay cells and calculate their dual points.
Foam::conformalVoronoiMesh::dualMeshPointTypeNames_
static const NamedEnum< dualMeshPointType, 5 > dualMeshPointTypeNames_
Definition: conformalVoronoiMesh.H:126