From fbe43eb343c89cd7d38e9aefe79d87c624058a9c Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 22 Sep 2023 08:44:34 -0600 Subject: [PATCH] Simplify step-48 a bit. --- examples/step-48/step-48.cc | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/examples/step-48/step-48.cc b/examples/step-48/step-48.cc index ea993a5800..7c6f14ae6d 100644 --- a/examples/step-48/step-48.cc +++ b/examples/step-48/step-48.cc @@ -375,18 +375,13 @@ namespace Step48 GridGenerator::hyper_cube(triangulation, -15, 15); triangulation.refine_global(n_global_refinements); { - typename Triangulation::active_cell_iterator - cell = triangulation.begin_active(), - end_cell = triangulation.end(); - for (; cell != end_cell; ++cell) + for (const auto &cell : triangulation.active_cell_iterators()) if (cell->is_locally_owned()) if (cell->center().norm() < 11) cell->set_refine_flag(); triangulation.execute_coarsening_and_refinement(); - cell = triangulation.begin_active(); - end_cell = triangulation.end(); - for (; cell != end_cell; ++cell) + for (const auto &cell : triangulation.active_cell_iterators()) if (cell->is_locally_owned()) if (cell->center().norm() < 6) cell->set_refine_flag(); @@ -394,12 +389,7 @@ namespace Step48 } pcout << " Number of global active cells: " -#ifdef DEAL_II_WITH_P4EST - << triangulation.n_global_active_cells() -#else - << triangulation.n_active_cells() -#endif - << std::endl; + << triangulation.n_global_active_cells() << std::endl; dof_handler.distribute_dofs(fe); -- 2.39.5