polyMeshFromShapeMesh.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "polyMesh.H"
27 #include "Time.H"
28 #include "primitiveMesh.H"
29 #include "DynamicList.H"
30 #include "indexedOctree.H"
31 #include "treeDataCell.H"
32 #include "globalMeshData.H"
33 
34 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
35 
36 Foam::labelListList Foam::polyMesh::cellShapePointCells
37 (
38  const cellShapeList& c
39 ) const
40 {
41  List<DynamicList<label, primitiveMesh::cellsPerPoint_> >
42  pc(points().size());
43 
44  // For each cell
45  forAll(c, i)
46  {
47  // For each vertex
48  const labelList& labels = c[i];
49 
50  forAll(labels, j)
51  {
52  // Set working point label
53  label curPoint = labels[j];
54  DynamicList<label, primitiveMesh::cellsPerPoint_>& curPointCells =
55  pc[curPoint];
56 
57  // Enter the cell label in the point's cell list
58  curPointCells.append(i);
59  }
60  }
61 
62  labelListList pointCellAddr(pc.size());
63 
64  forAll(pc, pointI)
65  {
66  pointCellAddr[pointI].transfer(pc[pointI]);
67  }
68 
69  return pointCellAddr;
70 }
71 
72 
73 Foam::labelList Foam::polyMesh::facePatchFaceCells
74 (
75  const faceList& patchFaces,
76  const labelListList& pointCells,
77  const faceListList& cellsFaceShapes,
78  const label patchID
79 ) const
80 {
81  bool found;
82 
83  labelList FaceCells(patchFaces.size());
84 
85  forAll(patchFaces, fI)
86  {
87  found = false;
88 
89  const face& curFace = patchFaces[fI];
90  const labelList& facePoints = patchFaces[fI];
91 
92  forAll(facePoints, pointI)
93  {
94  const labelList& facePointCells = pointCells[facePoints[pointI]];
95 
96  forAll(facePointCells, cellI)
97  {
98  faceList cellFaces = cellsFaceShapes[facePointCells[cellI]];
99 
100  forAll(cellFaces, cellFace)
101  {
102  if (face::sameVertices(cellFaces[cellFace], curFace))
103  {
104  // Found the cell corresponding to this face
105  FaceCells[fI] = facePointCells[cellI];
106 
107  found = true;
108  }
109  if (found) break;
110  }
111  if (found) break;
112  }
113  if (found) break;
114  }
115 
116  if (!found)
117  {
119  (
120  "polyMesh::facePatchFaceCells(const faceList& patchFaces,"
121  "const labelListList& pointCells,"
122  "const faceListList& cellsFaceShapes,"
123  "const label patchID)"
124  ) << "face " << fI << " in patch " << patchID
125  << " does not have neighbour cell"
126  << " face: " << patchFaces[fI]
127  << abort(FatalError);
128  }
129  }
130 
131  return FaceCells;
132 }
133 
134 
135 //- Set faces_, calculate cells and patchStarts.
136 void Foam::polyMesh::setTopology
137 (
138  const cellShapeList& cellsAsShapes,
139  const faceListList& boundaryFaces,
140  const wordList& boundaryPatchNames,
141  labelList& patchSizes,
142  labelList& patchStarts,
143  label& defaultPatchStart,
144  label& nFaces,
145  cellList& cells
146 )
147 {
148  // Calculate the faces of all cells
149  // Initialise maximum possible numer of mesh faces to 0
150  label maxFaces = 0;
151 
152  // Set up a list of face shapes for each cell
153  faceListList cellsFaceShapes(cellsAsShapes.size());
154  cells.setSize(cellsAsShapes.size());
155 
156  forAll(cellsFaceShapes, cellI)
157  {
158  cellsFaceShapes[cellI] = cellsAsShapes[cellI].faces();
159 
160  cells[cellI].setSize(cellsFaceShapes[cellI].size());
161 
162  // Initialise cells to -1 to flag undefined faces
163  static_cast<labelList&>(cells[cellI]) = -1;
164 
165  // Count maximum possible numer of mesh faces
166  maxFaces += cellsFaceShapes[cellI].size();
167  }
168 
169  // Set size of faces array to maximum possible number of mesh faces
170  faces_.setSize(maxFaces);
171 
172  // Initialise number of faces to 0
173  nFaces = 0;
174 
175  // Set reference to point-cell addressing
176  labelListList PointCells = cellShapePointCells(cellsAsShapes);
177 
178  bool found = false;
179 
180  forAll(cells, cellI)
181  {
182  // Note:
183  // Insertion cannot be done in one go as the faces need to be
184  // added into the list in the increasing order of neighbour
185  // cells. Therefore, all neighbours will be detected first
186  // and then added in the correct order.
187 
188  const faceList& curFaces = cellsFaceShapes[cellI];
189 
190  // Record the neighbour cell
191  labelList neiCells(curFaces.size(), -1);
192 
193  // Record the face of neighbour cell
194  labelList faceOfNeiCell(curFaces.size(), -1);
195 
196  label nNeighbours = 0;
197 
198  // For all faces ...
199  forAll(curFaces, faceI)
200  {
201  // Skip faces that have already been matched
202  if (cells[cellI][faceI] >= 0) continue;
203 
204  found = false;
205 
206  const face& curFace = curFaces[faceI];
207 
208  // Get the list of labels
209  const labelList& curPoints = curFace;
210 
211  // For all points
212  forAll(curPoints, pointI)
213  {
214  // dGget the list of cells sharing this point
215  const labelList& curNeighbours =
216  PointCells[curPoints[pointI]];
217 
218  // For all neighbours
219  forAll(curNeighbours, neiI)
220  {
221  label curNei = curNeighbours[neiI];
222 
223  // Reject neighbours with the lower label
224  if (curNei > cellI)
225  {
226  // Get the list of search faces
227  const faceList& searchFaces = cellsFaceShapes[curNei];
228 
229  forAll(searchFaces, neiFaceI)
230  {
231  if (searchFaces[neiFaceI] == curFace)
232  {
233  // Match!!
234  found = true;
235 
236  // Record the neighbour cell and face
237  neiCells[faceI] = curNei;
238  faceOfNeiCell[faceI] = neiFaceI;
239  nNeighbours++;
240 
241  break;
242  }
243  }
244  if (found) break;
245  }
246  if (found) break;
247  }
248  if (found) break;
249  } // End of current points
250  } // End of current faces
251 
252  // Add the faces in the increasing order of neighbours
253  for (label neiSearch = 0; neiSearch < nNeighbours; neiSearch++)
254  {
255  // Find the lowest neighbour which is still valid
256  label nextNei = -1;
257  label minNei = cells.size();
258 
259  forAll(neiCells, ncI)
260  {
261  if (neiCells[ncI] > -1 && neiCells[ncI] < minNei)
262  {
263  nextNei = ncI;
264  minNei = neiCells[ncI];
265  }
266  }
267 
268  if (nextNei > -1)
269  {
270  // Add the face to the list of faces
271  faces_[nFaces] = curFaces[nextNei];
272 
273  // Set cell-face and cell-neighbour-face to current face label
274  cells[cellI][nextNei] = nFaces;
275  cells[neiCells[nextNei]][faceOfNeiCell[nextNei]] = nFaces;
276 
277  // Stop the neighbour from being used again
278  neiCells[nextNei] = -1;
279 
280  // Increment number of faces counter
281  nFaces++;
282  }
283  else
284  {
286  (
287  "polyMesh::setTopology\n"
288  "(\n"
289  " const cellShapeList& cellsAsShapes,\n"
290  " const faceListList& boundaryFaces,\n"
291  " const wordList& boundaryPatchNames,\n"
292  " labelList& patchSizes,\n"
293  " labelList& patchStarts,\n"
294  " label& defaultPatchStart,\n"
295  " label& nFaces,\n"
296  " cellList& cells\n"
297  ")"
298  ) << "Error in internal face insertion"
299  << abort(FatalError);
300  }
301  }
302  }
303 
304  // Do boundary faces
305 
306  patchSizes.setSize(boundaryFaces.size(), -1);
307  patchStarts.setSize(boundaryFaces.size(), -1);
308 
309  forAll(boundaryFaces, patchI)
310  {
311  const faceList& patchFaces = boundaryFaces[patchI];
312 
313  labelList curPatchFaceCells =
314  facePatchFaceCells
315  (
316  patchFaces,
317  PointCells,
318  cellsFaceShapes,
319  patchI
320  );
321 
322  // Grab the start label
323  label curPatchStart = nFaces;
324 
325  forAll(patchFaces, faceI)
326  {
327  const face& curFace = patchFaces[faceI];
328 
329  const label cellInside = curPatchFaceCells[faceI];
330 
331  // Get faces of the cell inside
332  const faceList& facesOfCellInside = cellsFaceShapes[cellInside];
333 
334  bool found = false;
335 
336  forAll(facesOfCellInside, cellFaceI)
337  {
338  if (face::sameVertices(facesOfCellInside[cellFaceI], curFace))
339  {
340  if (cells[cellInside][cellFaceI] >= 0)
341  {
343  (
344  "polyMesh::setTopology\n"
345  "(\n"
346  " const cellShapeList& cellsAsShapes,\n"
347  " const faceListList& boundaryFaces,\n"
348  " const wordList& boundaryPatchNames,\n"
349  " labelList& patchSizes,\n"
350  " labelList& patchStarts,\n"
351  " label& defaultPatchStart,\n"
352  " label& nFaces,\n"
353  " cellList& cells\n"
354  ")"
355  ) << "Trying to specify a boundary face " << curFace
356  << " on the face on cell " << cellInside
357  << " which is either an internal face or already "
358  << "belongs to some other patch. This is face "
359  << faceI << " of patch "
360  << patchI << " named "
361  << boundaryPatchNames[patchI] << "."
362  << abort(FatalError);
363  }
364 
365  found = true;
366 
367  // Set the patch face to corresponding cell-face
368  faces_[nFaces] = facesOfCellInside[cellFaceI];
369 
370  cells[cellInside][cellFaceI] = nFaces;
371 
372  break;
373  }
374  }
375 
376  if (!found)
377  {
378  FatalErrorIn("polyMesh::polyMesh(... construct from shapes...)")
379  << "face " << faceI << " of patch " << patchI
380  << " does not seem to belong to cell " << cellInside
381  << " which, according to the addressing, "
382  << "should be next to it."
383  << abort(FatalError);
384  }
385 
386  // Increment the counter of faces
387  nFaces++;
388  }
389 
390  patchSizes[patchI] = nFaces - curPatchStart;
391  patchStarts[patchI] = curPatchStart;
392  }
393 
394  // Grab "non-existing" faces and put them into a default patch
395 
396  defaultPatchStart = nFaces;
397 
398  forAll(cells, cellI)
399  {
400  labelList& curCellFaces = cells[cellI];
401 
402  forAll(curCellFaces, faceI)
403  {
404  if (curCellFaces[faceI] == -1) // "non-existent" face
405  {
406  curCellFaces[faceI] = nFaces;
407  faces_[nFaces] = cellsFaceShapes[cellI][faceI];
408 
409  nFaces++;
410  }
411  }
412  }
413 
414  // Reset the size of the face list
415  faces_.setSize(nFaces);
416 
417  return ;
418 }
419 
420 
421 Foam::polyMesh::polyMesh
422 (
423  const IOobject& io,
424  const Xfer<pointField>& points,
425  const cellShapeList& cellsAsShapes,
426  const faceListList& boundaryFaces,
427  const wordList& boundaryPatchNames,
428  const wordList& boundaryPatchTypes,
429  const word& defaultBoundaryPatchName,
430  const word& defaultBoundaryPatchType,
431  const wordList& boundaryPatchPhysicalTypes,
432  const bool syncPar
433 )
434 :
435  objectRegistry(io),
436  primitiveMesh(),
437  points_
438  (
439  IOobject
440  (
441  "points",
442  instance(),
443  meshSubDir,
444  *this,
447  ),
448  points
449  ),
450  faces_
451  (
452  IOobject
453  (
454  "faces",
455  instance(),
456  meshSubDir,
457  *this,
460  ),
461  0
462  ),
463  owner_
464  (
465  IOobject
466  (
467  "owner",
468  instance(),
469  meshSubDir,
470  *this,
473  ),
474  0
475  ),
476  neighbour_
477  (
478  IOobject
479  (
480  "neighbour",
481  instance(),
482  meshSubDir,
483  *this,
486  ),
487  0
488  ),
489  clearedPrimitives_(false),
490  boundary_
491  (
492  IOobject
493  (
494  "boundary",
495  instance(),
496  meshSubDir,
497  *this,
500  ),
501  *this,
502  boundaryFaces.size() + 1 // Add room for a default patch
503  ),
504  bounds_(points_, syncPar),
505  comm_(UPstream::worldComm),
506  geometricD_(Vector<label>::zero),
507  solutionD_(Vector<label>::zero),
508  tetBasePtIsPtr_(NULL),
509  cellTreePtr_(NULL),
510  pointZones_
511  (
512  IOobject
513  (
514  "pointZones",
515  instance(),
516  meshSubDir,
517  *this,
520  ),
521  *this,
522  0
523  ),
524  faceZones_
525  (
526  IOobject
527  (
528  "faceZones",
529  instance(),
530  meshSubDir,
531  *this,
534  ),
535  *this,
536  0
537  ),
538  cellZones_
539  (
540  IOobject
541  (
542  "cellZones",
543  instance(),
544  meshSubDir,
545  *this,
548  ),
549  *this,
550  0
551  ),
552  globalMeshDataPtr_(NULL),
553  moving_(false),
554  topoChanging_(false),
555  curMotionTimeIndex_(time().timeIndex()),
556  oldPointsPtr_(NULL)
557 {
558  if (debug)
559  {
560  Info<<"Constructing polyMesh from cell and boundary shapes." << endl;
561  }
562 
563  // Remove all of the old mesh files if they exist
565 
566  // Calculate faces and cells
567  labelList patchSizes;
568  labelList patchStarts;
569  label defaultPatchStart;
570  label nFaces;
571  cellList cells;
572  setTopology
573  (
574  cellsAsShapes,
575  boundaryFaces,
576  boundaryPatchNames,
577  patchSizes,
578  patchStarts,
579  defaultPatchStart,
580  nFaces,
581  cells
582  );
583 
584  // Warning: Patches can only be added once the face list is
585  // completed, as they hold a subList of the face list
586  forAll(boundaryFaces, patchI)
587  {
588  // Add the patch to the list
589  boundary_.set
590  (
591  patchI,
593  (
594  boundaryPatchTypes[patchI],
595  boundaryPatchNames[patchI],
596  patchSizes[patchI],
597  patchStarts[patchI],
598  patchI,
599  boundary_
600  )
601  );
602 
603  if
604  (
605  boundaryPatchPhysicalTypes.size()
606  && boundaryPatchPhysicalTypes[patchI].size()
607  )
608  {
609  boundary_[patchI].physicalType() =
610  boundaryPatchPhysicalTypes[patchI];
611  }
612  }
613 
614  label nAllPatches = boundaryFaces.size();
615 
616 
617  label nDefaultFaces = nFaces - defaultPatchStart;
618  if (syncPar)
619  {
620  reduce(nDefaultFaces, sumOp<label>());
621  }
622 
623  if (nDefaultFaces > 0)
624  {
625  WarningIn("polyMesh::polyMesh(... construct from shapes...)")
626  << "Found " << nDefaultFaces
627  << " undefined faces in mesh; adding to default patch." << endl;
628 
629  // Check if there already exists a defaultFaces patch as last patch
630  // and reuse it.
631  label patchI = findIndex(boundaryPatchNames, defaultBoundaryPatchName);
632 
633  if (patchI != -1)
634  {
635  if (patchI != boundaryFaces.size()-1 || boundary_[patchI].size())
636  {
637  FatalErrorIn("polyMesh::polyMesh(... construct from shapes...)")
638  << "Default patch " << boundary_[patchI].name()
639  << " already has faces in it or is not"
640  << " last in list of patches." << exit(FatalError);
641  }
642 
643  WarningIn("polyMesh::polyMesh(... construct from shapes...)")
644  << "Reusing existing patch " << patchI
645  << " for undefined faces." << endl;
646 
647  boundary_.set
648  (
649  patchI,
651  (
652  boundaryPatchTypes[patchI],
653  boundaryPatchNames[patchI],
654  nFaces - defaultPatchStart,
655  defaultPatchStart,
656  patchI,
657  boundary_
658  )
659  );
660  }
661  else
662  {
663  boundary_.set
664  (
665  nAllPatches,
667  (
668  defaultBoundaryPatchType,
669  defaultBoundaryPatchName,
670  nFaces - defaultPatchStart,
671  defaultPatchStart,
672  boundary_.size() - 1,
673  boundary_
674  )
675  );
676 
677  nAllPatches++;
678  }
679  }
680 
681  // Reset the size of the boundary
682  boundary_.setSize(nAllPatches);
683 
684  // Set the primitive mesh
685  initMesh(cells);
686 
687  if (syncPar)
688  {
689  // Calculate topology for the patches (processor-processor comms etc.)
690  boundary_.updateMesh();
691 
692  // Calculate the geometry for the patches (transformation tensors etc.)
693  boundary_.calcGeometry();
694  }
695 
696  if (debug)
697  {
698  if (checkMesh())
699  {
700  Info<< "Mesh OK" << endl;
701  }
702  }
703 }
704 
705 
706 Foam::polyMesh::polyMesh
707 (
708  const IOobject& io,
709  const Xfer<pointField>& points,
710  const cellShapeList& cellsAsShapes,
711  const faceListList& boundaryFaces,
712  const wordList& boundaryPatchNames,
713  const PtrList<dictionary>& boundaryDicts,
714  const word& defaultBoundaryPatchName,
715  const word& defaultBoundaryPatchType,
716  const bool syncPar
717 )
718 :
719  objectRegistry(io),
720  primitiveMesh(),
721  points_
722  (
723  IOobject
724  (
725  "points",
726  instance(),
727  meshSubDir,
728  *this,
731  ),
732  points
733  ),
734  faces_
735  (
736  IOobject
737  (
738  "faces",
739  instance(),
740  meshSubDir,
741  *this,
744  ),
745  0
746  ),
747  owner_
748  (
749  IOobject
750  (
751  "owner",
752  instance(),
753  meshSubDir,
754  *this,
757  ),
758  0
759  ),
760  neighbour_
761  (
762  IOobject
763  (
764  "neighbour",
765  instance(),
766  meshSubDir,
767  *this,
770  ),
771  0
772  ),
773  clearedPrimitives_(false),
774  boundary_
775  (
776  IOobject
777  (
778  "boundary",
779  instance(),
780  meshSubDir,
781  *this,
784  ),
785  *this,
786  boundaryFaces.size() + 1 // Add room for a default patch
787  ),
788  bounds_(points_, syncPar),
789  comm_(UPstream::worldComm),
790  geometricD_(Vector<label>::zero),
791  solutionD_(Vector<label>::zero),
792  tetBasePtIsPtr_(NULL),
793  cellTreePtr_(NULL),
794  pointZones_
795  (
796  IOobject
797  (
798  "pointZones",
799  instance(),
800  meshSubDir,
801  *this,
804  ),
805  *this,
806  0
807  ),
808  faceZones_
809  (
810  IOobject
811  (
812  "faceZones",
813  instance(),
814  meshSubDir,
815  *this,
818  ),
819  *this,
820  0
821  ),
822  cellZones_
823  (
824  IOobject
825  (
826  "cellZones",
827  instance(),
828  meshSubDir,
829  *this,
832  ),
833  *this,
834  0
835  ),
836  globalMeshDataPtr_(NULL),
837  moving_(false),
838  topoChanging_(false),
839  curMotionTimeIndex_(time().timeIndex()),
840  oldPointsPtr_(NULL)
841 {
842  if (debug)
843  {
844  Info<<"Constructing polyMesh from cell and boundary shapes." << endl;
845  }
846 
847  // Remove all of the old mesh files if they exist
849 
850  // Calculate faces and cells
851  labelList patchSizes;
852  labelList patchStarts;
853  label defaultPatchStart;
854  label nFaces;
855  cellList cells;
856  setTopology
857  (
858  cellsAsShapes,
859  boundaryFaces,
860  boundaryPatchNames,
861  patchSizes,
862  patchStarts,
863  defaultPatchStart,
864  nFaces,
865  cells
866  );
867 
868  // Warning: Patches can only be added once the face list is
869  // completed, as they hold a subList of the face list
870  forAll(boundaryDicts, patchI)
871  {
872  dictionary patchDict(boundaryDicts[patchI]);
873 
874  patchDict.set("nFaces", patchSizes[patchI]);
875  patchDict.set("startFace", patchStarts[patchI]);
876 
877  // Add the patch to the list
878  boundary_.set
879  (
880  patchI,
882  (
883  boundaryPatchNames[patchI],
884  patchDict,
885  patchI,
886  boundary_
887  )
888  );
889  }
890 
891  label nAllPatches = boundaryFaces.size();
892 
893  label nDefaultFaces = nFaces - defaultPatchStart;
894  if (syncPar)
895  {
896  reduce(nDefaultFaces, sumOp<label>());
897  }
898 
899  if (nDefaultFaces > 0)
900  {
901  WarningIn("polyMesh::polyMesh(... construct from shapes...)")
902  << "Found " << nDefaultFaces
903  << " undefined faces in mesh; adding to default patch." << endl;
904 
905  // Check if there already exists a defaultFaces patch as last patch
906  // and reuse it.
907  label patchI = findIndex(boundaryPatchNames, defaultBoundaryPatchName);
908 
909  if (patchI != -1)
910  {
911  if (patchI != boundaryFaces.size()-1 || boundary_[patchI].size())
912  {
913  FatalErrorIn("polyMesh::polyMesh(... construct from shapes...)")
914  << "Default patch " << boundary_[patchI].name()
915  << " already has faces in it or is not"
916  << " last in list of patches." << exit(FatalError);
917  }
918 
919  WarningIn("polyMesh::polyMesh(... construct from shapes...)")
920  << "Reusing existing patch " << patchI
921  << " for undefined faces." << endl;
922 
923  boundary_.set
924  (
925  patchI,
927  (
928  boundary_[patchI].type(),
929  boundary_[patchI].name(),
930  nFaces - defaultPatchStart,
931  defaultPatchStart,
932  patchI,
933  boundary_
934  )
935  );
936  }
937  else
938  {
939  boundary_.set
940  (
941  nAllPatches,
943  (
944  defaultBoundaryPatchType,
945  defaultBoundaryPatchName,
946  nFaces - defaultPatchStart,
947  defaultPatchStart,
948  boundary_.size() - 1,
949  boundary_
950  )
951  );
952 
953  nAllPatches++;
954  }
955  }
956 
957  // Reset the size of the boundary
958  boundary_.setSize(nAllPatches);
959 
960  // Set the primitive mesh
961  initMesh(cells);
962 
963  if (syncPar)
964  {
965  // Calculate topology for the patches (processor-processor comms etc.)
966  boundary_.updateMesh();
967 
968  // Calculate the geometry for the patches (transformation tensors etc.)
969  boundary_.calcGeometry();
970  }
971 
972  if (debug)
973  {
974  if (checkMesh())
975  {
976  Info << "Mesh OK" << endl;
977  }
978  }
979 }
980 
981 
982 // ************************************************************************* //
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
Definition: polyMesh.H:309
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
Definition: PtrList.C:142
label size() const
Return the number of elements in the PtrList.
Definition: PtrListI.H:32
label nFaces() const
bool set(const label) const
Is element set.
Definition: PtrListI.H:107
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
A simple container for copying or transferring objects of type <T>.
Definition: Xfer.H:85
label timeIndex
Definition: getTimeIndex.H:4
A class for handling words, derived from string.
Definition: word.H:59
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
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:76
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
const fileName & instance() const
Definition: IOobject.H:337
void updateMesh()
Correct polyBoundaryMesh after topology update.
const cellList & cells() const
messageStream Info
List< face > faceList
Definition: faceListFwd.H:43
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Templated 3D Vector derived from VectorSpace adding construction from 3 components, element access using x(), y() and z() member functions and the inner-product (dot-product) and cross product operators.
Definition: Vector.H:57
List< faceList > faceListList
Definition: faceListFwd.H:45
static bool sameVertices(const face &, const face &)
Return true if the faces have the same vertices.
Definition: face.C:405
void setSize(const label)
Reset size of List.
Definition: List.C:318
List< cell > cellList
list of cells
Definition: cellList.H:42
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
#define WarningIn(functionName)
Report a warning using Foam::Warning.
virtual const pointField & points() const
Return raw points.
Definition: polyMesh.C:1035
primitiveMesh()
Construct null.
Definition: primitiveMesh.C:39
#define forAll(list, i)
Definition: UList.H:421
label size() const
Return number of elements in table.
errorManip< error > abort(error &err)
Definition: errorManip.H:131
const word & name() const
Return name.
Definition: IOobject.H:260
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:589
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
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
Definition: error.H:314
void set(entry *)
Assign a new entry, overwrite any existing entry.
Definition: dictionary.C:866
virtual bool checkMesh(const bool report=false) const
Check mesh for correctness. Returns false for no error.
List< word > wordList
A List of words.
Definition: fileName.H:54
error FatalError
Registry of regIOobjects.
List< label > labelList
A List of labels.
Definition: labelList.H:56
List< cellShape > cellShapeList
List of cellShapes and PtrList of List of cellShape.
Definition: cellShapeList.H:43
void removeFiles() const
Remove all files from mesh instance()
Definition: polyMesh.C:1254
const Time & time() const
Return time.
List< labelList > labelListList
A List of labelList.
Definition: labelList.H:57
static label worldComm
Default communicator (all processors)
Definition: UPstream.H:261
bool found(const word &) const
Return true if hashedEntry is found in table.