]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix a bug which showed up in 3d, where constraints were erroneously
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 17 Feb 1999 12:55:34 +0000 (12:55 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 17 Feb 1999 12:55:34 +0000 (12:55 +0000)
entered twice (the check to avoid this was already there, but the
function was not left).

git-svn-id: https://svn.dealii.org/trunk@833 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 38180a324d52dd6ea5cc54cc66427b0a50d07594..81283580d38f0159c33307e30a1ccd90b874955b 100644 (file)
@@ -61,18 +61,22 @@ void ConstraintMatrix::add_entry (const unsigned int line,
                                   // point to 'line' then
   Assert (line_ptr->line==line, 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
+                                  //
+                                  // in any case: exit the function if an
+                                  // entry for this column already exists,
+                                  // since we don't want to enter it twice
   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
+      {
+       Assert (p->second == value,
+               ExcEntryAlreadyExists(line, column, p->second, value));
+       return;
+      };
   
   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.