From: wolf Date: Thu, 11 Feb 1999 16:09:47 +0000 (+0000) Subject: Add another test for consistency of constraints. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=200692fd1a2d533cc21931113c39a9342082e61b;p=dealii-svn.git Add another test for consistency of constraints. git-svn-id: https://svn.dealii.org/trunk@782 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/dofs/dof_constraints.h b/deal.II/deal.II/include/dofs/dof_constraints.h index 4afb7c20f5..92f8c59100 100644 --- a/deal.II/deal.II/include/dofs/dof_constraints.h +++ b/deal.II/deal.II/include/dofs/dof_constraints.h @@ -293,6 +293,14 @@ class ConstraintMatrix { * Exception */ DeclException0 (ExcIO); + /** + * Exception + */ + DeclException4 (ExcEntryAlreadyExists, + int, int, double, double, + << "The entry for the indices " << arg1 << " and " + << arg2 << " already exists, but the values " + << arg3 << " (old) and " << arg4 << " (new) differ."); private: diff --git a/deal.II/deal.II/source/dofs/dof_constraints.cc b/deal.II/deal.II/source/dofs/dof_constraints.cc index c06c3f6c66..5f89c1f075 100644 --- a/deal.II/deal.II/source/dofs/dof_constraints.cc +++ b/deal.II/deal.II/source/dofs/dof_constraints.cc @@ -56,6 +56,18 @@ void ConstraintMatrix::add_entry (const unsigned int line, Assert (false, ExcLineInexistant(line)); }; +#ifdef DEBUG + // if in debug mode, check whether an + // entry for this column already + // exists and if its the same as + // the one entered at present + for (vector >::const_iterator p=line_ptr->entries.begin(); + p != line_ptr->entries.end(); ++p) + if (p->first == column) + Assert (p->second == value, + ExcEntryAlreadyExists(line, column, p->second, value)); +#endif + line_ptr->entries.push_back (make_pair(column,value)); };