From 04d6a81dc6129e7dff1ef4a69a9787bc76f32ab3 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sat, 11 May 2019 14:58:29 -0400 Subject: [PATCH] Modernize step-26 --- examples/step-26/step-26.cc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/examples/step-26/step-26.cc b/examples/step-26/step-26.cc index 57a75fc782..a28bfb02a4 100644 --- a/examples/step-26/step-26.cc +++ b/examples/step-26/step-26.cc @@ -145,7 +145,7 @@ namespace Step26 const unsigned int component) const { (void)component; - Assert(component == 0, ExcIndexRange(component, 0, 1)); + AssertIndexRange(component, 1); Assert(dim == 2, ExcNotImplemented()); const double time = this->get_time(); @@ -351,15 +351,11 @@ namespace Step26 0.4); if (triangulation.n_levels() > max_grid_level) - for (typename Triangulation::active_cell_iterator cell = - triangulation.begin_active(max_grid_level); - cell != triangulation.end(); - ++cell) + for (const auto &cell : + triangulation.active_cell_iterators_on_level(max_grid_level)) cell->clear_refine_flag(); - for (typename Triangulation::active_cell_iterator cell = - triangulation.begin_active(min_grid_level); - cell != triangulation.end_active(min_grid_level); - ++cell) + for (const auto &cell : + triangulation.active_cell_iterators_on_level(min_grid_level)) cell->clear_coarsen_flag(); // These two loops above are slightly different but this is easily // explained. In the first loop, instead of calling -- 2.39.5