34 inline void Foam::fileFormats::STARCDedgeFormat::writeLines
44 const edge&
e = edges[edgeI];
48 <<
' ' << starcdLineShape_
51 <<
' ' << starcdLineType_;
53 os <<
nl <<
" " << cellId <<
" " 54 << (e[0]+1) <<
" " << (e[1]+1) <<
nl;
71 <<
"! " << pointLst.
size() <<
" points, " << nEdges <<
" lines" <<
nl 72 <<
"! case " << caseName <<
nl 73 <<
"! ------------------------------" <<
nl;
82 os <<
"! ------------------------------" << nl
83 <<
"*set icvo mxv - 1" << nl
84 <<
"vread " << caseName <<
".vrt icvo,,,coded" << nl
85 <<
"cread " << caseName <<
".cel icvo,,,add,coded" << nl
130 mapPointId.insert(pointId[i], i);
144 <<
"Cannot read file " << is.
name()
152 label lineLabel, shapeId, nLabels, cellTableId, typeId;
155 while ((is >> lineLabel).good())
157 is >> shapeId >> nLabels >> cellTableId >> typeId;
159 vertexLabels.
clear();
163 for (
label i = 0; i < nLabels; ++i)
173 vertexLabels.
append(mapPointId[vrtId]);
176 if (typeId == starcdLineType_)
178 if (vertexLabels.
size() >= 2)
180 dynEdges.
append(
edge(vertexLabels[0], vertexLabels[1]));
182 usedPoints.
set(vertexLabels[0]);
183 usedPoints.
set(vertexLabels[1]);
191 if (
unsigned(
points().size()) != usedPoints.
count())
198 if (usedPoints.
get(pointi))
202 pts[nUsed] = pts[pointi];
206 mapPointId.set(pointi, nUsed);
217 edge&
e = dynEdges[edgeI];
219 e[0] = mapPointId[e[0]];
220 e[1] = mapPointId[e[1]];
243 writeLines(
OFstream(baseName +
".cel")(), edgeLst);
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A class for handling file names.
virtual void flush()=0
Flush stream.
errorManipArg< error, int > exit(error &err, const int errNo=1)
unsigned int get(const label) const
Get value at index I.
edgeList & storedEdges()
Non-const access to the edges.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void size(const label)
Override size to be inconsistent with allocated storage.
pointField & storedPoints()
Non-const access to global points.
bool good() const
Return true if next operation might succeed.
void reserve(const label)
Reserve allocation space for at least this size.
Various functions to operate on Lists.
void set(const PackedList< 1 > &)
Set specified bits.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
void clear()
Clear the list, i.e. set size to zero.
A class for handling words, derived from string.
static string dateTime()
Return the current wall-clock date/time as a string.
virtual const fileName & name() const
Return the name of the stream.
const fileName & name() const
Return the name of the stream.
const edgeList & edges() const
Return edges.
word name() const
Return file name (part beyond last /)
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const pointField & points() const
Return points.
Points connected by edges.
unsigned int count() const
Count number of bits set, O(log(n))
virtual void clear()
Clear all storage.
void setSize(const label)
Reset size of List.
fileName lessExt() const
Return file name without extension (part before last .)
const doubleScalar e
Elementary charge.
void clear()
Clear the addressed list, i.e. set the size to zero.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.