Ewoms::VtkMultiWriter< GridView, vtkFormat > Class Template Reference

Simplifies writing multi-file VTK datasets. More...

#include <vtkmultiwriter.hh>

Inheritance diagram for Ewoms::VtkMultiWriter< GridView, vtkFormat >:
Inheritance graph

Public Types

typedef BaseOutputWriter::Scalar Scalar
 
typedef BaseOutputWriter::Vector Vector
 
typedef BaseOutputWriter::Tensor Tensor
 
typedef
BaseOutputWriter::ScalarBuffer 
ScalarBuffer
 
typedef
BaseOutputWriter::VectorBuffer 
VectorBuffer
 
typedef
BaseOutputWriter::TensorBuffer 
TensorBuffer
 
typedef Dune::VTKWriter< GridView > VtkWriter
 

Public Member Functions

 VtkMultiWriter (const GridView &gridView, const std::string &simName="", std::string multiFileName="")
 
 ~VtkMultiWriter ()
 
int curWriterNum () const
 Returns the number of the current VTK file. More...
 
void gridChanged ()
 Updates the internal data structures after mesh refinement. More...
 
void beginWrite (double t)
 Called whenever a new time step must be written. More...
 
ScalarBufferallocateManagedScalarBuffer (int numEntities)
 Allocate a managed buffer for a scalar field. More...
 
VectorBufferallocateManagedVectorBuffer (int numOuter, int numInner)
 Allocate a managed buffer for a vector field. More...
 
void attachScalarVertexData (ScalarBuffer &buf, std::string name)
 Add a finished vertex centered vector field to the output. More...
 
void attachScalarElementData (ScalarBuffer &buf, std::string name)
 Add a element centered quantity to the output. More...
 
void attachVectorVertexData (VectorBuffer &buf, std::string name)
 Add a finished vertex centered vector field to the output. More...
 
void attachTensorVertexData (TensorBuffer &buf, std::string name)
 Add a finished vertex-centered tensor field to the output. More...
 
void attachVectorElementData (VectorBuffer &buf, std::string name)
 Add a element centered quantity to the output. More...
 
void attachTensorElementData (TensorBuffer &buf, std::string name)
 Add a finished element-centered tensor field to the output. More...
 
void endWrite (bool onlyDiscard=false)
 Finalizes the current writer. More...
 
template<class Restarter >
void serialize (Restarter &res)
 Write the multi-writer's state to a restart file. More...
 
template<class Restarter >
void deserialize (Restarter &res)
 Read the multi-writer's state from a restart file. More...
 

Detailed Description

template<class GridView, int vtkFormat>
class Ewoms::VtkMultiWriter< GridView, vtkFormat >

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.)

Member Typedef Documentation

template<class GridView , int vtkFormat>
typedef BaseOutputWriter::Scalar Ewoms::VtkMultiWriter< GridView, vtkFormat >::Scalar
template<class GridView , int vtkFormat>
typedef BaseOutputWriter::ScalarBuffer Ewoms::VtkMultiWriter< GridView, vtkFormat >::ScalarBuffer
template<class GridView , int vtkFormat>
typedef BaseOutputWriter::Tensor Ewoms::VtkMultiWriter< GridView, vtkFormat >::Tensor
template<class GridView , int vtkFormat>
typedef BaseOutputWriter::TensorBuffer Ewoms::VtkMultiWriter< GridView, vtkFormat >::TensorBuffer
template<class GridView , int vtkFormat>
typedef BaseOutputWriter::Vector Ewoms::VtkMultiWriter< GridView, vtkFormat >::Vector
template<class GridView , int vtkFormat>
typedef BaseOutputWriter::VectorBuffer Ewoms::VtkMultiWriter< GridView, vtkFormat >::VectorBuffer
template<class GridView , int vtkFormat>
typedef Dune::VTKWriter<GridView> Ewoms::VtkMultiWriter< GridView, vtkFormat >::VtkWriter

Constructor & Destructor Documentation

template<class GridView , int vtkFormat>
Ewoms::VtkMultiWriter< GridView, vtkFormat >::VtkMultiWriter ( const GridView &  gridView,
const std::string &  simName = "",
std::string  multiFileName = "" 
)
inline
template<class GridView , int vtkFormat>
Ewoms::VtkMultiWriter< GridView, vtkFormat >::~VtkMultiWriter ( )
inline

