Go to the documentation of this file.
40 writeHeader(os,
"CELL");
44 const edge&
e = edges[edgeI];
48 <<
' ' << starcdLineShape_
51 <<
' ' << starcdLineType_;
54 << (
e[0]+1) <<
" " << (
e[1]+1) <<
nl;
70 os <<
"! STAR-CD file written " << clock::dateTime().c_str() <<
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()
148 readHeader(is,
"PROSTAR_CELL");
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]];
225 storedEdges().transfer(dynEdges);
242 writePoints(
OFstream(baseName +
".vrt")(), pointLst);
243 writeLines(
OFstream(baseName +
".cel")(), edgeLst);
const fileName & name() const
Return the name of the stream.
A class for handling words, derived from string.
A class for handling file names.
#define forAll(list, i)
Loop across all elements in list.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
bool read(const char *, int32_t &)
void set(const PackedList< 1 > &)
Set specified bits.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
fileName lessExt() const
Return file name without extension (part before last .)
word name() const
Return file name (part beyond last /)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
void clear()
Clear the addressed list, i.e. set the size to zero.
unsigned int count() const
Count number of bits set, O(log(n))
unsigned int get(const label) const
Get value at index I.
virtual void flush()=0
Flush stream.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const dimensionedScalar e
Elementary charge.
void clear()
Clear the list, i.e. set size to zero.
void reserve(const label)
Reserve allocation space for at least this size.
Various functions to operate on Lists.
void size(const label)
Override size to be inconsistent with allocated storage.
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.
Points connected by edges.
virtual const fileName & name() const
Return the name of the stream.