From 09f72214d1969387ab049780139f988608298373 Mon Sep 17 00:00:00 2001 From: "Jorgen S. Dokken" Date: Thu, 4 Apr 2024 14:20:05 +0000 Subject: [PATCH] Move piece node outside of function loop. --- cpp/dolfinx/io/VTKFile.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cpp/dolfinx/io/VTKFile.cpp b/cpp/dolfinx/io/VTKFile.cpp index d295fbbf35d..ac1f60f7a04 100644 --- a/cpp/dolfinx/io/VTKFile.cpp +++ b/cpp/dolfinx/io/VTKFile.cpp @@ -663,14 +663,14 @@ void write_function( add_field(_u.get().name + field_ext[0], size); add_field(_u.get().name + field_ext[1], size); } + } - // Add data for each process to the PVTU object - for (int r = 0; r < mpi_size; ++r) - { - std::filesystem::path vtu = create_vtu_path(r); - pugi::xml_node piece_node = grid_node.append_child("Piece"); - piece_node.append_attribute("Source") = vtu.filename().c_str(); - } + // Add data for each process to the PVTU object + for (int r = 0; r < mpi_size; ++r) + { + std::filesystem::path vtu = create_vtu_path(r); + pugi::xml_node piece_node = grid_node.append_child("Piece"); + piece_node.append_attribute("Source") = vtu.filename().c_str(); } // Write PVTU file