Commit d64ffd15 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Handle relative directories for timesteps

parent 1dfa3b2c
......@@ -17,7 +17,15 @@ void PvdWriter<W>
p.removeFilename();
Vtk::Path fn_dir = p;
if (!Vtk::exists(fn_dir))
Vtk::createDirectories(fn_dir);
Vtk::Path data_dir = dir ? Vtk::Path(*dir) : fn_dir;
if (data_dir.isRelative())
data_dir = fn_dir / data_dir;
if (!Vtk::exists(data_dir))
Vtk::createDirectories(data_dir);
Vtk::Path rel_dir = Vtk::relative(data_dir, fn_dir);
std::string pvd_fn = fn_dir.string() + '/' + name.string();
......
......@@ -130,5 +130,10 @@ namespace Dune
/// Find the path of `a` relative to directory of `b`
Path relative(Path const& a, Path const& b);
inline Path operator/ (Path lhs, Path const& rhs)
{
return lhs /= rhs;
}
} // end namespace Vtk
} // end namespace Dune
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment