From: Julian Roth <mathmerizing@gmail.com>
Date: Fri, 5 Jun 2020 17:36:55 +0000 (+0200)
Subject: Only distributing user constraints before prolongation
X-Git-Tag: v9.3.0-rc1~1476^2~3
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cabe15e86c5d61dbbf09b805667d7e58a1c32301;p=dealii.git

Only distributing user constraints before prolongation
---

diff --git a/source/multigrid/mg_transfer_prebuilt.cc b/source/multigrid/mg_transfer_prebuilt.cc
index 7295d243b1..80d8390171 100644
--- a/source/multigrid/mg_transfer_prebuilt.cc
+++ b/source/multigrid/mg_transfer_prebuilt.cc
@@ -85,10 +85,11 @@ MGTransferPrebuilt<VectorType>::prolongate(const unsigned int to_level,
   Assert((to_level >= 1) && (to_level <= prolongation_matrices.size()),
          ExcIndexRange(to_level, 1, prolongation_matrices.size() + 1));
 
-  prolongation_matrices[to_level - 1]->vmult(dst, src);
+  VectorType copy_src(src);
   if (this->mg_constrained_dofs != nullptr)
-    this->mg_constrained_dofs->get_user_constraint_matrix(to_level).distribute(
-      dst);
+    this->mg_constrained_dofs->get_user_constraint_matrix(to_level - 1)
+      .distribute(copy_src);
+  prolongation_matrices[to_level - 1]->vmult(dst, copy_src);
 }
 
 
@@ -104,9 +105,6 @@ MGTransferPrebuilt<VectorType>::restrict_and_add(const unsigned int from_level,
   (void)from_level;
 
   prolongation_matrices[from_level - 1]->Tvmult_add(dst, src);
-  if (this->mg_constrained_dofs != nullptr)
-    this->mg_constrained_dofs->get_user_constraint_matrix(from_level - 1)
-      .distribute(dst);
 }