From: David Wells Date: Fri, 29 Jun 2018 13:04:11 +0000 (-0400) Subject: Use a range-for in step-10. X-Git-Tag: v9.1.0-rc1~967^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6859%2Fhead;p=dealii.git Use a range-for in step-10. This finishes the modernization started in commits 0ef6e96485b and 332a199f3f9. --- 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)