62 <<
"Cannot read file " << filename <<
nl
67 string hdr = this->getLineNoComment(is);
71 <<
"OFF file " << filename <<
" does not start with 'OFF'"
79 string line = this->getLineNoComment(is);
87 for (
point& pt : pointLst)
91 line = this->getLineNoComment(is);
94 lineStream >>
x >>
y >> z;
104 for (label facei = 0; facei < nElems; ++facei)
106 line = this->getLineNoComment(is);
112 lineStream >> nVerts;
118 lineStream >> verts[vertI];
127 for (label fp1 = 1; fp1 <
f.size() - 1; fp1++)
129 label fp2 =
f.fcIndex(fp1);
131 dynFaces.
append(Face{
f[0],
f[fp1],
f[fp2]});
160 streamOpt.
format(IOstream::ASCII);
173 <<
"Cannot write file " << filename <<
nl
179 <<
"# Geomview OFF file written " << clock::dateTime().c_str() <<
nl
181 <<
"# points : " << pointLst.
size() <<
nl
182 <<
"# faces : " << faceLst.
size() <<
nl
183 <<
"# zones : " << zoneLst.
size() <<
nl;
188 os <<
"# " << zoneI <<
" " << zoneLst[zoneI].name()
189 <<
" (nFaces: " << zoneLst[zoneI].
size() <<
")" <<
nl;
193 <<
"# nPoints nFaces nEdges" <<
nl
194 << pointLst.
size() <<
' ' << faceLst.
size() <<
' ' << 0 <<
nl
196 <<
"# <points count=\"" << pointLst.
size() <<
"\">" <<
nl;
201 os << pointLst[ptI].x() <<
' '
202 << pointLst[ptI].y() <<
' '
203 << pointLst[ptI].z() <<
" #" << ptI <<
nl;
206 os <<
"# </points>" <<
nl
208 <<
"# <faces count=\"" << faceLst.
size() <<
"\">" <<
nl;
217 for (label nLocal =
zone.
size(); nLocal--; ++faceIndex)
220 (useFaceMap ?
faceMap[faceIndex] : faceIndex);
222 const Face&
f = faceLst[facei];
225 for (
const label verti :
f)
231 os <<
' ' << zoneIndex <<
nl;
234 os <<
"# </zone>" <<
nl;
238 os <<
"# </faces>" <<
nl;
Input/output from string buffers.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
Input from file stream, using an ISstream.
The IOstreamOption is a simple container for options an IOstream can normally have.
streamFormat format() const noexcept
Get the current stream format.
bool good() const noexcept
True if next operation might succeed.
Input from string buffer, using a ISstream. Always UNCOMPRESSED.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
const UList< surfZone > & surfZones() const
Const access to the surface zones.
const UList< Face > & surfFaces() const
Return const access to the faces.
bool useFaceMap() const
Can/should use faceMap?
const pointField & points() const
Return const access to the points.
const labelUList & faceMap() const
Const access to the faceMap, zero-sized when unused.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Output to file stream, using an OSstream.
virtual bool read()
Re-read model coefficients if they have changed.
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
virtual bool write()
Write the output fields.
A surface zone on a MeshedSurface.
const word & name() const noexcept
The zone name.
Base class for mesh zones.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
const labelList nEdges(UPstream::listGatherValues< label >(aMesh.nEdges()))
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.