63 precision_(
IOstream::defaultPrecision()),
81 options.getOrDefault(
"precision",
IOstream::defaultPrecision())
83 writeNormal_(options.getOrDefault(
"normal", false))
97 open(surf, outputPath, parallel);
130 outputFile.
ext(
"raw");
134 Info<<
"Writing geometry to " << outputFile <<
endl;
144 const faceList& faces = surf.faces();
145 const bool withFaceNormal = (writeNormal_ && !this->
isPointData());
152 OFstream
os(outputFile, streamOpt_);
153 os.precision(precision_);
157 os <<
"# geometry NO_DATA " << faces.size() <<
nl;
167 for (
const face&
f : faces)
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A simple container for options an IOstream can normally have.
An IOstream is an abstract base class for all input/output systems; be they streams,...
Output to file stream as an OSstream, normally using std::ofstream for the actual output.
void size(const label n)
Older name for setAddressableSize.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A face is a list of labels corresponding to mesh vertices.
A class for handling file names.
word ext() const
Return file name extension (part after last .).
static std::string path(const std::string &str)
Return directory path name (part before last /).
static std::string name(const std::string &str)
Return basename (part beyond last /), including its extension.
Implements a meshed surface by referencing another meshed surface or faces/points components.
virtual const pointField & points() const
The points used for the surface.
virtual const faceList & faces() const
The faces used for the surface.
Abstract definition of a meshed surface defined by faces and points.
Base class for surface writers.
surfaceWriter()
Default construct.
virtual void open(const fileName &outputPath)
Open for output on specified path, using existing surface.
bool wroteGeom_
Track if geometry has been written since the last open.
bool useTimeDir() const noexcept
Should a time directory be spliced into the output path?
bool isPointData() const noexcept
Are the field data to be treated as point data?
const word & timeName() const
The current time value/name.
void checkOpen() const
Verify that the outputPath_ has been set or FatalError.
bool parallel_
Writing in parallel (via master).
bool empty() const
The surface to write is empty if the global number of faces is zero.
bool verbose_
Additional output verbosity.
const meshedSurfRef & adjustSurface() const
Merge surfaces (if not upToDate) and return merged (parallel) or regular surface (non-parallel) and a...
fileName outputPath_
The full output directory and file (surface) name.
A surfaceWriter for raw output.
rawWriter()
Default construct.
virtual fileName write()
Write surface geometry to file.
A class for handling words, derived from Foam::string.
#define defineTypeName(Type)
Define the typeName.
OBJstream os(runTime.globalPath()/outputName)
Namespace for surface writers.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
static void writePoint(Ostream &os, const point &p)
messageStream Info
Information stream (stdout output on master, null elsewhere).
List< face > faceList
List of faces.
static void writeHeaderArea(Ostream &os)
Ostream & endl(Ostream &os)
Add newline and flush stream.
vectorField pointField
pointField is a vectorField.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
constexpr char nl
The newline '\n' character (0x0a).
Convenience macros for instantiating surfaceWriter methods.
#define defineSurfaceWriterWriteFields(ThisClass)