Go to the documentation of this file.
60 <<
"Cannot read file " << filename
75 <<
"When reading AC3D file " << filename
76 <<
" read header " <<
line <<
" with version "
78 <<
"Only tested reading with version 'b'."
79 <<
" This might give problems" <<
endl;
84 if (!cueTo(is,
"OBJECT",
args) ||
args !=
"world")
87 <<
"Cannot find \"OBJECT world\" in file " << filename
92 args = cueToOrDie(is,
"kids");
96 label vertexOffset = 0;
107 args = cueToOrDie(is,
"OBJECT",
"while reading " + names[zoneI]);
110 label nZonePoints = 0;
119 if (!readCmd(is, cmd,
args))
122 <<
"Did not read up to \"kids 0\" while reading zone "
123 << zoneI <<
" from file " << filename
130 const string str = parse<string>(
args);
133 else if (cmd ==
"rot")
145 <<
"rot (rotation tensor) command not implemented"
146 <<
"Line:" << cmd <<
' ' <<
args <<
endl
147 <<
"while reading zone " << zoneI <<
endl;
149 else if (cmd ==
"loc")
159 else if (cmd ==
"numvert")
162 nZonePoints = parse<int>(
args);
164 for (
label vertI = 0; vertI < nZonePoints; ++vertI)
171 >> pt.
x() >> pt.
y() >> pt.
z();
174 dynPoints.
append(location + pt);
177 else if (cmd ==
"numsurf")
181 for (
label facei = 0; facei < nFaces; ++facei)
183 const string errorMsg =
184 string(
" while reading face ")
187 +
" from file " + filename;
189 cueToOrDie(is,
"SURF", errorMsg);
190 cueToOrDie(is,
"mat", errorMsg);
191 args = cueToOrDie(is,
"refs", errorMsg);
199 verts[vertI] = vertexOffset + parse<int>(
line);
208 for (
label fp1 = 1; fp1 <
f.size() - 1; ++fp1)
210 label fp2 =
f.fcIndex(fp1);
212 dynFaces.
append(Face{
f[0],
f[fp1],
f[fp2]});
225 vertexOffset += nZonePoints;
227 else if (cmd ==
"kids")
235 <<
"Can only read objects without kids."
236 <<
" Encountered " << nKids <<
" kids when"
237 <<
" reading zone " << zoneI
248 this->storedPoints().transfer(dynPoints);
249 this->storedFaces().transfer(dynFaces);
252 this->addZones(sizes, names);
253 this->addZonesToFaces();
254 this->stitchFaces(SMALL);
266 template<
class>
class FaceList,
279 os <<
"OBJECT poly" <<
nl
280 <<
"name \"" <<
name <<
"\"" <<
nl;
282 os <<
"numvert " <<
patch.nPoints() <<
nl;
286 os << pt.x() <<
' ' << pt.y() <<
' ' << pt.z() <<
nl;
289 os <<
"numsurf " <<
patch.size() <<
nl;
291 for (
const Face&
f :
patch.localFaces())
293 os <<
"SURF 0x20" <<
nl
294 <<
"mat " << zoneI <<
nl
295 <<
"refs " <<
f.size() <<
nl;
297 for (
const label verti :
f)
299 os << verti <<
" 0 0" <<
nl;
303 os <<
"kids 0" <<
endl;
322 : surfaceFormatsCore::oneZone(faceLst)
325 const bool useFaceMap = (surf.
useFaceMap() && zones.size() > 1);
331 <<
"Cannot open file for writing " << filename
337 if (zones.size() == 1)
390 <<
"Cannot open file for writing " << filename
397 if (zoneLst.size() <= 1)
403 : surfaceFormatsCore::oneZone(surf.surfFaces())
const Cmpt & x() const
Access to the vector x component.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
A class for handling words, derived from Foam::string.
ISstream & getLine(std::string &str, char delim='\n')
Raw, low-level getline into a string function.
A class for handling file names.
bool useFaceMap() const
Use faceMap?
static constexpr const zero Zero
Global zero.
Input from file stream, using an ISstream.
A List obtained as a section of another List.
thermo validate(args.executable(), "h")
Base class for mesh zones.
static void writeZone(Ostream &os, const PrimitivePatch< Face, FaceList, PointField, PointType > &patch, const word &name, const label zoneI)
const pointField & points() const
Return const access to the points.
Input/output from string buffers.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A class for handling character strings derived from std::string.
static void writeHeader(Ostream &os, const word &fieldName)
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
const Cmpt & z() const
Access to the vector z component.
const labelUList & faceMap() const
Const access to the faceMap, zero-sized when unused.
#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 surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
word name(const complex &c)
Return string representation of complex.
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Input from string buffer, using a ISstream.
const word & name() const
Return name.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const std::string version
OpenFOAM version (name or stringified number) as a std::string.
Output to file stream, using an OSstream.
const Cmpt & y() const
Access to the vector y component.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const std::string patch
OpenFOAM patch number as a std::string.
A surface zone on a MeshedSurface.
A List with indirect addressing.
const UList< Face > & surfFaces() const
Return const access to the faces.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
bool good() const
Return true if next operation might succeed.
Foam::argList args(argc, argv)
#define WarningInFunction
Report a warning using Foam::Warning.
surfZoneList sortedZones(labelList &faceMap) const
Sort faces according to zoneIds.
A list of faces which address into the list of points.
const UList< surfZone > & surfZones() const
Const access to the surface zones.