From: Matthias Maier Date: Thu, 26 Dec 2019 15:24:01 +0000 (-0600) Subject: use write_vtu_with_pvtu_record, code cleanup X-Git-Tag: v9.2.0-rc1~443^2~34 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4af1d09533b1290c033ae192a0d3c6f801dfe4de;p=dealii.git use write_vtu_with_pvtu_record, code cleanup --- diff --git a/examples/step-69/step-69.cc b/examples/step-69/step-69.cc index 95a1ec813a..8823c0f2cb 100644 --- a/examples/step-69/step-69.cc +++ b/examples/step-69/step-69.cc @@ -1993,16 +1993,9 @@ namespace Step69 template void TimeLoop::run() { - if (Utilities::MPI::this_mpi_process(mpi_communicator) == 0) - { - pcout << "Reading parameters and allocating objects... " << std::flush; - ParameterAcceptor::initialize("step-69.prm"); - pcout << "done" << std::endl; - } - else - { - ParameterAcceptor::initialize("step-69.prm"); - } + pcout << "Reading parameters and allocating objects... " << std::flush; + ParameterAcceptor::initialize("step-69.prm"); + pcout << "done" << std::endl; print_head(pcout, "create triangulation"); discretization.setup(); @@ -2177,28 +2170,7 @@ namespace Step69 DataOutBase::VtkFlags::best_speed); data_out.set_flags(flags); - const auto filename = [&](const unsigned int i) -> std::string { - const auto seq = dealii::Utilities::int_to_string(i, 4); - return name + "-" + Utilities::int_to_string(cycle, 6) + "-" + seq + - ".vtu"; - }; - - const unsigned int i = triangulation.locally_owned_subdomain(); - std::ofstream output(filename(i)); - data_out.write_vtu(output); - - if (dealii::Utilities::MPI::this_mpi_process(mpi_communicator) == 0) - { - const unsigned int n_mpi_processes = - dealii::Utilities::MPI::n_mpi_processes(mpi_communicator); - std::vector filenames; - for (unsigned int i = 0; i < n_mpi_processes; ++i) - filenames.push_back(filename(i)); - - std::ofstream output(name + "-" + Utilities::int_to_string(cycle, 6) + - ".pvtu"); - data_out.write_pvtu_record(output, filenames); - } + data_out.write_vtu_with_pvtu_record("", name, cycle, 6, mpi_communicator); }; output_thread = std::move(std::thread(output_worker));