Member Function Documentation

template<class GridView , int vtkFormat>
ScalarBuffer* Ewoms::VtkMultiWriter< GridView, vtkFormat >::allocateManagedScalarBuffer ( int  numEntities)
inline

Allocate a managed buffer for a scalar field.

The buffer will be deleted automatically after the data has been written by to disk.

Referenced by Ewoms::FvBaseDiscretization< TypeTag >::addConvergenceVtkFields(), and Ewoms::StokesModel< TypeTag >::appendOutputFields().

template<class GridView , int vtkFormat>
VectorBuffer* Ewoms::VtkMultiWriter< GridView, vtkFormat >::allocateManagedVectorBuffer ( int  numOuter,
int  numInner 
)
inline

Allocate a managed buffer for a vector field.

The buffer will be deleted automatically after the data has been written by to disk.

Referenced by Ewoms::StokesModel< TypeTag >::appendOutputFields().

template<class GridView , int vtkFormat>
void Ewoms::VtkMultiWriter< GridView, vtkFormat >::attachScalarElementData ( ScalarBuffer buf,
std::string  name 
)
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 Ewoms::BaseOutputWriter.

template<class GridView , int vtkFormat>
void Ewoms::VtkMultiWriter< GridView, vtkFormat >::attachScalarVertexData ( ScalarBuffer buf,
std::string  name 
)
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 Ewoms::BaseOutputWriter.

Referenced by Ewoms::StokesModel< TypeTag >::appendOutputFields().

template<class GridView , int vtkFormat>
void Ewoms::VtkMultiWriter< GridView, vtkFormat >::attachTensorElementData ( TensorBuffer buf,
std::string  name 
)
inlinevirtual

Add a finished element-centered tensor field to the output.

Implements Ewoms::BaseOutputWriter.

template<class GridView , int vtkFormat>
void Ewoms::VtkMultiWriter< GridView, vtkFormat >::attachTensorVertexData ( TensorBuffer buf,
std::string  name 
)
inlinevirtual

Add a finished vertex-centered tensor field to the output.

Implements Ewoms::BaseOutputWriter.

template<class GridView , int vtkFormat>
void Ewoms::VtkMultiWriter< GridView, vtkFormat >::attachVectorElementData ( VectorBuffer buf,
std::string  name 
)
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 Ewoms::BaseOutputWriter.

template<class GridView , int vtkFormat>
void Ewoms::VtkMultiWriter< GridView, vtkFormat >::attachVectorVertexData ( VectorBuffer buf,
std::string  name 
)
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 Ewoms::BaseOutputWriter.

Referenced by Ewoms::StokesModel< TypeTag >::appendOutputFields().

template<class GridView , int vtkFormat>
void Ewoms::VtkMultiWriter< GridView, vtkFormat >::beginWrite ( double  t)
inlinevirtual
template<class GridView , int vtkFormat>
int Ewoms::VtkMultiWriter< GridView, vtkFormat >::curWriterNum ( ) const
inline

Returns the number of the current VTK file.

template<class GridView , int vtkFormat>
template<class Restarter >
void Ewoms::VtkMultiWriter< GridView, vtkFormat >::deserialize ( Restarter &  res)
inline

Read the multi-writer's state from a restart file.

Referenced by Ewoms::FvBaseProblem< TypeTag >::deserialize().

template<class GridView , int vtkFormat>
void Ewoms::VtkMultiWriter< GridView, vtkFormat >::endWrite ( bool  onlyDiscard = false)
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 Ewoms::BaseOutputWriter.

Referenced by Ewoms::FvBaseNewtonConvergenceWriter< TypeTag >::endIteration(), and Ewoms::FvBaseProblem< TypeTag >::writeOutput().

template<class GridView , int vtkFormat>
void Ewoms::VtkMultiWriter< GridView, vtkFormat >::gridChanged ( )
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()!

template<class GridView , int vtkFormat>
template<class Restarter >
void Ewoms::VtkMultiWriter< GridView, vtkFormat >::serialize ( Restarter &  res)
inline

Write the multi-writer's state to a restart file.

Referenced by Ewoms::FvBaseProblem< TypeTag >::serialize().


The documentation for this class was generated from the following file: