4 #ifndef DUNE_VTKSEQUENCE_HH
5 #define DUNE_VTKSEQUENCE_HH
19 template<
class Gr
idView >
23 std::string name_,path_,extendpath_;
24 std::vector<double> timesteps_;
27 const std::string& name,
28 const std::string& path,
29 const std::string& extendpath,
32 name_(name), path_(path),
33 extendpath_(extendpath)
45 unsigned int count = timesteps_.size();
46 timesteps_.push_back(time);
52 std::string pvtuName =
BaseType::pwrite(seqName(count), path_,extendpath_,ot);
56 std::ofstream pvdFile;
57 pvdFile.exceptions(std::ios_base::badbit | std::ios_base::failbit |
58 std::ios_base::eofbit);
59 std::string pvdname = name_ +
".pvd";
60 pvdFile.open(pvdname.c_str());
61 pvdFile <<
"<?xml version=\"1.0\"?> \n"
62 <<
"<VTKFile type=\"Collection\" version=\"0.1\" byte_order=\"LittleEndian\"> \n"
64 for (
unsigned int i=0; i<=count; i++)
67 std::string piecepath = concatPaths(path_, extendpath_);
68 std::string fullname =
72 pvdFile <<
"<DataSet timestep=\"" << timesteps_[i]
73 <<
"\" group=\"\" part=\"0\" name=\"\" file=\""
74 << fullname <<
"\"/> \n";
76 pvdFile <<
"</Collection> \n"
77 <<
"</VTKFile> \n" << std::flush;
84 std::string seqName(
unsigned int count)
const
88 n << name_ <<
"-" << std::setw(5) << count;