From: bangerth Date: Fri, 9 Mar 2007 16:35:04 +0000 (+0000) Subject: Add an assertion to make sure that a DoF isn't constrained to itself. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2ba00a79d882394bd060b2e9e198ee6948b90c3;p=dealii-svn.git Add an assertion to make sure that a DoF isn't constrained to itself. git-svn-id: https://svn.dealii.org/trunk@14562 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/dofs/dof_constraints.cc b/deal.II/deal.II/source/dofs/dof_constraints.cc index 3be0c40c8e..2ad16f6521 100644 --- a/deal.II/deal.II/source/dofs/dof_constraints.cc +++ b/deal.II/deal.II/source/dofs/dof_constraints.cc @@ -120,6 +120,9 @@ ConstraintMatrix::add_entries (const unsigned int line, col_val_pair = col_val_pairs.begin(); col_val_pair!=col_val_pairs.end(); ++col_val_pair) { + Assert (line != col_val_pair->first, + ExcMessage ("Can't constrain a degree of freedom to itself")); + for (std::vector >::const_iterator p=line_ptr->entries.begin(); p != line_ptr->entries.end(); ++p) @@ -131,10 +134,10 @@ ConstraintMatrix::add_entries (const unsigned int line, ExcEntryAlreadyExists(line, col_val_pair->first, p->second, col_val_pair->second)); break; - }; + } line_ptr->entries.push_back (*col_val_pair); - }; + } }