Go to the documentation of this file.
37 namespace surfaceWriters
67 fmtType_(static_cast<unsigned>(vtk::
formatType::INLINE_BASE64)),
68 precision_(
IOstream::defaultPrecision()),
79 fmtType_(
static_cast<unsigned>(opts.
fmt())),
96 "precision", {{
"writePrecision", 1806}},
108 if (formatName.size())
122 fmtType_ =
static_cast<unsigned>(opts.
fmt());
136 open(surf, outputPath, parallel);
151 open(
points, faces, outputPath, parallel);
210 if (useTimeDir() && !
timeName().empty())
213 outputFile = outputPath_.
path() /
timeName() / outputPath_.name();
219 Info<<
"Writing geometry to " << outputFile <<
endl;
241 writer_->setTime(currTime_);
242 writer_->writeTimeValue();
247 writer_->beginFile(outputPath_.nameLessExt());
250 writer_->writeGeometry();
263 const word& fieldName,
274 Info<<
"Writing field " << fieldName <<
" to " << outputFile <<
endl;
282 if (this->isPointData())
284 writer_->beginPointData(nFields_);
288 writer_->beginCellData(nFields_);
291 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.
T lookupOrDefaultCompat(const word &keyword, std::initializer_list< std::pair< const char *, int >> compat, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
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.
defineTypeName(boundaryDataWriter)
bool legacy() const
True if writer uses legacy file format.
Ostream & endl(Ostream &os)
Add newline and flush stream.
T lookupOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Convenience macros for instantiating surfaceWriter methods.
formatType fmt() const
The output format type.
virtual void endTime()
End a time-step.
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.
static bool master(const label communicator=0)
Am I the master process.
addToRunTimeSelectionTable(surfaceWriter, boundaryDataWriter, word)
static unsigned int defaultPrecision()
Return the default precision.
static streamFormat formatEnum(const word &formatName)
The stream format enum corresponding to the string.
Write faces/points (optionally with fields) as a vtp file or a legacy vtk file.
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.
vtkWriter()
Construct null.
word ext() const
File extension for current format type.
addNamedToRunTimeSelectionTable(surfaceWriter, vtkWriter, word, vtp)