----------------------------------------------------------------------------
| 746 | } |
| 747 | //---------------------------------------------------------------------------- |
| 748 | void io::VTKFile::flush() |
| 749 | { |
| 750 | int mpi_rank = dolfinx::MPI::rank(_comm.comm()); |
| 751 | if (!_pvd_xml and mpi_rank == 0) |
| 752 | throw std::runtime_error("VTKFile has already been closed"); |
| 753 | |
| 754 | if (mpi_rank == 0) |
| 755 | { |
| 756 | if (_filename.has_parent_path()) |
| 757 | std::filesystem::create_directories(_filename.parent_path()); |
| 758 | _pvd_xml->save_file(_filename.c_str(), " "); |
| 759 | } |
| 760 | } |
| 761 | //---------------------------------------------------------------------------- |
| 762 | template <std::floating_point U> |
| 763 | void io::VTKFile::write(const mesh::Mesh<U>& mesh, double time) |