Go to the documentation of this file.
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().nameLessExt();
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
99 Foam::fileFormats::STARCDedgeFormat::STARCDedgeFormat
134 mapPointId.insert(pointId[i], i);
148 <<
"Cannot read file " << is.
name()
156 label ignoredLabel, shapeId, nLabels, cellTableId, typeId;
169 vertexLabels.
clear();
173 for (label i = 0; i < nLabels; ++i)
183 vertexLabels.
append(mapPointId[vrtId]);
186 if (typeId == starcdLineType)
188 if (vertexLabels.size() >= 2)
190 dynEdges.
append(
edge(vertexLabels[0], vertexLabels[1]));
192 usedPoints.
set(vertexLabels[0]);
193 usedPoints.
set(vertexLabels[1]);
201 if (!usedPoints.
all())
206 for (
const label pointi : usedPoints)
210 pts[nUsed] = pts[pointi];
214 mapPointId.set(pointi, nUsed);
221 for (
edge&
e : dynEdges)
223 e[0] = mapPointId[
e[0]];
224 e[1] = mapPointId[
e[1]];
228 storedEdges().transfer(dynEdges);
253 writePoints(
os, pointLst);
260 writeLines(
os, edgeLst);
bool isLabel() const noexcept
Token is LABEL.
List< edge > edgeList
A List of edges.
A class for handling words, derived from Foam::string.
A class for handling file names.
bool all() const
True if all bits in this bitset are set or if the set is empty.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Input from file stream, using an ISstream.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
virtual const fileName & name() const
Read/write access to the name of the stream.
bool read(const char *buf, int32_t &val)
Same as readInt32.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
streamFormat format() const noexcept
Get the current stream format.
void set(const bitSet &bitset)
Set specified bits from another bitset.
Input/output from string buffers.
A token holds an item read from Istream.
fileName lessExt() const
Return file name without extension (part before last .)
void reserve(const label len)
static void writeHeader(Ostream &os, const word &fieldName)
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
#define forAll(list, i)
Loop across all elements in list.
bool good() const noexcept
True if next operation might succeed.
static std::string dateTime()
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
The IOstreamOption is a simple container for options an IOstream can normally have.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Output to file stream, using an OSstream.
const edgeList & edges() const noexcept
Return edges.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const dimensionedScalar e
Elementary charge.
void clear()
Clear the list, i.e. set size to zero.
virtual Istream & read(token &t)
Return next token from stream.
Various functions to operate on Lists.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Mesh data needed to do the Finite Area discretisation.