50#ifndef Foam_vtk_fileWriter_H
51#define Foam_vtk_fileWriter_H
191 const
word& fieldName,
201 const
word& fieldName,
278 virtual
bool beginFile(std::
string title =
"");
351#include "foamVtkFileWriterI.H"
354 #include "foamVtkFileWriter.txx"
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,...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Inter-processor communications stream.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A class for handling file names.
bool enter_Piece()
Trigger change state to Piece. Resets nCellData_, nPointData_.
bool enter_CellData(label nEntries, label nFields)
Trigger change state to CellData.
bool isCellData() const noexcept
True if output state corresponds to CELL_DATA.
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 writeProcIDs(const label nValues)
Write nValues of processor ids as CellData or PointData (no-op in serial).
Ostream & reportBadState(Ostream &, outputState, outputState) const
Generate message reporting bad writer state.
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.
bool isPointData() const noexcept
True if output state corresponds to POINT_DATA.
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
The number of PointData written for the Piece thus far.
label nCellData() const noexcept
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.
Ostream & reportBadState(Ostream &, outputState expected) const
Generate message reporting bad writer 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=UPstream::parRun())
Open file for writing (creates parent directory).
virtual bool writeGeometry()=0
Write mesh topology.
fileWriter(const fileWriter &)=delete
No copy construct.
outputState
Internal tracking of the output state.
@ FIELD_DATA
Inside FieldData.
@ DECLARED
File contents declared (VTKFile header written).
@ CELL_DATA
Inside CellData.
@ PIECE
Inside Piece (after geometry write).
@ POINT_DATA
Inside PointData.
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.
virtual bool beginFile(std::string title="")
Write file header (non-collective).
Encapsulated combinations of output format options. This is primarily useful when defining the output...
A class for handling words, derived from Foam::string.
Namespace for handling VTK output. Contains classes and functions for writing VTK file content.
fileTag
Some common XML tags for vtk files.