Go to the documentation of this file.
39 namespace surfaceWriters
83 open(surf, outputPath, parallel);
98 open(
points, faces, outputPath, parallel);
112 if (useTimeDir() && !
timeName().empty())
115 surfaceDir = outputPath_.
path() /
timeName() / outputPath_.name();
120 Info<<
"Writing geometry to " << surfaceDir <<
endl;
131 if (!
isDir(surfaceDir))
140 OFstream(surfaceDir/
"faces", streamOpt_)() << faces;
149 faceCentres[facei] = faces[facei].centre(
points);
152 OFstream(surfaceDir/
"faceCentres", streamOpt_)() << faceCentres;
165 const word& fieldName,
184 if (useTimeDir() && !
timeName().empty())
187 surfaceDir = outputPath_.
path() /
timeName() / outputPath_.name();
201 const scalar varScale =
203 std::is_integral<Type>::value
205 : fieldScale_.getOrDefault<scalar>(fieldName, 1)
210 Info<<
"Writing field " << fieldName;
211 if (!
equal(varScale, 1))
213 Info<<
" (scaling " << varScale <<
')';
215 Info<<
" to " << surfaceDir <<
endl;
230 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.
defineTypeName(abaqusWriter)
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.
static bool master(const label communicator=worldComm)
Am I the master process.
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.
addToRunTimeSelectionTable(surfaceWriter, abaqusWriter, word)
messageStream Info
Information stream (stdout output on master, null elsewhere)
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.
dictionary subOrEmptyDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX, const bool mandatory=false) const
static const char *const typeName
Typename for Field.
Output to file stream, using an OSstream.
static streamFormat formatEnum(const word &formatName, const streamFormat deflt=streamFormat::ASCII)
A traits class, which is primarily used 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 equal(const T &s1, const T &s2)
Compare two values for equality.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?