]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix one of the probably oldest oversights in deal.II. It did not much
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 10 Mar 1999 14:27:22 +0000 (14:27 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 10 Mar 1999 14:27:22 +0000 (14:27 +0000)
harm though, and went through unnoticed (though it throws an
exception!) because it only shows up when trying to renumber the
degrees of freedom on a grid that consists of a single cell only.

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

deal.II/deal.II/source/dofs/dof_handler.cc

index 88928fd737306dd7bea94914924ae710952900d8..074bd35434588e0d9181ebb72a8f8a6296e2ef7b 100644 (file)
@@ -1609,12 +1609,16 @@ void DoFHandler<dim>::renumber_dofs (const RenumberingMethod method,
       for (int row=0; row<n_dofs; ++row) 
        {
          unsigned int j;
+
+                                          // loop until we hit the end
+                                          // of this row's entries
          for (j=sparsity.get_rowstart_indices()[row];
               j<sparsity.get_rowstart_indices()[row+1]; ++j)
            if (sparsity.get_column_numbers()[j] == -1)
              break;
                                           // post-condition after loop:
-                                          // coordination is now
+                                          // coordination, i.e. the number
+                                          // of entries in this row is now
                                           // j-rowstart[row]
          if (j-sparsity.get_rowstart_indices()[row] <  min_coordination)
            {
@@ -1622,6 +1626,20 @@ void DoFHandler<dim>::renumber_dofs (const RenumberingMethod method,
              starting_point   = row;
            };
        };
+      
+                                      // now we still have to care for the
+                                      // case that no dof has a coordination
+                                      // number less than n_dofs. this rather
+                                      // exotic case only happens if we only
+                                      // have one cell, as far as I can see,
+                                      // but there may be others as well.
+                                      //
+                                      // if that should be the case, we can
+                                      // chose an arbitrary dof as starting
+                                      // point, e.g. the one with number zero
+      if (starting_point == -1)
+       starting_point = 0;
+      
                                       // initialize the first dof
       last_round_dofs.push_back (starting_point);
     };

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.