]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Don't segfault if constraint matrix is empty.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 17 Feb 2003 00:06:28 +0000 (00:06 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 17 Feb 2003 00:06:28 +0000 (00:06 +0000)
git-svn-id: https://svn.dealii.org/trunk@7106 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 1bb745694f0ab15d1b531d94b34d8d402b495cc0..38a38a0ff395dcbc270344b634032e0d1cb32f0c 100644 (file)
@@ -1100,6 +1100,9 @@ unsigned int ConstraintMatrix::n_constraints () const
 
 bool ConstraintMatrix::is_constrained (const unsigned int index) const 
 {
+  if (lines.size() == 0)
+    return false;
+  
   if (sorted == true)
     {
       ConstraintLine index_comparison;
@@ -1124,6 +1127,9 @@ bool ConstraintMatrix::is_constrained (const unsigned int index) const
 
 bool ConstraintMatrix::is_identity_constrained (const unsigned int index) const 
 {
+  if (lines.size() == 0)
+    return false;
+  
   if (sorted == true)
     {
       ConstraintLine index_comparison;

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.