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()
154 DynamicList<edge> dynEdges;
156 label ignoredLabel, shapeId, nLabels, cellTableId, typeId;
157 DynamicList<label> vertexLabels(64);
161 while (is.read(tok).good() && tok.isLabel())
169 vertexLabels.clear();
170 vertexLabels.reserve(nLabels);
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);
vectorField pointField
pointField is a vectorField.
bool isLabel() const noexcept
List< edge > edgeList
A List of edges.
A class for handling words, derived from Foam::string.
A class for handling file names.
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
bool read(const char *buf, int32_t &val)
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
streamFormat format() const noexcept
void set(const bitSet &bitset)
Input/output from string buffers.
A token holds an item read from Istream.
void reserve(const label len)
static void writeHeader(Ostream &os, const word &fieldName)
bool good() const noexcept
Generic templated field type.
static std::string dateTime()
DynamicList< T, SizeMin > & append(const T &val)
The IOstreamOption is a simple container for options an IOstream can normally have.
label max(const labelHashSet &set, label maxValue=labelMin)
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
@ ASCII
"ascii" (normal default)
#define FatalErrorInFunction
const dimensionedScalar e
virtual Istream & read(token &t)
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.