From: Julian Roth Date: Sat, 6 Jun 2020 20:17:13 +0000 (+0200) Subject: Moved copy of vector into if block X-Git-Tag: v9.3.0-rc1~1476^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2e19b77b517484a4d9382e456900bbdf4e04047;p=dealii.git Moved copy of vector into if block --- diff --git a/source/multigrid/mg_transfer_prebuilt.cc b/source/multigrid/mg_transfer_prebuilt.cc index c250fefb37..d7d3669aca 100644 --- a/source/multigrid/mg_transfer_prebuilt.cc +++ b/source/multigrid/mg_transfer_prebuilt.cc @@ -85,14 +85,20 @@ MGTransferPrebuilt::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); + } }