]> https://gitweb.dealii.org/ - dealii.git/commitdiff
use write_vtu_with_pvtu_record
authorTimo Heister <timo.heister@gmail.com>
Wed, 23 Oct 2019 10:16:40 +0000 (12:16 +0200)
committerTimo Heister <timo.heister@gmail.com>
Wed, 23 Oct 2019 10:21:01 +0000 (12:21 +0200)
examples/step-50/step-50.cc

index 0c7218a698cf6629161963196a3f20fa2ee89f1d..895ab9257f0d1e8d1f59c69e4c1c929980094a4c 100644 (file)
@@ -853,34 +853,9 @@ namespace Step50
 
     data_out.build_patches(0);
 
-    const std::string filename =
-      ("solution-" + Utilities::int_to_string(cycle, 5) + "." +
-       Utilities::int_to_string(triangulation.locally_owned_subdomain(), 4) +
-       ".vtu");
-    std::ofstream output(filename);
-    data_out.write_vtu(output);
-
-    if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
-      {
-        std::vector<std::string> filenames;
-        for (unsigned int i = 0;
-             i < Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD);
-             ++i)
-          filenames.push_back(std::string("solution-") +
-                              Utilities::int_to_string(cycle, 5) + "." +
-                              Utilities::int_to_string(i, 4) + ".vtu");
-        const std::string pvtu_master_filename =
-          ("solution-" + Utilities::int_to_string(cycle, 5) + ".pvtu");
-        std::ofstream pvtu_master(pvtu_master_filename);
-        data_out.write_pvtu_record(pvtu_master, filenames);
-
-        const std::string visit_master_filename =
-          ("solution-" + Utilities::int_to_string(cycle, 5) + ".visit");
-        std::ofstream visit_master(visit_master_filename);
-        DataOutBase::write_visit_record(visit_master, filenames);
-
-        std::cout << "   wrote " << pvtu_master_filename << std::endl;
-      }
+    const auto filename = data_out.write_vtu_with_pvtu_record(
+      "", "solution", cycle, 5, mpi_communicator, 8);
+    pcout << "    wrote " << filename << std::endl;
   }
 
 

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.