From afeb523f33bb4578e0838b84ff7baff9e58dd4d8 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 13 Jul 2015 22:29:38 +0200 Subject: [PATCH] Restrict DoFs that can be used in constraints to those in the IndexSet --- include/deal.II/lac/constraint_matrix.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/deal.II/lac/constraint_matrix.h b/include/deal.II/lac/constraint_matrix.h index 85fe21b231..4afd5f892f 100644 --- a/include/deal.II/lac/constraint_matrix.h +++ b/include/deal.II/lac/constraint_matrix.h @@ -1081,6 +1081,19 @@ public: << " should not be stored by this object, but a constraint " << "is being added."); + /** + * Exception + * + * @ingroup Exceptions + */ + DeclException2 (ExcColumnNotStoredHere, + size_type, + size_type, + << "The index set given to this constraint matrix indicates " + << "constraints using degree of freedom " << arg2 + << " should not be stored by this object, but a constraint " + << "for degree of freedom " << arg1 <<" uses it."); + /** * Exception * @@ -1404,6 +1417,8 @@ ConstraintMatrix::add_entry (const size_type line, // exists, since we don't want to enter it twice Assert (lines_cache[calculate_line_index(line)] != numbers::invalid_size_type, ExcInternalError()); + Assert (!local_lines.size() || local_lines.is_element(column), + ExcColumnNotStoredHere(line, column)); ConstraintLine *line_ptr = &lines[lines_cache[calculate_line_index(line)]]; Assert (line_ptr->line == line, ExcInternalError()); for (ConstraintLine::Entries::const_iterator -- 2.39.5