41 const label cellTableId
47 <<
' ' << (cellTableId + 1)
48 <<
' ' << starcdShellType;
53 for (
const label pointi :
f)
59 os <<
' ' << (pointi + 1);
92 Map<word> cellTableLookup = readInpCellTable
94 IFstream(starFileName(prefix, STARCDCore::INP_FILE))()
104 IFstream(starFileName(prefix, STARCDCore::VRT_FILE))(),
105 this->storedPoints(),
113 mapPointId.insert(pointId[i], i);
120 IFstream is(starFileName(prefix, STARCDCore::CEL_FILE));
124 <<
"Cannot read file " << is.name() <<
nl 128 readHeader(is, STARCDCore::HEADER_CEL);
130 DynamicList<label> dynElemId;
131 DynamicList<Face> dynFaces;
133 DynamicList<label> dynZones;
134 DynamicList<word> dynNames;
135 DynamicList<label> dynSizes;
143 bool ignoreElemId =
false;
145 label ignoredLabel, shapeId, nLabels, cellTableId, typeId;
146 DynamicList<label> vertexLabels(64);
150 while (is.read(tok).good() && tok.isLabel())
153 label elemId = tok.labelToken();
160 vertexLabels.clear();
161 vertexLabels.reserve(nLabels);
164 for (label i = 0; i < nLabels; ++i)
174 vertexLabels.append(mapPointId[vrtId]);
177 if (typeId == starcdShellType)
180 const auto iterGroup = lookup.cfind(cellTableId);
181 if (iterGroup.good())
183 if (zoneId != *iterGroup)
192 zoneId = dynSizes.size();
193 lookup.insert(cellTableId, zoneId);
195 const auto iterTableName = cellTableLookup.cfind(cellTableId);
197 if (iterTableName.good())
199 dynNames.append(*iterTableName);
203 dynNames.append(
"cellTable_" + ::
Foam::name(cellTableId));
209 SubList<label>
vertices(vertexLabels, vertexLabels.size());
210 if (faceTraits<Face>::isTri() && nLabels > 3)
220 f.triangles(this->
points(), nTri, trias);
222 for (
const face& tri : trias)
225 dynFaces.append(Face(tri));
226 dynZones.append(zoneId);
230 else if (nLabels >= 3)
233 dynElemId.append(elemId);
236 dynZones.append(zoneId);
250 this->sortFacesAndStore(dynFaces, dynZones, dynElemId, sorted);
253 this->addZones(dynSizes, dynNames);
254 this->addZonesToFaces();
270 streamOpt.
format(IOstreamOption::ASCII);
280 ? surfaceFormatsCore::oneZone(faceLst)
288 const bool useOrigFaceIds =
300 OFstream os(starFileName(prefix, STARCDCore::VRT_FILE), streamOpt);
301 writePoints(
os, pointLst);
305 OFstream os(starFileName(prefix, STARCDCore::CEL_FILE), streamOpt);
313 for (label nLocal =
zone.
size(); nLocal--; ++faceIndex)
316 (useFaceMap ?
faceMap[faceIndex] : faceIndex);
318 const Face&
f = faceLst[facei];
322 elemId = elemIds[facei];
325 writeShell(
os,
f, elemId, zoneIndex);
334 OFstream
os(starFileName(prefix, STARCDCore::INP_FILE));
void size(const label n)
Older name for setAddressableSize.
A class for handling file names.
static void writeHeader(Ostream &os, const word &fieldName)
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Output to file stream, using an OSstream.
A surface zone on a MeshedSurface.
constexpr char nl
The newline '\n' character (0x0a)
A simple container for options an IOstream can normally have.
const pointField & points() const noexcept
Return const access to the points.
const labelUList & faceMap() const noexcept
Const access to the faceMap, zero-sized when unused.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
Various functions to operate on Lists.
#define forAll(list, i)
Loop across all elements in list.
List< face > faceList
List of faces.
pointField vertices(const blockVertexList &bvl)
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
bool useFaceMap() const noexcept
Can/should use faceMap?
Base class for mesh zones.
void clear()
Clear the list, i.e. set size to zero.
const UList< surfZone > & surfZones() const noexcept
Const access to the surface zones.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
OBJstream os(runTime.globalPath()/outputName)
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats...
Input from file stream, using an ISstream.
const labelUList & faceIds() const noexcept
Const access to the faceIds, zero-sized when unused.
fileName lessExt() const
Return file name without extension (part before last .)
const UList< Face > & surfFaces() const noexcept
Return const access to the faces.
streamFormat format() const noexcept
Get the current stream format.
A HashTable to objects of type <T> with a label key.