]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Moved copy of vector into if block 10348/head
authorJulian Roth <mathmerizing@gmail.com>
Sat, 6 Jun 2020 20:17:13 +0000 (22:17 +0200)
committerJulian Roth <mathmerizing@gmail.com>
Sat, 6 Jun 2020 20:17:13 +0000 (22:17 +0200)
source/multigrid/mg_transfer_prebuilt.cc

index c250fefb37af97c0743c23f84415d0a3b792fee3..d7d3669aca8705c35d7ec01fa0a64605a08543c1 100644 (file)
@@ -85,14 +85,20 @@ 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));
 
-  VectorType copy_src(src);
   if (this->mg_constrained_dofs != nullptr &&
       this->mg_constrained_dofs->get_user_constraint_matrix(to_level - 1)
           .get_local_lines()
           .size() > 0)
-    this->mg_constrained_dofs->get_user_constraint_matrix(to_level - 1)
-      .distribute(copy_src);
-  prolongation_matrices[to_level - 1]->vmult(dst, copy_src);
+    {
+      VectorType copy_src(src);
+      this->mg_constrained_dofs->get_user_constraint_matrix(to_level - 1)
+        .distribute(copy_src);
+      prolongation_matrices[to_level - 1]->vmult(dst, copy_src);
+    }
+  else
+    {
+      prolongation_matrices[to_level - 1]->vmult(dst, src);
+    }
 }
 
 

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.