86 Info<<
"faces: " << faces.size() <<
endl;
115bool Foam::fileFormats::FIREMeshWriter::writeSelections(OSstream&
os)
const
129 forAll(mesh_.boundaryMesh(), patchI)
131 const polyPatch&
patch = mesh_.boundaryMesh()[patchI];
132 if (
patch.size() && !isA<processorPolyPatch>(patch))
136 const word oldName =
patch.name();
140 newName =
"BND_" + oldName;
142 if (usedPatchNames.found(newName))
151 if (usedPatchNames.found(newName))
157 usedPatchNames.set(newName);
164 forAll(mesh_.cellZones(), zoneI)
166 const cellZone& cZone = mesh_.cellZones()[zoneI];
171 const word oldName = cZone.name();
172 word newName = oldName;
174 if (usedPatchNames.found(newName) || usedZoneNames.found(newName))
179 usedZoneNames.set(newName);
180 zoneNames.set(zoneI, newName);
193 forAll(mesh_.cellZones(), zoneI)
195 const cellZone& cZone = mesh_.cellZones()[zoneI];
199 Info<<
"cellZone " << zoneI
200 <<
" (size: " << cZone.size()
201 <<
") name: " << zoneNames[zoneI] <<
nl;
203 putFireString(
os, zoneNames[zoneI]);
207 putFireLabels(
os, cZone);
213 forAll(mesh_.boundaryMesh(), patchI)
215 const polyPatch&
patch = mesh_.boundaryMesh()[patchI];
216 if (
patch.size() && !isA<processorPolyPatch>(patch))
218 Info<<
"patch " << patchI
219 <<
" (start: " <<
patch.start() <<
" size: " <<
patch.size()
243 const scalar scaleFactor
254 bool useBinary = binary;
255 bool useCompress = compress;
258 if (baseName.empty())
275 const word ext(baseName.
ext());
327 Info<<
"Writing output to ";
331 Info<<
'"' << osPtr().name().c_str() <<
"z\"" <<
endl;
339 writeSelections(osPtr());
347 Foam::mv(filename +
".gz", filename +
"z");
352 Info<<
"could not open file for writing " << filename <<
endl;
@ UNCOMPRESSED
compression = false
@ COMPRESSED
compression = true
static const versionNumber currentVersion
The current version number (2.0)
bool good() const noexcept
True if next operation might succeed.
Output to file stream, using an OSstream.
Generic output stream using a standard (STL) stream.
virtual int precision() const
Get precision of output field.
const word & constant() const
Return constant name.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static word timeName(const scalar t, const int precision=precision_)
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.
void writeGeometry()
Write the mesh.
A class for handling file names.
fileName lessExt() const
Return file name without extension (part before last .)
word ext() const
Return file name extension (part after last .)
virtual bool write()
Write the output fields.
Write OpenFOAM meshes and/or results to another CFD format.
scalar scaleFactor_
Scaling factor for points (eg, [m] -> [mm])
static string defaultMeshName
Specify a default mesh name.
const polyMesh & mesh_
Mesh reference.
const Time & time() const noexcept
Return time registry.
Mesh consisting of general polyhedral cells.
virtual const faceList & faces() const
Return raw faces.
virtual const pointField & points() const
Return raw points.
const cellList & cells() const
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
const std::string patch
OpenFOAM patch number as a std::string.
List< cell > cellList
A List of cells.
messageStream Info
Information stream (stdout output on master, null elsewhere)
vectorField pointField
pointField is a vectorField.
Ostream & endl(Ostream &os)
Add newline and flush stream.
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
bool mv(const fileName &src, const fileName &dst, const bool followLink=false)
Rename src to dst.
List< face > faceList
A List of faces.
constexpr char nl
The newline '\n' character (0x0a)
wordList patchNames(nPatches)
#define forAll(list, i)
Loop across all elements in list.