Go to the documentation of this file.
39 namespace surfaceWriters
55 os <<
p.x() <<
' ' <<
p.y() <<
' ' <<
p.z();
92 geometryScale_(options.
getOrDefault<scalar>(
"scale", 1)),
107 open(surf, outputPath, parallel);
122 open(
points, faces, outputPath, parallel);
135 if (useTimeDir() && !
timeName().empty())
138 outputFile = outputPath_.
path() /
timeName() / outputPath_.name();
140 outputFile.
ext(
"raw");
144 Info<<
"Writing geometry to " << outputFile <<
endl;
160 OFstream os(outputFile, streamOpt_);
164 os <<
"# geometry NO_DATA " << faces.size() <<
nl
169 for (
const face&
f : faces)
171 writePoint(os,
f.centre(
points)*geometryScale_);
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
Base class for surface writers.
A class for handling file names.
static std::string path(const std::string &str)
Return directory path name (part before last /)
virtual const faceList & faces() const =0
The faces used for the surface.
Abstract definition of a meshed surface defined by faces and points.
defineTypeName(boundaryDataWriter)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Convenience macros for instantiating surfaceWriter methods.
messageStream Info
Information stream (uses stdout - output is on the master only)
virtual const pointField & points() const =0
The points used for the surface.
A surfaceWriter for raw output.
static compressionType compressionEnum(const word &compName, const compressionType deflt=compressionType::UNCOMPRESSED)
The compression enum corresponding to the string.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
word ext() const
Return file name extension (part after last .)
dictionary subOrEmptyDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX, const bool mandatory=false) const
Output to file stream, using an OSstream.
static bool master(const label communicator=0)
Am I the master process.
addToRunTimeSelectionTable(surfaceWriter, boundaryDataWriter, word)
rawWriter()
Default construct.
defineSurfaceWriterWriteFields(Foam::surfaceWriters::rawWriter)
A face is a list of labels corresponding to mesh vertices.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual fileName write()
Write surface geometry to file.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?