44inline 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)
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);
237 for (label nLocal =
zone.
size(); nLocal--; ++faceIndex)
240 (useFaceMap ?
faceMap[faceIndex] : faceIndex);
242 const Face&
f = faceLst[facei];
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
The IOstreamOption is a simple container for options an IOstream can normally have.
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
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.
Output to file stream, using an OSstream.
Generic output stream using a standard (STL) stream.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
void size(const label n)
Older name for setAddressableSize.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
void clear() noexcept
Same as reset(nullptr)
bool good() const noexcept
True if the managed pointer is non-null.
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.
writeType
Enumeration for what to write. Used as a bit-pattern.
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 nFaces(UPstream::listGatherValues< label >(aMesh.nFaces()))
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool mv(const fileName &src, const fileName &dst, const bool followLink=false)
Rename src to dst.
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.