Commit 48e6a546 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

change output format for vtk files to allow parallel writes

parent 65242abd
......@@ -86,9 +86,12 @@ namespace AMDiS
vtkWriter_ = std::make_shared<Dune::VTKWriter<GridView>>(gridView());
if (animation_)
vtkSeqWriter_ = std::make_shared<Dune::VTKSequenceWriter<GridView>>(vtkWriter_, filename_, dir_, "");
vtkSeqWriter_ = std::make_shared<Dune::VTKSequenceWriter<GridView>>(vtkWriter_, filename_, dir_, "data");
vtkWriter_->addVertexData(discreteFct_, Dune::VTK::FieldInfo(name_, VTKFieldType<Range>, VTKFieldSize<Range>));
test_exit(dir_ == "." || filesystem::exists(dir_), "Output directory '{}' does not exist!",dir_);
filesystem::create_directories(dir_ + "/data");
}
void init(std::string const&, tag::unknown) {}
......@@ -96,12 +99,10 @@ namespace AMDiS
/// Implements \ref FileWriterInterface::writeFiles
void writeFiles(AdaptInfo& adaptInfo, bool force) override
{
test_exit(dir_ == "." || filesystem::exists(dir_), "Output directory '{}' does not exist!",dir_);
if (vtkSeqWriter_)
vtkSeqWriter_->write(adaptInfo.time(), mode_);
else if (vtkWriter_)
vtkWriter_->write(filesystem::path({dir_, filename_}).string(), mode_);
vtkWriter_->pwrite(filename_, dir_, "data", mode_);
}
protected:
......
Supports Markdown
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