dune-vtk 2.8
Loading...
Searching...
No Matches
Public Member Functions | Protected Types | Protected Attributes | List of all members
Dune::VtkTimeseriesWriter< VtkWriter > Class Template Reference

File-Writer for Vtk timeseries .vtu files. More...

#include <dune/vtk/vtktimeserieswriter.hh>

Inheritance diagram for Dune::VtkTimeseriesWriter< VtkWriter >:
Inheritance graph

Public Member Functions

template<class... Args, disableCopyMove< Self, Args... > = 0>
 VtkTimeseriesWriter (Args &&... args)
 Constructor, stores the gridView. More...
 
 ~VtkTimeseriesWriter ()
 Remove all written intermediate files and remove temporary directory. More...
 
void writeTimestep (double time, std::string const &fn, std::optional< std::string > tmpDir={}, bool writeCollection=true) const
 Write the attached data to the file. More...
 
virtual std::string write (std::string const &fn, std::optional< std::string > dir={}) const override
 Writes all timesteps to single timeseries file. More...
 
template<class Function , class... Args>
VtkTimeseriesWriteraddPointData (Function const &fct, Args &&... args)
 Attach point data to the writer,. More...
 
template<class Function , class... Args>
VtkTimeseriesWriteraddCellData (Function const &fct, Args &&... args)
 Attach cell data to the writer,. More...
 

Protected Types

using Self = VtkTimeseriesWriter
 
using pos_type = typename std::ostream::pos_type
 
template<class W >
using HasWriteTimeseriesSerialFile = decltype(&W::writeTimeseriesSerialFile)
 
template<class W >
using HasWriteTimeseriesParallelFile = decltype(&W::writeTimeseriesParallelFile)
 

Protected Attributes

VtkWriter vtkWriter_
 
Vtk::Path tmpDir_
 
bool initialized_ = false
 
std::vector< std::uint64_t > blocks_
 
std::string filenameMesh_
 
std::vector< std::pair< double, std::string > > timesteps_
 

Detailed Description

template<class VtkWriter>
class Dune::VtkTimeseriesWriter< VtkWriter >

File-Writer for Vtk timeseries .vtu files.

Template Parameters
VtkWriterType of a FileWriter derived from VtkWriterInterface that additionally supports writeTimeseriesSerialFile() and writeTimeseriesParallelFile(), e.g. VtkUnstructuredGridWriter.

Member Typedef Documentation

◆ HasWriteTimeseriesParallelFile

template<class VtkWriter >
template<class W >
using Dune::VtkTimeseriesWriter< VtkWriter >::HasWriteTimeseriesParallelFile = decltype(&W::writeTimeseriesParallelFile)
protected

◆ HasWriteTimeseriesSerialFile

template<class VtkWriter >
template<class W >
using Dune::VtkTimeseriesWriter< VtkWriter >::HasWriteTimeseriesSerialFile = decltype(&W::writeTimeseriesSerialFile)
protected

◆ pos_type

template<class VtkWriter >
using Dune::VtkTimeseriesWriter< VtkWriter >::pos_type = typename std::ostream::pos_type
protected

◆ Self

template<class VtkWriter >
using Dune::VtkTimeseriesWriter< VtkWriter >::Self = VtkTimeseriesWriter
protected

Constructor & Destructor Documentation

◆ VtkTimeseriesWriter()

template<class VtkWriter >
template<class... Args, disableCopyMove< Self, Args... > = 0>
Dune::VtkTimeseriesWriter< VtkWriter >::VtkTimeseriesWriter ( Args &&...  args)
inline

Constructor, stores the gridView.

◆ ~VtkTimeseriesWriter()

Remove all written intermediate files and remove temporary directory.

Member Function Documentation

◆ addCellData()

template<class VtkWriter >
template<class Function , class... Args>
VtkTimeseriesWriter & Dune::VtkTimeseriesWriter< VtkWriter >::addCellData ( Function const &  fct,
Args &&...  args 
)
inline

Attach cell data to the writer,.

See also
Vtk::Function for possible arguments

◆ addPointData()

template<class VtkWriter >
template<class Function , class... Args>
VtkTimeseriesWriter & Dune::VtkTimeseriesWriter< VtkWriter >::addPointData ( Function const &  fct,
Args &&...  args 
)
inline

Attach point data to the writer,.

See also
VtkFunction for possible arguments

◆ write()

template<class W >
std::string Dune::VtkTimeseriesWriter< W >::write ( std::string const &  fn,
std::optional< std::string >  dir = {} 
) const
overridevirtual

Writes all timesteps to single timeseries file.

Create a timeseries file with all timesteps written by writeTimestep.

Parameters
fnFilename of the Timeseries file. May contain a directory and any file extension.
dirThe optional parameter specifies the directory of the partition files.
Returns
File name of the actual written file

Implements Dune::Vtk::FileWriter.

◆ writeTimestep()

template<class W >
void Dune::VtkTimeseriesWriter< W >::writeTimestep ( double  time,
std::string const &  fn,
std::optional< std::string >  tmpDir = {},
bool  writeCollection = true 
) const

Write the attached data to the file.

Create intermediate files for the data associated to the current timestep time.

Parameters
timeThe time value of the written data
fnFilename of the file to write to. Only the base part (without dir and extentsion) is used to write the intermediate file into a tmp directory.
tmpDirIf the directory is given, it is used as tmp dir, otherwise /tmp.
writeCollectionCreate a timeseries file directly

Member Data Documentation

◆ blocks_

template<class VtkWriter >
std::vector<std::uint64_t> Dune::VtkTimeseriesWriter< VtkWriter >::blocks_
mutableprotected

◆ filenameMesh_

template<class VtkWriter >
std::string Dune::VtkTimeseriesWriter< VtkWriter >::filenameMesh_
mutableprotected

◆ initialized_

template<class VtkWriter >
bool Dune::VtkTimeseriesWriter< VtkWriter >::initialized_ = false
mutableprotected

◆ timesteps_

template<class VtkWriter >
std::vector<std::pair<double, std::string> > Dune::VtkTimeseriesWriter< VtkWriter >::timesteps_
mutableprotected

◆ tmpDir_

template<class VtkWriter >
Vtk::Path Dune::VtkTimeseriesWriter< VtkWriter >::tmpDir_
protected

◆ vtkWriter_

template<class VtkWriter >
VtkWriter Dune::VtkTimeseriesWriter< VtkWriter >::vtkWriter_
protected

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