From 732fa19d32fe4cd3b7f52afcd9d269fafe1596a8 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Tue, 25 Jul 2023 23:42:59 +0200 Subject: [PATCH] MGTransferMF::interpolate_to_mg(): zero out ghost values --- doc/news/changes/incompatibilities/20230725Munch | 4 ++++ include/deal.II/multigrid/mg_transfer_matrix_free.h | 3 +++ tests/mappings/mapping_q_eulerian_08.cc | 2 ++ tests/mappings/mapping_q_eulerian_14.cc | 2 ++ tests/matrix_free/interpolate_to_mg.cc | 2 ++ 5 files changed, 13 insertions(+) create mode 100644 doc/news/changes/incompatibilities/20230725Munch diff --git a/doc/news/changes/incompatibilities/20230725Munch b/doc/news/changes/incompatibilities/20230725Munch new file mode 100644 index 0000000000..5e265659c1 --- /dev/null +++ b/doc/news/changes/incompatibilities/20230725Munch @@ -0,0 +1,4 @@ +Changed: MGTransferMatrixFree::interpolate_to_mg() +returns now non-ghosted vectors. +
+(Peter Munch, 2023/07/25) diff --git a/include/deal.II/multigrid/mg_transfer_matrix_free.h b/include/deal.II/multigrid/mg_transfer_matrix_free.h index 5dd1797005..d4d53f059b 100644 --- a/include/deal.II/multigrid/mg_transfer_matrix_free.h +++ b/include/deal.II/multigrid/mg_transfer_matrix_free.h @@ -632,6 +632,9 @@ MGTransferMatrixFree::interpolate_to_mg( dst[level - 1].update_ghost_values(); } + + for (unsigned int level = min_level; level <= max_level; ++level) + dst[level].zero_out_ghost_values(); } diff --git a/tests/mappings/mapping_q_eulerian_08.cc b/tests/mappings/mapping_q_eulerian_08.cc index 5139b342ad..cb6dd8f4df 100644 --- a/tests/mappings/mapping_q_eulerian_08.cc +++ b/tests/mappings/mapping_q_eulerian_08.cc @@ -305,6 +305,8 @@ test(const unsigned int n_ref = 0) MatrixFree mg_level_euler; + displacement_level[level].update_ghost_values(); + MappingQEulerian> euler_level(euler_fe_degree, dof_handler_euler, diff --git a/tests/mappings/mapping_q_eulerian_14.cc b/tests/mappings/mapping_q_eulerian_14.cc index 44766fffea..f8d33d22e4 100644 --- a/tests/mappings/mapping_q_eulerian_14.cc +++ b/tests/mappings/mapping_q_eulerian_14.cc @@ -346,6 +346,8 @@ test(const unsigned int n_ref = 0) MatrixFree mg_level_euler; + displacement_level[level].update_ghost_values(); + MappingQEulerian> euler_level(euler_fe_degree, dof_handler_euler, diff --git a/tests/matrix_free/interpolate_to_mg.cc b/tests/matrix_free/interpolate_to_mg.cc index f2226fb70c..1d30f8e38e 100644 --- a/tests/matrix_free/interpolate_to_mg.cc +++ b/tests/matrix_free/interpolate_to_mg.cc @@ -211,6 +211,8 @@ test(const unsigned int n_glob_ref = 2, const unsigned int n_ref = 0) { --level; + level_projection[level].update_ghost_values(); + std::vector dof_indices(fe.dofs_per_cell); typename DoFHandler::cell_iterator cell = dof_handler.begin(level); typename DoFHandler::cell_iterator endc = dof_handler.end(level); -- 2.39.5