52 size_t expSign = s.find_last_of(
"+-");
54 if (expSign != string::npos && expSign > 0 && !
isspace(s[expSign-1]))
59 if (s[expSign] ==
'-')
63 return mantissa*
pow(10, exponent);
72 bool triSurface::readNAS(
const fileName& fName)
79 <<
"Cannot read file " << fName
111 if (line.substr(0, 10) ==
"$ANSA_NAME")
120 && sem1 != string::npos
121 && sem2 != string::npos
128 ansaType = line.substr(sem1+1, sem2-sem1-1);
132 if (ansaName[ansaName.size()-1] ==
'\r')
134 ansaName = ansaName.substr(1, ansaName.size()-2);
138 ansaName = ansaName.substr(1, ansaName.size()-1);
152 line.substr(0, 12) ==
"$HMNAME COMP" 153 && line.find (
'"') != string::npos
164 lineStream >> rawName;
166 groupToName.
insert(groupId, string::validate<word>(rawName));
167 Info<<
"group " << groupId <<
" => " << rawName <<
endl;
171 if (line.empty() || line[0] ==
'$')
178 if (line.size() > 72 && line[72] ==
'+')
180 line = line.substr(0, 72);
187 if (buf.size() > 72 && buf[72]==
'+')
189 line += buf.substr(8, 64);
193 line += buf.substr(8, buf.size()-8);
216 if (iter == groupToPatch.
end())
219 groupToPatch.
insert(groupId, patchi);
220 Info<<
"patch " << patchi <<
" => group " << groupId <<
endl;
229 else if (cmd ==
"CQUAD4")
241 if (iter == groupToPatch.
end())
244 groupToPatch.
insert(groupId, patchi);
245 Info<<
"patch " << patchi <<
" => group " << groupId <<
endl;
255 else if (cmd ==
"PSHELL")
259 if (groupId == ansaId && ansaType ==
"PSHELL")
261 groupToName.
insert(groupId, string::validate<word>(ansaName));
262 Info<<
"group " << groupId <<
" => " << ansaName <<
endl;
265 else if (cmd ==
"GRID")
275 else if (cmd ==
"GRID*")
291 <<
"Expected continuation symbol '*' when reading GRID*" 292 <<
" (double precision coordinate) output" <<
nl 293 <<
"Read:" << line <<
nl 294 <<
"File:" << is.
name()
303 else if (unhandledCmd.
insert(cmd))
305 Info<<
"Unhandled Nastran command " << line <<
nl 315 Info<<
"Read triangles:" << faces.
size() <<
" points:" << points.
size()
323 indexToPoint.insert(indices[i], i);
331 f[0] = indexToPoint[f[0]];
332 f[1] = indexToPoint[f[1]];
333 f[2] = indexToPoint[f[2]];
353 Info<<
"patches:" << patches <<
endl;
359 *
this =
triSurface(faces, patches, allPoints,
true);
A HashTable with keys but without contents.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void size(const label)
Override size to be inconsistent with allocated storage.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m K].
Ostream & endl(Ostream &os)
Add newline and flush stream.
label lineNumber() const
Return current stream line number.
bool insert(const Key &key)
Insert a new entry.
const dimensionedScalar c
Speed of light in a vacuum.
bool good() const
Return true if next operation might succeed.
bool insert(const label &, const T &newElmt)
Insert a new hashedEntry.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
A class for handling words, derived from string.
const fileName & name() const
Return the name of the stream.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
const Field< PointType > & points() const
Return reference to global points.
Triangle with additional region number.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
graph_traits< Graph >::vertices_size_type size_type
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
label readLabel(Istream &is)
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
const geometricSurfacePatchList & patches() const
ISstream & getLine(string &, const bool continuation=true)
Read line into a string.
triSurface()
Construct null.
vector point
Point is a vector.
Input from memory buffer stream.
The geometricSurfacePatch is like patchIdentifier but for surfaces. Holds type, name and index...
faceList faces() const
Return the list of triangles as a faceList.
static scalar parseNASCoord(const string &s)