polyMesh.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2018-2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::polyMesh
29 
30 Description
31  Mesh consisting of general polyhedral cells.
32 
33 SourceFiles
34  polyMesh.C
35  polyMeshInitMesh.C
36  polyMeshClear.C
37  polyMeshFromShapeMesh.C
38  polyMeshIO.C
39  polyMeshUpdate.C
40  polyMeshCheck.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef polyMesh_H
45 #define polyMesh_H
46 
47 #include "objectRegistry.H"
48 #include "primitiveMesh.H"
49 #include "pointField.H"
50 #include "faceList.H"
51 #include "cellList.H"
52 #include "cellShapeList.H"
53 #include "pointIOField.H"
54 #include "faceIOList.H"
55 #include "labelIOList.H"
56 #include "polyBoundaryMesh.H"
57 #include "boundBox.H"
58 #include "pointZoneMesh.H"
59 #include "faceZoneMesh.H"
60 #include "cellZoneMesh.H"
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 
67 // Forward declaration of classes
68 class globalMeshData;
69 class mapPolyMesh;
70 class polyMeshTetDecomposition;
71 class treeDataCell;
72 template<class Type> class indexedOctree;
73 
74 /*---------------------------------------------------------------------------*\
75  Class polyMesh Declaration
76 \*---------------------------------------------------------------------------*/
77 
78 class polyMesh
79 :
80  public objectRegistry,
81  public primitiveMesh
82 {
83 
84 public:
85 
86  // Public data types
87 
88  //- Enumeration defining the state of the mesh after a read update.
89  // Used for post-processing applications, where the mesh
90  // needs to update based on the files written in time
91  // directories
92  enum readUpdateState
93  {
98  };
99 
100  //- Enumeration defining the decomposition of the cell for
101  // inside/outside test
102  enum cellDecomposition
103  {
104  FACE_PLANES, //- Faces considered as planes
105 
106  FACE_CENTRE_TRIS, //- Faces decomposed into triangles
107  // using face-centre
108 
109  FACE_DIAG_TRIS, //- Faces decomposed into triangles diagonally
110 
111  CELL_TETS //- Cell decomposed into tets
112  };
113 
114 
115 private:
116 
117  // Permanent data
118 
119  // Primitive mesh data
120 
121  //- Points
122  pointIOField points_;
123 
124  //- Faces
125  faceCompactIOList faces_;
126 
127  //- Face owner
128  labelIOList owner_;
129 
130  //- Face neighbour
131  labelIOList neighbour_;
132 
133  //- Have the primitives been cleared
134  bool clearedPrimitives_;
135 
136 
137  //- Boundary mesh
138  mutable polyBoundaryMesh boundary_;
139 
140  //- Mesh bounding-box.
141  // Created from points on construction, updated when the mesh moves
142  boundBox bounds_;
143 
144  //- Communicator used for parallel communication
145  label comm_;
146 
147  //- Vector of non-constrained directions in mesh
148  // defined according to the presence of empty and wedge patches
149  mutable Vector<label> geometricD_;
150 
151  //- Vector of valid directions in mesh
152  // defined according to the presence of empty patches
153  mutable Vector<label> solutionD_;
154 
155  //- Base point for face decomposition into tets
156  mutable autoPtr<labelIOList> tetBasePtIsPtr_;
157 
158  //- Search tree to allow spatial cell searching
159  mutable autoPtr<indexedOctree<treeDataCell>> cellTreePtr_;
160 
161 
162  // Zoning information
163 
164  //- Point zones
165  pointZoneMesh pointZones_;
166 
167  //- Face zones
168  faceZoneMesh faceZones_;
169 
170  //- Cell zones
171  cellZoneMesh cellZones_;
172 
173 
174  //- Parallel info
175  mutable autoPtr<globalMeshData> globalMeshDataPtr_;
176 
177 
178  // Mesh motion related data
179 
180  //- Is the mesh moving
181  bool moving_;
182 
183  //- Is the mesh topology changing
184  bool topoChanging_;
185 
186  //- Current time index for mesh motion
187  mutable label curMotionTimeIndex_;
188 
189  //- Old points (for the last mesh motion)
190  mutable autoPtr<pointField> oldPointsPtr_;
191 
192 
193  // Private Member Functions
194 
195  //- No copy construct
196  polyMesh(const polyMesh&) = delete;
197 
198  //- No copy assignment
199  void operator=(const polyMesh&) = delete;
200 
201  //- Initialise the polyMesh from the primitive data
202  void initMesh();
203 
204  //- Initialise the polyMesh from the given set of cells
205  void initMesh(cellList& c);
206 
207  //- Calculate the valid directions in the mesh from the boundaries
208  void calcDirections() const;
209 
210  //- Calculate the cell shapes from the primitive
211  // polyhedral information
212  void calcCellShapes() const;
213 
214  //- Read and return the tetBasePtIs
215  autoPtr<labelIOList> readTetBasePtIs() const;
216 
217 
218  // Helper functions for constructor from cell shapes
219 
220  labelListList cellShapePointCells(const cellShapeList&) const;
221 
222  labelList facePatchFaceCells
223  (
224  const faceList& patchFaces,
225  const labelListList& pointCells,
226  const faceListList& cellsFaceShapes,
227  const label patchID
228  ) const;
229 
230  void setTopology
231  (
232  const cellShapeList& cellsAsShapes,
233  const faceListList& boundaryFaces,
234  const wordList& boundaryPatchNames,
235  labelList& patchSizes,
236  labelList& patchStarts,
237  label& defaultPatchStart,
238  label& nFaces,
239  cellList& cells
240  );
241 
242 
243  // Geometry checks
244 
245  //- Check non-orthogonality
246  bool checkFaceOrthogonality
247  (
248  const vectorField& fAreas,
249  const vectorField& cellCtrs,
250  const bool report,
251  const bool detailedReport,
252  labelHashSet* setPtr
253  ) const;
254 
255  //- Check face skewness
256  bool checkFaceSkewness
257  (
258  const pointField& points,
259  const vectorField& fCtrs,
260  const vectorField& fAreas,
261  const vectorField& cellCtrs,
262  const bool report,
263  const bool detailedReport,
264  labelHashSet* setPtr
265  ) const;
266 
267  bool checkEdgeAlignment
268  (
269  const pointField& p,
270  const bool report,
271  const Vector<label>& directions,
272  labelHashSet* setPtr
273  ) const;
274 
275  bool checkCellDeterminant
276  (
277  const vectorField& faceAreas,
278  const bool report,
279  labelHashSet* setPtr,
280  const Vector<label>& meshD
281  ) const;
282 
283  bool checkFaceWeight
284  (
285  const vectorField& fCtrs,
286  const vectorField& fAreas,
287  const vectorField& cellCtrs,
288  const bool report,
289  const scalar minWeight,
290  labelHashSet* setPtr
291  ) const;
292 
293  bool checkVolRatio
294  (
295  const scalarField& cellVols,
296  const bool report,
297  const scalar minRatio,
298  labelHashSet* setPtr
299  ) const;
300 
301 public:
302 
303  // Public typedefs
304 
305  typedef polyMesh Mesh;
307 
308 
309  //- Runtime type information
310  TypeName("polyMesh");
311 
312  //- Return the default region name
313  static word defaultRegion;
314 
315  //- Return the mesh sub-directory name (usually "polyMesh")
316  static word meshSubDir;
317 
318 
319  // Constructors
320 
321  //- Read construct from IOobject
322  explicit polyMesh(const IOobject& io);
323 
324  //- Construct from IOobject or as zero-sized mesh
325  // Boundary is added using addPatches() member function
326  polyMesh(const IOobject& io, const zero, bool syncPar=true);
327 
328  //- Construct from IOobject or from components.
329  // Boundary is added using addPatches() member function
330  polyMesh
331  (
332  const IOobject& io,
333  pointField&& points,
334  faceList&& faces,
335  labelList&& owner,
336  labelList&& neighbour,
337  const bool syncPar = true
338  );
339 
340  //- Construct without boundary with cells rather than owner/neighbour.
341  // Boundary is added using addPatches() member function
342  polyMesh
343  (
344  const IOobject& io,
345  pointField&& points,
346  faceList&& faces,
347  cellList&& cells,
348  const bool syncPar = true
349  );
350 
351  //- Construct from cell shapes
352  polyMesh
353  (
354  const IOobject& io,
355  pointField&& points,
356  const cellShapeList& shapes,
357  const faceListList& boundaryFaces,
358  const wordList& boundaryPatchNames,
359  const wordList& boundaryPatchTypes,
360  const word& defaultBoundaryPatchName,
361  const word& defaultBoundaryPatchType,
362  const wordList& boundaryPatchPhysicalTypes,
363  const bool syncPar = true
364  );
365 
366  //- Construct from cell shapes, with patch information in dictionary
367  //- format.
368  polyMesh
369  (
370  const IOobject& io,
371  pointField&& points,
372  const cellShapeList& shapes,
373  const faceListList& boundaryFaces,
374  const wordList& boundaryPatchNames,
376  const word& defaultBoundaryPatchName,
377  const word& defaultBoundaryPatchType,
378  const bool syncPar = true
379  );
380 
381 
382  //- Destructor
383  virtual ~polyMesh();
384 
385 
386  // Member Functions
387 
388  // Database
389 
390  //- Override the objectRegistry dbDir for a single-region case
391  virtual const fileName& dbDir() const;
392 
393  //- Return the local mesh directory (dbDir()/meshSubDir)
394  fileName meshDir() const;
395 
396  //- Return the current instance directory for points
397  // Used in the construction of geometric mesh data dependent
398  // on points
399  const fileName& pointsInstance() const;
400 
401  //- Return the current instance directory for faces
402  const fileName& facesInstance() const;
403 
404  //- Set the instance for mesh files
405  void setInstance
406  (
407  const fileName& instance,
409  );
410 
411 
412  // Access
413 
414  //- Return raw points
415  virtual const pointField& points() const;
416 
417  //- Return true if io is up-to-date with points
418  virtual bool upToDatePoints(const regIOobject& io) const;
419 
420  //- Set io to be up-to-date with points
421  virtual void setUpToDatePoints(regIOobject& io) const;
422 
423  //- Return raw faces
424  virtual const faceList& faces() const;
425 
426  //- Return face owner
427  virtual const labelList& faceOwner() const;
428 
429  //- Return face neighbour
430  virtual const labelList& faceNeighbour() const;
431 
432  //- Return old points for mesh motion
433  virtual const pointField& oldPoints() const;
434 
435  //- Return boundary mesh
436  const polyBoundaryMesh& boundaryMesh() const
437  {
438  return boundary_;
439  }
440 
441  //- Return mesh bounding box
442  const boundBox& bounds() const
443  {
444  return bounds_;
445  }
446 
447  //- Return the vector of geometric directions in mesh.
448  // Defined according to the presence of empty and wedge patches.
449  // 1 indicates unconstrained direction and -1 a constrained
450  // direction.
451  const Vector<label>& geometricD() const;
452 
453  //- Return the number of valid geometric dimensions in the mesh
454  label nGeometricD() const;
455 
456  //- Return the vector of solved-for directions in mesh.
457  // Differs from geometricD in that it includes for wedge cases
458  // the circumferential direction in case of swirl.
459  // 1 indicates valid direction and -1 an invalid direction.
460  const Vector<label>& solutionD() const;
461 
462  //- Return the number of valid solved-for dimensions in the mesh
463  label nSolutionD() const;
464 
465  //- Return the tetBasePtIs
466  const labelIOList& tetBasePtIs() const;
467 
468  //- Return the cell search tree
469  const indexedOctree<treeDataCell>& cellTree() const;
470 
471  //- Return point zone mesh
472  const pointZoneMesh& pointZones() const
473  {
474  return pointZones_;
475  }
476 
477  //- Return face zone mesh
478  const faceZoneMesh& faceZones() const
479  {
480  return faceZones_;
481  }
482 
483  //- Return cell zone mesh
484  const cellZoneMesh& cellZones() const
485  {
486  return cellZones_;
487  }
488 
489  //- Return parallel info
490  const globalMeshData& globalData() const;
491 
492  //- Return communicator used for parallel communication
493  label comm() const;
494 
495  //- Return communicator used for parallel communication
496  label& comm();
497 
498  //- Return the object registry
499  const objectRegistry& thisDb() const
500  {
501  return *this;
502  }
503 
504 
505  // Mesh motion
506 
507  //- Is mesh dynamic
508  virtual bool dynamic() const
509  {
510  return false;
511  }
512 
513  //- Is mesh moving
514  bool moving() const
515  {
516  return moving_;
517  }
518 
519  //- Set the mesh to be moving
520  bool moving(const bool m)
521  {
522  bool m0 = moving_;
523  moving_ = m;
524  return m0;
525  }
526 
527  //- Is mesh topology changing
528  bool topoChanging() const
529  {
530  return topoChanging_;
531  }
532 
533  //- Set the mesh topology to be changing
534  bool topoChanging(const bool c)
535  {
536  bool c0 = topoChanging_;
537  topoChanging_ = c;
538  return c0;
539  }
540 
541  //- Is mesh changing (topology changing and/or moving)
542  bool changing() const
543  {
544  return moving()||topoChanging();
545  }
546 
547  //- Move points, returns volumes swept by faces in motion
548  virtual tmp<scalarField> movePoints(const pointField&);
549 
550  //- Reset motion
551  void resetMotion() const;
552 
553 
554  // Topological change
555 
556  //- Return non-const access to the pointZones
558  {
559  return pointZones_;
560  }
561 
562  //- Return non-const access to the faceZones
564  {
565  return faceZones_;
566  }
567 
568  //- Return non-const access to the cellZones
570  {
571  return cellZones_;
572  }
573 
574  //- Add boundary patches
575  void addPatches
576  (
577  PtrList<polyPatch>& plist,
578  const bool validBoundary = true
579  );
580 
581  //- Add boundary patches
582  void addPatches
583  (
584  const List<polyPatch*>& p,
585  const bool validBoundary = true
586  );
587 
588  //- Add mesh zones
589  void addZones
590  (
591  const List<pointZone*>& pz,
592  const List<faceZone*>& fz,
593  const List<cellZone*>& cz
594  );
595 
596  //- Update the mesh based on the mesh files saved in
597  // time directories
598  virtual readUpdateState readUpdate();
599 
600  //- Update the mesh corresponding to given map
601  virtual void updateMesh(const mapPolyMesh& mpm);
602 
603  //- Remove boundary patches
604  void removeBoundary();
605 
606  //- Reset mesh primitive data. Assumes all patch info correct
607  // (so does e.g. parallel communication). If not use
608  // validBoundary=false
609  //
610  // \note Only autoPtr parameters that test as valid() are used
611  // for resetting, otherwise the existing entries are left
612  // untouched.
613  void resetPrimitives
614  (
617  autoPtr<labelList>&& owner,
618  autoPtr<labelList>&& neighbour,
619  const labelUList& patchSizes,
620  const labelUList& patchStarts,
621  const bool validBoundary = true
622  );
623 
624 
625  // Storage management
626 
627  //- Clear geometry
628  void clearGeom();
629 
630  //- Update geometry; keep topology. Optional new face decomposition
631  void updateGeom
632  (
633  pointIOField& newPoints,
634  autoPtr<labelIOList>& newTetBasePtIsPtr
635  );
636 
637  //- Clear addressing
638  void clearAddressing(const bool isMeshUpdate = false);
639 
640  //- Clear all geometry and addressing unnecessary for CFD
641  void clearOut();
642 
643  //- Clear primitive data (points, faces and cells)
644  void clearPrimitives();
645 
646  //- Clear tet base points
647  void clearTetBasePtIs();
648 
649  //- Clear cell tree data
650  void clearCellTree();
651 
652  //- Remove all files from mesh instance
653  void removeFiles(const fileName& instanceDir) const;
654 
655  //- Remove all files from mesh instance()
656  void removeFiles() const;
657 
658 
659  // Geometric checks. Selectively override primitiveMesh functionality.
660 
661  //- Check non-orthogonality
662  virtual bool checkFaceOrthogonality
663  (
664  const bool report = false,
665  labelHashSet* setPtr = nullptr
666  ) const;
667 
668  //- Check face skewness
669  virtual bool checkFaceSkewness
670  (
671  const bool report = false,
672  labelHashSet* setPtr = nullptr
673  ) const;
674 
675  //- Check edge alignment for 1D/2D cases
676  virtual bool checkEdgeAlignment
677  (
678  const bool report,
679  const Vector<label>& directions,
680  labelHashSet* setPtr
681  ) const;
682 
683  virtual bool checkCellDeterminant
684  (
685  const bool report,
686  labelHashSet* setPtr
687  ) const;
688 
689  //- Check mesh motion for correctness given motion points
690  virtual bool checkMeshMotion
691  (
692  const pointField& newPoints,
693  const bool report = false,
694  const bool detailedReport = false
695  ) const;
696 
697  //- Check for face weights
698  virtual bool checkFaceWeight
699  (
700  const bool report,
701  const scalar minWeight = 0.05,
702  labelHashSet* setPtr = nullptr
703  ) const;
704 
705  //- Check for neighbouring cell volumes
706  virtual bool checkVolRatio
707  (
708  const bool report,
709  const scalar minRatio = 0.01,
710  labelHashSet* setPtr = nullptr
711  ) const;
712 
713 
714  // Position search functions
715 
716  //- Find the cell, tetFacei and tetPti for point p
717  void findCellFacePt
718  (
719  const point& p,
720  label& celli,
721  label& tetFacei,
722  label& tetPti
723  ) const;
724 
725  //- Find the tetFacei and tetPti for point p in celli.
726  // tetFacei and tetPtI are set to -1 if not found
727  void findTetFacePt
728  (
729  const label celli,
730  const point& p,
731  label& tetFacei,
732  label& tetPti
733  ) const;
734 
735  //- Test if point p is in the celli
736  bool pointInCell
737  (
738  const point& p,
739  label celli,
741  ) const;
742 
743  //- Find cell enclosing this location and return index
744  // If not found -1 is returned
746  (
747  const point& p,
749  ) const;
750 };
751 
752 
753 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
754 
755 } // End namespace Foam
756 
757 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
758 
759 #endif
760 
761 // ************************************************************************* //
Foam::polyMesh::addPatches
void addPatches(PtrList< polyPatch > &plist, const bool validBoundary=true)
Add boundary patches.
Definition: polyMesh.C:930
Foam::polyMesh::changing
bool changing() const
Is mesh changing (topology changing and/or moving)
Definition: polyMesh.H:541
Foam::polyMesh::points
virtual const pointField & points() const
Return raw points.
Definition: polyMesh.C:1038
Foam::polyMesh::topoChanging
bool topoChanging() const
Is mesh topology changing.
Definition: polyMesh.H:527
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::IOobject::AUTO_WRITE
Definition: IOobject.H:129
Foam::polyMesh::FACE_DIAG_TRIS
Definition: polyMesh.H:108
Foam::polyMesh::resetMotion
void resetMotion() const
Reset motion.
Definition: polyMesh.C:1234
Foam::polyMesh::cellDecomposition
cellDecomposition
Enumeration defining the decomposition of the cell for.
Definition: polyMesh.H:101
cellZoneMesh.H
Foam::cellZoneMesh.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::IOField
A primitive field of type <T> with automated input and output.
Definition: foamVtkLagrangianWriter.H:61
Foam::polyBoundaryMesh
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
Definition: polyBoundaryMesh.H:62
Foam::polyMesh::POINTS_MOVED
Definition: polyMesh.H:94
Foam::polyMesh::defaultRegion
static word defaultRegion
Return the default region name.
Definition: polyMesh.H:312
Foam::primitiveMesh::clearAddressing
void clearAddressing()
Clear topological data.
Definition: primitiveMeshClear.C:143
Foam::polyMesh::topoChanging
bool topoChanging(const bool c)
Set the mesh topology to be changing.
Definition: polyMesh.H:533
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::polyMesh::moving
bool moving(const bool m)
Set the mesh to be moving.
Definition: polyMesh.H:519
Foam::polyMesh::nGeometricD
label nGeometricD() const
Return the number of valid geometric dimensions in the mesh.
Definition: polyMesh.C:838
Foam::polyMesh::movePoints
virtual tmp< scalarField > movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
Definition: polyMesh.C:1107
Foam::polyMesh::BoundaryMesh
polyBoundaryMesh BoundaryMesh
Definition: polyMesh.H:305
Foam::polyMesh::moving
bool moving() const
Is mesh moving.
Definition: polyMesh.H:513
Foam::primitiveMesh::nFaces
label nFaces() const
Number of mesh faces.
Definition: primitiveMeshI.H:90
Foam::polyMesh::dbDir
virtual const fileName & dbDir() const
Override the objectRegistry dbDir for a single-region case.
Definition: polyMesh.C:798
Foam::IOobject::instance
const fileName & instance() const
Definition: IOobjectI.H:167
Foam::polyMesh::meshSubDir
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
Definition: polyMesh.H:315
Foam::polyMesh::clearCellTree
void clearCellTree()
Clear cell tree data.
Definition: polyMeshClear.C:250
cellShapeList.H
Foam::primitiveMesh::cells
const cellList & cells() const
Definition: primitiveMeshCells.C:138
objectRegistry.H
Foam::polyMesh::facesInstance
const fileName & facesInstance() const
Return the current instance directory for faces.
Definition: polyMesh.C:821
Foam::polyMesh::Mesh
polyMesh Mesh
Definition: polyMesh.H:304
Foam::polyMesh::cellZones
const cellZoneMesh & cellZones() const
Return cell zone mesh.
Definition: polyMesh.H:483
pointIOField.H
Foam::polyMesh::boundaryMesh
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Definition: polyMesh.H:435
Foam::polyMesh::updateGeom
void updateGeom(pointIOField &newPoints, autoPtr< labelIOList > &newTetBasePtIsPtr)
Update geometry; keep topology. Optional new face decomposition.
Definition: polyMeshClear.C:80
primitiveMesh.H
Foam::polyMesh::clearOut
void clearOut()
Clear all geometry and addressing unnecessary for CFD.
Definition: polyMeshClear.C:232
Foam::polyMesh::solutionD
const Vector< label > & solutionD() const
Return the vector of solved-for directions in mesh.
Definition: polyMesh.C:844
Foam::polyMesh::removeFiles
void removeFiles() const
Remove all files from mesh instance()
Definition: polyMesh.C:1295
faceList.H
Foam::directions
Set of directions for each cell in the mesh. Either uniform and size=1 or one set of directions per c...
Definition: directions.H:66
Foam::HashSet< label, Hash< label > >
Foam::polyMesh::geometricD
const Vector< label > & geometricD() const
Return the vector of geometric directions in mesh.
Definition: polyMesh.C:827
Foam::polyMesh::pointInCell
bool pointInCell(const point &p, label celli, const cellDecomposition=CELL_TETS) const
Test if point p is in the celli.
Definition: polyMesh.C:1343
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::polyMesh::faceZones
const faceZoneMesh & faceZones() const
Return face zone mesh.
Definition: polyMesh.H:477
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::polyMesh::TOPO_PATCH_CHANGE
Definition: polyMesh.H:96
Foam::polyMesh::cellZones
cellZoneMesh & cellZones()
Return non-const access to the cellZones.
Definition: polyMesh.H:568
Foam::polyMesh::pointsInstance
const fileName & pointsInstance() const
Return the current instance directory for points.
Definition: polyMesh.C:815
Foam::IOobject::writeOption
writeOption
Enumeration defining the write options.
Definition: IOobject.H:127
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:62
Foam::Field< vector >
Foam::polyMesh::FACE_CENTRE_TRIS
Definition: polyMesh.H:105
Foam::polyMesh::clearPrimitives
void clearPrimitives()
Clear primitive data (points, faces and cells)
Definition: polyMeshClear.C:219
Foam::polyMesh::pointZones
const pointZoneMesh & pointZones() const
Return point zone mesh.
Definition: polyMesh.H:471
Foam::polyMesh::faceZones
faceZoneMesh & faceZones()
Return non-const access to the faceZones.
Definition: polyMesh.H:562
Foam::polyMesh::updateMesh
virtual void updateMesh(const mapPolyMesh &mpm)
Update the mesh corresponding to given map.
Definition: polyMeshUpdate.C:41
Foam::polyMesh::clearTetBasePtIs
void clearTetBasePtIs()
Clear tet base points.
Definition: polyMeshClear.C:239
patchID
label patchID
Definition: boundaryProcessorFaPatchPoints.H:5
Foam::polyMesh::faceOwner
virtual const labelList & faceOwner() const
Return face owner.
Definition: polyMesh.C:1076
Foam::polyMesh::resetPrimitives
void resetPrimitives(autoPtr< pointField > &&points, autoPtr< faceList > &&faces, autoPtr< labelList > &&owner, autoPtr< labelList > &&neighbour, const labelUList &patchSizes, const labelUList &patchStarts, const bool validBoundary=true)
Reset mesh primitive data. Assumes all patch info correct.
Definition: polyMesh.C:687
Foam::indexedOctree
Non-pointer based hierarchical recursive searching.
Definition: treeDataEdge.H:50
Foam::ZoneMesh< pointZone, polyMesh >
Foam::CompactIOList< face, label >
Foam::polyMesh::UNCHANGED
Definition: polyMesh.H:93
Foam::polyMesh::thisDb
const objectRegistry & thisDb() const
Return the object registry.
Definition: polyMesh.H:498
cellVols
const scalarField & cellVols
Definition: temperatureAndPressureVariables.H:51
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:65
Foam::polyMesh::TOPO_CHANGE
Definition: polyMesh.H:95
cellList.H
Foam::polyMesh::comm
label comm() const
Return communicator used for parallel communication.
Definition: polyMesh.C:1259
Foam::polyMesh::oldPoints
virtual const pointField & oldPoints() const
Return old points for mesh motion.
Definition: polyMesh.C:1088
pointZoneMesh.H
Foam::pointZoneMesh.
Foam::globalMeshData
Various mesh related information for a parallel run. Upon construction, constructs all info using par...
Definition: globalMeshData.H:106
Foam::polyMesh::findCellFacePt
void findCellFacePt(const point &p, label &celli, label &tetFacei, label &tetPti) const
Find the cell, tetFacei and tetPti for point p.
Definition: polyMesh.C:1302
faceZoneMesh.H
Foam::faceZoneMesh.
Foam::polyMesh::upToDatePoints
virtual bool upToDatePoints(const regIOobject &io) const
Return true if io is up-to-date with points.
Definition: polyMesh.C:1051
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
faceIOList.H
Foam::polyMesh::meshDir
fileName meshDir() const
Return the local mesh directory (dbDir()/meshSubDir)
Definition: polyMesh.C:809
Foam::polyMesh::removeBoundary
void removeBoundary()
Remove boundary patches.
Definition: polyMeshClear.C:38
Foam::polyMesh::clearGeom
void clearGeom()
Clear geometry.
Definition: polyMeshClear.C:55
Foam::polyMesh::readUpdateState
readUpdateState
Enumeration defining the state of the mesh after a read update.
Definition: polyMesh.H:91
Foam::polyMesh::nSolutionD
label nSolutionD() const
Return the number of valid solved-for dimensions in the mesh.
Definition: polyMesh.C:855
Foam::polyMesh::bounds
const boundBox & bounds() const
Return mesh bounding box.
Definition: polyMesh.H:441
pointField.H
boundBox.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::polyMesh::cellTree
const indexedOctree< treeDataCell > & cellTree() const
Return the cell search tree.
Definition: polyMesh.C:895
Foam::polyMesh::~polyMesh
virtual ~polyMesh()
Destructor.
Definition: polyMesh.C:789
Foam::regIOobject
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:67
Foam::polyMesh::findCell
label findCell(const point &p, const cellDecomposition=CELL_TETS) const
Find cell enclosing this location and return index.
Definition: polyMesh.C:1453
Foam::polyMesh::CELL_TETS
Definition: polyMesh.H:110
Foam::polyMesh::faces
virtual const faceList & faces() const
Return raw faces.
Definition: polyMesh.C:1063
boundaryDicts
Info<< "Creating boundary faces"<< endl;boundary.setSize(b.boundaryPatches().size());forAll(boundary, patchi) { faceList faces(b.boundaryPatches()[patchi].size());forAll(faces, facei) { faces[facei]=face(b.boundaryPatches()[patchi][facei]);} boundary[patchi].transfer(faces);} points.transfer(const_cast< pointField & >b.points()));}Info<< "Creating patch dictionaries"<< endl;wordList patchNames(boundary.size());forAll(patchNames, patchi){ patchNames[patchi]="patch"+Foam::name(patchi);}PtrList< dictionary > boundaryDicts(boundary.size())
Definition: createBlockMesh.H:64
Foam::polyMesh::pointZones
pointZoneMesh & pointZones()
Return non-const access to the pointZones.
Definition: polyMesh.H:556
Foam::polyMesh::TypeName
TypeName("polyMesh")
Runtime type information.
Foam::Vector< label >
Foam::List< cell >
labelIOList.H
Foam::UList< label >
Foam::IOList< label >
polyBoundaryMesh.H
Foam::boundBox
A bounding box defined in terms of min/max extrema points.
Definition: boundBox.H:63
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:160
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
Foam::polyMesh::FACE_PLANES
Definition: polyMesh.H:103
Foam::pointCells
Smooth ATC in cells having a point to a set of patches supplied by type.
Definition: pointCells.H:56
Foam::polyMesh::checkMeshMotion
virtual bool checkMeshMotion(const pointField &newPoints, const bool report=false, const bool detailedReport=false) const
Check mesh motion for correctness given motion points.
Definition: polyMeshCheck.C:758
Foam::polyMesh::globalData
const globalMeshData & globalData() const
Return parallel info.
Definition: polyMesh.C:1241
Foam::polyMesh::findTetFacePt
void findTetFacePt(const label celli, const point &p, label &tetFacei, label &tetPti) const
Find the tetFacei and tetPti for point p in celli.
Definition: polyMesh.C:1327
Foam::polyMesh::addZones
void addZones(const List< pointZone * > &pz, const List< faceZone * > &fz, const List< cellZone * > &cz)
Add mesh zones.
Definition: polyMesh.C:968
Foam::polyMesh::dynamic
virtual bool dynamic() const
Is mesh dynamic.
Definition: polyMesh.H:507
Foam::polyMesh::setUpToDatePoints
virtual void setUpToDatePoints(regIOobject &io) const
Set io to be up-to-date with points.
Definition: polyMesh.C:1057
Foam::polyMesh::setInstance
void setInstance(const fileName &instance, const IOobject::writeOption wOpt=IOobject::AUTO_WRITE)
Set the instance for mesh files.
Definition: polyMeshIO.C:35
Foam::polyMesh::faceNeighbour
virtual const labelList & faceNeighbour() const
Return face neighbour.
Definition: polyMesh.C:1082
Foam::polyMesh::readUpdate
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in.
Definition: polyMeshIO.C:77
Foam::zero
A class representing the concept of 0 (zero), which can be used to avoid manipulating objects that ar...
Definition: zero.H:61
Foam::primitiveMesh::faceAreas
const vectorField & faceAreas() const
Definition: primitiveMeshFaceCentresAndAreas.C:156
Foam::polyMesh::tetBasePtIs
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.
Definition: polyMesh.C:861
Foam::primitiveMesh
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:78