Go to the documentation of this file.
57 bool Foam::fileFormats::FIREMeshWriter::writeGeometry(OSstream&
os)
const
86 Info<<
"faces: " << faces.size() <<
endl;
115 bool 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()
240 Foam::fileFormats::FIREMeshWriter::FIREMeshWriter
243 const scalar scaleFactor
254 bool useBinary = binary;
255 bool useCompress = compress;
258 if (baseName.empty())
275 const word ext(baseName.
ext());
280 if (fireFileType == FIRECore::fileExt3d::POLY_ASCII)
285 else if (fireFileType == FIRECore::fileExt3d::POLY_BINARY)
290 else if (fireFileType == FIRECore::fileExt3d::POLY_ASCII_Z)
295 else if (fireFileType == FIRECore::fileExt3d::POLY_BINARY_Z)
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;
vectorField pointField
pointField is a vectorField.
virtual const pointField & points() const
Return raw points.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
A class for handling file names.
static word timeName(const scalar t, const int precision=precision_)
const cellList & cells() const
static const versionNumber currentVersion
The current version number (2.0)
Ostream & endl(Ostream &os)
Add newline and flush stream.
fileName lessExt() const
Return file name without extension (part before last .)
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
messageStream Info
Information stream (stdout output on master, null elsewhere)
List< cell > cellList
A List of cells.
scalar scaleFactor_
Scaling factor for points (eg, [m] -> [mm])
bool good() const noexcept
True if the managed pointer is non-null.
Generic output stream using a standard (STL) stream.
wordList patchNames(nPatches)
bool mv(const fileName &src, const fileName &dst, const bool followLink=false)
Rename src to dst.
OBJstream os(runTime.globalPath()/outputName)
word ext() const
Return file name extension (part after last .)
const polyMesh & mesh_
Mesh reference.
Output to file stream, using an OSstream.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
virtual const faceList & faces() const
Return raw faces.
static string defaultMeshName
Specify a default mesh name.
const std::string patch
OpenFOAM patch number as a std::string.
List< face > faceList
A List of faces.
void clear() noexcept
Same as reset(nullptr)
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.
const word & constant() const
Return constant name.
const Time & time() const noexcept
Return time registry.
Write OpenFOAM meshes and/or results to another CFD format.