36 Foam::fileFormats::NASedgeFormat::NASedgeFormat(
const fileName& filename)
55 <<
"Cannot read file " << filename
75 if (line.size() > 72 && line[72] ==
'+')
84 if (buf.size() > 72 && buf[72] ==
'+')
86 line += buf.substr(8, 64);
90 line += buf.substr(8);
100 if (cmd ==
"CBEAM" || cmd ==
"CROD")
103 (void) nextNasField(line, linei, 8);
105 (void) nextNasField(line, linei, 8);
107 label a =
readLabel(nextNasField(line, linei, 8));
108 label
b =
readLabel(nextNasField(line, linei, 8));
112 else if (cmd ==
"PLOTEL")
115 (void) nextNasField(line, linei, 8);
117 label a =
readLabel(nextNasField(line, linei, 8));
118 label
b =
readLabel(nextNasField(line, linei, 8));
122 else if (cmd ==
"GRID")
124 label index =
readLabel(nextNasField(line, linei, 8));
125 (void) nextNasField(line, linei, 8);
126 scalar
x = readNasScalar(nextNasField(line, linei, 8));
127 scalar
y = readNasScalar(nextNasField(line, linei, 8));
128 scalar z = readNasScalar(nextNasField(line, linei, 8));
133 else if (cmd ==
"GRID*")
141 label index =
readLabel(nextNasField(line, linei, 16));
142 (void) nextNasField(line, linei, 16);
143 scalar
x = readNasScalar(nextNasField(line, linei, 16));
144 scalar
y = readNasScalar(nextNasField(line, linei, 16));
151 <<
"Expected continuation symbol '*' when reading GRID*" 152 <<
" (double precision coordinate) format" <<
nl 153 <<
"Read:" << line <<
nl 154 <<
"File:" << is.name() <<
" line:" << is.lineNumber()
157 (void) nextNasField(line, linei, 8);
158 scalar z = readNasScalar(nextNasField(line, linei, 16));
166 storedPoints().transfer(dynPoints);
172 Map<label> mapPointId(2*pointId.
size());
175 mapPointId.insert(pointId[i], i);
179 bitSet usedPoints(
points().size());
184 for (edge&
e : dynEdges)
186 e[0] = mapPointId[
e[0]];
187 e[1] = mapPointId[
e[1]];
189 usedPoints.set(
e[0]);
190 usedPoints.set(
e[1]);
196 if (!usedPoints.all())
201 for (
const label pointi : usedPoints)
209 mapPointId.set(pointi, nUsed);
216 for (edge&
e : dynEdges)
218 e[0] = mapPointId[
e[0]];
219 e[1] = mapPointId[
e[1]];
223 storedEdges().transfer(dynEdges);
static word validate(const std::string &s, const bool prefix=false)
Construct validated word (no invalid characters).
void size(const label n)
Older name for setAddressableSize.
A class for handling file names.
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.
#define forAll(list, i)
Loop across all elements in list.
vectorField pointField
pointField is a vectorField.
const dimensionedScalar e
Elementary charge.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
void append(const T &val)
Copy append an element to the end of this list.
graph_traits< Graph >::vertices_size_type size_type
DynamicList< T, SizeMin > & shrink()
Shrink the allocated space to the number of elements used.
Input from file stream, using an ISstream.
vector point
Point is a vector.
void clearStorage()
Clear the list and delete storage.