From c2e19b77b517484a4d9382e456900bbdf4e04047 Mon Sep 17 00:00:00 2001 From: Julian Roth Date: Sat, 6 Jun 2020 22:17:13 +0200 Subject: [PATCH] Moved copy of vector into if block --- source/multigrid/mg_transfer_prebuilt.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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); + } } -- 2.39.5