70 static label MSHLINE = 1;
72 static label MSHTRI = 2;
73 static label MSHQUAD = 3;
74 static label MSHTET = 4;
77 static label MSHHEX = 5;
78 static label MSHPRISM = 6;
79 static label MSHPYR = 7;
95 while (
line.size() < 4 ||
line.substr(0, 4) !=
"$End");
109 labels[labelI] = mshToFoam[labels[labelI]];
120 if (!meshPointMap.
found(meshF[0]))
122 Warning<<
"Not using gmsh face " << meshF
123 <<
" since zero vertex is not on boundary of polyMesh" <<
endl;
143 if (meshF.found(
f[fp]))
149 if (nMatched == meshF.size())
181 if (nMatched == meshF.
size())
200 for (
const face&
f : faces)
205 if (((
points[
f[0]] - cc) & areaNorm) < 0)
226 const auto zoneFnd = physToZone.
cfind(regPhys);
231 zoneCells[zoneFnd()].append(celli);
236 const label zonei = zoneCells.size();
237 zoneCells.setSize(zonei+1);
240 Info<<
"Mapping region " << regPhys <<
" to Foam cellZone " 242 physToZone.
insert(regPhys, zonei);
244 zoneToPhys[zonei] = regPhys;
245 zoneCells[zonei].
append(celli);
251 scalar readMeshFormat(
IFstream& inFile)
253 Info<<
"Starting to read mesh format at line " 262 label asciiFlag, nBytes;
263 lineStr >>
version >> asciiFlag >> nBytes;
265 Info<<
"Read format version " <<
version <<
" ascii " << asciiFlag <<
endl;
270 <<
"Can only read ascii msh files." 278 if (tag !=
"$EndMeshFormat")
281 <<
"Did not find $ENDNOD tag on line " 302 Info<<
"Vertices to be read: " << nVerts <<
endl;
306 for (label pointi = 0; pointi < nVerts; pointi++)
309 scalar xVal, yVal, zVal;
315 lineStr >> mshLabel >> xVal >> yVal >> zVal;
323 mshToFoam.
insert(mshLabel, pointi);
332 if (tag !=
"$ENDNOD" && tag !=
"$EndNodes")
335 <<
"Did not find $ENDNOD tag on line " 351 label nEntities, nVerts;
352 lineStr >> nEntities >> nVerts;
354 Info<<
"Vertices to be read: " << nVerts <<
endl;
362 for (label entityi = 0; entityi < nEntities; entityi++)
364 label entityDim, entityLabel, isParametric, nNodes;
365 scalar xVal, yVal, zVal;
370 lineStr >> entityDim >> entityLabel >> isParametric >> nNodes;
374 for (label eNode = 0; eNode < nNodes; ++eNode)
378 lineStr >> nodeIDs[eNode];
382 for (label eNode = 0; eNode < nNodes; ++eNode)
386 lineStr >> xVal >> yVal >> zVal;
391 mshToFoam.
insert(nodeIDs[eNode], pointi++);
402 if (tag !=
"$ENDNOD" && tag !=
"$EndNodes")
405 <<
"Did not find $ENDNOD tag on line " 415 Info<<
"Starting to read physical names at line " << inFile.
lineNumber()
425 Info<<
"Physical names:" << nNames <<
endl;
427 for (label i = 0; i < nNames; i++)
435 label nSpaces = lineStr.str().count(
' ');
441 Info<<
" " << regionI <<
'\t' 444 else if (nSpaces == 2)
451 Info<<
" " <<
"Line " << regionI <<
'\t' 454 else if (physType == 2)
456 Info<<
" " <<
"Surface " << regionI <<
'\t' 459 else if (physType == 3)
461 Info<<
" " <<
"Volume " << regionI <<
'\t' 477 if (tag !=
"$EndPhysicalNames")
480 <<
"Did not find $EndPhysicalNames tag on line " 488 const scalar versionFormat,
489 const bool keepOrientation,
549 for (label elemI = 0; elemI < nElems; elemI++)
555 label elmNumber, elmType, regPhys;
556 if (versionFormat >= 2)
558 lineStr >> elmNumber >> elmType;
567 for (label i = 1; i < nTags; i++)
576 label regElem, nNodes;
577 lineStr >> elmNumber >> elmType >> regPhys >> regElem >> nNodes;
581 if (elmType == MSHLINE)
584 lineStr >> meshPti >> meshPti;
586 else if (elmType == MSHTRI)
592 const auto regFnd = physToPatch.
cfind(regPhys);
603 patchi = patchFaces.size();
605 patchFaces.setSize(patchi + 1);
606 patchToPhys.
setSize(patchi + 1);
608 Info<<
"Mapping region " << regPhys <<
" to Foam patch " 610 physToPatch.
insert(regPhys, patchi);
611 patchToPhys[patchi] = regPhys;
617 else if (elmType == MSHQUAD)
620 >> quadPoints[0] >> quadPoints[1] >> quadPoints[2]
625 const auto regFnd = physToPatch.
cfind(regPhys);
636 patchi = patchFaces.size();
638 patchFaces.setSize(patchi + 1);
639 patchToPhys.
setSize(patchi + 1);
641 Info<<
"Mapping region " << regPhys <<
" to Foam patch " 643 physToPatch.
insert(regPhys, patchi);
644 patchToPhys[patchi] = regPhys;
648 patchFaces[patchi].
append(quadPoints);
650 else if (elmType == MSHTET)
671 else if (elmType == MSHPYR)
683 >> pyrPoints[0] >> pyrPoints[1] >> pyrPoints[2]
684 >> pyrPoints[3] >> pyrPoints[4];
688 cells[celli++].reset(pyr, pyrPoints);
692 else if (elmType == MSHPRISM)
704 >> prismPoints[0] >> prismPoints[1] >> prismPoints[2]
705 >> prismPoints[3] >> prismPoints[4] >> prismPoints[5];
709 cells[celli].reset(prism, prismPoints);
713 if (!keepOrientation && !correctOrientation(
points,
cell))
715 Info<<
"Inverting prism " << celli <<
endl;
717 prismPoints[0] =
cell[0];
718 prismPoints[1] =
cell[2];
719 prismPoints[2] =
cell[1];
720 prismPoints[3] =
cell[3];
721 prismPoints[4] =
cell[4];
722 prismPoints[5] =
cell[5];
724 cells[celli].reset(prism, prismPoints);
731 else if (elmType == MSHHEX)
743 >> hexPoints[0] >> hexPoints[1]
744 >> hexPoints[2] >> hexPoints[3]
745 >> hexPoints[4] >> hexPoints[5]
746 >> hexPoints[6] >> hexPoints[7];
754 if (!keepOrientation && !correctOrientation(
points,
cell))
756 Info<<
"Inverting hex " << celli <<
endl;
758 hexPoints[0] =
cell[4];
759 hexPoints[1] =
cell[5];
760 hexPoints[2] =
cell[6];
761 hexPoints[3] =
cell[7];
762 hexPoints[4] =
cell[0];
763 hexPoints[5] =
cell[1];
764 hexPoints[6] =
cell[2];
765 hexPoints[7] =
cell[3];
776 Info<<
"Unhandled element " << elmType <<
" at line " 786 if (tag !=
"$ENDELM" && tag !=
"$EndElements")
789 <<
"Did not find $ENDELM tag on line " 796 forAll(patchFaces, patchi)
798 patchFaces[patchi].shrink();
804 <<
" hex :" << nHex <<
endl 805 <<
" prism:" << nPrism <<
endl 806 <<
" pyr :" << nPyr <<
endl 807 <<
" tet :" << nTet <<
endl 813 <<
"No cells read from file " << inFile.
name() <<
nl 814 <<
"Does your file specify any 3D elements (hex=" << MSHHEX
815 <<
", prism=" << MSHPRISM <<
", pyramid=" << MSHPYR
816 <<
", tet=" << MSHTET <<
")?" <<
nl 817 <<
"Perhaps you have not exported the 3D elements?" 822 <<
"Zone\tSize" <<
endl;
826 zoneCells[zonei].shrink();
828 const labelList& zCells = zoneCells[zonei];
840 const scalar versionFormat,
841 const bool keepOrientation,
875 label nEntities, nElems, minElemTag, maxElemTag;
876 lineStr >> nEntities >> nElems >> minElemTag >> maxElemTag;
897 for (label entityi = 0; entityi < nEntities; entityi++)
903 label entityDim, entityID, regPhys, elmType, nElemInBlock, elemID;
904 lineStr >> entityDim >> entityID >> elmType >> nElemInBlock;
907 regPhys = surfEntityToPhysSurface[entityID];
908 else if (entityDim == 3)
909 regPhys = volEntityToPhysVolume[entityID];
914 if (elmType == MSHLINE)
916 for (label entityElm = 0; entityElm < nElemInBlock; entityElm++)
921 lineStr >> elemID >> meshPti >> meshPti;
924 else if (elmType == MSHTRI)
926 for (label entityElm = 0; entityElm < nElemInBlock; entityElm++)
934 const auto regFnd = physToPatch.
cfind(regPhys);
945 patchi = patchFaces.size();
947 patchFaces.setSize(patchi + 1);
948 patchToPhys.
setSize(patchi + 1);
950 Info<<
"Mapping region " << regPhys <<
" to Foam patch " 952 physToPatch.
insert(regPhys, patchi);
953 patchToPhys[patchi] = regPhys;
960 else if (elmType == MSHQUAD)
962 for (label entityElm = 0; entityElm < nElemInBlock; entityElm++)
967 >> quadPoints[0] >> quadPoints[1] >> quadPoints[2]
972 const auto regFnd = physToPatch.
cfind(regPhys);
983 patchi = patchFaces.size();
985 patchFaces.setSize(patchi + 1);
986 patchToPhys.
setSize(patchi + 1);
988 Info<<
"Mapping region " << regPhys <<
" to Foam patch " 990 physToPatch.
insert(regPhys, patchi);
991 patchToPhys[patchi] = regPhys;
995 patchFaces[patchi].
append(quadPoints);
998 else if (elmType == MSHTET)
1000 nTet += nElemInBlock;
1002 for (label entityElm = 0; entityElm < nElemInBlock; entityElm++)
1025 else if (elmType == MSHPYR)
1027 nPyr += nElemInBlock;
1029 for (label entityElm = 0; entityElm < nElemInBlock; entityElm++)
1044 >> pyrPoints[0] >> pyrPoints[1] >> pyrPoints[2]
1045 >> pyrPoints[3] >> pyrPoints[4];
1049 cells[celli++].reset(pyr, pyrPoints);
1052 else if (elmType == MSHPRISM)
1054 nPrism += nElemInBlock;
1056 for (label entityElm = 0; entityElm < nElemInBlock; entityElm++)
1071 >> prismPoints[0] >> prismPoints[1] >> prismPoints[2]
1072 >> prismPoints[3] >> prismPoints[4] >> prismPoints[5];
1076 cells[celli].reset(prism, prismPoints);
1080 if (!keepOrientation && !correctOrientation(
points,
cell))
1082 Info<<
"Inverting prism " << celli <<
endl;
1084 prismPoints[0] =
cell[0];
1085 prismPoints[1] =
cell[2];
1086 prismPoints[2] =
cell[1];
1087 prismPoints[3] =
cell[3];
1088 prismPoints[4] =
cell[4];
1089 prismPoints[5] =
cell[5];
1091 cells[celli].reset(prism, prismPoints);
1097 else if (elmType == MSHHEX)
1099 nHex += nElemInBlock;
1101 for (label entityElm = 0; entityElm < nElemInBlock; entityElm++)
1116 >> hexPoints[0] >> hexPoints[1]
1117 >> hexPoints[2] >> hexPoints[3]
1118 >> hexPoints[4] >> hexPoints[5]
1119 >> hexPoints[6] >> hexPoints[7];
1123 cells[celli].reset(
hex, hexPoints);
1127 if (!keepOrientation && !correctOrientation(
points,
cell))
1129 Info<<
"Inverting hex " << celli <<
endl;
1131 hexPoints[0] =
cell[4];
1132 hexPoints[1] =
cell[5];
1133 hexPoints[2] =
cell[6];
1134 hexPoints[3] =
cell[7];
1135 hexPoints[4] =
cell[0];
1136 hexPoints[5] =
cell[1];
1137 hexPoints[6] =
cell[2];
1138 hexPoints[7] =
cell[3];
1140 cells[celli].reset(
hex, hexPoints);
1148 Info<<
"Unhandled element " << elmType <<
" at line " 1149 << inFile.
lineNumber() <<
"in/on physical region ID: " 1151 Info <<
"Perhaps you created a higher order mesh?" <<
endl;
1160 if (tag !=
"$ENDELM" && tag !=
"$EndElements")
1163 <<
"Did not find $ENDELM tag on line " 1170 forAll(patchFaces, patchi)
1172 patchFaces[patchi].shrink();
1178 <<
" hex : " << nHex <<
endl 1179 <<
" prism: " << nPrism <<
endl 1180 <<
" pyr : " << nPyr <<
endl 1181 <<
" tet : " << nTet <<
endl 1187 <<
"No cells read from file " << inFile.
name() <<
nl 1188 <<
"Does your file specify any 3D elements (hex=" << MSHHEX
1189 <<
", prism=" << MSHPRISM <<
", pyramid=" << MSHPYR
1190 <<
", tet=" << MSHTET <<
")?" <<
nl 1191 <<
"Perhaps you have not exported the 3D elements?" 1195 Info<<
"CellZones:" <<
nl 1196 <<
"Zone\tSize" <<
endl;
1200 zoneCells[zonei].shrink();
1202 const labelList& zCells = zoneCells[zonei];
1219 label
nPoints, nCurves, nSurfaces, nVolumes;
1220 label entityID, physicalID, nPhysicalTags;
1226 lineStr >>
nPoints >> nCurves >> nSurfaces >> nVolumes;
1229 for (label i = 0; i <
nPoints; ++i)
1233 for (label i = 0; i < nCurves; ++i)
1237 for (label i = 0; i < nSurfaces; ++i)
1241 lineStr >> entityID;
1244 for (label j = 0; j < 6; ++j)
1248 lineStr >> nPhysicalTags;
1249 if (nPhysicalTags > 1)
1252 <<
"Cannot interpret multiple physical surfaces associated" 1253 <<
" with one surface on line number " << inFile.
lineNumber()
1257 lineStr >> physicalID;
1258 surfEntityToPhysSurface.
insert(entityID, physicalID);
1262 for (label i = 0; i < nVolumes; ++i)
1266 lineStr >> entityID;
1269 for (label j = 0; j < 6; ++j)
1273 lineStr >> nPhysicalTags;
1274 if (nPhysicalTags > 1)
1277 <<
"Cannot interpret multiple physical volumes associated" 1278 <<
" with one volume on line number " << inFile.
lineNumber()
1282 lineStr >> physicalID;
1283 volEntityToPhysVolume.
insert(entityID, physicalID);
1291 if (tag !=
"$EndEntities")
1294 <<
"Did not find $EndEntities tag on line " 1300 int main(
int argc,
char *argv[])
1304 "Convert a gmsh .msh file to OpenFOAM" 1312 "Retain raw orientation for prisms/hexs" 1328 const bool keepOrientation =
args.
found(
"keepOrientation");
1356 scalar versionFormat = 1;
1370 if (tag ==
"$MeshFormat")
1372 versionFormat = readMeshFormat(inFile);
1374 else if (tag ==
"$PhysicalNames")
1376 readPhysNames(inFile, physicalNames);
1378 else if (tag ==
"$Entities")
1381 readEntities(inFile,
1382 surfEntityToPhysSurface,
1383 volEntityToPhysVolume);
1385 else if (tag ==
"$NOD" || tag ==
"$Nodes")
1387 if (versionFormat < 4.0)
1388 readPointsLegacy(inFile,
points, mshToFoam);
1390 readPoints(inFile,
points, mshToFoam);
1392 else if (tag ==
"$ELM" || tag ==
"$Elements")
1394 if (versionFormat < 4.0)
1421 surfEntityToPhysSurface,
1422 volEntityToPhysVolume
1427 Info<<
"Skipping tag " << tag <<
" at line " 1431 if (!skipSection(inFile))
1436 }
while (inFile.
good());
1439 label nValidCellZones = 0;
1443 if (zoneCells[zonei].size())
1462 wordList boundaryPatchNames(boundaryFaces.size());
1464 forAll(boundaryPatchNames, patchi)
1466 boundaryPatchNames[patchi] =
1469 patchToPhys[patchi],
1473 Info<<
"Patch " << patchi <<
" gets name " 1474 << boundaryPatchNames[patchi] <<
endl;
1478 wordList boundaryPatchTypes(boundaryFaces.size(), polyPatch::typeName);
1481 wordList boundaryPatchPhysicalTypes
1483 boundaryFaces.size(),
1502 boundaryPatchPhysicalTypes
1520 forAll(patchFaces, patchi)
1524 Info<<
"Finding faces of patch " << patchi <<
endl;
1531 label patchFacei = findFace(
pp,
f);
1533 if (patchFacei != -1)
1535 label meshFacei =
pp.start() + patchFacei;
1537 repatcher.changePatchID(meshFacei, patchi);
1543 label meshFacei = findInternalFace(
mesh,
f);
1545 if (meshFacei != -1)
1547 zoneFaces[patchi].append(meshFacei);
1552 <<
"Could not match gmsh face " <<
f 1553 <<
" to any of the interior or exterior faces" 1554 <<
" that share the same 0th point" <<
endl;
1562 label nValidFaceZones = 0;
1564 Info<<
"FaceZones:" <<
nl 1565 <<
"Zone\tSize" <<
endl;
1569 zoneFaces[zonei].shrink();
1571 const labelList& zFaces = zoneFaces[zonei];
1587 repatcher.repatch();
1596 if (nValidCellZones > 0)
1600 nValidCellZones = 0;
1604 if (zoneCells[zonei].size())
1615 Info<<
"Writing zone " << zonei <<
" to cellZone " 1616 << zoneName <<
" and cellSet" 1634 if (nValidFaceZones > 0)
1638 nValidFaceZones = 0;
1642 if (zoneFaces[zonei].size())
1653 Info<<
"Writing zone " << zonei <<
" to faceZone " 1654 << zoneName <<
" and faceSet" 1683 label newPatchi = 0;
1686 if (patchi != defaultPatchID)
1704 repatcher.changePatches(newPatches);
label findPatchID(const word &patchName, const bool allowNotFound=true) const
Find patch index given a name, return -1 if not found.
static word validate(const std::string &s, const bool prefix=false)
Construct validated word (no invalid characters).
static word defaultName(const label n=-1)
Default patch name: "patch" or "patchN".
static void addNote(const string ¬e)
Add extra notes for the usage information.
void size(const label n)
Older name for setAddressableSize.
T & last()
Return reference to the last element of the list.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A face is a list of labels corresponding to mesh vertices.
void resize(const label len)
Adjust allocated size of list.
IOstream & hex(IOstream &io)
void append(const T &val)
Append an element at the end of the list.
bool found(const Key &key) const
Same as contains()
const word & regionName() const
The mesh region name or word::null if polyMesh::defaultRegion.
Cell-face mesh analysis engine.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
IntListType renumber(const labelUList &oldToNew, const IntListType &input)
Renumber the values (not the indices) of a list.
An analytical geometric cellShape.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool found(const T &val, label pos=0) const
Same as contains()
static unsigned int defaultPrecision() noexcept
Return the default precision.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
static void noParallel()
Remove the parallel options.
#define forAll(list, i)
Loop across all elements in list.
static const cellModel & ref(const modelType model)
Look up reference to cellModel by enumeration. Fatal on failure.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
label size() const noexcept
The number of elements in table.
A list of faces which address into the list of points.
virtual const fileName & name() const override
Read/write access to the name of the stream.
const Map< label > & meshPointMap() const
Mesh point map.
faceList faces() const
Faces of this cell.
void setSize(const label n)
Alias for resize()
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A mesh which allows changes in the patch distribution of the boundary faces. The change in patching i...
void removeFiles(const fileName &instanceDir) const
Remove all files from mesh instance.
const_iterator cfind(const Key &key) const
Find and return an const_iterator set at the hashed entry.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A class for handling words, derived from Foam::string.
Triangle point storage. Default constructable (triangle is not)
label size() const noexcept
The number of entries in the list.
void addZones(PtrList< pointZone > &&pz, PtrList< faceZone > &&fz, PtrList< cellZone > &&cz)
Add mesh zones.
virtual void setTime(const Time &t)
Reset the time and time-index to those of the given time.
virtual const faceList & faces() const
Return raw faces.
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
virtual bool write(const bool writeOnProc=true) const
Write mesh using IO settings from time.
const labelListList & pointFaces() const
Return point-face addressing.
ISstream & getLine(std::string &str, char delim='\n')
Raw, low-level getline (until delimiter) into a string.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const word & constant() const noexcept
Return constant name.
const faceZoneMesh & faceZones() const noexcept
Return face zone mesh.
Input from file stream, using an ISstream.
Info<< "Finished reading KIVA file"<< endl;cellShapeList cellShapes(nPoints);labelList cellZoning(nPoints, -1);const cellModel &hex=cellModel::ref(cellModel::HEX);labelList hexLabels(8);label activeCells=0;labelList pointMap(nPoints);forAll(pointMap, i){ pointMap[i]=i;}for(label i=0;i< nPoints;i++){ if(f[i] > 0.0) { hexLabels[0]=i;hexLabels[1]=i1tab[i];hexLabels[2]=i3tab[i1tab[i]];hexLabels[3]=i3tab[i];hexLabels[4]=i8tab[i];hexLabels[5]=i1tab[i8tab[i]];hexLabels[6]=i3tab[i1tab[i8tab[i]]];hexLabels[7]=i3tab[i8tab[i]];cellShapes[activeCells].reset(hex, hexLabels);edgeList edges=cellShapes[activeCells].edges();forAll(edges, ei) { if(edges[ei].mag(points)< SMALL) { label start=pointMap[edges[ei].start()];while(start !=pointMap[start]) { start=pointMap[start];} label end=pointMap[edges[ei].end()];while(end !=pointMap[end]) { end=pointMap[end];} label minLabel=min(start, end);pointMap[start]=pointMap[end]=minLabel;} } cellZoning[activeCells]=idreg[i];activeCells++;}}cellShapes.setSize(activeCells);cellZoning.setSize(activeCells);forAll(cellShapes, celli){ cellShape &cs=cellShapes[celli];forAll(cs, i) { cs[i]=pointMap[cs[i]];} cs.collapse();}label bcIDs[11]={-1, 0, 2, 4, -1, 5, -1, 6, 7, 8, 9};const label nBCs=12;const word *kivaPatchTypes[nBCs]={ &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &symmetryPolyPatch::typeName, &wedgePolyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &symmetryPolyPatch::typeName, &oldCyclicPolyPatch::typeName};enum patchTypeNames{ PISTON, VALVE, LINER, CYLINDERHEAD, AXIS, WEDGE, INFLOW, OUTFLOW, PRESIN, PRESOUT, SYMMETRYPLANE, CYCLIC};const char *kivaPatchNames[nBCs]={ "piston", "valve", "liner", "cylinderHead", "axis", "wedge", "inflow", "outflow", "presin", "presout", "symmetryPlane", "cyclic"};List< SLList< face > > pFaces[nBCs]
messageStream Warning
Warning stream (stdout output on master, null elsewhere), with additional 'FOAM Warning' header text...
label lineNumber() const noexcept
Const access to the current stream line number.
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name...
const std::string version
OpenFOAM version (name or stringified number) as a std::string.
const T & lookup(const label &key, const T &deflt) const
Return hashed entry if it exists, or return the given default.
T get(const label index) const
Get a value from the argument at index.
#define WarningInFunction
Report a warning using Foam::Warning.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
Tet point storage. Default constructable (tetrahedron is not)
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
A cell is defined as a list of faces with extra functionality.
Input from string buffer, using a ISstream. Always UNCOMPRESSED.
A collection of cell labels.
bool good() const noexcept
True if next operation might succeed.
Maps a geometry to a set of cell primitives.
const std::string patch
OpenFOAM patch number as a std::string.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
messageStream Info
Information stream (stdout output on master, null elsewhere)
const labelListList & pointFaces() const
Mesh consisting of general polyhedral cells.
A subset of mesh faces organised as a primitive patch.
A patch is a list of labels that address the faces in the global face list.
Foam::argList args(argc, argv)
Defines the attributes of an object for which implicit objectRegistry management is supported...
bool found(const word &optName) const
Return true if the named option is found.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
point centre(const UList< point > &points) const
Centroid of the cell.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...