37 inline void Foam::fileFormats::STARCDedgeFormat::writeLines
44 starCellId =
max(1, starCellId);
46 for (
const edge&
e :
edges)
55 <<
" " << starCellId <<
" " 56 << (
e[0]+1) <<
" " << (
e[1]+1) <<
nl;
72 const word caseName =
os.name().stem();
75 <<
"! " << pointLst.
size() <<
" points, " << nEdges <<
" lines" <<
nl 76 <<
"! case " << caseName <<
nl 77 <<
"! ------------------------------" <<
nl;
86 os <<
"! ------------------------------" <<
nl 87 <<
"*set icvo mxv - 1" <<
nl 88 <<
"vread " << caseName <<
".vrt icvo,,,coded" <<
nl 89 <<
"cread " << caseName <<
".cel icvo,,,add,coded" <<
nl 144 <<
"Cannot read file " << is.name()
152 label ignoredLabel, shapeId, nLabels, cellTableId, typeId;
157 while (is.read(tok).good() && tok.
isLabel())
165 vertexLabels.clear();
166 vertexLabels.reserve(nLabels);
169 for (label i = 0; i < nLabels; ++i)
179 vertexLabels.append(mapPointId[vrtId]);
182 if (typeId == starcdLineType)
184 if (vertexLabels.size() >= 2)
186 dynEdges.
append(edge(vertexLabels[0], vertexLabels[1]));
188 usedPoints.set(vertexLabels[0]);
189 usedPoints.set(vertexLabels[1]);
197 if (!usedPoints.all())
202 for (
const label pointi : usedPoints)
210 mapPointId.set(pointi, nUsed);
217 for (edge&
e : dynEdges)
219 e[0] = mapPointId[
e[0]];
220 e[1] = mapPointId[
e[1]];
224 storedEdges().transfer(dynEdges);
249 writePoints(
os, pointLst);
256 writeLines(
os, edgeLst);
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.
Input/output from string buffers.
List< edge > edgeList
List of edge.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Output to file stream as an OSstream, normally using std::ofstream for the actual output...
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.
Various functions to operate on Lists.
bool read(const char *buf, int32_t &val)
Same as readInt32.
vectorField pointField
pointField is a vectorField.
const dimensionedScalar e
Elementary charge.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
A class for handling words, derived from Foam::string.
static std::string dateTime()
The current wall-clock date/time (in local time) as a string in ISO-8601 format (yyyy-mm-ddThh:mm:ss)...
void append(const T &val)
Copy append an element to the end of this list.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
Mesh data needed to do the Finite Area discretisation.
Input from file stream as an ISstream, normally using std::ifstream for the actual input...
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
const edgeList & edges() const noexcept
Return edges.
fileName lessExt() const
Return file name without extension (part before last .)
bool isLabel() const noexcept
Token is LABEL.
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.