From: Peter Munch Date: Mon, 6 Sep 2021 13:58:05 +0000 (+0200) Subject: Fix MGTransferGlobalCoarsening::copy_to_mg() X-Git-Tag: v9.4.0-rc1~999^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12745%2Fhead;p=dealii.git Fix MGTransferGlobalCoarsening::copy_to_mg() --- diff --git a/include/deal.II/multigrid/mg_transfer_global_coarsening.h b/include/deal.II/multigrid/mg_transfer_global_coarsening.h index 64bbd4aa1e..d59f1dddd9 100644 --- a/include/deal.II/multigrid/mg_transfer_global_coarsening.h +++ b/include/deal.II/multigrid/mg_transfer_global_coarsening.h @@ -608,9 +608,14 @@ MGTransferGlobalCoarsening::copy_to_mg( "MGTransferGlobalCoarsening.")); for (unsigned int level = dst.min_level(); level <= dst.max_level(); ++level) - initialize_dof_vector(level, dst[level]); - - dst[dst.max_level()].copy_locally_owned_data_from(src); + { + initialize_dof_vector(level, dst[level]); + + if (level == dst.max_level()) + dst[level].copy_locally_owned_data_from(src); + else + dst[level] = 0.0; + } }