]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Only distributing user constraints before prolongation
authorJulian Roth <mathmerizing@gmail.com>
Fri, 5 Jun 2020 17:36:55 +0000 (19:36 +0200)
committerJulian Roth <mathmerizing@gmail.com>
Fri, 5 Jun 2020 17:36:55 +0000 (19:36 +0200)
source/multigrid/mg_transfer_prebuilt.cc

index 7295d243b1161d2d3d1a4622472cff23a9ffb0db..80d8390171dd46d4fd420273b6f0d88257ab4534 100644 (file)
@@ -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);
 }
 
 

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.