55 <<
"Cannot read file " << filename
72 else if (line[0] ==
'$')
79 if (line.size() > 72 && line[72] ==
'+')
88 if (buf.size() > 72 && buf[72] ==
'+')
90 line += buf.substr(8, 64);
94 line += buf.substr(8);
102 std::string::size_type linei = 0;
105 const bool freeFormat = line.
contains(
',');
110 if (cmd ==
"CBEAM" || cmd ==
"CROD")
119 (void) nextNasField(line, linei, 8, freeFormat);
121 (void) nextNasField(line, linei, 8, freeFormat);
123 label a =
readLabel(nextNasField(line, linei, 8, freeFormat));
124 label
b =
readLabel(nextNasField(line, linei, 8, freeFormat));
128 else if (cmd ==
"PLOTEL")
137 (void) nextNasField(line, linei, 8, freeFormat);
139 label a =
readLabel(nextNasField(line, linei, 8, freeFormat));
140 label
b =
readLabel(nextNasField(line, linei, 8, freeFormat));
144 else if (cmd ==
"GRID")
156 label index =
readLabel(nextNasField(line, linei, 8, freeFormat));
157 (void) nextNasField(line, linei, 8, freeFormat);
158 scalar
x = readNasScalar(nextNasField(line, linei, 8, freeFormat));
159 scalar
y = readNasScalar(nextNasField(line, linei, 8, freeFormat));
160 scalar z = readNasScalar(nextNasField(line, linei, 8, freeFormat));
165 else if (cmd ==
"GRID*")
175 label index =
readLabel(nextNasField(line, linei, 16));
176 (void) nextNasField(line, linei, 16);
177 scalar
x = readNasScalar(nextNasField(line, linei, 16));
178 scalar
y = readNasScalar(nextNasField(line, linei, 16));
185 <<
"Expected continuation symbol '*' when reading GRID*"
186 <<
" (double precision coordinate) format" <<
nl
187 <<
"Read:" << line <<
nl
188 <<
"File:" << is.name() <<
" line:" << is.lineNumber()
191 (void) nextNasField(line, linei, 8);
192 scalar z = readNasScalar(nextNasField(line, linei, 16));
206 bitSet usedPoints(
points().size());
211 for (edge&
e : dynEdges)
213 e[0] = mapPointId[
e[0]];
214 e[1] = mapPointId[
e[1]];
216 usedPoints.set(
e[0]);
217 usedPoints.set(
e[1]);
223 if (!usedPoints.all())
228 for (
const label pointi : usedPoints)
236 mapPointId.set(pointi, nUsed);
243 for (edge&
e : dynEdges)
245 e[0] = mapPointId[
e[0]];
246 e[1] = mapPointId[
e[1]];
250 storedEdges().transfer(dynEdges);
Input/output from string buffers.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void transfer(List< T > &list)
Transfer contents of the argument List into this.
T & emplace_back(Args &&... args)
Construct an element at the end of the list, return reference to the new list element.
void clearStorage()
Clear the list and delete storage.
void push_back(const T &val)
Copy append an element to the end of this list.
bool set(const Key &key, const T &obj)
Copy assign a new entry, overwriting existing entries.
void clear()
Remove all entries from table.
Input from file stream as an ISstream, normally using std::ifstream for the actual input.
virtual const fileName & name() const override
Read/write access to the name of the stream.
label lineNumber() const noexcept
Const access to the current stream line number.
bool good() const noexcept
True if next operation might succeed.
ISstream & getLine(std::string &str, char delim='\n')
Raw, low-level getline (until delimiter) into a string.
A HashTable to objects of type <T> with a label key.
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.
pointField & storedPoints() noexcept
Non-const access to global points.
edgeList & storedEdges() noexcept
Non-const access to the edges.
static label size(const faMesh &mesh) noexcept
The geometric (internal) size - number of internal edges.
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
A class for handling file names.
bool contains(char c) const noexcept
True if string contains given character (cf. C++23).
A class for handling words, derived from Foam::string.
static word validate(const std::string &s, const bool prefix=false)
Construct validated word (no invalid characters).
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Map< label > invertToMap(const labelUList &values)
Create inverse mapping, which is a lookup table into the given list.
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
vectorField pointField
pointField is a vectorField.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).