Go to the documentation of this file.
48 #ifndef foamVtkFileWriter_H
49 #define foamVtkFileWriter_H
120 inline std::ofstream&
os();
136 const word& fieldName,
200 inline bool legacy()
const;
227 virtual bool beginFile(std::string title =
"");
bool enter_Piece()
Trigger change state to Piece. Resets nCellData_, nPointData_.
Encapsulated combinations of output format options. This is primarily useful when defining the output...
bool parallel() const
Parallel output requested?
virtual bool writeGeometry()=0
Write mesh topology.
Base class for VTK output writers that handle geometry and fields (eg, vtp, vtu data)....
void close()
End the file contents and close the file after writing.
A class for handling words, derived from Foam::string.
bool legacy() const
Commonly used query.
A class for handling file names.
vtk::outputOptions opts() const
The output options in use.
bool enter_CellData(label nEntries, label nFields)
Trigger change state to CellData.
fileName outputFile_
The output file name.
bool endCellData()
Explicitly end CellData output and switch to PIECE state.
void writeTimeValue(scalar timeValue)
Write "TimeValue" FieldData (name as per Catalyst output)
virtual bool beginCellData(label nFields=0)=0
Begin CellData output section for specified number of fields.
void writeUniform(const word &fieldName, const Type &val, const label nValues)
Write uniform field content.
static bool & parRun()
Test if this a parallel run, or allow modify access.
vtk::fileTag contentType() const
The content type.
bool beginFieldData(label nFields=0)
Begin FieldData output section for specified number of fields.
bool notState(outputState test) const
True if the output state does not correspond to the test state.
std::ofstream os_
The backend ostream in use (master process)
virtual bool beginFile(std::string title="")
Write file header (non-collective)
std::ofstream & os()
The backend ostream in use.
static const Enum< outputState > stateNames
Names for the output state (for messages, not for file output).
autoPtr< vtk::formatter > format_
The VTK formatter in use (master process)
label nPointData_
The number of PointData written for the Piece thus far.
outputState state_
The output state.
label nPointData() const
Return the number of PointData written for the Piece thus far.
bool open(const fileName &file, bool parallel=Pstream::parRun())
Open file for writing (creates parent directory).
outputOptions opts_
The requested output options.
const fileName & output() const
The current output file name.
fileWriter(const fileWriter &)=delete
No copy construct.
virtual bool beginPointData(label nFields=0)=0
Begin PointData for specified number of fields.
label nCellData() const
Return the number of CellData written for the Piece thus far.
vtk::fileTag contentType_
The content type.
bool enter_PointData(label nEntries, label nFields)
Trigger change state to PointData.
void operator=(const fileWriter &)=delete
No copy assignment.
virtual ~fileWriter()
Destructor.
bool endPiece()
Explicitly end Piece output and switch to DECLARED state.
bool parallel_
Writing in parallel (via master)
File contents declared (VTKFile header written)
bool endPointData()
Explicitly end PointData output and switch to PIECE state.
fileTag
Some common XML tags for vtk files.
const word & state() const
The output state in printable format.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Inside Piece (after geometry write)
bool exit_File()
Emit file footer (end data, end piece, end file)
label nCellData_
The number of CellData written for the Piece thus far.
vtk::formatter & format()
The VTK formatter in use.
outputState
Internal tracking of the output state.
bool endFieldData()
Explicitly end FieldData output and switch to DECLARED state.
bool isState(outputState test) const
True if the output state corresponds to the test state.
word ext() const
File extension for current format type.