Go to the documentation of this file.
44 inline static int countFaces(
const Face&
f)
46 int n = (
f.size() - 2);
47 return n == 2 ? 1 :
n;
60 if (os.format() == IOstream::BINARY)
62 if (
f.size() == 3 ||
f.size() == 4)
64 putFireLabel(os,
f.size());
65 for (
const label verti :
f)
67 putFireLabel(os, verti);
74 for (label fp1 = 1; fp1 <
f.size() - 1; ++fp1)
76 const label fp2 =
f.fcIndex(fp1);
79 putFireLabel(os,
f[0]);
80 putFireLabel(os,
f[fp1]);
81 putFireLabel(os,
f[fp2]);
88 if (
f.size() == 3 ||
f.size() == 4)
90 os <<
' ' <<
f.size();
91 for (
const label verti :
f)
99 for (label fp1 = 1; fp1 <
f.size() - 1; ++fp1)
101 const label fp2 =
f.fcIndex(fp1);
102 os <<
' ' << 3 <<
' '
103 <<
f[0] <<
' ' <<
f[fp1] <<
' ' <<
f[fp2]
118 if (os.format() == IOstream::BINARY)
122 putFireLabel(os, fireQuad);
126 const label
n = countFaces(
f);
127 for (label i=0; i <
n; ++i)
129 putFireLabel(os, fireTri);
138 os <<
' ' << fireQuad;
142 const label
n = countFaces(
f);
143 for (label i=0; i <
n; ++i)
145 os <<
' ' << fireTri;
164 <<
"bad output state "
176 ? surfaceFormatsCore::oneZone(faceLst, word::null)
180 const bool useFaceMap = (surf.
useFaceMap() && zones.size() > 1);
195 for (label nLocal =
zone.size(); nLocal--; ++faceIndex)
198 (useFaceMap ?
faceMap[faceIndex] : faceIndex);
200 const Face&
f = faceLst[facei];
202 selCount += countFaces(
f);
205 zoneCount[zonei] = selCount;
218 putFireLabel(os, pointLst.
size());
221 for (
const point& pt : pointLst)
224 putFirePoint(os, pt);
231 putFireLabel(os, nFaces);
237 for (label nLocal =
zone.size(); nLocal--; ++faceIndex)
240 (useFaceMap ?
faceMap[faceIndex] : faceIndex);
242 const Face&
f = faceLst[facei];
254 putFireLabel(os, nFaces);
260 for (label nLocal =
zone.size(); nLocal--; ++faceIndex)
263 (useFaceMap ?
faceMap[faceIndex] : faceIndex);
265 const Face&
f = faceLst[facei];
276 putFireLabel(os, zones.size());
283 const label selCount = zoneCount[zonei];
286 putFireLabel(os,
static_cast<int>(FIRECore::cellSelection));
289 putFireLabels(os, selCount, faceIndex);
290 faceIndex += selCount;
316 if (comp == IOstream::COMPRESSED)
323 Foam::mv(filename +
".gz", filename);
329 <<
"Cannot write file " << filename <<
nl
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
A class for handling file names.
bool useFaceMap() const
Can/should use faceMap?
Base class for mesh zones.
streamFormat format() const noexcept
Get the current stream format.
const pointField & points() const
Return const access to the points.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
const labelUList & faceMap() const
Const access to the faceMap, zero-sized when unused.
#define forAll(list, i)
Loop across all elements in list.
messageStream Info
Information stream (uses stdout - output is on the master only)
The IOstreamOption is a simple container for options an IOstream can normally have.
Generic output stream using a standard (STL) stream.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool mv(const fileName &src, const fileName &dst, const bool followLink=false)
Rename src to dst.
const word & name() const
Return name.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Output to file stream, using an OSstream.
virtual int precision() const
Get precision of output field.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A surface zone on a MeshedSurface.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
void clear() noexcept
Same as reset(nullptr)
void size(const label n) noexcept
Override size to be inconsistent with allocated storage.
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
const UList< Face > & surfFaces() const
Return const access to the faces.
bool good() const
Return true if next operation might succeed.
const UList< surfZone > & surfZones() const
Const access to the surface zones.