]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Modernize step-26 8099/head
authorDaniel Arndt <arndtd@ornl.gov>
Sat, 11 May 2019 18:58:29 +0000 (14:58 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Sat, 11 May 2019 19:00:02 +0000 (15:00 -0400)
examples/step-26/step-26.cc

index 57a75fc78295a50781e74e0ecf1e83fd10f5f05e..a28bfb02a49ca6fa399b2c088f8e29ed06887f9e 100644 (file)
@@ -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<dim>::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<dim>::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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.