]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix MGTransferGlobalCoarsening::copy_to_mg() 12745/head
authorPeter Munch <peterrmuench@gmail.com>
Mon, 6 Sep 2021 13:58:05 +0000 (15:58 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Mon, 6 Sep 2021 13:58:05 +0000 (15:58 +0200)
include/deal.II/multigrid/mg_transfer_global_coarsening.h

index 64bbd4aa1ed74ab6989749ac36a6aee7dbb88696..d59f1dddd9fe551121ed20be85b00675affc66cf 100644 (file)
@@ -608,9 +608,14 @@ MGTransferGlobalCoarsening<dim, VectorType>::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;
+    }
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.