]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix a stupid bug in the renumbering code. This seems to have not been tested for...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 8 Dec 1998 16:58:45 +0000 (16:58 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 8 Dec 1998 16:58:45 +0000 (16:58 +0000)
git-svn-id: https://svn.dealii.org/trunk@685 0785d39b-7218-0410-832d-ea1e28bc413d

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

index fa5a5a71be65feb23a1bb5f0aa029a2f5219e0cc..8ca18175490f32f3dec8f0e9e220a1e6444c7284 100644 (file)
@@ -1215,12 +1215,18 @@ void DoFHandler<1>::do_renumbering (const vector<int> &new_numbers) {
                                   // renumber the dofs on the interface of
                                   // two cells more than once. Anyway, this
                                   // way it's not only more correct but also
-                                  // faster
+                                  // faster; note, however, that dof numbers
+                                  // may be -1, namely when the appropriate
+                                  // vertex/line/etc is unused
   for (vector<int>::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i)
-    {
-      Assert (*i != -1, ExcInternalError());
+    if (*i != -1)
       *i = new_numbers[*i];
-    };
+    else
+                                      // if index is -1: check if this one
+                                      // really is unused
+      Assert (tria->vertices_used[(i-vertex_dofs.begin()) /
+                                selected_fe->dofs_per_vertex] == false,
+             ExcInternalError ());
   
   for (unsigned int level=0; level<levels.size(); ++level) 
     for (vector<int>::iterator i=levels[level]->line_dofs.begin();
@@ -1238,11 +1244,23 @@ template <>
 void DoFHandler<2>::do_renumbering (const vector<int> &new_numbers) {
   Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete());
 
+                                  // note that we can not use cell iterators
+                                  // in this function since then we would
+                                  // renumber the dofs on the interface of
+                                  // two cells more than once. Anyway, this
+                                  // way it's not only more correct but also
+                                  // faster; note, however, that dof numbers
+                                  // may be -1, namely when the appropriate
+                                  // vertex/line/etc is unused
   for (vector<int>::iterator i=vertex_dofs.begin(); i!=vertex_dofs.end(); ++i)
-    {
-      Assert (*i != -1, ExcInternalError());
+    if (*i != -1)
       *i = new_numbers[*i];
-    };
+    else
+                                      // if index is -1: check if this one
+                                      // really is unused
+      Assert (tria->vertices_used[(i-vertex_dofs.begin()) /
+                                selected_fe->dofs_per_vertex] == false,
+             ExcInternalError ());
   
   for (unsigned int level=0; level<levels.size(); ++level) 
     {

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.