]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add an assertion to make sure that a DoF isn't constrained to itself.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 9 Mar 2007 16:35:04 +0000 (16:35 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 9 Mar 2007 16:35:04 +0000 (16:35 +0000)
git-svn-id: https://svn.dealii.org/trunk@14562 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 3be0c40c8eb7f6aa6cb4be29e0e9b048b0760a89..2ad16f6521e1f4061a73434f6cdb01aae7649282 100644 (file)
@@ -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<std::pair<unsigned int,double> >::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);
-    };
+    }
 }
 
 

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.