From: Wolfgang Bangerth Date: Fri, 22 Sep 2023 14:44:34 +0000 (-0600) Subject: Simplify step-48 a bit. X-Git-Tag: relicensing~476^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16033%2Fhead;p=dealii.git Simplify step-48 a bit. --- 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);