Wrong File references in VTKSequenceWriter
The VTKSequenceWriter
should write a .pvd
file containing a collection of timestep files, building a (time) sequence of outputs. Therefore the collection file contains references to the individual timestep. When writing with path
and extendpath
, those file references are wrong:
Dune::VTKWriter<GridView> vtkWriter(gridView);
Dune::VTKSequenceWriter<GridView> seqWriter(stackobject_to_shared_ptr(vtkWriter), "filename", "dir", "subdir");
// attach some data
seqWriter.write(0.0);
Running this code in parallel with 2 procs produces the files
filename.pvd
dir/s0002-filename-00000.pvtu
dir/s0002-filename-00001.pvtu
dir/s0002-filename-00002.pvtu...
dir/subdir/s0002-p0000-filename-00000.vtu
dir/subdir/s0002-p0000-filename-00001.vtu
dir/subdir/s0002-p0000-filename-00002.vtu...
dir/subdir/s0002-p0001-filename-00000.vtu
dir/subdir/s0002-p0001-filename-00001.vtu
dir/subdir/s0002-p0001-filename-00002.vtu...
But the filename.pvd
contains the references
<DataSet timestep="0" group="" part="0" name="" file="dir/subdir/s0002-filename-00000.pvtu"/>
<DataSet timestep="0.1" group="" part="0" name="" file="dir/subdir/s0002-filename-00001.pvtu"/>
<DataSet timestep="0.2" group="" part="0" name="" file="dir/subdir/s0002-filename-00002.pvtu"/>...
The reason is a wrong determination of the path for the piece files in vtksequencewriter.hh:138
:
piecepath = concatPaths(path_, extendpath_);
but it should be
piecepath = path_;
Note also, that in sequential mode (mpiSize == 1 or !HAVE_MPI) the behavior is completely different, since a filenames are created differently. (This is IMHO a very confusing behavior and can not be controlled from outside)