polyMeshFromShapeMesh.C
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-2025 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 \*---------------------------------------------------------------------------*/
25 
26 #include "polyMesh.H"
27 #include "primitiveMesh.H"
28 #include "Time.H"
29 #include "DynamicList.H"
30 #include "globalMeshData.H"
31 
32 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
33 
34 Foam::labelListList Foam::polyMesh::cellShapePointCells
35 (
36  const cellShapeList& c
37 ) const
38 {
39  List<DynamicList<label, primitiveMesh::cellsPerPoint_>>
40  pc(points().size());
41 
42  // For each cell
43  forAll(c, i)
44  {
45  // For each vertex
46  const labelList& labels = c[i];
47 
48  forAll(labels, j)
49  {
50  // Set working point label
51  label curPoint = labels[j];
52  DynamicList<label, primitiveMesh::cellsPerPoint_>& curPointCells =
53  pc[curPoint];
54 
55  // Enter the cell label in the point's cell list
56  curPointCells.append(i);
57  }
58  }
59 
60  labelListList pointCellAddr(pc.size());
61 
62  forAll(pc, pointi)
63  {
64  pointCellAddr[pointi].transfer(pc[pointi]);
65  }
66 
67  return pointCellAddr;
68 }
69 
70 
71 Foam::labelList Foam::polyMesh::facePatchFaceCells
72 (
73  const faceList& patchFaces,
74  const labelListList& pointCells,
75  const faceListList& cellsFaceShapes,
76  const label patchID
77 ) const
78 {
79  bool found;
80 
81  labelList FaceCells(patchFaces.size());
82 
83  forAll(patchFaces, fI)
84  {
85  found = false;
86 
87  const face& curFace = patchFaces[fI];
88  const labelList& facePoints = patchFaces[fI];
89 
90  forAll(facePoints, pointi)
91  {
92  const labelList& facePointCells = pointCells[facePoints[pointi]];
93 
94  forAll(facePointCells, celli)
95  {
96  faceList cellFaces = cellsFaceShapes[facePointCells[celli]];
97 
98  forAll(cellFaces, cellFace)
99  {
100  if (face::sameVertices(cellFaces[cellFace], curFace))
101  {
102  // Found the cell corresponding to this face
103  FaceCells[fI] = facePointCells[celli];
104 
105  found = true;
106  }
107  if (found) break;
108  }
109  if (found) break;
110  }
111  if (found) break;
112  }
113 
114  if (!found)
115  {
117  << "face " << fI << " in patch " << patchID
118  << " does not have neighbour cell"
119  << " face: " << patchFaces[fI]
120  << abort(FatalError);
121  }
122  }
123 
124  return FaceCells;
125 }
126 
127 
128 void Foam::polyMesh::setTopology
129 (
130  const cellShapeList& cellsAsShapes,
131  const faceListList& boundaryFaces,
132  const wordList& boundaryPatchNames,
133  labelList& patchSizes,
134  labelList& patchStarts,
135  label& defaultPatchStart,
136  label& nFaces,
137  cellList& cells
138 )
139 {
140  // Calculate the faces of all cells
141  // Initialise maximum possible number of mesh faces to 0
142  label maxFaces = 0;
143 
144  // Set up a list of face shapes for each cell
145  faceListList cellsFaceShapes(cellsAsShapes.size());
146  cells.setSize(cellsAsShapes.size());
147 
148  forAll(cellsFaceShapes, celli)
149  {
150  cellsFaceShapes[celli] = cellsAsShapes[celli].faces();
151 
152  cells[celli].setSize(cellsFaceShapes[celli].size());
153 
154  // Initialise cells to -1 to flag undefined faces
155  static_cast<labelList&>(cells[celli]) = -1;
156 
157  // Count maximum possible number of mesh faces
158  maxFaces += cellsFaceShapes[celli].size();
159  }
160 
161  // Set size of faces array to maximum possible number of mesh faces
162  faces_.setSize(maxFaces);
163 
164  // Initialise number of faces to 0
165  nFaces = 0;
166 
167  // Set reference to point-cell addressing
168  labelListList PointCells = cellShapePointCells(cellsAsShapes);
169 
170  bool found = false;
171 
172  forAll(cells, celli)
173  {
174  // Note:
175  // Insertion cannot be done in one go as the faces need to be
176  // added into the list in the increasing order of neighbour
177  // cells. Therefore, all neighbours will be detected first
178  // and then added in the correct order.
179 
180  const faceList& curFaces = cellsFaceShapes[celli];
181 
182  // Record the neighbour cell
183  labelList neiCells(curFaces.size(), -1);
184 
185  // Record the face of neighbour cell
186  labelList faceOfNeiCell(curFaces.size(), -1);
187 
188  label nNeighbours = 0;
189 
190  // For all faces ...
191  forAll(curFaces, facei)
192  {
193  // Skip faces that have already been matched
194  if (cells[celli][facei] >= 0) continue;
195 
196  found = false;
197 
198  const face& curFace = curFaces[facei];
199 
200  // Get the list of labels
201  const labelList& curPoints = curFace;
202 
203  // For all points
204  forAll(curPoints, pointi)
205  {
206  // dGget the list of cells sharing this point
207  const labelList& curNeighbours =
208  PointCells[curPoints[pointi]];
209 
210  // For all neighbours
211  forAll(curNeighbours, neiI)
212  {
213  label curNei = curNeighbours[neiI];
214 
215  // Reject neighbours with the lower label
216  if (curNei > celli)
217  {
218  // Get the list of search faces
219  const faceList& searchFaces = cellsFaceShapes[curNei];
220 
221  forAll(searchFaces, neiFacei)
222  {
223  if (searchFaces[neiFacei] == curFace)
224  {
225  // Match!!
226  found = true;
227 
228  // Record the neighbour cell and face
229  neiCells[facei] = curNei;
230  faceOfNeiCell[facei] = neiFacei;
231  nNeighbours++;
232 
233  break;
234  }
235  }
236  if (found) break;
237  }
238  if (found) break;
239  }
240  if (found) break;
241  } // End of current points
242  } // End of current faces
243 
244  // Add the faces in the increasing order of neighbours
245  for (label neiSearch = 0; neiSearch < nNeighbours; neiSearch++)
246  {
247  // Find the lowest neighbour which is still valid
248  label nextNei = -1;
249  label minNei = cells.size();
250 
251  forAll(neiCells, ncI)
252  {
253  if (neiCells[ncI] > -1 && neiCells[ncI] < minNei)
254  {
255  nextNei = ncI;
256  minNei = neiCells[ncI];
257  }
258  }
259 
260  if (nextNei > -1)
261  {
262  // Add the face to the list of faces
263  faces_[nFaces] = curFaces[nextNei];
264 
265  // Set cell-face and cell-neighbour-face to current face label
266  cells[celli][nextNei] = nFaces;
267  cells[neiCells[nextNei]][faceOfNeiCell[nextNei]] = nFaces;
268 
269  // Stop the neighbour from being used again
270  neiCells[nextNei] = -1;
271 
272  // Increment number of faces counter
273  nFaces++;
274  }
275  else
276  {
278  << "Error in internal face insertion"
279  << abort(FatalError);
280  }
281  }
282  }
283 
284  // Do boundary faces
285 
286  patchSizes.setSize(boundaryFaces.size(), -1);
287  patchStarts.setSize(boundaryFaces.size(), -1);
288 
289  forAll(boundaryFaces, patchi)
290  {
291  const faceList& patchFaces = boundaryFaces[patchi];
292 
293  labelList curPatchFaceCells =
294  facePatchFaceCells
295  (
296  patchFaces,
297  PointCells,
298  cellsFaceShapes,
299  patchi
300  );
301 
302  // Grab the start label
303  label curPatchStart = nFaces;
304 
305  forAll(patchFaces, facei)
306  {
307  const face& curFace = patchFaces[facei];
308 
309  const label cellInside = curPatchFaceCells[facei];
310 
311  // Get faces of the cell inside
312  const faceList& facesOfCellInside = cellsFaceShapes[cellInside];
313 
314  bool found = false;
315 
316  forAll(facesOfCellInside, cellFacei)
317  {
318  if (face::sameVertices(facesOfCellInside[cellFacei], curFace))
319  {
320  if (cells[cellInside][cellFacei] >= 0)
321  {
323  << "Trying to specify a boundary face " << curFace
324  << " on the face on cell " << cellInside
325  << " which is either an internal face or already "
326  << "belongs to some other patch. This is face "
327  << facei << " of patch "
328  << patchi << " named "
329  << boundaryPatchNames[patchi] << "."
330  << abort(FatalError);
331  }
332 
333  found = true;
334 
335  // Set the patch face to corresponding cell-face
336  faces_[nFaces] = facesOfCellInside[cellFacei];
337 
338  cells[cellInside][cellFacei] = nFaces;
339 
340  break;
341  }
342  }
343 
344  if (!found)
345  {
347  << "face " << facei << " of patch " << patchi
348  << " does not seem to belong to cell " << cellInside
349  << " which, according to the addressing, "
350  << "should be next to it."
351  << abort(FatalError);
352  }
353 
354  // Increment the counter of faces
355  nFaces++;
356  }
357 
358  patchSizes[patchi] = nFaces - curPatchStart;
359  patchStarts[patchi] = curPatchStart;
360  }
361 
362  // Grab "non-existing" faces and put them into a default patch
363 
364  defaultPatchStart = nFaces;
365 
366  forAll(cells, celli)
367  {
368  labelList& curCellFaces = cells[celli];
369 
370  forAll(curCellFaces, facei)
371  {
372  if (curCellFaces[facei] == -1) // "non-existent" face
373  {
374  curCellFaces[facei] = nFaces;
375  faces_[nFaces] = cellsFaceShapes[celli][facei];
376 
377  nFaces++;
378  }
379  }
380  }
381 
382  // Reset the size of the face list
383  faces_.setSize(nFaces);
384 }
385 
386 
388 (
389  const IOobject& io,
390  pointField&& points,
391  const cellShapeList& cellsAsShapes,
392  const faceListList& boundaryFaces,
393  const wordList& boundaryPatchNames,
394  const wordList& boundaryPatchTypes,
395  const word& defaultBoundaryPatchName,
396  const word& defaultBoundaryPatchType,
397  const wordList& boundaryPatchPhysicalTypes,
398  const bool syncPar
399 )
400 :
401  objectRegistry(io, regionDir(io)),
402  primitiveMesh(),
403  points_
404  (
405  IOobject
406  (
407  "points",
408  instance(),
409  meshSubDir,
410  *this,
411  IOobject::NO_READ,
412  IOobject::AUTO_WRITE
413  ),
414  move(points)
415  ),
416  faces_
417  (
418  IOobject
419  (
420  "faces",
421  instance(),
422  meshSubDir,
423  *this,
424  IOobject::NO_READ,
425  IOobject::AUTO_WRITE
426  ),
427  label(0)
428  ),
429  owner_
430  (
431  IOobject
432  (
433  "owner",
434  instance(),
435  meshSubDir,
436  *this,
437  IOobject::NO_READ,
438  IOobject::AUTO_WRITE
439  ),
440  label(0)
441  ),
442  neighbour_
443  (
444  IOobject
445  (
446  "neighbour",
447  instance(),
448  meshSubDir,
449  *this,
450  IOobject::NO_READ,
451  IOobject::AUTO_WRITE
452  ),
453  label(0)
454  ),
455  clearedPrimitives_(false),
456  boundary_
457  (
458  IOobject
459  (
460  "boundary",
461  instance(),
462  meshSubDir,
463  *this,
464  IOobject::NO_READ,
465  IOobject::AUTO_WRITE
466  ),
467  *this,
468  boundaryFaces.size() + 1 // Add room for a default patch
469  ),
470  bounds_(points_, syncPar),
471  comm_(UPstream::worldComm),
472  geometricD_(Zero),
473  solutionD_(Zero),
474  tetBasePtIsPtr_(nullptr),
475  pointZones_
476  (
477  IOobject
478  (
479  "pointZones",
480  instance(),
481  meshSubDir,
482  *this,
483  IOobject::NO_READ,
484  IOobject::NO_WRITE
485  ),
486  *this
487  ),
488  faceZones_
489  (
490  IOobject
491  (
492  "faceZones",
493  instance(),
494  meshSubDir,
495  *this,
496  IOobject::NO_READ,
497  IOobject::NO_WRITE
498  ),
499  *this
500  ),
501  cellZones_
502  (
503  IOobject
504  (
505  "cellZones",
506  instance(),
507  meshSubDir,
508  *this,
509  IOobject::NO_READ,
510  IOobject::NO_WRITE
511  ),
512  *this
513  ),
514  globalMeshDataPtr_(nullptr),
515  curMotionTimeIndex_(-1),
516  oldPointsPtr_(nullptr),
517  oldCellCentresPtr_(nullptr),
518  storeOldCellCentres_(false),
519  moving_(false),
520  topoChanged_(false)
521 {
522  if (debug)
523  {
524  Info<<"Constructing polyMesh from cell and boundary shapes." << endl;
525  }
526 
527  // Remove all of the old mesh files if they exist
529 
530  // Calculate faces and cells
531  labelList patchSizes;
532  labelList patchStarts;
533  label defaultPatchStart;
534  label nFaces;
535  cellList cells;
536  setTopology
537  (
538  cellsAsShapes,
539  boundaryFaces,
540  boundaryPatchNames,
541  patchSizes,
542  patchStarts,
543  defaultPatchStart,
544  nFaces,
545  cells
546  );
547 
548  // Warning: Patches can only be added once the face list is
549  // completed, as they hold a subList of the face list
550  forAll(boundaryFaces, patchi)
551  {
552  // Add the patch to the list
553  boundary_.set
554  (
555  patchi,
557  (
558  boundaryPatchTypes[patchi],
559  boundaryPatchNames[patchi],
560  patchSizes[patchi],
561  patchStarts[patchi],
562  patchi,
563  boundary_
564  )
565  );
566 
567  if
568  (
569  boundaryPatchPhysicalTypes.size()
570  && boundaryPatchPhysicalTypes[patchi].size()
571  )
572  {
573  boundary_[patchi].physicalType() =
574  boundaryPatchPhysicalTypes[patchi];
575  }
576  }
577 
578  label nAllPatches = boundaryFaces.size();
579 
580 
581  label nDefaultFaces = nFaces - defaultPatchStart;
582  if (syncPar)
583  {
584  reduce(nDefaultFaces, sumOp<label>());
585  }
586 
587  if (nDefaultFaces > 0)
588  {
589  if (debug)
590  {
592  << "Found " << nDefaultFaces
593  << " undefined faces in mesh; adding to default patch." << endl;
594  }
595 
596  // Check if there already exists a defaultFaces patch as last patch
597  // and reuse it.
598  label patchi = findIndex(boundaryPatchNames, defaultBoundaryPatchName);
599 
600  if (patchi != -1)
601  {
602  if (patchi != boundaryFaces.size()-1 || boundary_[patchi].size())
603  {
605  << "Default patch " << boundary_[patchi].name()
606  << " already has faces in it or is not"
607  << " last in list of patches." << exit(FatalError);
608  }
609 
611  << "Reusing existing patch " << patchi
612  << " for undefined faces." << endl;
613 
614  boundary_.set
615  (
616  patchi,
618  (
619  boundaryPatchTypes[patchi],
620  boundaryPatchNames[patchi],
621  nFaces - defaultPatchStart,
622  defaultPatchStart,
623  patchi,
624  boundary_
625  )
626  );
627  }
628  else
629  {
630  boundary_.set
631  (
632  nAllPatches,
634  (
635  defaultBoundaryPatchType,
636  defaultBoundaryPatchName,
637  nFaces - defaultPatchStart,
638  defaultPatchStart,
639  boundary_.size() - 1,
640  boundary_
641  )
642  );
643 
644  nAllPatches++;
645  }
646  }
647 
648  // Reset the size of the boundary
649  boundary_.setSize(nAllPatches);
650 
651  // Set the primitive mesh
652  initMesh(cells);
653 
654  if (syncPar)
655  {
656  // Calculate topology for the patches (processor-processor comms etc.)
657  boundary_.topoChange();
658 
659  // Calculate the geometry for the patches (transformation tensors etc.)
660  boundary_.calcGeometry();
661  }
662 }
663 
664 
666 (
667  const IOobject& io,
668  pointField&& points,
669  const cellShapeList& cellsAsShapes,
670  const faceListList& boundaryFaces,
671  const wordList& boundaryPatchNames,
672  const PtrList<dictionary>& boundaryDicts,
673  const word& defaultBoundaryPatchName,
674  const word& defaultBoundaryPatchType,
675  const bool syncPar
676 )
677 :
678  objectRegistry(io, regionDir(io)),
679  primitiveMesh(),
680  points_
681  (
682  IOobject
683  (
684  "points",
685  instance(),
686  meshSubDir,
687  *this,
688  IOobject::NO_READ,
689  IOobject::AUTO_WRITE
690  ),
691  move(points)
692  ),
693  faces_
694  (
695  IOobject
696  (
697  "faces",
698  instance(),
699  meshSubDir,
700  *this,
701  IOobject::NO_READ,
702  IOobject::AUTO_WRITE
703  ),
704  label(0)
705  ),
706  owner_
707  (
708  IOobject
709  (
710  "owner",
711  instance(),
712  meshSubDir,
713  *this,
714  IOobject::NO_READ,
715  IOobject::AUTO_WRITE
716  ),
717  label(0)
718  ),
719  neighbour_
720  (
721  IOobject
722  (
723  "neighbour",
724  instance(),
725  meshSubDir,
726  *this,
727  IOobject::NO_READ,
728  IOobject::AUTO_WRITE
729  ),
730  label(0)
731  ),
732  clearedPrimitives_(false),
733  boundary_
734  (
735  IOobject
736  (
737  "boundary",
738  instance(),
739  meshSubDir,
740  *this,
741  IOobject::NO_READ,
742  IOobject::AUTO_WRITE
743  ),
744  *this,
745  boundaryFaces.size() + 1 // Add room for a default patch
746  ),
747  bounds_(points_, syncPar),
748  comm_(UPstream::worldComm),
749  geometricD_(Zero),
750  solutionD_(Zero),
751  tetBasePtIsPtr_(nullptr),
752  pointZones_
753  (
754  IOobject
755  (
756  "pointZones",
757  instance(),
758  meshSubDir,
759  *this,
760  IOobject::NO_READ,
761  IOobject::NO_WRITE
762  ),
763  *this
764  ),
765  faceZones_
766  (
767  IOobject
768  (
769  "faceZones",
770  instance(),
771  meshSubDir,
772  *this,
773  IOobject::NO_READ,
774  IOobject::NO_WRITE
775  ),
776  *this
777  ),
778  cellZones_
779  (
780  IOobject
781  (
782  "cellZones",
783  instance(),
784  meshSubDir,
785  *this,
786  IOobject::NO_READ,
787  IOobject::NO_WRITE
788  ),
789  *this
790  ),
791  globalMeshDataPtr_(nullptr),
792  curMotionTimeIndex_(-1),
793  oldPointsPtr_(nullptr),
794  oldCellCentresPtr_(nullptr),
795  storeOldCellCentres_(false),
796  moving_(false)
797 {
798  if (debug)
799  {
800  Info<<"Constructing polyMesh from cell and boundary shapes." << endl;
801  }
802 
803  // Remove all of the old mesh files if they exist
805 
806  // Calculate faces and cells
807  labelList patchSizes;
808  labelList patchStarts;
809  label defaultPatchStart;
810  label nFaces;
811  cellList cells;
812  setTopology
813  (
814  cellsAsShapes,
815  boundaryFaces,
816  boundaryPatchNames,
817  patchSizes,
818  patchStarts,
819  defaultPatchStart,
820  nFaces,
821  cells
822  );
823 
824  // Warning: Patches can only be added once the face list is
825  // completed, as they hold a subList of the face list
826  forAll(boundaryDicts, patchi)
827  {
828  dictionary patchDict(boundaryDicts[patchi]);
829 
830  patchDict.set("nFaces", patchSizes[patchi]);
831  patchDict.set("startFace", patchStarts[patchi]);
832 
833  // Add the patch to the list
834  boundary_.set
835  (
836  patchi,
838  (
839  boundaryPatchNames[patchi],
840  patchDict,
841  patchi,
842  boundary_
843  )
844  );
845  }
846 
847  label nAllPatches = boundaryFaces.size();
848 
849  label nDefaultFaces = nFaces - defaultPatchStart;
850  if (syncPar)
851  {
852  reduce(nDefaultFaces, sumOp<label>());
853  }
854 
855  if (nDefaultFaces > 0)
856  {
857  if (debug)
858  {
860  << "Found " << nDefaultFaces
861  << " undefined faces in mesh; adding to default patch." << endl;
862  }
863 
864  // Check if there already exists a defaultFaces patch as last patch
865  // and reuse it.
866  label patchi = findIndex(boundaryPatchNames, defaultBoundaryPatchName);
867 
868  if (patchi != -1)
869  {
870  if (patchi != boundaryFaces.size()-1 || boundary_[patchi].size())
871  {
873  << "Default patch " << boundary_[patchi].name()
874  << " already has faces in it or is not"
875  << " last in list of patches." << exit(FatalError);
876  }
877 
879  << "Reusing existing patch " << patchi
880  << " for undefined faces." << endl;
881 
882  boundary_.set
883  (
884  patchi,
886  (
887  boundary_[patchi].type(),
888  boundary_[patchi].name(),
889  nFaces - defaultPatchStart,
890  defaultPatchStart,
891  patchi,
892  boundary_
893  )
894  );
895  }
896  else
897  {
898  boundary_.set
899  (
900  nAllPatches,
902  (
903  defaultBoundaryPatchType,
904  defaultBoundaryPatchName,
905  nFaces - defaultPatchStart,
906  defaultPatchStart,
907  boundary_.size() - 1,
908  boundary_
909  )
910  );
911 
912  nAllPatches++;
913  }
914  }
915 
916  // Reset the size of the boundary
917  boundary_.setSize(nAllPatches);
918 
919  // Set the primitive mesh
920  initMesh(cells);
921 
922  if (syncPar)
923  {
924  // Calculate topology for the patches (processor-processor comms etc.)
925  boundary_.topoChange();
926 
927  // Calculate the geometry for the patches (transformation tensors etc.)
928  boundary_.calcGeometry();
929  }
930 }
931 
932 
933 // ************************************************************************* //
bool found
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:433
label size() const
Return number of elements in table.
Definition: HashTableI.H:65
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
fileName & instance() const
Return the instance directory, constant, system, <time> etc.
Definition: IOobject.C:352
const word & name() const
Return name.
Definition: IOobject.H:307
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:164
void setSize(const label)
Reset size of List.
Definition: List.C:281
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
bool set(const label) const
Is element set.
Definition: PtrListI.H:62
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
Definition: PtrList.C:131
Inter-processor communications stream.
Definition: UPstream.H:59
label size() const
Return the number of elements in the UPtrList.
Definition: UPtrListI.H:29
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
static bool sameVertices(const face &, const face &)
Return true if the faces have the same vertices.
Definition: face.C:150
Registry of regIOobjects.
void topoChange()
Correct polyBoundaryMesh after topology update.
polyMesh(const IOobject &io)
Construct from IOobject.
Definition: polyMesh.C:178
virtual const pointField & points() const
Return raw points.
Definition: polyMesh.C:1302
void removeFiles() const
Remove all files from mesh instance()
Definition: polyMesh.C:1540
static autoPtr< polyPatch > New(const word &patchType, const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
Return a pointer to a new patch created on freestore from.
Definition: polyPatchNew.C:32
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:75
const cellList & cells() const
label nFaces() const
A class for handling words, derived from string.
Definition: word.H:62
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:334
label patchi
const pointField & points
const cellShapeList & cells
#define WarningInFunction
Report a warning using Foam::Warning.
const dimensionedScalar c
Speed of light in a vacuum.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
static const zero Zero
Definition: zero.H:97
List< cellShape > cellShapeList
List of cellShapes and PtrList of List of cellShape.
Definition: cellShapeList.H:43
List< word > wordList
A List of words.
Definition: fileName.H:54
List< label > labelList
A List of labels.
Definition: labelList.H:56
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
List< cell > cellList
list of cells
Definition: cellList.H:42
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:258
errorManip< error > abort(error &err)
Definition: errorManip.H:131
messageStream Info
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
List< labelList > labelListList
A List of labelList.
Definition: labelList.H:57
List< faceList > faceListList
Definition: faceListFwd.H:43
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
error FatalError
List< face > faceList
Definition: faceListFwd.H:41
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488