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 {
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  DebugInFunction << "Constructing polyMesh from shapes" << endl;
523 
524  // Remove all of the old mesh files if they exist
526 
527  // Calculate faces and cells
528  labelList patchSizes;
529  labelList patchStarts;
530  label defaultPatchStart;
531  label nFaces;
532  cellList cells;
533  setTopology
534  (
535  cellsAsShapes,
536  boundaryFaces,
537  boundaryPatchNames,
538  patchSizes,
539  patchStarts,
540  defaultPatchStart,
541  nFaces,
542  cells
543  );
544 
545  // Warning: Patches can only be added once the face list is
546  // completed, as they hold a subList of the face list
547  forAll(boundaryFaces, patchi)
548  {
549  // Add the patch to the list
550  boundary_.set
551  (
552  patchi,
554  (
555  boundaryPatchTypes[patchi],
556  boundaryPatchNames[patchi],
557  patchSizes[patchi],
558  patchStarts[patchi],
559  patchi,
560  boundary_
561  )
562  );
563 
564  if
565  (
566  boundaryPatchPhysicalTypes.size()
567  && boundaryPatchPhysicalTypes[patchi].size()
568  )
569  {
570  boundary_[patchi].physicalType() =
571  boundaryPatchPhysicalTypes[patchi];
572  }
573  }
574 
575  label nAllPatches = boundaryFaces.size();
576 
577 
578  label nDefaultFaces = nFaces - defaultPatchStart;
579  if (syncPar)
580  {
581  reduce(nDefaultFaces, sumOp<label>());
582  }
583 
584  if (nDefaultFaces > 0)
585  {
586  if (debug)
587  {
589  << "Found " << nDefaultFaces
590  << " undefined faces in mesh; adding to default patch." << endl;
591  }
592 
593  // Check if there already exists a defaultFaces patch as last patch
594  // and reuse it.
595  label patchi = findIndex(boundaryPatchNames, defaultBoundaryPatchName);
596 
597  if (patchi != -1)
598  {
599  if (patchi != boundaryFaces.size()-1 || boundary_[patchi].size())
600  {
602  << "Default patch " << boundary_[patchi].name()
603  << " already has faces in it or is not"
604  << " last in list of patches." << exit(FatalError);
605  }
606 
608  << "Reusing existing patch " << patchi
609  << " for undefined faces." << endl;
610 
611  boundary_.set
612  (
613  patchi,
615  (
616  boundaryPatchTypes[patchi],
617  boundaryPatchNames[patchi],
618  nFaces - defaultPatchStart,
619  defaultPatchStart,
620  patchi,
621  boundary_
622  )
623  );
624  }
625  else
626  {
627  boundary_.set
628  (
629  nAllPatches,
631  (
632  defaultBoundaryPatchType,
633  defaultBoundaryPatchName,
634  nFaces - defaultPatchStart,
635  defaultPatchStart,
636  boundary_.size() - 1,
637  boundary_
638  )
639  );
640 
641  nAllPatches++;
642  }
643  }
644 
645  // Reset the size of the boundary
646  boundary_.setSize(nAllPatches);
647 
648  // Set the primitive mesh
649  initMesh(cells);
650 
651  if (syncPar)
652  {
653  // Calculate topology for the patches (processor-processor comms etc.)
654  boundary_.topoChange();
655 
656  // Calculate the geometry for the patches (transformation tensors etc.)
657  boundary_.calcGeometry();
658  }
659 }
660 
661 
663 (
664  const IOobject& io,
665  pointField&& points,
666  const cellShapeList& cellsAsShapes,
667  const faceListList& boundaryFaces,
668  const wordList& boundaryPatchNames,
669  const PtrList<dictionary>& boundaryDicts,
670  const word& defaultBoundaryPatchName,
671  const word& defaultBoundaryPatchType,
672  const bool syncPar
673 )
674 :
675  objectRegistry(io, regionDir(io)),
676  primitiveMesh(),
677  points_
678  (
679  IOobject
680  (
681  "points",
682  instance(),
683  meshSubDir,
684  *this,
685  IOobject::NO_READ,
686  IOobject::AUTO_WRITE
687  ),
688  move(points)
689  ),
690  faces_
691  (
692  IOobject
693  (
694  "faces",
695  instance(),
696  meshSubDir,
697  *this,
698  IOobject::NO_READ,
699  IOobject::AUTO_WRITE
700  ),
701  label(0)
702  ),
703  owner_
704  (
705  IOobject
706  (
707  "owner",
708  instance(),
709  meshSubDir,
710  *this,
711  IOobject::NO_READ,
712  IOobject::AUTO_WRITE
713  ),
714  label(0)
715  ),
716  neighbour_
717  (
718  IOobject
719  (
720  "neighbour",
721  instance(),
722  meshSubDir,
723  *this,
724  IOobject::NO_READ,
725  IOobject::AUTO_WRITE
726  ),
727  label(0)
728  ),
729  clearedPrimitives_(false),
730  boundary_
731  (
732  IOobject
733  (
734  "boundary",
735  instance(),
736  meshSubDir,
737  *this,
738  IOobject::NO_READ,
739  IOobject::AUTO_WRITE
740  ),
741  *this,
742  boundaryFaces.size() + 1 // Add room for a default patch
743  ),
744  bounds_(points_, syncPar),
745  comm_(UPstream::worldComm),
746  geometricD_(Zero),
747  solutionD_(Zero),
748  tetBasePtIsPtr_(nullptr),
749  pointZones_
750  (
751  IOobject
752  (
753  "pointZones",
754  instance(),
755  meshSubDir,
756  *this,
757  IOobject::NO_READ,
758  IOobject::NO_WRITE
759  ),
760  *this
761  ),
762  faceZones_
763  (
764  IOobject
765  (
766  "faceZones",
767  instance(),
768  meshSubDir,
769  *this,
770  IOobject::NO_READ,
771  IOobject::NO_WRITE
772  ),
773  *this
774  ),
775  cellZones_
776  (
777  IOobject
778  (
779  "cellZones",
780  instance(),
781  meshSubDir,
782  *this,
783  IOobject::NO_READ,
784  IOobject::NO_WRITE
785  ),
786  *this
787  ),
788  globalMeshDataPtr_(nullptr),
789  curMotionTimeIndex_(-1),
790  oldPointsPtr_(nullptr),
791  oldCellCentresPtr_(nullptr),
792  storeOldCellCentres_(false),
793  moving_(false)
794 {
795  DebugInFunction << "Constructing polyMesh from shapes" << endl;
796 
797  // Remove all of the old mesh files if they exist
799 
800  // Calculate faces and cells
801  labelList patchSizes;
802  labelList patchStarts;
803  label defaultPatchStart;
804  label nFaces;
805  cellList cells;
806  setTopology
807  (
808  cellsAsShapes,
809  boundaryFaces,
810  boundaryPatchNames,
811  patchSizes,
812  patchStarts,
813  defaultPatchStart,
814  nFaces,
815  cells
816  );
817 
818  // Warning: Patches can only be added once the face list is
819  // completed, as they hold a subList of the face list
820  forAll(boundaryDicts, patchi)
821  {
822  dictionary patchDict(boundaryDicts[patchi]);
823 
824  patchDict.set("nFaces", patchSizes[patchi]);
825  patchDict.set("startFace", patchStarts[patchi]);
826 
827  // Add the patch to the list
828  boundary_.set
829  (
830  patchi,
832  (
833  boundaryPatchNames[patchi],
834  patchDict,
835  patchi,
836  boundary_
837  )
838  );
839  }
840 
841  label nAllPatches = boundaryFaces.size();
842 
843  label nDefaultFaces = nFaces - defaultPatchStart;
844  if (syncPar)
845  {
846  reduce(nDefaultFaces, sumOp<label>());
847  }
848 
849  if (nDefaultFaces > 0)
850  {
851  if (debug)
852  {
854  << "Found " << nDefaultFaces
855  << " undefined faces in mesh; adding to default patch." << endl;
856  }
857 
858  // Check if there already exists a defaultFaces patch as last patch
859  // and reuse it.
860  label patchi = findIndex(boundaryPatchNames, defaultBoundaryPatchName);
861 
862  if (patchi != -1)
863  {
864  if (patchi != boundaryFaces.size()-1 || boundary_[patchi].size())
865  {
867  << "Default patch " << boundary_[patchi].name()
868  << " already has faces in it or is not"
869  << " last in list of patches." << exit(FatalError);
870  }
871 
873  << "Reusing existing patch " << patchi
874  << " for undefined faces." << endl;
875 
876  boundary_.set
877  (
878  patchi,
880  (
881  boundary_[patchi].type(),
882  boundary_[patchi].name(),
883  nFaces - defaultPatchStart,
884  defaultPatchStart,
885  patchi,
886  boundary_
887  )
888  );
889  }
890  else
891  {
892  boundary_.set
893  (
894  nAllPatches,
896  (
897  defaultBoundaryPatchType,
898  defaultBoundaryPatchName,
899  nFaces - defaultPatchStart,
900  defaultPatchStart,
901  boundary_.size() - 1,
902  boundary_
903  )
904  );
905 
906  nAllPatches++;
907  }
908  }
909 
910  // Reset the size of the boundary
911  boundary_.setSize(nAllPatches);
912 
913  // Set the primitive mesh
914  initMesh(cells);
915 
916  if (syncPar)
917  {
918  // Calculate topology for the patches (processor-processor comms etc.)
919  boundary_.topoChange();
920 
921  // Calculate the geometry for the patches (transformation tensors etc.)
922  boundary_.calcGeometry();
923  }
924 }
925 
926 
927 // ************************************************************************* //
bool found
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:449
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.
Motion of the mesh specified as a list of pointMeshMovers.
void topoChange()
Correct polyBoundaryMesh after topology update.
polyMesh(const IOobject &io)
Construct from IOobject.
Definition: polyMesh.C:175
virtual const pointField & points() const
Return raw points.
Definition: polyMesh.C:1295
void removeFiles() const
Remove all files from mesh instance()
Definition: polyMesh.C:1526
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:63
#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.
#define DebugInFunction
Report an information message using Foam::Info.
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:288
errorManip< error > abort(error &err)
Definition: errorManip.H:131
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