Go to the documentation of this file.
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);
112 else if (cmd ==
"PLOTEL")
115 (void) nextNasField(
line, linei, 8);
122 else if (cmd ==
"GRID")
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*")
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
157 (void) nextNasField(
line, linei, 8);
158 scalar z = readNasScalar(nextNasField(
line, linei, 16));
166 storedPoints().transfer(dynPoints);
175 mapPointId.insert(pointId[i], i);
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)
205 pts[nUsed] = pts[pointi];
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);
A class for handling words, derived from Foam::string.
ISstream & getLine(std::string &str, char delim='\n')
Raw, low-level getline (until delimiter) into a string.
A class for handling file names.
bool all() const
True if all bits in this bitset are set or if the set is empty.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Input from file stream, using an ISstream.
virtual const fileName & name() const
Read/write access to the name of the stream.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
void set(const bitSet &bitset)
Set specified bits from another bitset.
static word validate(const std::string &s, const bool prefix=false)
Construct validated word (no invalid characters).
label lineNumber() const noexcept
Const access to the current stream line number.
Input/output from string buffers.
DynamicList< T, SizeMin > & shrink()
Shrink the allocated space to the number of elements used.
#define forAll(list, i)
Loop across all elements in list.
bool good() const noexcept
True if next operation might succeed.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
graph_traits< Graph >::vertices_size_type size_type
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
const dimensionedScalar e
Elementary charge.
void clearStorage()
Clear the list and delete storage.
vector point
Point is a vector.