Go to the documentation of this file.
38 #include "triSurface.H"
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);
79 <<
"Cannot read file " << fName
86 dynamicLabelList indices;
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;
178 if (
line.size() > 72 &&
line[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")
272 indices.append(index);
275 else if (cmd ==
"GRID*")
291 <<
"Expected continuation symbol '*' when reading GRID*"
292 <<
" (double precision coordinate) output" <<
nl
294 <<
"File:" << is.
name()
300 indices.append(index);
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]];
343 label patchI = groupToPatch[iter.key()];
const fileName & name() const
Return the name of the stream.
const Field< point > & points() const
Return reference to global points.
A class for handling words, derived from string.
A class for handling file names.
#define forAll(list, i)
Loop across all elements in list.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
The geometricSurfacePatch is like patchIdentifier but for surfaces. Holds type, name and index.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const geometricSurfacePatchList & patches() const
A HashTable with keys but without contents.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
static scalar parseNASCoord(const string &s)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Pre-declare SubField and related Field type.
ISstream & getLine(string &)
Raw, low-level getline into a string function.
triSurface()
Construct null.
graph_traits< Graph >::vertices_size_type size_type
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
bool readNAS(const fileName &)
Input from memory buffer stream.
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))
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)
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
bool insert(const Key &key)
Insert a new entry.
label readLabel(Istream &is)
Triangle with additional region number.
const dimensionedScalar c
Speed of light in a vacuum.
label lineNumber() const
Return current stream line number.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
vector point
Point is a vector.
bool good() const
Return true if next operation might succeed.