My Project
|
Simplifies writing multi-file VTK datasets. More...
#include <vtkmultiwriter.hh>
Public Types | |
using | Scalar = BaseOutputWriter::Scalar |
using | Vector = BaseOutputWriter::Vector |
using | Tensor = BaseOutputWriter::Tensor |
using | ScalarBuffer = BaseOutputWriter::ScalarBuffer |
using | VectorBuffer = BaseOutputWriter::VectorBuffer |
using | TensorBuffer = BaseOutputWriter::TensorBuffer |
using | VtkWriter = Dune::VTKWriter< GridView > |
using | FunctionPtr = std::shared_ptr< Dune::VTKFunction< GridView > > |
![]() | |
using | Scalar = double |
using | Vector = Dune::DynamicVector< double > |
using | Tensor = Dune::DynamicMatrix< double > |
using | ScalarBuffer = std::vector< Scalar > |
using | VectorBuffer = std::vector< Vector > |
using | TensorBuffer = std::vector< Tensor > |
Public Member Functions | |
VtkMultiWriter (bool asyncWriting, const GridView &gridView, const std::string &outputDir, const std::string &simName="", std::string multiFileName="") | |
int | curWriterNum () const |
Returns the number of the current VTK file. | |
void | gridChanged () |
Updates the internal data structures after mesh refinement. | |
void | beginWrite (double t) |
Called whenever a new time step must be written. | |
ScalarBuffer * | allocateManagedScalarBuffer (size_t numEntities) |
Allocate a managed buffer for a scalar field. | |
VectorBuffer * | allocateManagedVectorBuffer (size_t numOuter, size_t numInner) |
Allocate a managed buffer for a vector field. | |
void | attachScalarVertexData (ScalarBuffer &buf, std::string name) |
Add a finished vertex centered vector field to the output. | |
void | attachScalarElementData (ScalarBuffer &buf, std::string name) |
Add a element centered quantity to the output. | |
void | attachVectorVertexData (VectorBuffer &buf, std::string name) |
Add a finished vertex centered vector field to the output. | |
void | attachTensorVertexData (TensorBuffer &buf, std::string name) |
Add a finished vertex-centered tensor field to the output. | |
void | attachVectorElementData (VectorBuffer &buf, std::string name) |
Add a element centered quantity to the output. | |
void | attachTensorElementData (TensorBuffer &buf, std::string name) |
Add a finished element-centered tensor field to the output. | |
void | endWrite (bool onlyDiscard=false) |
Finalizes the current writer. | |
template<class Restarter > | |
void | serialize (Restarter &res) |
Write the multi-writer's state to a restart file. | |
template<class Restarter > | |
void | deserialize (Restarter &res) |
Read the multi-writer's state from a restart file. | |
Simplifies writing multi-file VTK datasets.
This class automatically keeps the meta file up to date and simplifies writing datasets consisting of multiple files. (i.e. multiple time steps or grid refinements within a time step.)
|
inline |
Allocate a managed buffer for a scalar field.
The buffer will be deleted automatically after the data has been written by to disk.
|
inline |
Allocate a managed buffer for a vector field.
The buffer will be deleted automatically after the data has been written by to disk.
|
inlinevirtual |
Add a element centered quantity to the output.
If the buffer is managed by the VtkMultiWriter, it must have been created using createField() and may not be used by anywhere after calling this method. After the data is written to disk, it will be deleted automatically.
If the buffer is not managed by the MultiWriter, the buffer must exist at least until the call to endWrite() finishes.
In both cases, modifying the buffer between the call to this method and endWrite() results in undefined behaviour.
Implements Opm::BaseOutputWriter.
|
inlinevirtual |
Add a finished vertex centered vector field to the output.
If the buffer is managed by the VtkMultiWriter, it must have been created using allocateManagedBuffer() and may not be used anywhere after calling this method. After the data is written to disk, it will be deleted automatically.
If the buffer is not managed by the MultiWriter, the buffer must exist at least until the call to endWrite() finishes.
In both cases, modifying the buffer between the call to this method and endWrite() results in undefined behavior.
Implements Opm::BaseOutputWriter.
|
inlinevirtual |
Add a finished element-centered tensor field to the output.
Implements Opm::BaseOutputWriter.
|
inlinevirtual |
Add a finished vertex-centered tensor field to the output.
Implements Opm::BaseOutputWriter.
|
inlinevirtual |
Add a element centered quantity to the output.
If the buffer is managed by the VtkMultiWriter, it must have been created using createField() and may not be used by anywhere after calling this method. After the data is written to disk, it will be deleted automatically.
If the buffer is not managed by the MultiWriter, the buffer must exist at least until the call to endWrite() finishes.
In both cases, modifying the buffer between the call to this method and endWrite() results in undefined behaviour.
Implements Opm::BaseOutputWriter.
|
inlinevirtual |
Add a finished vertex centered vector field to the output.
If the buffer is managed by the VtkMultiWriter, it must have been created using allocateManagedBuffer() and may not be used anywhere after calling this method. After the data is written to disk, it will be deleted automatically.
If the buffer is not managed by the MultiWriter, the buffer must exist at least until the call to endWrite() finishes.
In both cases, modifying the buffer between the call to this method and endWrite() results in undefined behavior.
Implements Opm::BaseOutputWriter.
|
inlinevirtual |
Called whenever a new time step must be written.
Implements Opm::BaseOutputWriter.
|
inlinevirtual |
Finalizes the current writer.
This means that everything will be written to disk, except if the onlyDiscard argument is true. In this case only all managed buffers are deleted, but no output is written.
Implements Opm::BaseOutputWriter.
|
inline |
Updates the internal data structures after mesh refinement.
If the grid changes between two calls of beginWrite(), this method must be called before the second beginWrite()!