Go to the documentation of this file.
45 inline static int countFaces(
const Face&
f)
47 int n = (
f.size() - 2);
48 return n == 2 ? 1 :
n;
61 if (os.format() == IOstream::BINARY)
63 if (
f.size() == 3 ||
f.size() == 4)
65 putFireLabel(os,
f.size());
66 for (
const label verti :
f)
68 putFireLabel(os, verti);
75 for (
label fp1 = 1; fp1 <
f.size() - 1; ++fp1)
77 const label fp2 =
f.fcIndex(fp1);
80 putFireLabel(os,
f[0]);
81 putFireLabel(os,
f[fp1]);
82 putFireLabel(os,
f[fp2]);
89 if (
f.size() == 3 ||
f.size() == 4)
91 os <<
' ' <<
f.size();
92 for (
const label verti :
f)
100 for (
label fp1 = 1; fp1 <
f.size() - 1; ++fp1)
102 const label fp2 =
f.fcIndex(fp1);
103 os <<
' ' << 3 <<
' '
104 <<
f[0] <<
' ' <<
f[fp1] <<
' ' <<
f[fp2]
119 if (os.format() == IOstream::BINARY)
123 putFireLabel(os, fireQuad);
128 for (
label i=0; i <
n; ++i)
130 putFireLabel(os, fireTri);
139 os <<
' ' << fireQuad;
144 for (
label i=0; i <
n; ++i)
146 os <<
' ' << fireTri;
165 <<
"bad output state "
177 ? surfaceFormatsCore::oneZone(faceLst, word::null)
181 const bool useFaceMap = (surf.
useFaceMap() && zones.size() > 1);
200 selCount += countFaces(faceLst[
faceMap[faceIndex++]]);
207 selCount += countFaces(faceLst[faceIndex++]);
211 zoneCount[zoneI] = selCount;
224 putFireLabel(os, pointLst.
size());
227 for (
const point& pt : pointLst)
230 putFirePoint(os, pt);
237 putFireLabel(os, nFaces);
247 for (
label i=0; i<nLocalFaces; ++i)
249 writeShell(os, faceLst[
faceMap[faceIndex++]]);
254 for (
label i=0; i<nLocalFaces; ++i)
256 writeShell(os, faceLst[faceIndex++]);
267 putFireLabel(os, nFaces);
277 for (
label i=0; i<nLocalFaces; ++i)
279 writeType(os, faceLst[
faceMap[faceIndex++]]);
284 for (
label i=0; i<nLocalFaces; ++i)
286 writeType(os, faceLst[faceIndex++]);
296 putFireLabel(os, zones.size());
303 const label selCount = zoneCount[zoneI];
306 putFireLabel(os,
static_cast<int>(FIRECore::cellSelection));
309 putFireLabels(os, selCount, faceIndex);
310 faceIndex += selCount;
333 IOstream::currentVersion,
348 Foam::mv(filename +
".gz", filename);
354 <<
"Cannot open file for writing " << filename
370 write(
false, filename, surf);
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
A class for handling file names.
bool useFaceMap() const
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.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
messageStream Info
Information stream (uses stdout - output is on the master only)
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
Delete managed object and set pointer to nullptr.
void size(const label n) noexcept
Override size to be inconsistent with allocated storage.
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.