From e7a5a014b26f2180401ba38b229c280f4aa844a9 Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Tue, 19 Jul 2022 23:33:59 +0200 Subject: [PATCH] Update tutorials to use cell->as_dof_handler_iterator() --- examples/step-32/step-32.cc | 8 ++++---- examples/step-51/step-51.cc | 12 ++++-------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/examples/step-32/step-32.cc b/examples/step-32/step-32.cc index 309c0064ba..a66bda791a 100644 --- a/examples/step-32/step-32.cc +++ b/examples/step-32/step-32.cc @@ -2218,8 +2218,8 @@ namespace Step32 scratch.stokes_fe_values.reinit(cell); - typename DoFHandler::active_cell_iterator temperature_cell( - &triangulation, cell->level(), cell->index(), &temperature_dof_handler); + const typename DoFHandler::active_cell_iterator temperature_cell = + cell->as_dof_handler_iterator(temperature_dof_handler); scratch.temperature_fe_values.reinit(temperature_cell); if (rebuild_stokes_matrix) @@ -2485,8 +2485,8 @@ namespace Step32 scratch.temperature_fe_values.reinit(cell); - typename DoFHandler::active_cell_iterator stokes_cell( - &triangulation, cell->level(), cell->index(), &stokes_dof_handler); + typename DoFHandler::active_cell_iterator stokes_cell = + cell->as_dof_handler_iterator(stokes_dof_handler); scratch.stokes_fe_values.reinit(stokes_cell); scratch.temperature_fe_values.get_function_values( diff --git a/examples/step-51/step-51.cc b/examples/step-51/step-51.cc index 60ec5c8901..648cdc1392 100644 --- a/examples/step-51/step-51.cc +++ b/examples/step-51/step-51.cc @@ -698,10 +698,8 @@ namespace Step51 PerTaskData & task_data) { // Construct iterator for dof_handler_local for FEValues reinit function. - typename DoFHandler::active_cell_iterator loc_cell(&triangulation, - cell->level(), - cell->index(), - &dof_handler_local); + const typename DoFHandler::active_cell_iterator loc_cell = + cell->as_dof_handler_iterator(dof_handler_local); const unsigned int n_q_points = scratch.fe_values_local.get_quadrature().size(); @@ -1128,10 +1126,8 @@ namespace Step51 PostProcessScratchData & scratch, unsigned int &) { - typename DoFHandler::active_cell_iterator loc_cell(&triangulation, - cell->level(), - cell->index(), - &dof_handler_local); + const typename DoFHandler::active_cell_iterator loc_cell = + cell->as_dof_handler_iterator(dof_handler_local); scratch.fe_values_local.reinit(loc_cell); scratch.fe_values.reinit(cell); -- 2.39.5