37inline void Foam::fileFormats::STARCDedgeFormat::writeLines
40 const edgeList& edges,
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
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]];
253 writePoints(
os, pointLst);
260 writeLines(
os, edgeLst);
Various functions to operate on Lists.
Input/output from string buffers.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
void append(const T &val)
Copy append an element to the end of this list.
void reserve(const label len)
bool set(const Key &key, const T &obj)
Copy assign a new entry, overwriting existing entries.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
void transfer(HashTable< T, Key, Hash > &rhs)
Transfer contents into this table.
void clear()
Clear all entries from table.
Input from file stream, using an ISstream.
virtual const fileName & name() const
Read/write access to the name of the stream.
The IOstreamOption is a simple container for options an IOstream can normally have.
streamFormat format() const noexcept
Get the current stream format.
bool good() const noexcept
True if next operation might succeed.
virtual Istream & read(token &t)
Return next token from stream.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void resize(const label len)
Adjust allocated size of list.
void clear()
Clear the list, i.e. set size to zero.
A HashTable to objects of type <T> with a label key.
Output to file stream, using an OSstream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual bool read()
Re-read model coefficients if they have changed.
void size(const label n)
Older name for setAddressableSize.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void set(const bitSet &bitset)
Set specified bits from another bitset.
bool all() const
True if all bits in this bitset are set or if the set is empty.
static std::string dateTime()
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Mesh data needed to do the Finite Area discretisation.
const edgeList & edges() const noexcept
Return edges.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
A class for handling file names.
fileName lessExt() const
Return file name without extension (part before last .)
virtual bool write()
Write the output fields.
A token holds an item read from Istream.
bool isLabel() const noexcept
Token is LABEL.
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
const labelList nEdges(UPstream::listGatherValues< label >(aMesh.nEdges()))
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
bool read(const char *buf, int32_t &val)
Same as readInt32.
static void writeHeader(Ostream &os, const word &fieldName)
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.