]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Avoid directly accessing the active_fe_index of a cell that is at this
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 25 Jan 2014 04:09:13 +0000 (04:09 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 25 Jan 2014 04:09:13 +0000 (04:09 +0000)
point no longer active.

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

deal.II/source/hp/dof_handler.cc

index 28c11884560360e1d7d30427de72f481feced028..b083369760b1b9d3e2107597c36a03b2b6f57124 100644 (file)
@@ -3275,8 +3275,11 @@ namespace hp
                       endc = end ();
         for (; cell != endc; ++cell)
           {
-            // Look if the cell got children during
-            // refinement
+            // Look if the cell got children during refinement by
+            // checking whether it has children now but didn't have
+            // children before refinement (the has_children array is
+            // set in pre-refinement action)
+           //
             // Note: Although one level is added to
             // the DoFHandler levels, when the
             // triangulation got one, for the buffer
@@ -3291,10 +3294,15 @@ namespace hp
             if (cell->has_children () &&
                 !(*has_children [cell->level ()])[cell->index ()])
               {
-                // Set active_fe_index in children to the
-                // same value as in the parent cell.
+                // Set active_fe_index in children to the same value
+                // as in the parent cell. we can't access the
+                // active_fe_index in the parent cell any more through
+                // cell->active_fe_index() since that function is not
+                // allowed for inactive cells, but we can access this
+                // information from the DoFLevels directly
                 for (unsigned int i = 0; i < cell->n_children(); ++i)
-                  cell->child (i)->set_active_fe_index (cell->active_fe_index ());
+                 cell->child (i)->set_active_fe_index
+                   (levels[cell->level()]->active_fe_index (cell->index()));
               }
           }
       }

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.