50 const bool mustTriangulate = this->isTri();
58 "fileFormats::NASsurfaceFormat::read(const fileName&)" 60 <<
"Cannot read file " << filename
85 word ansaType, ansaName;
96 if (line.substr(0, 10) ==
"$ANSA_NAME")
105 && sem1 != string::npos
106 && sem2 != string::npos
113 ansaType = line.substr(sem1+1, sem2-sem1-1);
117 if (rawName[rawName.size()-1] ==
'\r')
119 rawName = rawName.substr(1, rawName.size()-2);
123 rawName = rawName.substr(1, rawName.size()-1);
126 string::stripInvalid<word>(rawName);
140 line.substr(0, 12) ==
"$HMNAME COMP" 141 && line.find (
'"') != string::npos
152 lineStream >> rawName;
153 string::stripInvalid<word>(rawName);
155 word groupName(rawName);
156 nameLookup.
insert(groupId, groupName);
163 if (line.empty() || line[0] ==
'$')
169 if (line.size() > 72 && line[72] ==
'+')
171 line = line.substr(0, 72);
178 if (buf.size() > 72 && buf[72] ==
'+')
180 line += buf.substr(8, 64);
184 line += buf.substr(8, buf.size()-8);
207 if (fnd != lookup.
end())
218 zoneI = dynSizes.
size();
219 lookup.
insert(groupId, zoneI);
228 else if (cmd ==
"CQUAD4")
241 if (fnd != lookup.
end())
252 zoneI = dynSizes.
size();
253 lookup.
insert(groupId, zoneI);
265 dynSizes[zoneI] += 2;
274 else if (cmd ==
"GRID")
284 else if (cmd ==
"GRID*")
301 "fileFormats::NASsurfaceFormat::read(const fileName&)" 303 <<
"Expected continuation symbol '*' when reading GRID*" 304 <<
" (double precision coordinate) format" <<
nl 305 <<
"Read:" << line <<
nl 314 else if (cmd ==
"PSHELL")
319 if (groupId == ansaId && ansaType ==
"PSHELL")
321 nameLookup.
insert(ansaId, ansaName);
325 else if (unhandledCmd.
insert(cmd))
327 Info<<
"Unhandled Nastran command " << line <<
nl 338 this->storedPoints().transfer(dynPoints);
347 mapPointId.insert(pointId[i], i);
354 Face&
f = dynFaces[i];
357 f[fp] = mapPointId[f[fp]];
368 const label zoneI = iter();
369 const label groupI = iter.key();
372 if (fnd != nameLookup.
end())
374 names[zoneI] = fnd();
382 this->sortFacesAndStore(dynFaces.
xfer(), dynZones.
xfer(), sorted);
385 this->addZones(dynSizes, names,
true);
Input from memory buffer stream.
const fileName & name() const
Return the name of the stream.
vector point
Point is a vector.
An STL-conforming const_iterator.
word name(const complex &)
Return a string representation of a complex.
bool insert(const label &, const T &newElmt)
Insert a new hashedEntry.
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)
label readLabel(Istream &is)
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
static scalar parseNASCoord(const string &s)
graph_traits< Graph >::vertices_size_type size_type
A face is a list of labels corresponding to mesh vertices.
Ostream & endl(Ostream &os)
Add newline and flush stream.
stressControl lookup("compactNormalStress") >> compactNormalStress
Xfer< List< T > > xfer()
Transfer contents to the Xfer container as a plain List.
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.
virtual bool read(const fileName &)
Read from a file.
A class for handling file names.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A HashTable with keys but without contents.
A triangular face using a FixedList of labels corresponding to mesh vertices.
bool read(const char *, int32_t &)
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
void clearStorage()
Clear the list and delete storage.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
bool insert(const Key &key)
Insert a new entry.