46 inline int countFaces(
const Face&
f)
48 int n = (
f.size() - 2);
49 return n == 2 ? 1 :
n;
64 if (
os.format() == IOstreamOption::BINARY)
66 if (
f.size() == 3 ||
f.size() == 4)
68 putFireLabel(
os,
f.size());
69 for (
const label verti :
f)
71 putFireLabel(
os, verti);
78 for (label fp1 = 1; fp1 <
f.size() - 1; ++fp1)
80 const label fp2 =
f.fcIndex(fp1);
83 putFireLabel(
os,
f[0]);
84 putFireLabel(
os,
f[fp1]);
85 putFireLabel(
os,
f[fp2]);
92 if (
f.size() == 3 ||
f.size() == 4)
94 os <<
' ' <<
f.size();
95 for (
const label verti :
f)
103 for (label fp1 = 1; fp1 <
f.size() - 1; ++fp1)
105 const label fp2 =
f.fcIndex(fp1);
106 os <<
' ' << 3 <<
' ' 107 <<
f[0] <<
' ' <<
f[fp1] <<
' ' <<
f[fp2]
122 if (
os.format() == IOstreamOption::BINARY)
126 putFireLabel(
os, fireQuad);
130 const label
n = countFaces(
f);
131 for (label i=0; i <
n; ++i)
133 putFireLabel(
os, fireTri);
142 os <<
' ' << fireQuad;
146 const label
n = countFaces(
f);
147 for (label i=0; i <
n; ++i)
149 os <<
' ' << fireTri;
168 <<
"bad output state " 180 ? surfaceFormatsCore::oneZone(faceLst, word::null)
199 for (label nLocal =
zone.
size(); nLocal--; ++faceIndex)
202 (useFaceMap ?
faceMap[faceIndex] : faceIndex);
204 const Face&
f = faceLst[facei];
206 selCount += countFaces(
f);
209 zoneCount[zonei] = selCount;
222 putFireLabel(
os, pointLst.
size());
225 for (
const point& pt : pointLst)
228 putFirePoint(
os, pt);
235 putFireLabel(
os, nFaces);
239 for (
const surfZone& zone : zones)
241 for (label nLocal = zone.size(); nLocal--; ++faceIndex)
244 (useFaceMap ?
faceMap[faceIndex] : faceIndex);
246 const Face&
f = faceLst[facei];
258 putFireLabel(
os, nFaces);
262 for (
const surfZone& zone : zones)
264 for (label nLocal = zone.size(); nLocal--; ++faceIndex)
267 (useFaceMap ?
faceMap[faceIndex] : faceIndex);
269 const Face&
f = faceLst[facei];
280 putFireLabel(
os, zones.size());
286 const surfZone& zone = zones[zonei];
287 const label selCount = zoneCount[zonei];
289 putFireString(
os, zone.name());
290 putFireLabel(
os, static_cast<int>(FIRECore::cellSelection));
293 putFireLabels(
os, selCount, faceIndex);
294 faceIndex += selCount;
305 IOstreamOption::compressionType comp,
306 const fileName& filename,
307 const MeshedSurfaceProxy<Face>& surf
311 autoPtr<OFstream> osPtr
313 new OFstream(filename, IOstreamOption(IOstreamOption::ASCII, comp))
320 if (comp == IOstreamOption::COMPRESSED)
327 Foam::mv(filename +
".gz", filename);
333 <<
"Cannot write file " << filename <<
nl 352 IOstreamOption::UNCOMPRESSED,
370 IOstreamOption::COMPRESSED,
Generic output stream using a standard (STL) stream.
void size(const label n)
Older name for setAddressableSize.
bool mv(const fileName &src, const fileName &dst, const bool followLink=false)
Rename src to dst.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A surface zone on a MeshedSurface.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A simple container for options an IOstream can normally have.
const pointField & points() const noexcept
Return const access to the points.
const labelUList & faceMap() const noexcept
Const access to the faceMap, zero-sized when unused.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
#define forAll(list, i)
Loop across all elements in list.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
bool useFaceMap() const noexcept
Can/should use faceMap?
Base class for mesh zones.
const UList< surfZone > & surfZones() const noexcept
Const access to the surface zones.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
OBJstream os(runTime.globalPath()/outputName)
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats...
vector point
Point is a vector.
messageStream Info
Information stream (stdout output on master, null elsewhere)
const UList< Face > & surfFaces() const noexcept
Return const access to the faces.