----------------------------------------------------------------------------
| 729 | } |
| 730 | //---------------------------------------------------------------------------- |
| 731 | void io::VTKFile::close() |
| 732 | { |
| 733 | if (_pvd_xml and dolfinx::MPI::rank(_comm.comm()) == 0) |
| 734 | { |
| 735 | if (_filename.has_parent_path()) |
| 736 | std::filesystem::create_directories(_filename.parent_path()); |
| 737 | |
| 738 | bool status = _pvd_xml->save_file(_filename.c_str(), " "); |
| 739 | if (status == false) |
| 740 | { |
| 741 | throw std::runtime_error( |
| 742 | "Could not write VTKFile. Does the directory " |
| 743 | "exists and do you have read/write permissions?"); |
| 744 | } |
| 745 | } |
| 746 | } |
| 747 | //---------------------------------------------------------------------------- |
| 748 | void io::VTKFile::flush() |
| 749 | { |