Skip to content
Snippets Groups Projects
Commit 60777814 authored by Steffen Müthing's avatar Steffen Müthing
Browse files

Merge branch 'feature/vtksequencewriter-checkpoint-support' into 'master'

Add support for checkpointing to VTKSequenceWriter

See merge request !3
parents 02705dba bda8b3fe
No related branches found
No related tags found
1 merge request!3Add support for checkpointing to VTKSequenceWriter
......@@ -39,13 +39,15 @@ namespace Dune {
* piece as well as the parallel collection file.
*/
VTKSequenceWriter ( std::shared_ptr<VTKWriter<GridView> > vtkWriter,
const std::string& name )
const std::string& name,
const std::vector<double>& timesteps = std::vector<double>())
: VTKSequenceWriterBase<GridView>(vtkWriter,
name,
"",
"",
vtkWriter->gridView_.comm().rank(),
vtkWriter->gridView_.comm().size())
vtkWriter->gridView_.comm().size(),
timesteps)
{}
/** \brief Constructor with a given VTKWriter or SubsamplingVTKWriter
......@@ -68,13 +70,15 @@ namespace Dune {
VTKSequenceWriter ( std::shared_ptr<VTKWriter<GridView> > vtkWriter,
const std::string& name,
const std::string& path,
const std::string& extendpath )
const std::string& extendpath,
const std::vector<double>& timesteps = std::vector<double>())
: VTKSequenceWriterBase<GridView>(vtkWriter,
name,
path,
extendpath,
vtkWriter->gridView_.comm().rank(),
vtkWriter->gridView_.comm().size())
vtkWriter->gridView_.comm().size(),
timesteps)
{}
/** \brief Constructor creating its own VTKWriter object
......@@ -87,10 +91,12 @@ namespace Dune {
const std::string& name,
const std::string& path,
const std::string& extendpath,
VTK::DataMode dm = VTK::conforming )
VTK::DataMode dm = VTK::conforming,
const std::vector<double>& timesteps = std::vector<double>())
: VTKSequenceWriterBase<GridView>(std::make_shared<VTKWriter<GridView> >(gridView,dm),
name,path,extendpath,
gridView.comm().rank(), gridView.comm().size())
gridView.comm().rank(), gridView.comm().size(),
timesteps)
{}
~VTKSequenceWriter() {}
......
......@@ -47,8 +47,10 @@ namespace Dune {
const std::string& path,
const std::string& extendpath,
int rank,
int size)
int size,
const std::vector<double>& timesteps)
: vtkWriter_(vtkWriter),
timesteps_(timesteps),
name_(name), path_(path),
extendpath_(extendpath),
rank_(rank),
......@@ -141,6 +143,12 @@ namespace Dune {
pvdFile.close();
}
}
const std::vector<double>& timeSteps() const
{
return timesteps_;
}
private:
// create sequence name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment