50#ifndef Foam_vtk_fileWriter_H
51#define Foam_vtk_fileWriter_H
146 const
word& fieldName,
190 const
word& fieldName,
200 const
word& fieldName,
276 virtual
bool beginFile(std::
string title = "");
343#include "foamVtkFileWriterI.H"
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Inter-processor communications stream.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A class for handling file names.
Base class for VTK output writers that handle geometry and fields (eg, vtp, vtu data)....
bool enter_Piece()
Trigger change state to Piece. Resets nCellData_, nPointData_.
bool enter_CellData(label nEntries, label nFields)
Trigger change state to CellData.
static const Enum< outputState > stateNames
Names for the output state (for messages, not for file output).
vtk::fileTag contentType() const noexcept
The content type.
bool isState(outputState test) const noexcept
True if output state corresponds to the test state.
fileName outputFile_
The output file name.
virtual bool beginPointData(label nFields=0)=0
Begin PointData for specified number of fields.
void writeUniform(const word &fieldName, const Type &val, const label nValues)
Write uniform field content.
vtk::outputOptions opts() const noexcept
The output options in use.
const word & state() const
The output state in printable format.
void beginPoints(const label nPoints)
Start of a POINTS DataArray.
bool legacy() const noexcept
Commonly used query.
virtual bool beginCellData(label nFields=0)=0
Begin CellData output section for specified number of fields.
const fileName & output() const noexcept
The current output file name.
bool endCellData()
Explicitly end CellData output and switch to PIECE state.
label nPointData() const noexcept
Return the number of PointData written for the Piece thus far.
label nCellData() const noexcept
Return the number of CellData written for the Piece thus far.
autoPtr< vtk::formatter > format_
The VTK formatter in use (only valid on master process)
std::ofstream & os() noexcept
The backend ostream in use.
void close()
End the file contents and close the file after writing.
bool parallel_
Parallel writing (via master)
void endPoints()
End of a POINTS DataArray.
void checkFormatterValidity() const
Verify that formatter in either allocated or not required.
void endDataArray()
Flush formatter and end of DataArray output (non-legacy)
bool exit_File()
Emit file footer (end data, end piece, end file)
bool parallel() const noexcept
Parallel output requested?
bool enter_PointData(label nEntries, label nFields)
Trigger change state to PointData.
void beginDataArray(const word &fieldName, const label nValues)
Start of a field or DataArray output (legacy or non-legacy).
void writeBasicField(const word &fieldName, const UList< Type > &field)
Write basic (primitive) field content.
label nCellData_
The number of CellData written for the Piece thus far.
bool endFieldData()
Explicitly end FieldData output and switch to DECLARED state.
bool endPointData()
Explicitly end PointData output and switch to PIECE state.
outputState state_
The output state.
void writeTimeValue(scalar timeValue)
Write "TimeValue" FieldData (name as per Catalyst output)
bool beginFieldData(label nFields=0)
Begin FieldData output section for specified number of fields.
bool notState(outputState test) const noexcept
True if output state does not correspond to the test state.
word ext() const
File extension for current format type.
label nPointData_
The number of PointData written for the Piece thus far.
vtk::outputOptions opts_
Requested output options.
std::ofstream os_
The backend ostream in use (only opened on master process)
virtual bool open(const fileName &file, bool parallel=Pstream::parRun())
Open file for writing (creates parent directory).
virtual bool beginFile(std::string title="")
Write file header (non-collective)
virtual bool writeGeometry()=0
Write mesh topology.
outputState
Internal tracking of the output state.
@ FIELD_DATA
Inside FieldData.
@ DECLARED
File contents declared (VTKFile header written)
@ POINT_DATA
Inside PointData.
@ CELL_DATA
Inside CellData.
@ PIECE
Inside Piece (after geometry write)
Ostream & reportBadState(Ostream &, outputState expected) const
Generate message reporting bad writer state.
bool endPiece()
Explicitly end Piece output and switch to DECLARED state.
vtk::fileTag contentType_
The content type (PolyData, UnstructuredGrid ...)
vtk::formatter & format()
The VTK formatter in use. FatalError for off-processor.
Encapsulated combinations of output format options. This is primarily useful when defining the output...
A class for handling words, derived from Foam::string.
fileTag
Some common XML tags for vtk files.