primitiveMesh.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2023 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::primitiveMesh
26 
27 Description
28  Cell-face mesh analysis engine
29 
30 SourceFiles
31  primitiveMeshI.H
32  primitiveMesh.C
33  primitiveMeshClear.C
34  primitiveMeshCellCells.C
35  primitiveMeshEdgeCells.C
36  primitiveMeshPointCells.C
37  primitiveMeshCells.C
38  primitiveMeshEdgeFaces.C
39  primitiveMeshPointFaces.C
40  primitiveMeshCellEdges.C
41  primitiveMeshPointEdges.C
42  primitiveMeshPointPoints.C
43  primitiveMeshEdges.C
44  primitiveMeshCellCentresAndVols.C
45  primitiveMeshFaceCentresAndAreas.C
46  primitiveMeshFindCell.C
47 
48 \*---------------------------------------------------------------------------*/
49 
50 #ifndef primitiveMesh_H
51 #define primitiveMesh_H
52 
53 #include "DynamicList.H"
54 #include "edgeList.H"
55 #include "pointField.H"
56 #include "faceList.H"
57 #include "cellList.H"
58 #include "cellShapeList.H"
59 #include "labelList.H"
60 #include "boolList.H"
61 #include "HashSet.H"
62 #include "Map.H"
63 
64 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 
66 namespace Foam
67 {
68 
69 class PackedBoolList;
70 
71 /*---------------------------------------------------------------------------*\
72  Class primitiveMesh Declaration
73 \*---------------------------------------------------------------------------*/
74 
75 class primitiveMesh
76 {
77  // Permanent data
78 
79  // Primitive size data
80 
81  //- Number of internal points (or -1 if points not sorted)
82  label nInternalPoints_;
83 
84  //- Number of points
85  label nPoints_;
86 
87  //- Number of internal edges using 0 boundary points
88  mutable label nInternal0Edges_;
89 
90  //- Number of internal edges using 0 or 1 boundary points
91  mutable label nInternal1Edges_;
92 
93  //- Number of internal edges using 0,1 or 2boundary points
94  mutable label nInternalEdges_;
95 
96  //- Number of edges
97  mutable label nEdges_;
98 
99  //- Number of internal faces
100  label nInternalFaces_;
101 
102  //- Number of faces
103  label nFaces_;
104 
105  //- Number of cells
106  label nCells_;
107 
108 
109  // Shapes
110 
111  //- Cell shapes
112  mutable cellShapeList* cellShapesPtr_;
113 
114  //- Edges
115  mutable edgeList* edgesPtr_;
116 
117 
118  // Connectivity
119 
120  //- Cell-cells
121  mutable labelListList* ccPtr_;
122 
123  //- Edge-cells
124  mutable labelListList* ecPtr_;
125 
126  //- Point-cells
127  mutable labelListList* pcPtr_;
128 
129  //- Cell-faces
130  mutable cellList* cfPtr_;
131 
132  //- Edge-faces
133  mutable labelListList* efPtr_;
134 
135  //- Point-faces
136  mutable labelListList* pfPtr_;
137 
138  //- Cell-edges
139  mutable labelListList* cePtr_;
140 
141  //- Face-edges
142  mutable labelListList* fePtr_;
143 
144  //- Point-edges
145  mutable labelListList* pePtr_;
146 
147  //- Point-points
148  mutable labelListList* ppPtr_;
149 
150  //- Cell-points
151  mutable labelListList* cpPtr_;
152 
153 
154  // On-the-fly edge addressing storage
155 
156  //- Temporary storage for addressing.
157  mutable DynamicList<label> labels_;
158 
159  //- Temporary storage for addressing
160  mutable labelHashSet labelSet_;
161 
162 
163  // Geometric data
164 
165  //- Cell centres
166  mutable vectorField* cellCentresPtr_;
167 
168  //- Face centres
169  mutable vectorField* faceCentresPtr_;
170 
171  //- Cell volumes
172  mutable scalarField* cellVolumesPtr_;
173 
174  //- Face areas
175  mutable vectorField* faceAreasPtr_;
176 
177  //- Face area magnitudes
178  mutable scalarField* magFaceAreasPtr_;
179 
180 
181  // Topological calculations
182 
183  //- Calculate cell shapes
184  void calcCellShapes() const;
185 
186  //- Calculate cell-cell addressing
187  void calcCellCells() const;
188 
189  //- Calculate point-cell addressing
190  void calcPointCells() const;
191 
192  //- Calculate cell-face addressing
193  void calcCells() const;
194 
195  //- Calculate edge list
196  void calcCellEdges() const;
197 
198  //- Calculate point-point addressing
199  void calcPointPoints() const;
200 
201  //- Calculate edges, pointEdges and faceEdges (if doFaceEdges=true)
202  // During edge calculation, a larger set of data is assembled.
203  // Create and destroy as a set, using clearOutEdges()
204  void calcEdges(const bool doFaceEdges) const;
205  void clearOutEdges();
206  //- Helper: return (after optional creation) edge between two points
207  static label getEdge
208  (
211  const label,
212  const label
213  );
214  //- For on-the-fly addressing calculation
215  static label findFirstCommonElementFromSortedLists
216  (
217  const labelList&,
218  const labelList&
219  );
220 
221 protected:
222 
223  // Static Data Members
224 
225  // Geometrical calculations
226 
227  //- Calculate face centres and areas
228  void calcFaceCentresAndAreas() const;
229 
231  (
232  const pointField& p,
233  vectorField& fCtrs,
234  vectorField& fAreas,
235  scalarField& magfAreas
236  ) const;
237 
238  //- Calculate cell centres and volumes
239  void calcCellCentresAndVols() const;
240 
242  (
243  const vectorField& fCtrs,
244  const vectorField& fAreas,
245  vectorField& cellCtrs,
247  ) const;
248 
249  //- Calculate edge vectors
250  void calcEdgeVectors() const;
251 
252 
253  //- Construct null
254  primitiveMesh();
255 
256 
257 public:
258 
259  // Static data
260 
261  ClassName("primitiveMesh");
262 
263  //- Estimated number of cells per edge
264  static const unsigned cellsPerEdge_ = 4;
265 
266  //- Estimated number of cells per point
267  static const unsigned cellsPerPoint_ = 8;
268 
269  //- Estimated number of faces per cell
270  static const unsigned facesPerCell_ = 6;
271 
272  //- Estimated number of faces per edge
273  static const unsigned facesPerEdge_ = 4;
274 
275  //- Estimated number of faces per point
276  static const unsigned facesPerPoint_ = 12;
277 
278  //- Estimated number of edges per cell
279  static const unsigned edgesPerCell_ = 12;
280 
281  //- Estimated number of edges per cell
282  static const unsigned edgesPerFace_ = 4;
283 
284  //- Estimated number of edges per point
285  static const unsigned edgesPerPoint_ = 6;
286 
287  //- Estimated number of points per cell
288  static const unsigned pointsPerCell_ = 8;
289 
290  //- Estimated number of points per face
291  static const unsigned pointsPerFace_ = 4;
292 
293 
294  // Constructors
295 
296  //- Construct from components
298  (
299  const label nPoints,
300  const label nInternalFaces,
301  const label nFaces,
302  const label nCells
303  );
304 
305  //- Move constructor
306  primitiveMesh(primitiveMesh&&) = default;
307 
308  //- Disallow default bitwise copy construction
309  primitiveMesh(const primitiveMesh&) = delete;
310 
311 
312  //- Destructor
313  virtual ~primitiveMesh();
314 
315 
316  // Member Functions
317 
318  //- Reset this primitiveMesh given the primitive array sizes
319  void reset
320  (
321  const label nPoints,
322  const label nInternalFaces,
323  const label nFaces,
324  const label nCells
325  );
326 
327  //- Reset this primitiveMesh given the primitive array sizes and cells
328  void reset
329  (
330  const label nPoints,
331  const label nInternalFaces,
332  const label nFaces,
333  const label nCells,
334  cellList& cells
335  );
336 
337  //- Reset this primitiveMesh given the primitive array sizes and cells
338  void reset
339  (
340  const label nPoints,
341  const label nInternalFaces,
342  const label nFaces,
343  const label nCells,
344  cellList&& cells
345  );
346 
347 
348  // Access
349 
350  // Mesh size parameters
351 
352  inline label nPoints() const;
353  inline label nEdges() const;
354  inline label nInternalFaces() const;
355  inline label nFaces() const;
356  inline label nCells() const;
357 
358  // If points are ordered (nInternalPoints != -1):
359 
360  //- Points not on boundary
361  inline label nInternalPoints() const;
362 
363  //- Internal edges (i.e. not on boundary face) using
364  // no boundary point
365  inline label nInternal0Edges() const;
366 
367  //- Internal edges using 0 or 1 boundary point
368  inline label nInternal1Edges() const;
369 
370  //- Internal edges using 0,1 or 2 boundary points
371  inline label nInternalEdges() const;
372 
373 
374  // Primitive mesh data
375 
376  //- Return mesh points
377  virtual const pointField& points() const = 0;
378 
379  //- Return faces
380  virtual const faceList& faces() const = 0;
381 
382  //- Face face-owner addressing
383  virtual const labelList& faceOwner() const = 0;
384 
385  //- Face face-neighbour addressing
386  virtual const labelList& faceNeighbour() const = 0;
387 
388  //- Return old points for mesh motion
389  virtual const pointField& oldPoints() const = 0;
390 
391  //- Return old cell centres for mesh motion
392  virtual const pointField& oldCellCentres() const = 0;
393 
394 
395  // Derived mesh data
396 
397  //- Return cell shapes
398  const cellShapeList& cellShapes() const;
399 
400  //- Return mesh edges. Uses calcEdges.
401  const edgeList& edges() const;
402 
403  //- Helper function to calculate cell-face addressing from
404  // face-cell addressing. If nCells is not provided it will
405  // scan for the maximum.
406  static void calcCells
407  (
408  cellList&,
409  const labelUList& own,
410  const labelUList& nei,
411  const label nCells = -1
412  );
413 
414  //- Helper function to calculate point ordering. Returns true
415  // if points already ordered, false and fills pointMap (old to
416  // new). Map splits points into those not used by any boundary
417  // face and those that are.
418  static bool calcPointOrder
419  (
421  labelList& pointMap,
422  const faceList&,
423  const label nInternalFaces,
424  const label nPoints
425  );
426 
427  // Return mesh connectivity
428 
429  const labelListList& cellCells() const;
430  // faceCells given as owner and neighbour
431  const labelListList& edgeCells() const;
432  const labelListList& pointCells() const;
433 
434  const cellList& cells() const;
435  // faceFaces considered unnecessary
436  const labelListList& edgeFaces() const;
437  const labelListList& pointFaces() const;
438 
439  const labelListList& cellEdges() const;
440  const labelListList& faceEdges() const;
441  // edgeEdges considered unnecessary
442  const labelListList& pointEdges() const;
443  const labelListList& pointPoints() const;
444  const labelListList& cellPoints() const;
445 
446 
447  // Geometric data (raw!)
448 
449  const vectorField& cellCentres() const;
450  const vectorField& faceCentres() const;
451  const scalarField& cellVolumes() const;
452  const vectorField& faceAreas() const;
453  const scalarField& magFaceAreas() const;
454 
455 
456  // Mesh motion
457 
458  //- Move points, returns volumes swept by faces in motion
460  (
461  const pointField& p,
462  const pointField& oldP
463  );
464 
465 
466  //- Return true if given face label is internal to the mesh
467  inline bool isInternalFace(const label faceIndex) const;
468 
469 
470  // Topological checks
471 
472  //- Check face ordering
474  (
475  const bool report = false,
476  labelHashSet* setPtr = nullptr
477  ) const;
478 
479  //- Check cell zip-up
480  bool checkCellsZipUp
481  (
482  const bool report = false,
483  labelHashSet* setPtr = nullptr
484  ) const;
485 
486  //- Check uniqueness of face vertices
487  bool checkFaceVertices
488  (
489  const bool report = false,
490  labelHashSet* setPtr = nullptr
491  ) const;
492 
493  //- Check for unused points
494  bool checkPoints
495  (
496  const bool report = false,
497  labelHashSet* setPtr = nullptr
498  ) const;
499 
500  //- Check if all points on face are shared with another face.
502  (
503  const label,
504  const Map<label>&,
505  label& nBaffleFaces,
506  labelHashSet*
507  ) const;
508 
509  //- Check that shared points are in consecutive order.
510  bool checkCommonOrder
511  (
512  const label,
513  const Map<label>&,
514  labelHashSet*
515  ) const;
516 
517  //- Check face-face connectivity
518  bool checkFaceFaces
519  (
520  const bool report = false,
521  labelHashSet* setPtr = nullptr
522  ) const;
523 
524 
525  // Geometric checks
526 
527  //- Check boundary for closedness
528  bool checkClosedBoundary(const bool report = false) const;
529 
530  //- Check cells for closedness
531  bool checkClosedCells
532  (
533  const bool report = false,
534  labelHashSet* setPtr = nullptr,
535  labelHashSet* highAspectSetPtr = nullptr,
536  const Vector<label>& solutionD = Vector<label>::one
537  ) const;
538 
539  //- Check for negative face areas
540  bool checkFaceAreas
541  (
542  const bool report = false,
543  labelHashSet* setPtr = nullptr
544  ) const;
545 
546  //- Check for negative cell volumes
547  bool checkCellVolumes
548  (
549  const bool report = false,
550  labelHashSet* setPtr = nullptr
551  ) const;
552 
553  //- Check face pyramid volume
554  bool checkFacePyramids
555  (
556  const bool report = false,
557  const scalar minPyrVol = -small,
558  labelHashSet* setPtr = nullptr
559  ) const;
560 
561  //- Check face angles
562  bool checkFaceAngles
563  (
564  const bool report = false,
565  const scalar maxSin = 10, // In degrees
566  labelHashSet* setPtr = nullptr
567  ) const;
568 
569  //- Check face warpage: decompose face and check ratio between
570  // magnitude of sum of triangle areas and sum of magnitude of
571  // triangle areas.
572  bool checkFaceFlatness
573  (
574  const bool report,
575  const scalar warnFlatness, // When to include in set.
576  labelHashSet* setPtr
577  ) const;
578 
579  //- Check for point-point-nearness,
580  // e.g. colocated points which may be part of baffles.
581  bool checkPointNearness
582  (
583  const bool report,
584  const scalar reportDistSqr,
585  labelHashSet* setPtr = nullptr
586  ) const;
587 
588  //- Check edge length
589  bool checkEdgeLength
590  (
591  const bool report,
592  const scalar minLenSqr,
593  labelHashSet* setPtr = nullptr
594  ) const;
595 
596  //- Check for concave cells by the planes of faces
597  bool checkConcaveCells
598  (
599  const bool report = false,
600  labelHashSet* setPtr = nullptr
601  ) const;
602 
603 
604  // Useful derived info
605 
606  //- Return true if the point in the cell bounding box.
607  // The bounding box may be isotropically inflated by the fraction
608  // inflationFraction
609  bool pointInCellBB
610  (
611  const point& p,
612  label celli,
613  scalar inflationFraction = 0
614  ) const;
615 
616  //- Return true if the point is in the cell
617  bool pointInCell(const point& p, label celli) const;
618 
619  //- Find the cell with the nearest cell centre to location
620  label findNearestCell(const point& location) const;
621 
622  //- Find cell enclosing this location (-1 if not in mesh)
623  label findCell(const point& location) const;
624 
625 
626  // Storage management
627 
628  //- Print a list of all the currently allocated mesh data
629  void printAllocated() const;
630 
631  // Per storage whether allocated
632  inline bool hasCellShapes() const;
633  inline bool hasEdges() const;
634  inline bool hasCellCells() const;
635  inline bool hasEdgeCells() const;
636  inline bool hasPointCells() const;
637  inline bool hasCells() const;
638  inline bool hasEdgeFaces() const;
639  inline bool hasPointFaces() const;
640  inline bool hasCellEdges() const;
641  inline bool hasFaceEdges() const;
642  inline bool hasPointEdges() const;
643  inline bool hasPointPoints() const;
644  inline bool hasCellPoints() const;
645  inline bool hasCellCentres() const;
646  inline bool hasFaceCentres() const;
647  inline bool hasCellVolumes() const;
648  inline bool hasFaceAreas() const;
649 
650  // On-the-fly addressing calculation. These functions return either
651  // a reference to the full addressing (if already calculated) or
652  // a reference to the supplied storage. The one-argument ones
653  // use member DynamicList labels_ so be careful when not storing
654  // result.
655 
656  //- cellCells using cells.
657  const labelList& cellCells
658  (
659  const label celli,
661  ) const;
662 
663  const labelList& cellCells(const label celli) const;
664 
665  //- cellPoints using cells
666  const labelList& cellPoints
667  (
668  const label celli,
670  ) const;
671 
672  const labelList& cellPoints(const label celli) const;
673 
674  //- pointCells using pointFaces
675  const labelList& pointCells
676  (
677  const label pointi,
679  ) const;
680 
681  const labelList& pointCells(const label pointi) const;
682 
683  //- pointPoints using edges, pointEdges
684  const labelList& pointPoints
685  (
686  const label pointi,
688  ) const;
689 
690  const labelList& pointPoints(const label pointi) const;
691 
692  //- faceEdges using pointFaces, edges, pointEdges
693  const labelList& faceEdges
694  (
695  const label facei,
697  ) const;
698 
699  const labelList& faceEdges(const label facei) const;
700 
701  //- edgeFaces using pointFaces, edges, pointEdges
702  const labelList& edgeFaces
703  (
704  const label edgeI,
706  ) const;
707 
708  const labelList& edgeFaces(const label edgeI) const;
709 
710  //- edgeCells using pointFaces, edges, pointEdges
711  const labelList& edgeCells
712  (
713  const label edgeI,
715  ) const;
716 
717  const labelList& edgeCells(const label edgeI) const;
718 
719  //- cellEdges using cells, pointFaces, edges, pointEdges
720  const labelList& cellEdges
721  (
722  const label celli,
724  ) const;
725 
726  const labelList& cellEdges(const label celli) const;
727 
728 
729  //- Clear geometry
730  void clearGeom();
731 
732  //- Clear topological data
733  void clearAddressing();
734 
735  //- Clear all geometry and addressing unnecessary for CFD
736  void clearOut();
737 
738 
739  // Member Operators
740 
741  //- Disallow default bitwise assignment
742  void operator=(const primitiveMesh&) = delete;
743 };
744 
745 
746 namespace polyMeshCheck
747 {
748  //- Data to control mesh checking
749 
750  //- Cell closedness warning threshold
751  // set as the fraction of un-closed area to closed area
752  extern scalar closedThreshold;
753 
754  //- Aspect ratio warning threshold
755  extern scalar aspectThreshold;
756 
757  //- Non-orthogonality warning threshold in deg
758  extern scalar nonOrthThreshold;
759 
760  //- Skewness warning threshold
761  extern scalar skewThreshold;
762 
763  //- Threshold where faces are considered coplanar
764  extern scalar planarCosAngle;
765 }
766 
767 
768 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
769 
770 } // End namespace Foam
771 
772 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
773 
774 #include "primitiveMeshI.H"
775 
776 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
777 
778 #endif
779 
780 // ************************************************************************* //
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:75
label nEdges() const
label nCells() const
static bool calcPointOrder(label &nInternalPoints, labelList &pointMap, const faceList &, const label nInternalFaces, const label nPoints)
Helper function to calculate point ordering. Returns true.
label findNearestCell(const point &location) const
Find the cell with the nearest cell centre to location.
bool hasCellCells() const
bool hasCellShapes() const
primitiveMesh()
Construct null.
Definition: primitiveMesh.C:39
bool hasPointFaces() const
label nPoints() const
bool hasCellEdges() const
bool hasCellVolumes() const
const labelListList & pointEdges() const
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
const labelListList & cellEdges() const
bool pointInCell(const point &p, label celli) const
Return true if the point is in the cell.
bool hasPointPoints() const
bool checkClosedCells(const bool report=false, labelHashSet *setPtr=nullptr, labelHashSet *highAspectSetPtr=nullptr, const Vector< label > &solutionD=Vector< label >::one) const
Check cells for closedness.
const vectorField & faceCentres() const
bool checkFacePyramids(const bool report=false, const scalar minPyrVol=-small, labelHashSet *setPtr=nullptr) const
Check face pyramid volume.
virtual const faceList & faces() const =0
Return faces.
bool checkEdgeLength(const bool report, const scalar minLenSqr, labelHashSet *setPtr=nullptr) const
Check edge length.
bool checkCellsZipUp(const bool report=false, labelHashSet *setPtr=nullptr) const
Check cell zip-up.
const labelListList & pointCells() const
static const unsigned facesPerEdge_
Estimated number of faces per edge.
const scalarField & cellVolumes() const
bool checkFaceAreas(const bool report=false, labelHashSet *setPtr=nullptr) const
Check for negative face areas.
void clearGeom()
Clear geometry.
bool hasFaceAreas() const
bool checkCommonOrder(const label, const Map< label > &, labelHashSet *) const
Check that shared points are in consecutive order.
bool pointInCellBB(const point &p, label celli, scalar inflationFraction=0) const
Return true if the point in the cell bounding box.
bool checkFaceAngles(const bool report=false, const scalar maxSin=10, labelHashSet *setPtr=nullptr) const
Check face angles.
bool hasEdges() const
label nInternal1Edges() const
Internal edges using 0 or 1 boundary point.
bool hasFaceCentres() const
bool checkUpperTriangular(const bool report=false, labelHashSet *setPtr=nullptr) const
Check face ordering.
bool checkConcaveCells(const bool report=false, labelHashSet *setPtr=nullptr) const
Check for concave cells by the planes of faces.
void makeCellCentresAndVols(const vectorField &fCtrs, const vectorField &fAreas, vectorField &cellCtrs, scalarField &cellVols) const
static const unsigned edgesPerCell_
Estimated number of edges per cell.
const vectorField & cellCentres() const
bool hasPointCells() const
bool checkClosedBoundary(const bool report=false) const
Check boundary for closedness.
virtual ~primitiveMesh()
Destructor.
bool checkCellVolumes(const bool report=false, labelHashSet *setPtr=nullptr) const
Check for negative cell volumes.
const cellShapeList & cellShapes() const
Return cell shapes.
static const unsigned facesPerPoint_
Estimated number of faces per point.
void calcCellCentresAndVols() const
Calculate cell centres and volumes.
virtual const labelList & faceOwner() const =0
Face face-owner addressing.
bool checkDuplicateFaces(const label, const Map< label > &, label &nBaffleFaces, labelHashSet *) const
Check if all points on face are shared with another face.
label findCell(const point &location) const
Find cell enclosing this location (-1 if not in mesh)
void calcEdgeVectors() const
Calculate edge vectors.
static const unsigned pointsPerFace_
Estimated number of points per face.
ClassName("primitiveMesh")
bool checkFaceVertices(const bool report=false, labelHashSet *setPtr=nullptr) const
Check uniqueness of face vertices.
const labelListList & cellCells() const
const labelListList & cellPoints() const
label nInternalFaces() const
void clearAddressing()
Clear topological data.
static const unsigned cellsPerPoint_
Estimated number of cells per point.
bool checkPoints(const bool report=false, labelHashSet *setPtr=nullptr) const
Check for unused points.
bool hasCellCentres() const
bool hasCellPoints() const
static const unsigned cellsPerEdge_
Estimated number of cells per edge.
label nInternal0Edges() const
Internal edges (i.e. not on boundary face) using.
label nFaces() const
void operator=(const primitiveMesh &)=delete
Disallow default bitwise assignment.
bool checkPointNearness(const bool report, const scalar reportDistSqr, labelHashSet *setPtr=nullptr) const
Check for point-point-nearness,.
label nInternalEdges() const
Internal edges using 0,1 or 2 boundary points.
const scalarField & magFaceAreas() const
void printAllocated() const
Print a list of all the currently allocated mesh data.
void reset(const label nPoints, const label nInternalFaces, const label nFaces, const label nCells)
Reset this primitiveMesh given the primitive array sizes.
static const unsigned edgesPerPoint_
Estimated number of edges per point.
const labelListList & pointFaces() const
bool hasCells() const
virtual const labelList & faceNeighbour() const =0
Face face-neighbour addressing.
tmp< scalarField > movePoints(const pointField &p, const pointField &oldP)
Move points, returns volumes swept by faces in motion.
virtual const pointField & oldCellCentres() const =0
Return old cell centres for mesh motion.
static const unsigned pointsPerCell_
Estimated number of points per cell.
static const unsigned facesPerCell_
Estimated number of faces per cell.
bool hasFaceEdges() const
virtual const pointField & points() const =0
Return mesh points.
const labelListList & edgeFaces() const
const labelListList & pointPoints() const
const labelListList & faceEdges() const
const labelListList & edgeCells() const
const vectorField & faceAreas() const
bool hasEdgeCells() const
bool checkFaceFlatness(const bool report, const scalar warnFlatness, labelHashSet *setPtr) const
Check face warpage: decompose face and check ratio between.
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
void calcFaceCentresAndAreas() const
Calculate face centres and areas.
label nInternalPoints() const
Points not on boundary.
bool checkFaceFaces(const bool report=false, labelHashSet *setPtr=nullptr) const
Check face-face connectivity.
static const unsigned edgesPerFace_
Estimated number of edges per cell.
bool hasEdgeFaces() const
const cellList & cells() const
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
void makeFaceCentresAndAreas(const pointField &p, vectorField &fCtrs, vectorField &fAreas, scalarField &magfAreas) const
bool hasPointEdges() const
virtual const pointField & oldPoints() const =0
Return old points for mesh motion.
A class for managing temporary objects.
Definition: tmp.H:55
scalar closedThreshold
Data to control mesh checking.
Definition: polyMeshCheck.C:33
scalar skewThreshold
Skewness warning threshold.
Definition: polyMeshCheck.C:36
scalar aspectThreshold
Aspect ratio warning threshold.
Definition: polyMeshCheck.C:34
scalar planarCosAngle
Threshold where faces are considered coplanar.
Definition: polyMeshCheck.C:37
scalar nonOrthThreshold
Non-orthogonality warning threshold in deg.
Definition: polyMeshCheck.C:35
Namespace for OpenFOAM.
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
volScalarField & p
const scalarField & cellVols