50 fileExtension_(fileExt),
62 fileExtension_(fileExt),
118 const word& writeType,
138 if (fileExtension_.empty())
146 if (useTimeDir() && !
timeName().empty())
149 outputFile = outputPath_.
path() /
timeName() / outputPath_.name();
151 outputFile.
ext(fileExtension_);
155 Info<<
"Writing geometry to " << outputFile <<
endl;
159 const meshedSurfRef& surf = adjustSurface();
168 MeshedSurfaceProxy<face>(surf.points(), surf.faces()).write
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
A simple container for options an IOstream can normally have.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
static bool canWriteType(const word &fileType, bool verbose=false)
Can this file format type be written via MeshedSurfaceProxy?
static void write(const fileName &name, const MeshedSurfaceProxy &surf, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null)
Write to file, select based on its extension.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
static const fileName null
An empty fileName.
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 /).
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?
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 that writes the geometry via the MeshedSurfaceProxy, but which does not support any f...
static autoPtr< surfaceWriter > TryNew(const word &writeType)
Optional select construct proxy writer.
proxyWriter(const word &fileExt)
Construct for a given extension.
virtual fileName write()
Write surface geometry to file.
A class for handling words, derived from Foam::string.
#define defineTypeName(Type)
Define the typeName.
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.
messageStream Info
Information stream (stdout output on master, null elsewhere).
List< face > faceList
List of faces.
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?
Convenience macros for instantiating surfaceWriter methods.
#define defineSurfaceWriterWriteFields(ThisClass)