]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Python: write_vtu write a serialized mesh
authorBruno Turcksin <bruno.turcksin@gmail.com>
Tue, 24 Oct 2023 21:14:53 +0000 (17:14 -0400)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Tue, 24 Oct 2023 21:14:53 +0000 (17:14 -0400)
contrib/python-bindings/source/triangulation_wrapper.cc

index e802415a7c9991d682180083d05c4869922185bc..149e5c818b893cd06a6348925bb9021be7239617 100644 (file)
@@ -788,6 +788,8 @@ namespace python
       const Triangulation<dim, spacedim> *tria =
         static_cast<const Triangulation<dim, spacedim> *>(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();

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.