33 Foam::fileFormats::NASedgeFormat::NASedgeFormat
56 "fileFormats::NASedgeFormat::read(const fileName&)" 58 <<
"Cannot read file " << filename
72 if (line.empty() || line[0] ==
'$')
78 if (line.size() > 72 && line[72] ==
'+')
80 line = line.substr(0, 72);
87 if (buf.size() > 72 && buf[72] ==
'+')
89 line += buf.substr(8, 64);
93 line += buf.substr(8, buf.size()-8);
105 if (cmd ==
"CBEAM" || cmd ==
"CROD")
116 else if (cmd ==
"PLOTEL")
127 else if (cmd ==
"GRID")
137 else if (cmd ==
"GRID*")
154 "fileFormats::NASedgeFormat::read(const fileName&)" 156 <<
"Expected continuation symbol '*' when reading GRID*" 157 <<
" (double precision coordinate) format" <<
nl 158 <<
"Read:" << line <<
nl 170 storedPoints().transfer(dynPoints);
179 mapPointId.insert(pointId[i], i);
190 edge&
e = dynEdges[i];
191 e[0] = mapPointId[e[0]];
192 e[1] = mapPointId[e[1]];
194 usedPoints.
set(e[0]);
195 usedPoints.
set(e[1]);
201 if (
unsigned(
points().size()) != usedPoints.
count())
208 if (usedPoints.
get(pointI))
212 pts[nUsed] = pts[pointI];
216 mapPointId[pointI] = nUsed;
227 edge&
e = dynEdges[edgeI];
229 e[0] = mapPointId[e[0]];
230 e[1] = mapPointId[e[1]];
Input from memory buffer stream.
const pointField & points
const fileName & name() const
Return the name of the stream.
vector point
Point is a vector.
void set(const PackedList< 1 > &)
Set specified bits.
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void size(const label)
Override size to be inconsistent with allocated storage.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
errorManipArg< error, int > exit(error &err, const int errNo=1)
unsigned int count() const
Count number of bits set, O(log(n))
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
label readLabel(Istream &is)
static scalar parseNASCoord(const string &s)
void setSize(const label)
Reset size of List.
const dimensionedScalar e
Elementary charge.
virtual bool read(const fileName &)
Read from a file.
bool good() const
Return true if next operation might succeed.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
label lineNumber() const
Return current stream line number.
ISstream & getLine(string &)
Raw, low-level getline into a string function.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
A class for handling file names.
bool read(const char *, int32_t &)
void clearStorage()
Clear the list and delete storage.
void transfer(const FixedList< T, Size > &)
Copy (not transfer) the argument contents.
unsigned int get(const label) const
Get value at index I.