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(),
116 IFstream is(starFileName(prefix, STARCDCore::CEL_FILE));
120 <<
"Cannot read file " << is.
name() <<
nl 124 readHeader(is, STARCDCore::HEADER_CEL);
139 bool ignoreElemId =
false;
141 label ignoredLabel, shapeId, nLabels, cellTableId, typeId;
156 vertexLabels.clear();
157 vertexLabels.reserve(nLabels);
160 for (label i = 0; i < nLabels; ++i)
170 vertexLabels.append(mapPointId[vrtId]);
173 if (typeId == starcdShellType)
176 const auto iterGroup = lookup.
cfind(cellTableId);
177 if (iterGroup.good())
179 if (zoneId != *iterGroup)
188 zoneId = dynSizes.
size();
189 lookup.
insert(cellTableId, zoneId);
191 const auto iterTableName = cellTableLookup.cfind(cellTableId);
193 if (iterTableName.good())
195 dynNames.
append(*iterTableName);
205 SubList<label>
vertices(vertexLabels, vertexLabels.size());
206 if (faceTraits<Face>::isTri() && nLabels > 3)
216 f.triangles(this->
points(), nTri, trias);
218 for (
const face& tri : trias)
221 dynFaces.
append(Face(tri));
226 else if (nLabels >= 3)
246 this->sortFacesAndStore(dynFaces, dynZones, dynElemId, sorted);
249 this->addZones(dynSizes, dynNames);
250 this->addZonesToFaces();
266 streamOpt.
format(IOstreamOption::ASCII);
276 ? surfaceFormatsCore::oneZone(faceLst)
284 const bool useOrigFaceIds =
296 OFstream os(starFileName(prefix, STARCDCore::VRT_FILE), streamOpt);
297 writePoints(
os, pointLst);
301 OFstream os(starFileName(prefix, STARCDCore::CEL_FILE), streamOpt);
309 for (label nLocal =
zone.
size(); nLocal--; ++faceIndex)
312 (useFaceMap ?
faceMap[faceIndex] : faceIndex);
314 const Face&
f = faceLst[facei];
318 elemId = elemIds[facei];
321 writeShell(
os,
f, elemId, zoneIndex);
330 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 as an OSstream, normally using std::ofstream for the actual output...
A surface zone on a MeshedSurface.
constexpr char nl
The newline '\n' character (0x0a)
A token holds an item read from Istream.
A simple container for options an IOstream can normally have.
Lookup type of boundary radiation properties.
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.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
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.
virtual const fileName & name() const override
Read/write access to the name of the stream.
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?
const_iterator cfind(const Key &key) const
Find and return an const_iterator set at the hashed entry.
Base class for mesh zones.
void clear()
Clear the list, i.e. set size to zero.
void clear()
Remove all entries from table.
const UList< surfZone > & surfZones() const noexcept
Const access to the surface zones.
void append(const T &val)
Copy append an element to the end of this list.
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 as an ISstream, normally using std::ifstream for the actual input...
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
virtual Istream & read(token &t) override
Return next token from stream.
const labelUList & faceIds() const noexcept
Const access to the faceIds, zero-sized when unused.
bool good() const noexcept
True if next operation might succeed.
label labelToken() const
Return label value.
fileName lessExt() const
Return file name without extension (part before last .)
bool isLabel() const noexcept
Token is LABEL.
const UList< Face > & surfFaces() const noexcept
Return const access to the faces.
Map< label > invertToMap(const labelUList &values)
Create inverse mapping, which is a lookup table into the given list.
streamFormat format() const noexcept
Get the current stream format.
A HashTable to objects of type <T> with a label key.