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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016, 2020 OpenFOAM Foundation
9  Copyright (C) 2018-2020 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 \*---------------------------------------------------------------------------*/
28 
29 #include "polyMesh.H"
30 #include "Time.H"
31 #include "primitiveMesh.H"
32 #include "DynamicList.H"
33 #include "indexedOctree.H"
34 #include "treeDataCell.H"
35 #include "globalMeshData.H"
36 
37 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
38 
39 Foam::labelListList Foam::polyMesh::cellShapePointCells
40 (
41  const cellShapeList& c
42 ) const
43 {
44  List<DynamicList<label>> pc(points().size());
45 
46  // For each cell
47  forAll(c, i)
48  {
49  // For each vertex
50  const labelList& labels = c[i];
51 
52  forAll(labels, j)
53  {
54  // Set working point label
55  label curPoint = labels[j];
56  DynamicList<label>& curPointCells = pc[curPoint];
57 
58  // Enter the cell label in the point's cell list
59  curPointCells.append(i);
60  }
61  }
62 
63  labelListList pointCellAddr(pc.size());
64 
65  forAll(pc, pointi)
66  {
67  pointCellAddr[pointi].transfer(pc[pointi]);
68  }
69 
70  return pointCellAddr;
71 }
72 
73 
74 Foam::labelList Foam::polyMesh::facePatchFaceCells
75 (
76  const faceList& patchFaces,
77  const labelListList& pointCells,
78  const faceListList& cellsFaceShapes,
79  const label patchID
80 ) const
81 {
82  bool found;
83 
84  labelList FaceCells(patchFaces.size());
85 
86  forAll(patchFaces, fI)
87  {
88  found = false;
89 
90  const face& curFace = patchFaces[fI];
91  const labelList& facePoints = patchFaces[fI];
92 
93  forAll(facePoints, pointi)
94  {
95  const labelList& facePointCells = pointCells[facePoints[pointi]];
96 
97  forAll(facePointCells, celli)
98  {
99  faceList cellFaces = cellsFaceShapes[facePointCells[celli]];
100 
101  forAll(cellFaces, cellFace)
102  {
103  if (face::sameVertices(cellFaces[cellFace], curFace))
104  {
105  // Found the cell corresponding to this face
106  FaceCells[fI] = facePointCells[celli];
107 
108  found = true;
109  }
110  if (found) break;
111  }
112  if (found) break;
113  }
114  if (found) break;
115  }
116 
117  if (!found)
118  {
120  << "face " << fI << " in patch " << patchID
121  << " does not have neighbour cell"
122  << " face: " << patchFaces[fI]
123  << abort(FatalError);
124  }
125  }
126 
127  return FaceCells;
128 }
129 
130 
131 void Foam::polyMesh::setTopology
132 (
133  const cellShapeList& cellsAsShapes,
134  const faceListList& boundaryFaces,
135  const wordList& boundaryPatchNames,
136  labelList& patchSizes,
137  labelList& patchStarts,
138  label& defaultPatchStart,
139  label& nFaces,
140  cellList& cells
141 )
142 {
143  // Calculate the faces of all cells
144  // Initialise maximum possible number of mesh faces to 0
145  label maxFaces = 0;
146 
147  // Set up a list of face shapes for each cell
148  faceListList cellsFaceShapes(cellsAsShapes.size());
149  cells.setSize(cellsAsShapes.size());
150 
151  forAll(cellsFaceShapes, celli)
152  {
153  cellsFaceShapes[celli] = cellsAsShapes[celli].faces();
154 
155  cells[celli].setSize(cellsFaceShapes[celli].size());
156 
157  // Initialise cells to -1 to flag undefined faces
158  static_cast<labelList&>(cells[celli]) = -1;
159 
160  // Count maximum possible number of mesh faces
161  maxFaces += cellsFaceShapes[celli].size();
162  }
163 
164  // Set size of faces array to maximum possible number of mesh faces
165  faces_.setSize(maxFaces);
166 
167  // Initialise number of faces to 0
168  nFaces = 0;
169 
170  // Set reference to point-cell addressing
171  labelListList PointCells = cellShapePointCells(cellsAsShapes);
172 
173  bool found = false;
174 
175  forAll(cells, celli)
176  {
177  // Note:
178  // Insertion cannot be done in one go as the faces need to be
179  // added into the list in the increasing order of neighbour
180  // cells. Therefore, all neighbours will be detected first
181  // and then added in the correct order.
182 
183  const faceList& curFaces = cellsFaceShapes[celli];
184 
185  // Record the neighbour cell
186  labelList neiCells(curFaces.size(), -1);
187 
188  // Record the face of neighbour cell
189  labelList faceOfNeiCell(curFaces.size(), -1);
190 
191  label nNeighbours = 0;
192 
193  // For all faces ...
194  forAll(curFaces, facei)
195  {
196  // Skip faces that have already been matched
197  if (cells[celli][facei] >= 0) continue;
198 
199  found = false;
200 
201  const face& curFace = curFaces[facei];
202 
203  // Get the list of labels
204  const labelList& curPoints = curFace;
205 
206  // For all points
207  forAll(curPoints, pointi)
208  {
209  // Get the list of cells sharing this point
210  const labelList& curNeighbours =
211  PointCells[curPoints[pointi]];
212 
213  // For all neighbours
214  forAll(curNeighbours, neiI)
215  {
216  label curNei = curNeighbours[neiI];
217 
218  // Reject neighbours with the lower label
219  if (curNei > celli)
220  {
221  // Get the list of search faces
222  const faceList& searchFaces = cellsFaceShapes[curNei];
223 
224  forAll(searchFaces, neiFacei)
225  {
226  if (searchFaces[neiFacei] == curFace)
227  {
228  // Match!!
229  found = true;
230 
231  // Record the neighbour cell and face
232  neiCells[facei] = curNei;
233  faceOfNeiCell[facei] = neiFacei;
234  nNeighbours++;
235 
236  break;
237  }
238  }
239  if (found) break;
240  }
241  if (found) break;
242  }
243  if (found) break;
244  } // End of current points
245  } // End of current faces
246 
247  // Add the faces in the increasing order of neighbours
248  for (label neiSearch = 0; neiSearch < nNeighbours; neiSearch++)
249  {
250  // Find the lowest neighbour which is still valid
251  label nextNei = -1;
252  label minNei = cells.size();
253 
254  forAll(neiCells, ncI)
255  {
256  if (neiCells[ncI] > -1 && neiCells[ncI] < minNei)
257  {
258  nextNei = ncI;
259  minNei = neiCells[ncI];
260  }
261  }
262 
263  if (nextNei > -1)
264  {
265  // Add the face to the list of faces
266  faces_[nFaces] = curFaces[nextNei];
267 
268  // Set cell-face and cell-neighbour-face to current face label
269  cells[celli][nextNei] = nFaces;
270  cells[neiCells[nextNei]][faceOfNeiCell[nextNei]] = nFaces;
271 
272  // Stop the neighbour from being used again
273  neiCells[nextNei] = -1;
274 
275  // Increment number of faces counter
276  nFaces++;
277  }
278  else
279  {
281  << "Error in internal face insertion"
282  << abort(FatalError);
283  }
284  }
285  }
286 
287  // Do boundary faces
288  const label nInternalFaces = nFaces;
289 
290  patchSizes.setSize(boundaryFaces.size(), -1);
291  patchStarts.setSize(boundaryFaces.size(), -1);
292 
293  forAll(boundaryFaces, patchi)
294  {
295  const faceList& patchFaces = boundaryFaces[patchi];
296 
297  labelList curPatchFaceCells =
298  facePatchFaceCells
299  (
300  patchFaces,
301  PointCells,
302  cellsFaceShapes,
303  patchi
304  );
305 
306  // Grab the start label
307  label curPatchStart = nFaces;
308 
309  // Suppress multiple warnings per patch
310  bool patchWarned = false;
311 
312  forAll(patchFaces, facei)
313  {
314  const face& curFace = patchFaces[facei];
315 
316  const label cellInside = curPatchFaceCells[facei];
317 
318  // Get faces of the cell inside
319  const faceList& facesOfCellInside = cellsFaceShapes[cellInside];
320 
321  bool found = false;
322 
323  forAll(facesOfCellInside, cellFacei)
324  {
325  if (face::sameVertices(facesOfCellInside[cellFacei], curFace))
326  {
327  found = true;
328 
329  const label meshFacei = cells[cellInside][cellFacei];
330 
331  if (meshFacei >= 0)
332  {
333  // Already have mesh face for this side of the
334  // cellshape. This can happen for duplicate faces.
335  // It might be
336  // an error or explicitly desired (e.g. duplicate
337  // baffles or acmi). We could have a special 7-faced
338  // hex shape instead so we can have additional patches
339  // but that would be unworkable.
340  // So now either
341  // - exit with error
342  // - or warn and append face to addressing
343  // Note that duplicate baffles
344  // - cannot be on an internal faces
345  // - cannot be on the same patch (for now?)
346 
347  if
348  (
349  meshFacei < nInternalFaces
350  || meshFacei >= curPatchStart
351  )
352  {
354  << "Trying to specify a boundary face "
355  << curFace
356  << " on the face on cell " << cellInside
357  << " which is either an internal face"
358  << " or already belongs to the same patch."
359  << " This is face " << facei << " of patch "
360  << patchi << " named "
361  << boundaryPatchNames[patchi] << "."
362  << exit(FatalError);
363  }
364 
365 
366  if (!patchWarned)
367  {
369  << "Trying to specify a boundary face "
370  << curFace
371  << " on the face on cell " << cellInside
372  << " which is either an internal face"
373  << " or already belongs to some other patch."
374  << " This is face " << facei << " of patch "
375  << patchi << " named "
376  << boundaryPatchNames[patchi] << "."
377  //<< abort(FatalError);
378  << endl;
379  patchWarned = true;
380  }
381 
382  faces_.setSize(faces_.size()+1);
383 
384  // Set the patch face to corresponding cell-face
385  faces_[nFaces] = facesOfCellInside[cellFacei];
386 
387  cells[cellInside].append(nFaces);
388  }
389  else
390  {
391  // Set the patch face to corresponding cell-face
392  faces_[nFaces] = facesOfCellInside[cellFacei];
393 
394  cells[cellInside][cellFacei] = nFaces;
395  }
396 
397  break;
398  }
399  }
400 
401  if (!found)
402  {
404  << "face " << facei << " of patch " << patchi
405  << " does not seem to belong to cell " << cellInside
406  << " which, according to the addressing, "
407  << "should be next to it."
408  << abort(FatalError);
409  }
410 
411  // Increment the counter of faces
412  nFaces++;
413  }
414 
415  patchSizes[patchi] = nFaces - curPatchStart;
416  patchStarts[patchi] = curPatchStart;
417  }
418 
419  // Grab "non-existing" faces and put them into a default patch
420 
421  defaultPatchStart = nFaces;
422 
423  forAll(cells, celli)
424  {
425  labelList& curCellFaces = cells[celli];
426 
427  forAll(curCellFaces, facei)
428  {
429  if (curCellFaces[facei] == -1) // "non-existent" face
430  {
431  curCellFaces[facei] = nFaces;
432  faces_[nFaces] = cellsFaceShapes[celli][facei];
433 
434  nFaces++;
435  }
436  }
437  }
438 
439  // Reset the size of the face list
440  faces_.setSize(nFaces);
441 }
442 
443 
444 Foam::polyMesh::polyMesh
445 (
446  const IOobject& io,
447  pointField&& points,
448  const cellShapeList& cellsAsShapes,
449  const faceListList& boundaryFaces,
450  const wordList& boundaryPatchNames,
451  const wordList& boundaryPatchTypes,
452  const word& defaultBoundaryPatchName,
453  const word& defaultBoundaryPatchType,
454  const wordList& boundaryPatchPhysicalTypes,
455  const bool syncPar
456 )
457 :
458  objectRegistry(io),
459  primitiveMesh(),
460  points_
461  (
462  IOobject
463  (
464  "points",
465  instance(),
466  meshSubDir,
467  *this,
470  ),
471  std::move(points)
472  ),
473  faces_
474  (
475  IOobject
476  (
477  "faces",
478  instance(),
479  meshSubDir,
480  *this,
483  ),
484  0
485  ),
486  owner_
487  (
488  IOobject
489  (
490  "owner",
491  instance(),
492  meshSubDir,
493  *this,
496  ),
497  0
498  ),
499  neighbour_
500  (
501  IOobject
502  (
503  "neighbour",
504  instance(),
505  meshSubDir,
506  *this,
509  ),
510  0
511  ),
512  clearedPrimitives_(false),
513  boundary_
514  (
515  IOobject
516  (
517  "boundary",
518  instance(),
519  meshSubDir,
520  *this,
523  ),
524  *this,
525  boundaryFaces.size() + 1 // Add room for a default patch
526  ),
527  bounds_(points_, syncPar),
528  comm_(UPstream::worldComm),
529  geometricD_(Zero),
530  solutionD_(Zero),
531  tetBasePtIsPtr_(nullptr),
532  cellTreePtr_(nullptr),
533  pointZones_
534  (
535  IOobject
536  (
537  "pointZones",
538  instance(),
539  meshSubDir,
540  *this,
543  ),
544  *this,
545  0
546  ),
547  faceZones_
548  (
549  IOobject
550  (
551  "faceZones",
552  instance(),
553  meshSubDir,
554  *this,
557  ),
558  *this,
559  0
560  ),
561  cellZones_
562  (
563  IOobject
564  (
565  "cellZones",
566  instance(),
567  meshSubDir,
568  *this,
571  ),
572  *this,
573  0
574  ),
575  globalMeshDataPtr_(nullptr),
576  moving_(false),
577  topoChanging_(false),
578  storeOldCellCentres_(false),
579  curMotionTimeIndex_(time().timeIndex()),
580  oldPointsPtr_(nullptr),
581  oldCellCentresPtr_(nullptr)
582 {
583  DebugInfo
584  << "Constructing polyMesh from cell and boundary shapes." << endl;
585 
586  // Calculate faces and cells
587  labelList patchSizes;
588  labelList patchStarts;
589  label defaultPatchStart;
590  label nFaces;
591  cellList cells;
592  setTopology
593  (
594  cellsAsShapes,
595  boundaryFaces,
596  boundaryPatchNames,
597  patchSizes,
598  patchStarts,
599  defaultPatchStart,
600  nFaces,
601  cells
602  );
603 
604  // Warning: Patches can only be added once the face list is
605  // completed, as they hold a subList of the face list
606  forAll(boundaryFaces, patchi)
607  {
608  // Add the patch to the list
609  boundary_.set
610  (
611  patchi,
613  (
614  boundaryPatchTypes[patchi],
615  boundaryPatchNames[patchi],
616  patchSizes[patchi],
617  patchStarts[patchi],
618  patchi,
619  boundary_
620  )
621  );
622 
623  if
624  (
625  boundaryPatchPhysicalTypes.size()
626  && boundaryPatchPhysicalTypes[patchi].size()
627  )
628  {
629  boundary_[patchi].physicalType() =
630  boundaryPatchPhysicalTypes[patchi];
631  }
632  }
633 
634  label nAllPatches = boundaryFaces.size();
635 
636 
637  label nDefaultFaces = nFaces - defaultPatchStart;
638  if (syncPar)
639  {
640  reduce(nDefaultFaces, sumOp<label>());
641  }
642 
643  if (nDefaultFaces > 0)
644  {
646  << "Found " << nDefaultFaces
647  << " undefined faces in mesh; adding to default patch "
648  << defaultBoundaryPatchName << endl;
649 
650  // Check if there already exists a defaultFaces patch as last patch
651  // and reuse it.
652  label patchi = boundaryPatchNames.find(defaultBoundaryPatchName);
653 
654  if (patchi != -1)
655  {
656  if (patchi != boundaryFaces.size()-1 || boundary_[patchi].size())
657  {
659  << "Default patch " << boundary_[patchi].name()
660  << " already has faces in it or is not"
661  << " last in list of patches." << exit(FatalError);
662  }
663 
665  << "Reusing existing patch " << patchi
666  << " for undefined faces." << endl;
667 
668  boundary_.set
669  (
670  patchi,
672  (
673  boundaryPatchTypes[patchi],
674  boundaryPatchNames[patchi],
675  nFaces - defaultPatchStart,
676  defaultPatchStart,
677  patchi,
678  boundary_
679  )
680  );
681  }
682  else
683  {
684  boundary_.set
685  (
686  nAllPatches,
688  (
689  defaultBoundaryPatchType,
690  defaultBoundaryPatchName,
691  nFaces - defaultPatchStart,
692  defaultPatchStart,
693  boundary_.size() - 1,
694  boundary_
695  )
696  );
697 
698  nAllPatches++;
699  }
700  }
701 
702  // Reset the size of the boundary
703  boundary_.setSize(nAllPatches);
704 
705  // Set the primitive mesh
706  initMesh(cells);
707 
708  if (syncPar)
709  {
710  // Calculate topology for the patches (processor-processor comms etc.)
711  boundary_.updateMesh();
712 
713  // Calculate the geometry for the patches (transformation tensors etc.)
714  boundary_.calcGeometry();
715  }
716 
717  if (debug)
718  {
719  if (checkMesh())
720  {
721  Info<< "Mesh OK" << endl;
722  }
723  }
724 }
725 
726 
727 Foam::polyMesh::polyMesh
728 (
729  const IOobject& io,
730  pointField&& points,
731  const cellShapeList& cellsAsShapes,
732  const faceListList& boundaryFaces,
733  const wordList& boundaryPatchNames,
735  const word& defaultBoundaryPatchName,
736  const word& defaultBoundaryPatchType,
737  const bool syncPar
738 )
739 :
740  objectRegistry(io),
741  primitiveMesh(),
742  points_
743  (
744  IOobject
745  (
746  "points",
747  instance(),
748  meshSubDir,
749  *this,
752  ),
753  std::move(points)
754  ),
755  faces_
756  (
757  IOobject
758  (
759  "faces",
760  instance(),
761  meshSubDir,
762  *this,
765  ),
766  0
767  ),
768  owner_
769  (
770  IOobject
771  (
772  "owner",
773  instance(),
774  meshSubDir,
775  *this,
778  ),
779  0
780  ),
781  neighbour_
782  (
783  IOobject
784  (
785  "neighbour",
786  instance(),
787  meshSubDir,
788  *this,
791  ),
792  0
793  ),
794  clearedPrimitives_(false),
795  boundary_
796  (
797  IOobject
798  (
799  "boundary",
800  instance(),
801  meshSubDir,
802  *this,
805  ),
806  *this,
807  boundaryFaces.size() + 1 // Add room for a default patch
808  ),
809  bounds_(points_, syncPar),
810  comm_(UPstream::worldComm),
811  geometricD_(Zero),
812  solutionD_(Zero),
813  tetBasePtIsPtr_(nullptr),
814  cellTreePtr_(nullptr),
815  pointZones_
816  (
817  IOobject
818  (
819  "pointZones",
820  instance(),
821  meshSubDir,
822  *this,
825  ),
826  *this,
827  0
828  ),
829  faceZones_
830  (
831  IOobject
832  (
833  "faceZones",
834  instance(),
835  meshSubDir,
836  *this,
839  ),
840  *this,
841  0
842  ),
843  cellZones_
844  (
845  IOobject
846  (
847  "cellZones",
848  instance(),
849  meshSubDir,
850  *this,
853  ),
854  *this,
855  0
856  ),
857  globalMeshDataPtr_(nullptr),
858  moving_(false),
859  topoChanging_(false),
860  storeOldCellCentres_(false),
861  curMotionTimeIndex_(time().timeIndex()),
862  oldPointsPtr_(nullptr),
863  oldCellCentresPtr_(nullptr)
864 {
865  DebugInfo
866  << "Constructing polyMesh from cell and boundary shapes." << endl;
867 
868  // Calculate faces and cells
869  labelList patchSizes;
870  labelList patchStarts;
871  label defaultPatchStart;
872  label nFaces;
873  cellList cells;
874  setTopology
875  (
876  cellsAsShapes,
877  boundaryFaces,
878  boundaryPatchNames,
879  patchSizes,
880  patchStarts,
881  defaultPatchStart,
882  nFaces,
883  cells
884  );
885 
886  // Warning: Patches can only be added once the face list is
887  // completed, as they hold a subList of the face list
888  forAll(boundaryDicts, patchi)
889  {
890  dictionary patchDict(boundaryDicts[patchi]);
891 
892  patchDict.set("nFaces", patchSizes[patchi]);
893  patchDict.set("startFace", patchStarts[patchi]);
894 
895  // Add the patch to the list
896  boundary_.set
897  (
898  patchi,
900  (
901  boundaryPatchNames[patchi],
902  patchDict,
903  patchi,
904  boundary_
905  )
906  );
907  }
908 
909  label nAllPatches = boundaryFaces.size();
910 
911  label nDefaultFaces = nFaces - defaultPatchStart;
912  if (syncPar)
913  {
914  reduce(nDefaultFaces, sumOp<label>());
915  }
916 
917  if (nDefaultFaces > 0)
918  {
920  << "Found " << nDefaultFaces
921  << " undefined faces in mesh; adding to default patch "
922  << defaultBoundaryPatchName << endl;
923 
924  // Check if there already exists a defaultFaces patch as last patch
925  // and reuse it.
926  label patchi = boundaryPatchNames.find(defaultBoundaryPatchName);
927 
928  if (patchi != -1)
929  {
930  if (patchi != boundaryFaces.size()-1 || boundary_[patchi].size())
931  {
933  << "Default patch " << boundary_[patchi].name()
934  << " already has faces in it or is not"
935  << " last in list of patches." << exit(FatalError);
936  }
937 
939  << "Reusing existing patch " << patchi
940  << " for undefined faces." << endl;
941 
942  boundary_.set
943  (
944  patchi,
946  (
947  boundary_[patchi].type(),
948  boundary_[patchi].name(),
949  nFaces - defaultPatchStart,
950  defaultPatchStart,
951  patchi,
952  boundary_
953  )
954  );
955  }
956  else
957  {
958  boundary_.set
959  (
960  nAllPatches,
962  (
963  defaultBoundaryPatchType,
964  defaultBoundaryPatchName,
965  nFaces - defaultPatchStart,
966  defaultPatchStart,
967  boundary_.size() - 1,
968  boundary_
969  )
970  );
971 
972  nAllPatches++;
973  }
974  }
975 
976  // Reset the size of the boundary
977  boundary_.setSize(nAllPatches);
978 
979  // Set the primitive mesh
980  initMesh(cells);
981 
982  if (syncPar)
983  {
984  // Calculate topology for the patches (processor-processor comms etc.)
985  boundary_.updateMesh();
986 
987  // Calculate the geometry for the patches (transformation tensors etc.)
988  boundary_.calcGeometry();
989  }
990 
991  if (debug)
992  {
993  if (checkMesh())
994  {
995  Info<< "Mesh OK" << endl;
996  }
997  }
998 }
999 
1000 
1001 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
Foam::IOobject::NO_WRITE
Definition: IOobject.H:130
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:71
Foam::HashTable< regIOobject * >::size
label size() const noexcept
The number of elements in table.
Definition: HashTableI.H:52
Foam::polyMesh::points
virtual const pointField & points() const
Return raw points.
Definition: polyMesh.C:1069
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
Foam::IOobject::AUTO_WRITE
Definition: IOobject.H:129
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
globalMeshData.H
indexedOctree.H
Foam::cellShapeList
List< cellShape > cellShapeList
List of cellShapes and PtrList of List of cellShape.
Definition: cellShapeList.H:45
Foam::face::sameVertices
static bool sameVertices(const face &a, const face &b)
Return true if the faces have the same vertices.
Definition: face.C:402
Foam::List::append
void append(const T &val)
Append an element at the end of the list.
Definition: ListI.H:182
primitiveMesh.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
Foam::dictionary::set
entry * set(entry *entryPtr)
Assign a new entry, overwriting any existing entry.
Definition: dictionary.C:847
polyMesh.H
Foam::sumOp
Definition: ops.H:213
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::wordList
List< word > wordList
A List of words.
Definition: fileName.H:59
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::reduce
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
Definition: PstreamReduceOps.H:51
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]=polyPatch::defaultName(patchi);}PtrList< dictionary > boundaryDicts(boundary.size())
Definition: createBlockMesh.H:64
Foam::Field< vector >
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
patchID
label patchID
Definition: boundaryProcessorFaPatchPoints.H:5
Foam::cellList
List< cell > cellList
A List of cells.
Definition: cellListFwd.H:47
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:62
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::polyPatch::New
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:35
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:144
treeDataCell.H
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
found
bool found
Definition: TABSMDCalcMethod2.H:32
Time.H
Foam::labelListList
List< labelList > labelListList
A List of labelList.
Definition: labelList.H:56
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:381
Foam::faceListList
List< faceList > faceListList
A List of faceList.
Definition: faceListFwd.H:49
DebugInfo
#define DebugInfo
Report an information message using Foam::Info.
Definition: messageStream.H:359
Foam::faceList
List< face > faceList
A List of faces.
Definition: faceListFwd.H:47
Foam::UPstream::worldComm
static label worldComm
Default communicator (all processors)
Definition: UPstream.H:295
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
DynamicList.H
timeIndex
label timeIndex
Definition: getTimeIndex.H:4
cells
const cellShapeList & cells
Definition: gmvOutputHeader.H:3
Foam::List::setSize
void setSize(const label newSize)
Alias for resize(const label)
Definition: ListI.H:146
Foam::IOobject::NO_READ
Definition: IOobject.H:123
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition: messageStream.H:303
Foam::primitiveMesh
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:78