Use correct relative path names in pvd file.

This commit is contained in:
Atgeirr Flø Rasmussen 2020-05-29 10:21:31 +02:00
parent b31f33f567
commit c743d0a8c0

View File

@ -35,6 +35,8 @@
#include <opm/models/io/baseoutputwriter.hh> #include <opm/models/io/baseoutputwriter.hh>
#include <opm/models/parallel/tasklets.hh> #include <opm/models/parallel/tasklets.hh>
#include <opm/common/utility/FileSystem.hpp>
#include <opm/material/common/Valgrind.hpp> #include <opm/material/common/Valgrind.hpp>
#include <opm/material/common/Unused.hpp> #include <opm/material/common/Unused.hpp>
@ -85,9 +87,12 @@ class VtkMultiWriter : public BaseOutputWriter
// determine name to write into the multi-file for the // determine name to write into the multi-file for the
// current time step // current time step
// The file names in the pvd file are relative, the path should therefore be stripped.
const Opm::filesystem::path fullPath{fileName};
const std::string localFileName = fullPath.filename();
multiWriter_.multiFile_.precision(16); multiWriter_.multiFile_.precision(16);
multiWriter_.multiFile_ << " <DataSet timestep=\"" << multiWriter_.curTime_ << "\" file=\"" multiWriter_.multiFile_ << " <DataSet timestep=\"" << multiWriter_.curTime_ << "\" file=\""
<< fileName << "\"/>\n"; << localFileName << "\"/>\n";
} }
private: private: