From 6b40acb354edc23dfba1f952d7a7d3045b42d1f4 Mon Sep 17 00:00:00 2001 From: Bruno Turcksin Date: Tue, 24 Oct 2023 17:14:53 -0400 Subject: [PATCH] Python: write_vtu write a serialized mesh --- contrib/python-bindings/source/triangulation_wrapper.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/contrib/python-bindings/source/triangulation_wrapper.cc b/contrib/python-bindings/source/triangulation_wrapper.cc index e802415a7c..149e5c818b 100644 --- a/contrib/python-bindings/source/triangulation_wrapper.cc +++ b/contrib/python-bindings/source/triangulation_wrapper.cc @@ -788,6 +788,8 @@ namespace python const Triangulation *tria = static_cast *>(triangulation); + GridOut mesh_writer; + GridOut::OutputFormat output_format; if (format.compare("dx") == 0) output_format = GridOut::OutputFormat::dx; @@ -808,11 +810,14 @@ namespace python else if (format.compare("vtk") == 0) output_format = GridOut::OutputFormat::vtk; else if (format.compare("vtu") == 0) - output_format = GridOut::OutputFormat::vtu; + { + output_format = GridOut::OutputFormat::vtu; + GridOutFlags::Vtu flags(true); + mesh_writer.set_flags(flags); + } else output_format = GridOut::OutputFormat::none; - GridOut mesh_writer; std::ofstream ofs(filename); mesh_writer.write(*tria, ofs, output_format); ofs.close(); -- 2.39.5