From a6ea80ceaca3b363e3cf438f7ed78f0743bc00d1 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Mon, 17 Jun 2013 14:00:28 +0000 Subject: [PATCH] Avoid inserting elements already present in index set git-svn-id: https://svn.dealii.org/trunk@29836 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/lac/constraint_matrix.templates.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deal.II/include/deal.II/lac/constraint_matrix.templates.h b/deal.II/include/deal.II/lac/constraint_matrix.templates.h index af6d907509..397be1b7cc 100644 --- a/deal.II/include/deal.II/lac/constraint_matrix.templates.h +++ b/deal.II/include/deal.II/lac/constraint_matrix.templates.h @@ -1117,7 +1117,8 @@ ConstraintMatrix::distribute (VectorType &vec) const it != lines.end(); ++it) if (vec_owned_elements.is_element(it->line)) for (unsigned int i=0; ientries.size(); ++i) - needed_elements.add_index(it->entries[i].first); + if (!vec_owned_elements.is_element(it->entries[i].first)) + needed_elements.add_index(it->entries[i].first); VectorType ghosted_vector; internal::import_vector_with_ghost_elements (vec, -- 2.39.5