Go to the documentation of this file.
37 namespace surfaceWriters
67 fmtType_(static_cast<unsigned>(vtk::
formatType::INLINE_BASE64)),
68 precision_(
IOstream::defaultPrecision()),
80 fmtType_(
static_cast<unsigned>(opts.
fmt())),
115 fmtType_ =
static_cast<unsigned>(opts.
fmt());
129 open(surf, outputPath, parallel);
144 open(
points, faces, outputPath, parallel);
203 if (useTimeDir() && !
timeName().empty())
206 outputFile = outputPath_.
path() /
timeName() / outputPath_.name();
212 Info<<
"Writing geometry to " << outputFile <<
endl;
234 writer_->setTime(currTime_);
235 writer_->writeTimeValue();
240 writer_->beginFile(outputPath_.nameLessExt());
243 writer_->writeGeometry();
256 const word& fieldName,
269 const scalar varScale =
271 std::is_integral<Type>::value
273 : fieldScale_.getOrDefault<scalar>(fieldName, 1)
278 Info<<
"Writing field " << fieldName;
279 if (!
equal(varScale, 1))
281 Info<<
" (scaling " << varScale <<
')';
283 Info<<
" to " << outputFile <<
endl;
292 if (this->isPointData())
294 writer_->beginPointData(nFields_);
298 writer_->beginCellData(nFields_);
301 writer_->write(fieldName, tfield());
Encapsulated combinations of output format options. This is primarily useful when defining the output...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
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.
unsigned precision() const
Return the ASCII write precision.
virtual fileName write()
Write surface geometry to file.
virtual const faceList & faces() const =0
The faces used for the surface.
virtual void close()
Finish output, clears backend.
An IOstream is an abstract base class for all input/output systems; be they streams,...
Abstract definition of a meshed surface defined by faces and points.
virtual void beginTime(const Time &t)
Begin time step. Clears existing backend.
static bool master(const label communicator=worldComm)
Am I the master process.
bool legacy() const
True if writer uses legacy file format.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Convenience macros for instantiating surfaceWriter methods.
formatType fmt() const
The output format type.
virtual void endTime()
End a time-step.
addToRunTimeSelectionTable(surfaceWriter, abaqusWriter, word)
A surfaceWriter for VTK legacy (.vtk) or XML (.vtp) format.
formatType
The output format type for file contents.
virtual void beginTime(const Time &t)
Begin a time-step.
bool ascii() const
True if output format is ASCII.
messageStream Info
Information stream (uses stdout - output is on the master only)
virtual void endTime()
End time step. Clears existing backend.
virtual const pointField & points() const =0
The points used for the surface.
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.
XML inline base64, base64Formatter.
word ext() const
Return file name extension (part after last .)
virtual ~vtkWriter()
Destructor. Calls close()
dictionary subOrEmptyDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX, const bool mandatory=false) const
static unsigned int defaultPrecision()
Return the default precision.
Write faces/points (optionally with fields) as a vtp file or a legacy vtk file.
static streamFormat formatEnum(const word &formatName, const streamFormat deflt=streamFormat::ASCII)
defineSurfaceWriterWriteFields(Foam::surfaceWriters::vtkWriter)
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
An instant of time. Contains the time value and name.
virtual void close()
Finish output, performing any necessary cleanup.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
vtkWriter()
Default construct.
word ext() const
File extension for current format type.
bool equal(const T &s1, const T &s2)
Compare two values for equality.
addNamedToRunTimeSelectionTable(surfaceWriter, vtkWriter, word, vtp)