From: Bruno Turcksin Date: Tue, 24 Oct 2023 21:14:53 +0000 (-0400) Subject: Python: write_vtu write a serialized mesh X-Git-Tag: relicensing~348^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b40acb354edc23dfba1f952d7a7d3045b42d1f4;p=dealii.git Python: write_vtu write a serialized mesh --- 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();