From a51d7c46373e7c79abb6630ce85f4e200f0484e8 Mon Sep 17 00:00:00 2001 From: bangerth Date: Sat, 25 Jan 2014 04:09:13 +0000 Subject: [PATCH] Avoid directly accessing the active_fe_index of a cell that is at this 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 | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/deal.II/source/hp/dof_handler.cc b/deal.II/source/hp/dof_handler.cc index 28c1188456..b083369760 100644 --- a/deal.II/source/hp/dof_handler.cc +++ b/deal.II/source/hp/dof_handler.cc @@ -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())); } } } -- 2.39.5