84 void write (
double time, Dune::VTK::OutputType type = Dune::VTK::ascii)
87 unsigned int count = timesteps_.size();
88 timesteps_.push_back(time);
92 vtkWriter_->write(Dune::concatPaths(path_,seqName(count)),type);
94 vtkWriter_->pwrite(seqName(count), path_,extendpath_,type);
98 std::ofstream pvdFile;
99 pvdFile.exceptions(std::ios_base::badbit | std::ios_base::failbit |
100 std::ios_base::eofbit);
101 std::string pvdname = name_ +
".pvd";
102 pvdFile.open(pvdname.c_str());
103 pvdFile <<
"<?xml version=\"1.0\"?> \n"
104 <<
"<VTKFile type=\"Collection\" version=\"0.1\" byte_order=\"" << Dune::VTK::getEndiannessString() <<
"\"> \n"
105 <<
"<Collection> \n";
106 for (
unsigned int i=0; i<=count; i++)
109 std::string piecepath;
110 std::string fullname;
113 fullname = vtkWriter_->getSerialPieceName(seqName(i), piecepath);
116 piecepath = Dune::concatPaths(path_, extendpath_);
117 fullname = vtkWriter_->getParallelHeaderName(seqName(i), piecepath, size_);
119 pvdFile <<
"<DataSet timestep=\"" << timesteps_[i]
120 <<
"\" group=\"\" part=\"0\" name=\"\" file=\""
121 << fullname <<
"\"/> \n";
123 pvdFile <<
"</Collection> \n"
124 <<
"</VTKFile> \n" << std::flush;