]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add another test for consistency of constraints.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 11 Feb 1999 16:09:47 +0000 (16:09 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 11 Feb 1999 16:09:47 +0000 (16:09 +0000)
git-svn-id: https://svn.dealii.org/trunk@782 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/dof_constraints.h
deal.II/deal.II/source/dofs/dof_constraints.cc

index 4afb7c20f5707ca4f3766ba9eb54effe45b102f6..92f8c5910025258d520d67e47f647149a41b8032 100644 (file)
@@ -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:
 
index c06c3f6c66eb8a89cb355ede553fc7be09f4ced5..5f89c1f075bd4c05a5c7348cc36cc1de6510ab52 100644 (file)
@@ -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<pair<unsigned int,double> >::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));
 };
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.