From 89365991da56e6937522bb411529c23c1cc76dc7 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Wed, 23 Oct 2019 12:16:40 +0200 Subject: [PATCH] use write_vtu_with_pvtu_record --- examples/step-50/step-50.cc | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/examples/step-50/step-50.cc b/examples/step-50/step-50.cc index 0c7218a698..895ab9257f 100644 --- a/examples/step-50/step-50.cc +++ b/examples/step-50/step-50.cc @@ -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 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; } -- 2.39.5