From c1052ad836ab7dcde867a31c7036fd1034f98c72 Mon Sep 17 00:00:00 2001 From: David Wells Date: Fri, 29 Jun 2018 09:04:11 -0400 Subject: [PATCH] Use a range-for in step-10. This finishes the modernization started in commits 0ef6e96485b and 332a199f3f9. --- examples/step-10/step-10.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/examples/step-10/step-10.cc b/examples/step-10/step-10.cc index db6ed8ff5d..8ddacbf912 100644 --- a/examples/step-10/step-10.cc +++ b/examples/step-10/step-10.cc @@ -266,10 +266,7 @@ namespace Step10 // Now we loop over all cells, reinitialize the FEValues object // for each cell, and add up all the `JxW' values for this cell to // `area'... - typename DoFHandler::active_cell_iterator - cell = dof_handler.begin_active(), - endc = dof_handler.end(); - for (; cell != endc; ++cell) + for (const auto &cell : dof_handler.active_cell_iterators()) { fe_values.reinit(cell); for (unsigned int i = 0; i < fe_values.n_quadrature_points; ++i) @@ -359,11 +356,8 @@ namespace Step10 // Now we run over all cells and over all faces of each cell. Only // the contributions of the `JxW' values on boundary faces are // added to the long double variable `perimeter'. - typename DoFHandler::active_cell_iterator - cell = dof_handler.begin_active(), - endc = dof_handler.end(); long double perimeter = 0; - for (; cell != endc; ++cell) + for (const auto &cell : dof_handler.active_cell_iterators()) for (unsigned int face_no = 0; face_no < GeometryInfo::faces_per_cell; ++face_no) -- 2.39.5