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);
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));
200 storedPoints().transfer(dynPoints);
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);
static word validate(const std::string &s, const bool prefix=false)
Construct validated word (no invalid characters).
A class for handling file names.
bool contains(char c) const noexcept
True if string contains given character (cf. C++23)
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Input/output from string buffers.
constexpr char nl
The newline '\n' character (0x0a)
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
vectorField pointField
pointField is a vectorField.
const dimensionedScalar e
Elementary charge.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
T & emplace_back(Args &&... args)
Construct an element at the end of the list, return reference to the new list element.
graph_traits< Graph >::vertices_size_type size_type
Input from file stream as an ISstream, normally using std::ifstream for the actual input...
void push_back(const T &val)
Copy append an element to the end of this list.
void clearStorage()
Clear the list and delete storage.
Map< label > invertToMap(const labelUList &values)
Create inverse mapping, which is a lookup table into the given list.