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")
98 string::size_type sem0 = line.find (
';', 0);
99 string::size_type sem1 = line.find (
';', sem0+1);
100 string::size_type sem2 = line.find (
';', sem1+1);
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
144 label groupId = readLabel
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);
200 label groupId = readLabel(
IStringStream(line.substr(16,8))());
207 if (fnd != lookup.
end())
218 zoneI = dynSizes.
size();
219 lookup.
insert(groupId, zoneI);
228 else if (cmd ==
"CQUAD4")
233 label groupId = readLabel(
IStringStream(line.substr(16,8))());
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")
317 label groupId = readLabel(
IStringStream(line.substr(8,8))());
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 sortFacesAndStore(dynFaces.
xfer(), dynZones.
xfer(), sorted);
385 this->addZones(dynSizes, names,
true);