Go to the documentation of this file.
37 inline void Foam::fileFormats::STARCDedgeFormat::writeLines
47 for (
const edge&
e :
edges)
56 <<
" " << starCellId <<
" "
57 << (
e[0]+1) <<
" " << (
e[1]+1) <<
nl;
76 <<
"! " << pointLst.size() <<
" points, " << nEdges <<
" lines" <<
nl
77 <<
"! case " << caseName <<
nl
78 <<
"! ------------------------------" <<
nl;
87 os <<
"! ------------------------------" <<
nl
88 <<
"*set icvo mxv - 1" <<
nl
89 <<
"vread " << caseName <<
".vrt icvo,,,coded" <<
nl
90 <<
"cread " << caseName <<
".cel icvo,,,add,coded" <<
nl
100 Foam::fileFormats::STARCDedgeFormat::STARCDedgeFormat
135 mapPointId.insert(pointId[i], i);
149 <<
"Cannot read file " << is.
name()
157 label ignoredLabel, shapeId, nLabels, cellTableId, typeId;
170 vertexLabels.
clear();
174 for (label i = 0; i < nLabels; ++i)
184 vertexLabels.
append(mapPointId[vrtId]);
187 if (typeId == starcdLineType)
189 if (vertexLabels.size() >= 2)
191 dynEdges.
append(
edge(vertexLabels[0], vertexLabels[1]));
193 usedPoints.
set(vertexLabels[0]);
194 usedPoints.
set(vertexLabels[1]);
202 if (!usedPoints.
all())
207 for (
const label pointi : usedPoints)
211 pts[nUsed] = pts[pointi];
215 mapPointId.set(pointi, nUsed);
222 for (
edge&
e : dynEdges)
224 e[0] = mapPointId[
e[0]];
225 e[1] = mapPointId[
e[1]];
229 storedEdges().transfer(dynEdges);
List< edge > edgeList
A List of edges.
static std::string nameLessExt(const std::string &str)
Return basename, without extension.
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...
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 nElem)
Reserve allocation space for at least this size.
#define forAll(list, i)
Loop across all elements in list.
bool isLabel() const
Token is LABEL.
static std::string dateTime()
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
void clear()
Clear the addressed list, i.e. set the size to zero.
virtual const fileName & name() const
Return the name of the stream.
const edgeList & edges() const
Return edges.
virtual void flush()=0
Flush stream.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Output to file stream, using an OSstream.
#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,...
bool good() const
Return true if next operation might succeed.
Mesh data needed to do the Finite Area discretisation.