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;
}