Go to the documentation of this file.
39 namespace surfaceWriters
81 open(surf, outputPath, parallel);
96 open(
points, faces, outputPath, parallel);
110 if (useTimeDir() && !
timeName().empty())
113 surfaceDir = outputPath_.
path() /
timeName() / outputPath_.name();
118 Info<<
"Writing geometry to " << surfaceDir <<
endl;
129 if (!
isDir(surfaceDir))
138 OFstream(surfaceDir/
"faces", streamOpt_)() << faces;
147 faceCentres[facei] = faces[facei].centre(
points);
150 OFstream(surfaceDir/
"faceCentres", streamOpt_)() << faceCentres;
163 const word& fieldName,
182 if (useTimeDir() && !
timeName().empty())
185 surfaceDir = outputPath_.
path() /
timeName() / outputPath_.name();
197 Info<<
"Writing field " << fieldName <<
" to " << surfaceDir <<
endl;
212 OFstream(outputFile, streamOpt_)() << tfield();
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
virtual fileName write()
Write surface geometry to file.
A class for handling words, derived from Foam::string.
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 /)
A class for managing temporary objects.
static constexpr const zero Zero
Global zero (0)
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.
#define forAll(list, i)
Loop across all elements in list.
A surfaceWriter for OpenFOAM surfaces.
foamWriter()
Default construct.
messageStream Info
Information stream (uses stdout - output is on the master only)
virtual const pointField & points() const =0
The points used for the surface.
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.
static const char *const typeName
Typename for Field.
Output to file stream, using an OSstream.
static bool master(const label communicator=0)
Am I the master process.
addToRunTimeSelectionTable(surfaceWriter, boundaryDataWriter, word)
static streamFormat formatEnum(const word &formatName, const streamFormat deflt=streamFormat::ASCII)
Traits class for primitives.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
defineSurfaceWriterWriteFields(Foam::surfaceWriters::foamWriter)
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?