]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use GeometryInfo::vertex_indices() in tests/. 9622/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 5 Mar 2020 01:46:51 +0000 (18:46 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 5 Mar 2020 14:39:32 +0000 (07:39 -0700)
155 files changed:
tests/ad_common_tests/step-44-helper_res_lin_01.h
tests/ad_common_tests/step-44-helper_scalar_01.h
tests/ad_common_tests/step-44-helper_var_form_01.h
tests/ad_common_tests/step-44-helper_vector_01.h
tests/adolc/step-44.cc
tests/base/geometry_info_2.cc
tests/base/geometry_info_4.cc
tests/base/geometry_info_5.cc
tests/base/geometry_info_6.cc
tests/base/geometry_info_7.cc
tests/bits/cylinder_01.cc
tests/bits/cylinder_02.cc
tests/bits/cylinder_03.cc
tests/bits/cylinder_04.cc
tests/bits/distorted_cells_01.cc
tests/bits/distorted_cells_07.cc
tests/bits/find_cell_1.cc
tests/bits/find_cell_10a.cc
tests/bits/find_cell_2.cc
tests/bits/find_cell_3.cc
tests/bits/find_cell_4.cc
tests/bits/find_cell_5.cc
tests/bits/find_cell_8.cc
tests/bits/find_cell_9.cc
tests/bits/find_cell_alt_1.cc
tests/bits/find_cell_alt_2.cc
tests/bits/find_cell_alt_3.cc
tests/bits/find_cell_alt_4.cc
tests/bits/find_cell_alt_5.cc
tests/bits/find_cell_alt_6.cc
tests/bits/find_cell_alt_7.cc
tests/bits/find_cells_adjacent_to_vertex_1.cc
tests/bits/step-13.cc
tests/bits/step-14.cc
tests/bits/step-2.cc
tests/codim_one/extract_boundary_mesh_02.cc
tests/codim_one/extract_boundary_mesh_03.cc
tests/codim_one/extract_boundary_mesh_04.cc
tests/data_out/data_out_curved_cells.cc
tests/data_out/data_out_hdf5_02.cc
tests/data_out/patches.h
tests/distributed_grids/3d_coarse_grid_05.cc
tests/dofs/dof_tools_21_b.cc
tests/dofs/dof_tools_21_b_x.cc
tests/dofs/dof_tools_21_b_x_q3.cc
tests/dofs/dof_tools_21_b_y.cc
tests/dofs/dof_tools_21_c.cc
tests/fail/circular_01.cc
tests/fail/hp-step-14.cc
tests/fe/fe_abf_gradient_divergence_theorem.cc
tests/fe/fe_br.cc
tests/fe/fe_dgp_3rd_derivative_divergence_theorem.cc
tests/fe/fe_dgq_3rd_derivative_divergence_theorem.cc
tests/fe/fe_dgq_gradient_divergence_theorem.cc
tests/fe/fe_dgq_hessian_divergence_theorem.cc
tests/fe/fe_face_orientation_nedelec_0.cc
tests/fe/fe_nedelec_gradient_divergence_theorem.cc
tests/fe/fe_nedelec_hessian_divergence_theorem.cc
tests/fe/fe_nedelec_sz_gradient_divergence_theorem.cc
tests/fe/fe_project_2d.cc
tests/fe/fe_project_3d.cc
tests/fe/fe_q_3rd_derivative_divergence_theorem.cc
tests/fe/fe_q_gradient_divergence_theorem.cc
tests/fe/fe_q_hessian_divergence_theorem.cc
tests/fe/fe_q_hierarchical_3rd_derivative_divergence_theorem.cc
tests/fe/fe_rt_gradient_divergence_theorem.cc
tests/fe/fe_rt_hessian_divergence_theorem.cc
tests/fe/fe_system_3rd_derivative_divergence_theorem.cc
tests/fullydistributed_grids/copy_serial_tria_03.cc
tests/gmsh/create_tria_01.cc
tests/grid/build_triangulation_from_patch_01.cc
tests/grid/build_triangulation_from_patch_02.cc
tests/grid/build_triangulation_from_patch_03.cc
tests/grid/build_triangulation_from_patch_04.cc
tests/grid/coarsening_02.cc
tests/grid/coarsening_02_1d.cc
tests/grid/coarsening_03.cc
tests/grid/enclosing_sphere_01.cc
tests/grid/grid_generator_airfoil_01.cc
tests/grid/grid_in.cc
tests/grid/grid_in_3d.cc
tests/grid/grid_in_3d_02.cc
tests/grid/grid_in_abaqus_01.cc
tests/grid/grid_in_abaqus_02.cc
tests/grid/grid_in_gmsh_01.cc
tests/grid/grid_in_gmsh_01_v4.cc
tests/grid/grid_in_gmsh_01_v41.cc
tests/grid/grid_in_msh_version_4.cc
tests/grid/grid_invert.cc
tests/grid/grid_out_08.cc
tests/grid/grid_out_09.cc
tests/grid/grid_out_in_vtk_01.cc
tests/grid/grid_out_svg_01.cc
tests/grid/grid_out_svg_02.cc
tests/grid/grid_tools_05.cc
tests/grid/grid_tools_06.cc
tests/grid/grid_tools_compute_mesh_predicate_bounding_box_1.cc
tests/grid/merge_triangulations_03.cc
tests/grid/merge_triangulations_04.cc
tests/grid/mesh_3d_3.cc
tests/grid/oned_vertex_manifold.cc
tests/grid/project_to_object_01.cc
tests/grid/subcelldata.cc
tests/hp/crash_17.cc
tests/hp/crash_18.cc
tests/hp/distribute_dofs_linear_time.cc
tests/hp/project_01.cc
tests/hp/project_01_curved_boundary.cc
tests/hp/project_02.cc
tests/hp/step-13.cc
tests/hp/step-2.cc
tests/hp/step-27.cc
tests/lac/constraints_c1.cc
tests/lac/inhomogeneous_constraints.cc
tests/manifold/flat_manifold_08.cc
tests/manifold/flat_manifold_09.cc
tests/mappings/mapping_q_eulerian_09.cc
tests/mappings/mapping_q_mixed_manifolds_02.cc
tests/matrix_free/matrix_vector_faces_25.cc
tests/meshworker/step-50-mesh_loop.cc
tests/mpi/communicate_moved_vertices_03.cc
tests/mpi/data_out_hdf5_02.cc
tests/mpi/periodicity_04.cc
tests/mpi/petsc_step-27.cc
tests/mpi/tria_copy_triangulation.cc
tests/mpi/trilinos_step-27.cc
tests/multigrid/dof_01.cc
tests/multigrid/interface_matrix_entry_01.cc
tests/multigrid/max_level_for_coarse_mesh.cc
tests/multigrid/mg_output_dirichlet.cc
tests/multigrid/mg_output_neumann.cc
tests/multigrid/mg_renumbered_01.cc
tests/multigrid/mg_renumbered_02.cc
tests/multigrid/mg_renumbered_03.cc
tests/multigrid/step-16-02.cc
tests/multigrid/step-16-bdry1.cc
tests/multigrid/step-50_02.cc
tests/multigrid/transfer_03.cc
tests/numerics/kelly_crash_02.cc
tests/numerics/project_01.cc
tests/numerics/project_01_curved_boundary.cc
tests/numerics/project_02.cc
tests/numerics/project_03.cc
tests/optimization/step-44.h
tests/physics/elasticity-kinematics_01.cc
tests/physics/step-18-rotation_matrix.cc
tests/physics/step-18.cc
tests/physics/step-44-standard_tensors-material_push_forward.cc
tests/physics/step-44-standard_tensors-spatial.cc
tests/physics/step-44.cc
tests/serialization/cell_data_1.cc
tests/serialization/dof_handler_01.cc
tests/serialization/hp_dof_handler_01.cc
tests/serialization/triangulation_01.cc
tests/serialization/triangulation_02.cc

index 6372cbb4b98f7d4fdb7c22ca8ed0091b57e51551..d0ec99f9158eae332351d908700c7e047fc95ec5 100644 (file)
@@ -714,8 +714,7 @@ namespace Step44
             cell = dof_handler_ref.begin_active(),
             endc = dof_handler_ref.end();
           for (; cell != endc; ++cell)
-            for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
-                 ++v)
+            for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
               if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale)
                 {
                   Tensor<1, dim> soln;
index 6bc36540e8b3e402231d037f9e25914eb99d5ad3..b7e0d05ee234063b8e006fa9fdd933d9d4205d25 100644 (file)
@@ -994,8 +994,7 @@ namespace Step44
             cell = dof_handler_ref.begin_active(),
             endc = dof_handler_ref.end();
           for (; cell != endc; ++cell)
-            for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
-                 ++v)
+            for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
               if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale)
                 {
                   Tensor<1, dim> soln;
index 4988f19ef534385e1d9506c92f4e7384cb2d7423..23c133df8ec3fe9bb2b368c742e820abfe5eafc3 100644 (file)
@@ -680,8 +680,7 @@ namespace Step44
             cell = dof_handler_ref.begin_active(),
             endc = dof_handler_ref.end();
           for (; cell != endc; ++cell)
-            for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
-                 ++v)
+            for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
               if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale)
                 {
                   Tensor<1, dim> soln;
index bb416e79b3ff7d4c46d0bb5e41d39af3c0b1332b..03f6e2fdfd5d51e252cf1272f943d913ef82c018 100644 (file)
@@ -715,8 +715,7 @@ namespace Step44
             cell = dof_handler_ref.begin_active(),
             endc = dof_handler_ref.end();
           for (; cell != endc; ++cell)
-            for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
-                 ++v)
+            for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
               if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale)
                 {
                   Tensor<1, dim> soln;
index a549e37c7708a356e6e342b748fee37c613edce1..f1e9de190f5b0ecccb27d49f1c4ebfd8decf1921 100644 (file)
@@ -829,8 +829,7 @@ namespace Step44
             cell = dof_handler_ref.begin_active(),
             endc = dof_handler_ref.end();
           for (; cell != endc; ++cell)
-            for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
-                 ++v)
+            for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
               if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale)
                 {
                   Tensor<1, dim> soln;
index 23c6f5c6299e32e5629cfc43ae7bff4a7ae1b497..9e87421b4fe325de0d61a125b3ae1a8db58c4832 100644 (file)
@@ -99,7 +99,7 @@ test()
   for (unsigned int f = 0; f < GeometryInfo<dim>::lines_per_cell; ++f)
     {
       deallog << "line_vertices" << f;
-      for (unsigned int v = 0; v < GeometryInfo<1>::vertices_per_cell; ++v)
+      for (const unsigned int v : GeometryInfo<1>::vertex_indices())
         deallog << ' ' << GeometryInfo<dim>::line_to_cell_vertices(f, v);
       deallog << std::endl;
     }
index a0e3b9b28522b851ad952ccb64e01d23fe9c1d49..61363039e5a530de525ca519f736480642bbd25d 100644 (file)
@@ -30,8 +30,8 @@ test()
   deallog << "Checking in " << dim << "d" << std::endl;
 
   // check phi_i(v_j) = delta_{ij}
-  for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
-    for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+  for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
+    for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
       {
         const double phi_i = GeometryInfo<dim>::d_linear_shape_function(
           GeometryInfo<dim>::unit_cell_vertex(v), i);
@@ -44,10 +44,10 @@ test()
   //    sum_i phi_i(x) == 1
   // at all points. do so at every
   // vertex, and then at the center
-  for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+  for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
     {
       double s = 0;
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         s += GeometryInfo<dim>::d_linear_shape_function(
           GeometryInfo<dim>::unit_cell_vertex(v), i);
       AssertThrow(s == 1, ExcInternalError());
@@ -60,7 +60,7 @@ test()
       center[i] = 0.5;
 
     double s = 0;
-    for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
       s += GeometryInfo<dim>::d_linear_shape_function(center, i);
     AssertThrow(s == 1, ExcInternalError());
 
index df1a52ae5480e96d054d71adb03988adfb6a3f92..bdc31af2c94c2aaaafef94a4c3e5dbc7dc0a55b3 100644 (file)
@@ -30,8 +30,8 @@ test()
   deallog << "Checking in " << dim << "d" << std::endl;
 
   // check phi_i(v_j) = delta_{ij}
-  for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
-    for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+  for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
+    for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
       {
         const Tensor<1, dim> phi_i_grad =
           GeometryInfo<dim>::d_linear_shape_function_gradient(
@@ -46,10 +46,10 @@ test()
   // gradient of the sum of shape functions
   // is zero. do so at every vertex, and then
   // at the center
-  for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+  for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
     {
       Tensor<1, dim> s;
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         s += GeometryInfo<dim>::d_linear_shape_function_gradient(
           GeometryInfo<dim>::unit_cell_vertex(v), i);
       AssertThrow(s.norm() == 0, ExcInternalError());
@@ -62,7 +62,7 @@ test()
       center[i] = 0.5;
 
     Tensor<1, dim> s;
-    for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
       s += GeometryInfo<dim>::d_linear_shape_function_gradient(center, i);
     AssertThrow(s.norm() == 0, ExcInternalError());
 
index 0d822188387a7182295e843947dbb675d6c62966..1c36853334f2de339241ac258bb50fe351246655 100644 (file)
@@ -35,12 +35,12 @@ test()
   // that case
   {
     Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
-    for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+    for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
       vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
 
     Tensor<0, dim> determinants[GeometryInfo<dim>::vertices_per_cell];
     GeometryInfo<dim>::alternating_form_at_vertices(vertices, determinants);
-    for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+    for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
       {
         deallog << "Reference cell: " << determinants[v] << std::endl;
         AssertThrow(static_cast<double>(determinants[v]) == 1,
@@ -52,7 +52,7 @@ test()
   // in the x-direction by a factor of 10
   {
     Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
-    for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+    for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
       {
         vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
         vertices[v][0] /= 10;
@@ -60,7 +60,7 @@ test()
 
     Tensor<0, dim> determinants[GeometryInfo<dim>::vertices_per_cell];
     GeometryInfo<dim>::alternating_form_at_vertices(vertices, determinants);
-    for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+    for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
       {
         deallog << "Squashed cell: " << determinants[v] << std::endl;
         AssertThrow(static_cast<double>(determinants[v]) == 0.1,
@@ -75,7 +75,7 @@ test()
   // 1d)
   {
     Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
-    for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+    for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
       {
         vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
         vertices[v][0] /= 10;
@@ -89,7 +89,7 @@ test()
 
     Tensor<0, dim> determinants[GeometryInfo<dim>::vertices_per_cell];
     GeometryInfo<dim>::alternating_form_at_vertices(vertices, determinants);
-    for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+    for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
       {
         deallog << "Squashed+rotated cell: " << determinants[v] << std::endl;
         AssertThrow(static_cast<double>(determinants[v]) == 0.1,
@@ -100,13 +100,13 @@ test()
   // pinched cell
   {
     Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
-    for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+    for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
       vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
     vertices[1] /= 10;
 
     Tensor<0, dim> determinants[GeometryInfo<dim>::vertices_per_cell];
     GeometryInfo<dim>::alternating_form_at_vertices(vertices, determinants);
-    for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+    for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
       deallog << "Pinched cell: " << determinants[v] << std::endl;
   }
 
@@ -114,13 +114,13 @@ test()
   // inverted cell
   {
     Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
-    for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+    for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
       vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
     std::swap(vertices[0], vertices[1]);
 
     Tensor<0, dim> determinants[GeometryInfo<dim>::vertices_per_cell];
     GeometryInfo<dim>::alternating_form_at_vertices(vertices, determinants);
-    for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+    for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
       deallog << "Inverted cell: " << determinants[v] << std::endl;
   }
 }
index f83e7a1483e913bfd0748af5163185e4a38e6777..99af91de8d1db824ff453fd5b86c65c295d5498c 100644 (file)
@@ -35,7 +35,7 @@ test()
   // that case
   {
     Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
-    for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+    for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
       vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
 
     for (const unsigned int f : GeometryInfo<dim>::face_indices())
@@ -61,7 +61,7 @@ test()
   // in the x-direction by a factor of 10
   {
     Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
-    for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+    for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
       {
         vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
         vertices[v][0] /= 10;
@@ -105,7 +105,7 @@ test()
   // 1d)
   {
     Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
-    for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+    for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
       {
         vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
         vertices[v][0] /= 10;
@@ -152,7 +152,7 @@ test()
   // pinched cell
   {
     Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
-    for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+    for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
       vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
     vertices[1] /= 10;
 
@@ -175,7 +175,7 @@ test()
   // inverted cell
   {
     Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
-    for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+    for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
       vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
     std::swap(vertices[0], vertices[1]);
 
index 53f0fb3a02bf7fac5decd55415f07a171f00b034..f3442c9dcf0a4bd4eee8a6087afbef41587cd40f 100644 (file)
@@ -56,7 +56,7 @@ check<2>()
          triangulation.begin_active();
        cell != triangulation.end();
        ++cell)
-    for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
       deallog << cell->vertex(i) << std::endl;
 }
 
@@ -76,7 +76,7 @@ check<3>()
          triangulation.begin_active();
        cell != triangulation.end();
        ++cell)
-    for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
       deallog << cell->vertex(i) << std::endl;
 }
 
index c6e64ca2abf22525401a41335e475fc76ea45c46..a1949bcb2aa2df17709c3a36864e822064495cce 100644 (file)
@@ -73,7 +73,7 @@ check()
          triangulation.begin_active();
        cell != triangulation.end();
        ++cell)
-    for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
       deallog << cell->vertex(i) << std::endl;
 }
 
index 1c0586424a4a55a48a897163050b3e5ccb5f8722..71ff40266a2bee4f01af3e2d24775b14316f70ba 100644 (file)
@@ -67,7 +67,7 @@ check()
          triangulation.begin_active();
        cell != triangulation.end();
        ++cell)
-    for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
       deallog << cell->vertex(i) << std::endl;
 }
 
index 9f0e0196d89a1e373130430b4e27ef3b3caefe2b..309941d95481081d984ba2c4e882361e25fd5a31 100644 (file)
@@ -70,7 +70,7 @@ check()
          triangulation.begin_active();
        cell != triangulation.end();
        ++cell)
-    for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
       deallog << cell->vertex(i) << std::endl;
 }
 
index 29b70e2eca4ddedabea0037234fbb5e3334b00d1..424b431834eaecf09bd0244f58d824cbb358cd21 100644 (file)
@@ -42,7 +42,7 @@ void
 check(const unsigned int testcase)
 {
   std::vector<Point<dim>> vertices;
-  for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+  for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
     vertices.push_back(GeometryInfo<dim>::unit_cell_vertex(v));
 
   switch (testcase)
@@ -63,7 +63,7 @@ check(const unsigned int testcase)
   std::vector<CellData<dim>> cells;
   {
     CellData<dim> cell;
-    for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+    for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
       cell.vertices[j] = j;
     cells.push_back(cell);
   }
index ac5e3aa3dfdd4dc90de4bb0e47606b0cefa7841b..e295cab85827892e420c1e529130a0f3c13cdb78 100644 (file)
@@ -42,7 +42,7 @@ void
 check(const unsigned int testcase)
 {
   std::vector<Point<dim>> vertices;
-  for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+  for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
     vertices.push_back(GeometryInfo<dim>::unit_cell_vertex(v));
 
   switch (testcase)
@@ -59,7 +59,7 @@ check(const unsigned int testcase)
   std::vector<CellData<dim>> cells;
   {
     CellData<dim> cell;
-    for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+    for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
       cell.vertices[j] = j;
     cells.push_back(cell);
   }
index ad5071d33c09b27143d7aeccfe3a948727097e1a..9eef484c59f7702d86a906606a9a6b9e4e3e8e7f 100644 (file)
@@ -37,7 +37,7 @@ void check(Triangulation<2> &tria)
     GridTools::find_active_cell_around_point(tria, p);
 
   deallog << cell << std::endl;
-  for (unsigned int v = 0; v < GeometryInfo<2>::vertices_per_cell; ++v)
+  for (const unsigned int v : GeometryInfo<2>::vertex_indices())
     deallog << "<" << cell->vertex(v) << "> ";
   deallog << std::endl;
 
index 77216e7810c471075cc9f67ca8afb4510c9cfa8d..47146a7dca6c10fc737efd346186ca54042010aa 100644 (file)
@@ -68,7 +68,7 @@ void create_coarse_grid(Triangulation<2> &coarse_grid)
   std::vector<CellData<2>> cells(n_cells, CellData<2>());
   for (unsigned int i = 0; i < n_cells; ++i)
     {
-      for (unsigned int j = 0; j < GeometryInfo<2>::vertices_per_cell; ++j)
+      for (const unsigned int j : GeometryInfo<2>::vertex_indices())
         cells[i].vertices[j] = cell_vertices[i][j];
       cells[i].material_id = 0;
     }
index 614424232623ad711252759cd6209a390539728d..aad6b678f95c1c9ab1b5aa6a1549d1310031fce0 100644 (file)
@@ -36,7 +36,7 @@ void check(Triangulation<3> &tria)
     GridTools::find_active_cell_around_point(tria, p);
 
   deallog << cell << std::endl;
-  for (unsigned int v = 0; v < GeometryInfo<3>::vertices_per_cell; ++v)
+  for (const unsigned int v : GeometryInfo<3>::vertex_indices())
     deallog << "<" << cell->vertex(v) << "> ";
   deallog << std::endl;
 
index 87c1fe98fea670a8eb4fb515ea2eadb0d8aa5c9d..04471aa2a611d63dd8fe4fe6319ecaa7caec164f 100644 (file)
@@ -38,7 +38,7 @@ void check(Triangulation<3> &tria)
     GridTools::find_active_cell_around_point(tria, p);
 
   deallog << cell << std::endl;
-  for (unsigned int v = 0; v < GeometryInfo<3>::vertices_per_cell; ++v)
+  for (const unsigned int v : GeometryInfo<3>::vertex_indices())
     deallog << "<" << cell->vertex(v) << "> ";
   deallog << std::endl;
 
index 74788d870bc0f889b16cf06c03b1db7d0b5e38cd..fb2fe679978abf4f2943b86db2798aac51c665d0 100644 (file)
@@ -38,7 +38,7 @@ void check(Triangulation<3> &tria)
     GridTools::find_active_cell_around_point(tria, p);
 
   deallog << cell << std::endl;
-  for (unsigned int v = 0; v < GeometryInfo<3>::vertices_per_cell; ++v)
+  for (const unsigned int v : GeometryInfo<3>::vertex_indices())
     deallog << "<" << cell->vertex(v) << "> ";
   deallog << std::endl;
 
index 918a8ebe8b623f85f2dbb3e82ab05774417ea875..cae4e5df992e22b18f29f7597c1271978054b63f 100644 (file)
@@ -40,7 +40,7 @@ void check(Triangulation<3> &tria)
     GridTools::find_active_cell_around_point(tria, p);
 
   deallog << cell << std::endl;
-  for (unsigned int v = 0; v < GeometryInfo<3>::vertices_per_cell; ++v)
+  for (const unsigned int v : GeometryInfo<3>::vertex_indices())
     deallog << "<" << cell->vertex(v) << "> ";
   deallog << std::endl;
 
index 37cb67403c0b3bd17dd05dbc171047ec14adf09b..e7d995060775cdf6d585ebebb763320c0fa6dd91 100644 (file)
@@ -53,7 +53,7 @@ void create_coarse_grid(Triangulation<2> &coarse_grid)
   std::vector<CellData<2>> cells(n_cells, CellData<2>());
   for (unsigned int i = 0; i < n_cells; ++i)
     {
-      for (unsigned int j = 0; j < GeometryInfo<2>::vertices_per_cell; ++j)
+      for (const unsigned int j : GeometryInfo<2>::vertex_indices())
         cells[i].vertices[j] = cell_vertices[i][j];
       cells[i].material_id = 0;
     }
@@ -70,7 +70,7 @@ void check(Triangulation<2> &tria)
     GridTools::find_active_cell_around_point(tria, p);
 
   deallog << cell << std::endl;
-  for (unsigned int v = 0; v < GeometryInfo<2>::vertices_per_cell; ++v)
+  for (const unsigned int v : GeometryInfo<2>::vertex_indices())
     deallog << "<" << cell->vertex(v) << "> ";
   deallog << std::endl;
 
index 75f88ec89652ede96faad789569b2be296f8345e..46730d39f0109a2f8dcf9f79f773d7289a8416d6 100644 (file)
@@ -56,7 +56,7 @@ void create_coarse_grid(Triangulation<2> &coarse_grid)
   std::vector<CellData<2>> cells(n_cells, CellData<2>());
   for (unsigned int i = 0; i < n_cells; ++i)
     {
-      for (unsigned int j = 0; j < GeometryInfo<2>::vertices_per_cell; ++j)
+      for (const unsigned int j : GeometryInfo<2>::vertex_indices())
         cells[i].vertices[j] = cell_vertices[i][j];
       cells[i].material_id = 0;
     }
@@ -73,7 +73,7 @@ void check(Triangulation<2> &tria)
     GridTools::find_active_cell_around_point(tria, p);
 
   deallog << cell << std::endl;
-  for (unsigned int v = 0; v < GeometryInfo<2>::vertices_per_cell; ++v)
+  for (const unsigned int v : GeometryInfo<2>::vertex_indices())
     deallog << "<" << cell->vertex(v) << "> ";
   deallog << std::endl;
 
index 12c948c9a207a14361bc8cef8e7627b214123290..040867187a102c73cf44688ad3d4599cbe2cd341 100644 (file)
@@ -42,7 +42,7 @@ void check(Triangulation<2> &tria)
     GridTools::find_active_cell_around_point(map, tria, p);
 
   deallog << cell.first << std::endl;
-  for (unsigned int v = 0; v < GeometryInfo<2>::vertices_per_cell; ++v)
+  for (const unsigned int v : GeometryInfo<2>::vertex_indices())
     deallog << "<" << cell.first->vertex(v) << "> ";
   deallog << "[ " << cell.second << "] ";
   deallog << std::endl;
index afa539a9ab2c7629d98340d542ea5deae537d16e..c3d7abaaf76e1d8703c66c3bbaa7f07b476c839f 100644 (file)
@@ -40,7 +40,7 @@ void check(Triangulation<3> &tria)
     GridTools::find_active_cell_around_point(map, tria, p);
 
   deallog << cell.first << std::endl;
-  for (unsigned int v = 0; v < GeometryInfo<3>::vertices_per_cell; ++v)
+  for (const unsigned int v : GeometryInfo<3>::vertex_indices())
     deallog << "<" << cell.first->vertex(v) << "> " << std::endl;
   deallog << "[ " << cell.second << "] ";
 
index a8407f738a97c889c0b76106efdfb060bbebd876..be79c30b80257bb0feef077cb9a70f88d9345483 100644 (file)
@@ -42,7 +42,7 @@ void check(Triangulation<3> &tria)
     GridTools::find_active_cell_around_point(map, tria, p);
 
   deallog << cell.first << std::endl;
-  for (unsigned int v = 0; v < GeometryInfo<3>::vertices_per_cell; ++v)
+  for (const unsigned int v : GeometryInfo<3>::vertex_indices())
     deallog << "<" << cell.first->vertex(v) << "> ";
   deallog << "[ " << cell.second << "] ";
   deallog << std::endl;
index 4fbf4fd90563da29c3561abcec19b249888c23e0..5583c37b113d37112a1dd97c80268bdb5be49e7c 100644 (file)
@@ -40,7 +40,7 @@ void check(Triangulation<3> &tria)
     GridTools::find_active_cell_around_point(map, tria, p);
 
   deallog << cell.first << std::endl;
-  for (unsigned int v = 0; v < GeometryInfo<3>::vertices_per_cell; ++v)
+  for (const unsigned int v : GeometryInfo<3>::vertex_indices())
     deallog << "<" << cell.first->vertex(v) << "> ";
   deallog << "[ " << cell.second << "] ";
   deallog << std::endl;
index c0999e1efe3fd2b24c9c7804efd9db48226b0693..0565706d941be56e2a3aa0acf16cc005e2db1a79 100644 (file)
@@ -39,7 +39,7 @@ void check(Triangulation<3> &tria)
     GridTools::find_active_cell_around_point(map, tria, p);
 
   deallog << cell.first << std::endl;
-  for (unsigned int v = 0; v < GeometryInfo<3>::vertices_per_cell; ++v)
+  for (const unsigned int v : GeometryInfo<3>::vertex_indices())
     deallog << "<" << cell.first->vertex(v) << "> ";
   deallog << "[ " << cell.second << "] ";
   deallog << std::endl;
index de0729f406a4b72531529f775524c86c3ba01dee..203c0c24cfd2048d399724f031c9f758103645a3 100644 (file)
@@ -52,7 +52,7 @@ void check(Triangulation<2> &tria)
         GridTools::find_active_cell_around_point(map, tria, v[i]);
 
       deallog << "Vertex <" << v[i] << "> found in cell ";
-      for (unsigned int v = 0; v < GeometryInfo<2>::vertices_per_cell; ++v)
+      for (const unsigned int v : GeometryInfo<2>::vertex_indices())
         deallog << "<" << cell.first->vertex(v) << "> ";
       deallog << " [local: " << cell.second << "]" << std::endl;
     }
index c2cd625ecdac16efa25ca830cb173d476710a1e5..1a708592b8e8b54ccffaa383deb1afbe8e81b78f 100644 (file)
@@ -48,7 +48,7 @@ void check(Triangulation<2> &tria)
         GridTools::find_active_cell_around_point(map, tria, p);
 
       deallog << cell.first << std::endl;
-      for (unsigned int v = 0; v < GeometryInfo<2>::vertices_per_cell; ++v)
+      for (const unsigned int v : GeometryInfo<2>::vertex_indices())
         deallog << "< " << cell.first->vertex(v) << " > ";
       deallog << "[ " << cell.second << " ] ";
 
index 0de8f0dec742b1f675f24c9c77b61bc26d6ffe6c..7a0271a643b082bc20a88362298e8921d01ef465 100644 (file)
@@ -51,7 +51,7 @@ void check(Triangulation<2> &tria)
 
       for (unsigned c = 0; c < cells.size(); c++)
         {
-          for (unsigned int v = 0; v < GeometryInfo<2>::vertices_per_cell; ++v)
+          for (const unsigned int v : GeometryInfo<2>::vertex_indices())
             deallog << "<" << cells[c]->vertex(v) << "> ";
           deallog << std::endl;
         }
index 727b8aeecc0bf7b5f9bc5537e24b1770815b925c..5a3d523aed24aae80c01cbbd316c262c9befe2a4 100644 (file)
@@ -138,9 +138,7 @@ namespace Evaluation
                                                    endc = dof_handler.end();
     bool evaluation_point_found                         = false;
     for (; (cell != endc) && !evaluation_point_found; ++cell)
-      for (unsigned int vertex = 0;
-           vertex < GeometryInfo<dim>::vertices_per_cell;
-           ++vertex)
+      for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
         if (cell->vertex(vertex) == evaluation_point)
           {
             point_value = solution(cell->vertex_dof_index(vertex, 0));
index 0fb7762c856f8db3afc3138a9acb594e33d91433..f5c785426f0f390899b96c9cbab377c86fd20606 100644 (file)
@@ -135,9 +135,7 @@ namespace Evaluation
                                                    endc = dof_handler.end();
     bool evaluation_point_found                         = false;
     for (; (cell != endc) && !evaluation_point_found; ++cell)
-      for (unsigned int vertex = 0;
-           vertex < GeometryInfo<dim>::vertices_per_cell;
-           ++vertex)
+      for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
         if (cell->vertex(vertex).distance(evaluation_point) <
             cell->diameter() * 1e-8)
           {
@@ -201,9 +199,7 @@ namespace Evaluation
                                                    endc = dof_handler.end();
     unsigned int evaluation_point_hits                  = 0;
     for (; cell != endc; ++cell)
-      for (unsigned int vertex = 0;
-           vertex < GeometryInfo<dim>::vertices_per_cell;
-           ++vertex)
+      for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
         if (cell->vertex(vertex) == evaluation_point)
           {
             fe_values.reinit(cell);
@@ -1087,7 +1083,7 @@ namespace Data
     std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
     for (unsigned int i = 0; i < n_cells; ++i)
       {
-        for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+        for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
           cells[i].vertices[j] = cell_vertices[i][j];
         cells[i].material_id = 0;
       };
@@ -1150,9 +1146,7 @@ namespace DualFunctional
                                                      dof_handler.begin_active(),
                                                    endc = dof_handler.end();
     for (; cell != endc; ++cell)
-      for (unsigned int vertex = 0;
-           vertex < GeometryInfo<dim>::vertices_per_cell;
-           ++vertex)
+      for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
         if (cell->vertex(vertex).distance(evaluation_point) <
             cell->diameter() * 1e-8)
           {
index 2c9ee2feb73287c26df49075b42f9e02c4d6cfcd..7b4c0b82f1db27c41ad71e1fe4ac4c92301e0605 100644 (file)
@@ -59,9 +59,7 @@ void make_grid(Triangulation<2> &triangulation)
                                              endc = triangulation.end();
 
       for (; cell != endc; ++cell)
-        for (unsigned int vertex = 0;
-             vertex < GeometryInfo<2>::vertices_per_cell;
-             ++vertex)
+        for (const unsigned int vertex : GeometryInfo<2>::vertex_indices())
           {
             const double distance_from_center =
               center.distance(cell->vertex(vertex));
index e9fb543df8342d375c702a5765725f6a8d1381b7..6f385550d382fd7049c386be635a0bee6c6cab88 100644 (file)
@@ -55,11 +55,11 @@ test_vertices_orientation(
       face = surface_to_volume_mapping[cell];
 
       deallog << "Surface cell: " << cell << " with vertices:" << std::endl;
-      for (unsigned int k = 0; k < GeometryInfo<s_dim>::vertices_per_cell; ++k)
+      for (const unsigned int k : GeometryInfo<s_dim>::vertex_indices())
         deallog << "  " << cell->vertex(k) << std::endl;
 
       deallog << "Volume face: " << face << " with vertices:" << std::endl;
-      for (unsigned int k = 0; k < GeometryInfo<s_dim>::vertices_per_cell; ++k)
+      for (const unsigned int k : GeometryInfo<s_dim>::vertex_indices())
         deallog << "  " << face->vertex(k) << std::endl;
 
       Point<spacedim> diff(face->center());
index df962367008a981ffd5087ed1d52d85b0a5aea52..3f526cc09a1bb654a70453fe94db947de5861b0c 100644 (file)
@@ -54,7 +54,7 @@ test_vertices_orientation(
       Assert(face->at_boundary(), ExcInternalError());
 
       deallog << "Surface cell: " << cell << " with vertices:" << std::endl;
-      for (unsigned int k = 0; k < GeometryInfo<s_dim>::vertices_per_cell; ++k)
+      for (const unsigned int k : GeometryInfo<s_dim>::vertex_indices())
         {
           deallog << "  " << cell->vertex(k) << std::endl;
           Assert(std::fabs(cell->vertex(k).distance(Point<spacedim>()) - 1) <
@@ -63,7 +63,7 @@ test_vertices_orientation(
         }
 
       deallog << "Volume face: " << face << " with vertices:" << std::endl;
-      for (unsigned int k = 0; k < GeometryInfo<s_dim>::vertices_per_cell; ++k)
+      for (const unsigned int k : GeometryInfo<s_dim>::vertex_indices())
         {
           deallog << "  " << face->vertex(k) << std::endl;
           Assert(std::fabs(face->vertex(k).distance(Point<spacedim>()) - 1) <
index ad70237760e58b14649c8f60b8379cc6685132e9..5bf0c3005f3cd2f365a84233713a75c714c12bbe 100644 (file)
@@ -54,7 +54,7 @@ test_vertices_orientation(
       Assert(face->at_boundary(), ExcInternalError());
 
       deallog << "Surface cell: " << cell << " with vertices:" << std::endl;
-      for (unsigned int k = 0; k < GeometryInfo<s_dim>::vertices_per_cell; ++k)
+      for (const unsigned int k : GeometryInfo<s_dim>::vertex_indices())
         {
           deallog << "  " << cell->vertex(k) << std::endl;
           Assert(std::fabs(cell->vertex(k).distance(Point<spacedim>()) - 1) <
@@ -63,7 +63,7 @@ test_vertices_orientation(
         }
 
       deallog << "Volume face: " << face << " with vertices:" << std::endl;
-      for (unsigned int k = 0; k < GeometryInfo<s_dim>::vertices_per_cell; ++k)
+      for (const unsigned int k : GeometryInfo<s_dim>::vertex_indices())
         {
           deallog << "  " << face->vertex(k) << std::endl;
           Assert(std::fabs(face->vertex(k).distance(Point<spacedim>()) - 1) <
index 3508caa7f1e3c8b1cad7ba9f6aa04e4d4efefa89..782392e27415279c6cde1fd07452ab81d9daa2d1 100644 (file)
@@ -162,9 +162,7 @@ curved_grid(std::ofstream &out)
   for (; cell != endc; ++cell)
     {
       // fix all vertices
-      for (unsigned int vertex_no = 0;
-           vertex_no < GeometryInfo<2>::vertices_per_cell;
-           ++vertex_no)
+      for (const unsigned int vertex_no : GeometryInfo<2>::vertex_indices())
         {
           for (unsigned int i = 0; i < 2; ++i)
             m[i][cell->vertex_dof_index(vertex_no, 0)] = 0.;
index 2cb13dd8ec30238ccc2edcf0a7680004c440424e..0c555e3fda2f1f24ad430d3c3c015354bda029bf 100644 (file)
@@ -41,7 +41,7 @@ create_patches(std::vector<DataOutBase::Patch<dim, spacedim>> &patches)
       const unsigned int nsubp = nsub + 1;
 
       patch.n_subdivisions = nsub;
-      for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+      for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
         for (unsigned int d = 0; d < spacedim; ++d)
           patch.vertices[v](d) =
             p + cell_coordinates[d][v] + ((d >= dim) ? v : 0);
index da6ca77b488ef8152f8b6c5e56cce944de4f3404..52285f75b84c419a5baf6435c86f794f6bb3123f 100644 (file)
@@ -35,7 +35,7 @@ create_patches(std::vector<DataOutBase::Patch<dim, spacedim>> &patches)
       const unsigned int nsubp = nsub + 1;
 
       patch.n_subdivisions = nsub;
-      for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+      for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
         for (unsigned int d = 0; d < spacedim; ++d)
           patch.vertices[v](d) =
             p + cell_coordinates[d][v] + ((d >= dim) ? v : 0);
index a71d9eb98667c0a3a7cf17e117a7545d91c02786..818c529453b444c999b93242cf4a19ba473713cb 100644 (file)
@@ -81,7 +81,7 @@ create_disconnected_mesh(Triangulation<dim> &tria)
       }
 
     // Prepare cell data
-    for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
       cells[0].vertices[i] = i;
     cells[0].material_id = 0;
   }
@@ -133,7 +133,7 @@ create_disconnected_mesh(Triangulation<dim> &tria)
       }
 
     // Prepare cell data
-    for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
       cells[1].vertices[i] = GeometryInfo<dim>::vertices_per_cell + i;
     cells[1].material_id = 0;
   }
index 448eee1764aa8413abb29e4c97bc0fa1b7908e20..49cc57596bdd00e3ebebc9224c69d7b47b60a429 100644 (file)
@@ -82,7 +82,7 @@ void generate_grid(Triangulation<2> &triangulation, int orientation)
     {7, 6, 5, 4},
   };
 
-  for (unsigned int j = 0; j < GeometryInfo<2>::vertices_per_cell; ++j)
+  for (const unsigned int j : GeometryInfo<2>::vertex_indices())
     {
       cells[0].vertices[j] = cell_vertices_0[j];
       cells[1].vertices[j] = cell_vertices_1[orientation][j];
@@ -151,7 +151,7 @@ void generate_grid(Triangulation<3> &triangulation, int orientation)
     {15, 13, 14, 12, 11, 9, 10, 8},
   };
 
-  for (unsigned int j = 0; j < GeometryInfo<3>::vertices_per_cell; ++j)
+  for (const unsigned int j : GeometryInfo<3>::vertex_indices())
     {
       cells[0].vertices[j] = cell_vertices_0[j];
       cells[1].vertices[j] = cell_vertices_1[orientation][j];
index bf76667d60e0311786dc511584ab49f0b7b09d1c..7aa8ea1f9765e233a3718238dcd0072762ad88ae 100644 (file)
@@ -82,7 +82,7 @@ void generate_grid(Triangulation<2> &triangulation)
   /* cell 1 */
   int cell_vertices_1[GeometryInfo<2>::vertices_per_cell] = {7, 6, 5, 4};
 
-  for (unsigned int j = 0; j < GeometryInfo<2>::vertices_per_cell; ++j)
+  for (const unsigned int j : GeometryInfo<2>::vertex_indices())
     {
       cells[0].vertices[j] = cell_vertices_0[j];
       cells[1].vertices[j] = cell_vertices_1[j];
index 466d949142d3c3d8cafaaa02582e54501f3fe48f..029d85cb9384f7e360dca7f180f3e388ab0654da 100644 (file)
@@ -116,7 +116,7 @@ void generate_grid(Triangulation<2> &triangulation)
   /* cell 1 */
   int cell_vertices_1[GeometryInfo<2>::vertices_per_cell] = {7, 6, 5, 4};
 
-  for (unsigned int j = 0; j < GeometryInfo<2>::vertices_per_cell; ++j)
+  for (const unsigned int j : GeometryInfo<2>::vertex_indices())
     {
       cells[0].vertices[j] = cell_vertices_0[j];
       cells[1].vertices[j] = cell_vertices_1[j];
index 2a434aed4022b748dddecd52aaef44eb3e9f6da3..143f80075f54881968f9cf6521b570cecea757bf 100644 (file)
@@ -80,7 +80,7 @@ void generate_grid(Triangulation<2> &triangulation)
   /* cell 1 */
   int cell_vertices_1[GeometryInfo<2>::vertices_per_cell] = {7, 6, 5, 4};
 
-  for (unsigned int j = 0; j < GeometryInfo<2>::vertices_per_cell; ++j)
+  for (const unsigned int j : GeometryInfo<2>::vertex_indices())
     {
       cells[0].vertices[j] = cell_vertices_0[j];
       cells[1].vertices[j] = cell_vertices_1[j];
index d0464f1556cc044a6970c5256a8ba46d5bc45fac..7b684773bc7226d113eec9943c5831063c7a67e6 100644 (file)
@@ -85,7 +85,7 @@ void generate_grid(Triangulation<2> &triangulation, int orientation)
     {7, 6, 5, 4},
   };
 
-  for (unsigned int j = 0; j < GeometryInfo<2>::vertices_per_cell; ++j)
+  for (const unsigned int j : GeometryInfo<2>::vertex_indices())
     {
       cells[0].vertices[j] = cell_vertices_0[j];
       cells[1].vertices[j] = cell_vertices_1[orientation][j];
@@ -155,7 +155,7 @@ void generate_grid(Triangulation<3> &triangulation, int orientation)
     {15, 13, 14, 12, 11, 9, 10, 8},
   };
 
-  for (unsigned int j = 0; j < GeometryInfo<3>::vertices_per_cell; ++j)
+  for (const unsigned int j : GeometryInfo<3>::vertex_indices())
     {
       cells[0].vertices[j] = cell_vertices_0[j];
       cells[1].vertices[j] = cell_vertices_1[orientation][j];
index b94070c6a4add00c00e095c3727c6bc5f351b695..588c10d9480d6e362d2754529dde534a47363f52 100644 (file)
@@ -618,7 +618,7 @@ LaplaceProblem<2>::create_coarse_grid()
   std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
   for (unsigned int i = 0; i < n_cells; ++i)
     {
-      for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+      for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
         cells[i].vertices[j] = cell_vertices[i][j];
       cells[i].material_id = 0;
     }
@@ -784,7 +784,7 @@ LaplaceProblem<3>::create_coarse_grid()
   std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
   for (unsigned int i = 0; i < n_cells; ++i)
     {
-      for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+      for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
         cells[i].vertices[j] = cell_vertices[i][j];
       cells[i].material_id = 0;
     }
index a06360d9eaf8f07c9cee0c24d64bca4c8af9523c..13f4c1eced52e345ad68b5d07813b4e86285d04a 100644 (file)
@@ -136,9 +136,7 @@ namespace Evaluation
                                                        endc = dof_handler.end();
     bool evaluation_point_found                             = false;
     for (; (cell != endc) && !evaluation_point_found; ++cell)
-      for (unsigned int vertex = 0;
-           vertex < GeometryInfo<dim>::vertices_per_cell;
-           ++vertex)
+      for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
         if (cell->vertex(vertex).distance(evaluation_point) <
             cell->diameter() * 1e-8)
           {
@@ -202,9 +200,7 @@ namespace Evaluation
                                                        endc = dof_handler.end();
     unsigned int evaluation_point_hits                      = 0;
     for (; cell != endc; ++cell)
-      for (unsigned int vertex = 0;
-           vertex < GeometryInfo<dim>::vertices_per_cell;
-           ++vertex)
+      for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
         if (cell->vertex(vertex) == evaluation_point)
           {
             fe_values.reinit(cell);
@@ -1096,7 +1092,7 @@ namespace Data
     std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
     for (unsigned int i = 0; i < n_cells; ++i)
       {
-        for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+        for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
           cells[i].vertices[j] = cell_vertices[i][j];
         cells[i].material_id = 0;
       };
@@ -1161,9 +1157,7 @@ namespace DualFunctional
                                                                 .begin_active(),
                                                        endc = dof_handler.end();
     for (; cell != endc; ++cell)
-      for (unsigned int vertex = 0;
-           vertex < GeometryInfo<dim>::vertices_per_cell;
-           ++vertex)
+      for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
         if (cell->vertex(vertex).distance(evaluation_point) <
             cell->diameter() * 1e-8)
           {
index d2be402e2cb975a1dfd693b159b2bb02489d4be7..864ea7ed98a3829a29017a04067dd29c1a1bd7df 100644 (file)
@@ -85,7 +85,7 @@ test(const Triangulation<dim> &tr,
       fe_values.reinit(cell);
 
       deallog << "Cell nodes:" << std::endl;
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         {
           deallog << i << ": ( ";
           for (unsigned int d = 0; d < dim; ++d)
@@ -159,7 +159,7 @@ test_hyper_cube(const double tolerance)
   GridGenerator::hyper_cube(tr);
 
   typename Triangulation<dim>::active_cell_iterator cell = tr.begin_active();
-  for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+  for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
     {
       Point<dim> &point = cell->vertex(i);
       if (std::abs(point(dim - 1) - 1.0) < 1e-5)
index 784eccb4dac89de7e99ad7e29ab3b2d589b0f643..02a74347e20ebbd88c2d69278d8097ef4d494164 100644 (file)
@@ -76,7 +76,7 @@ test(const Triangulation<dim> &tr,
       fe_values.reinit(cell);
 
       deallog << "Cell nodes:" << std::endl;
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         {
           deallog << i << ": ( ";
           for (unsigned int d = 0; d < dim; ++d)
@@ -115,7 +115,7 @@ test_hyper_cube(const double tolerance)
   GridGenerator::hyper_cube(tr);
 
   typename Triangulation<dim>::active_cell_iterator cell = tr.begin_active();
-  for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+  for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
     {
       Point<dim> &point = cell->vertex(i);
       if (std::abs(point(dim - 1) - 1.0) < 1e-5)
index cc3c71a24c40b0e9ee9cd24bee29c5e0ba4ab5c1..ac76618930151b176350825ef88c63efb284ac7f 100644 (file)
@@ -83,7 +83,7 @@ test(const Triangulation<dim> &tr,
       fe_values.reinit(cell);
 
       deallog << "Cell nodes:" << std::endl;
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         {
           deallog << i << ": ( ";
           for (unsigned int d = 0; d < dim; ++d)
index 962c09a18e3ff5829541ee557ca5635011f23f1b..d839b386298c171c1b0efadb0a4c7aed536c1374 100644 (file)
@@ -82,7 +82,7 @@ test(const Triangulation<dim> &tr,
       fe_values.reinit(cell);
 
       deallog << "Cell nodes:" << std::endl;
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         {
           deallog << i << ": ( ";
           for (unsigned int d = 0; d < dim; ++d)
index 6301b544cfba17892e7b1fe6f818fa0c59afe943..fa1edce8dab5b82b9c9ae36c2ef9d55df4814415 100644 (file)
@@ -84,7 +84,7 @@ test(const Triangulation<dim> &tr,
       fe_values.reinit(cell);
 
       deallog << "Cell nodes:" << std::endl;
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         {
           deallog << i << ": ( ";
           for (unsigned int d = 0; d < dim; ++d)
index 9c4d12f3971cb1803cdd40c8c9025bd4446d0f24..ff4ebcce9cd46bbb1b1c59d66304c2f080233696 100644 (file)
@@ -84,7 +84,7 @@ test(const Triangulation<dim> &tr,
       fe_values.reinit(cell);
 
       deallog << "Cell nodes:" << std::endl;
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         {
           deallog << i << ": ( ";
           for (unsigned int d = 0; d < dim; ++d)
index f66e5d37bd66840b916a8873b793563357afab5f..c5e6deaeeebc84e6e44841844d3e7384b02fe1d2 100644 (file)
@@ -93,7 +93,7 @@ void create_triangulation(Triangulation<3> &triangulation)
   std::vector<CellData<3>> cells(n_cells, CellData<3>());
   for (unsigned i = 0; i < n_cells; ++i)
     {
-      for (unsigned int j = 0; j < GeometryInfo<3>::vertices_per_cell; ++j)
+      for (const unsigned int j : GeometryInfo<3>::vertex_indices())
         cells[i].vertices[j] = cell_vertices[i][j];
       cells[i].material_id = 0;
     }
index 51e2f55d86661f954e26cba7c5d09c5d011368d4..43ed79b986d1ea5ae2508dd5c4e87324fabef439 100644 (file)
@@ -84,7 +84,7 @@ test(const Triangulation<dim> &tr,
       fe_values.reinit(cell);
 
       deallog << "Cell nodes:" << std::endl;
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         {
           deallog << i << ": ( ";
           for (unsigned int d = 0; d < dim; ++d)
index eeacf5645ac2ad944635bb755158aacb9c7b9671..5859cc52d9335ca17ac98619c1d772f8e4bfebcc 100644 (file)
@@ -89,7 +89,7 @@ test(const Triangulation<dim> &tr,
       fe_values.reinit(cell);
 
       deallog << "Cell nodes:" << std::endl;
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         deallog << i << ": ( " << cell->vertex(i) << " )" << std::endl;
 
       bool cell_ok = true;
index f5cd41d371567516f4a7d21151606fec57e61420..2ee323e7c1bc880f48a247e531dd22f785c5872b 100644 (file)
@@ -83,7 +83,7 @@ test(const Triangulation<dim> &tr,
       fe_values.reinit(cell);
 
       deallog << "Cell nodes:" << std::endl;
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         {
           deallog << i << ": ( ";
           for (unsigned int d = 0; d < dim; ++d)
index ae249ea59c9d18aa54fc4183225bbfcb68e79dc2..3f56cd1df6d58bd0ef58c8c264b767be4c12cbc6 100644 (file)
@@ -154,7 +154,7 @@ void create_tria(Triangulation<2> &triangulation,
   std::vector<CellData<2>> cells(n_cells, CellData<2>());
   for (unsigned i = 0; i < cells.size(); ++i)
     {
-      for (unsigned int j = 0; j < GeometryInfo<2>::vertices_per_cell; ++j)
+      for (const unsigned int j : GeometryInfo<2>::vertex_indices())
         cells[i].vertices[j] = cell_vertices[i][j];
       cells[i].material_id = 0;
     }
index 7d11f916be23c3514d41d9012b06f3545fa490db..eeb00f851167e4dfa86f9a68630507800491ee71 100644 (file)
@@ -216,7 +216,7 @@ void create_tria(Triangulation<3> &triangulation,
   std::vector<CellData<3>> cells(n_cells, CellData<3>());
   for (unsigned i = 0; i < cells.size(); ++i)
     {
-      for (unsigned int j = 0; j < GeometryInfo<3>::vertices_per_cell; ++j)
+      for (const unsigned int j : GeometryInfo<3>::vertex_indices())
         cells[i].vertices[j] = cell_vertices[i][j];
       cells[i].material_id = 0;
     }
index 646d21e89c37dad5f63a5d690f4387dcfcab79e6..9e4945e9beabe14535561eaa9771fe2e4dbc5db4 100644 (file)
@@ -82,7 +82,7 @@ test(const Triangulation<dim> &tr,
       fe_values.reinit(cell);
 
       deallog << "Cell nodes:" << std::endl;
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         {
           deallog << i << ": ( ";
           for (unsigned int d = 0; d < dim; ++d)
index 69160aec392300ec73c58e36c82fa375e11c0d83..a222169c7a1dc6d7dd5d0d0d713d7e3472e6f2ac 100644 (file)
@@ -84,7 +84,7 @@ test(const Triangulation<dim> &tr,
       fe_values.reinit(cell);
 
       deallog << "Cell nodes:" << std::endl;
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         {
           deallog << i << ": ( ";
           for (unsigned int d = 0; d < dim; ++d)
index 38cd5177d08d061e0d2d7cec13478452db8f708e..5423e5e75826fb6dda8e1ee681b40645d61297be 100644 (file)
@@ -84,7 +84,7 @@ test(const Triangulation<dim> &tr,
       fe_values.reinit(cell);
 
       deallog << "Cell nodes:" << std::endl;
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         {
           deallog << i << ": ( ";
           for (unsigned int d = 0; d < dim; ++d)
index a4f870f275ec68ad85acc927eb93c96e8ffe8ba4..dd539441f54ff1ed9114e500d1968628dcd4d0f5 100644 (file)
@@ -83,7 +83,7 @@ test(const Triangulation<dim> &tr,
       fe_values.reinit(cell);
 
       deallog << "Cell nodes:" << std::endl;
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         {
           deallog << i << ": ( ";
           for (unsigned int d = 0; d < dim; ++d)
index 859be1200fb315d66c9e1c961b3233bab74c0fd1..3cd161aca10b1a03ec0fc8d2f5e94494f7c1984b 100644 (file)
@@ -84,7 +84,7 @@ test(const Triangulation<dim> &tr,
       fe_values.reinit(cell);
 
       deallog << "Cell nodes:" << std::endl;
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         {
           deallog << i << ": ( ";
           for (unsigned int d = 0; d < dim; ++d)
@@ -160,7 +160,7 @@ test_hyper_cube(const double tolerance)
   GridGenerator::hyper_cube(tr);
 
   typename Triangulation<dim>::active_cell_iterator cell = tr.begin_active();
-  for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+  for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
     {
       Point<dim> &point = cell->vertex(i);
       if (std::abs(point(dim - 1) - 1.0) < 1e-5)
index a20a58bea1694189c99bd0940168483707bc99f3..e0105a8e49442f2ce70ae799494aa51f0be7773b 100644 (file)
@@ -83,7 +83,7 @@ test(const Triangulation<dim> &tr,
       fe_values.reinit(cell);
 
       deallog << "Cell nodes:" << std::endl;
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         deallog << i << ": (" << cell->vertex(i) << ")" << std::endl;
 
       bool cell_ok = true;
@@ -158,7 +158,7 @@ test_hyper_cube(const double tolerance)
   GridGenerator::hyper_cube(tr);
 
   typename Triangulation<dim>::active_cell_iterator cell = tr.begin_active();
-  for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+  for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
     {
       Point<dim> &point = cell->vertex(i);
       if (std::abs(point(dim - 1) - 1.0) < 1e-5)
index 0053293879df0d991192071cc8bc91740ef09213..1c8ac04c9087217def9ecb6b3c51cdcb8b2e8e1a 100644 (file)
@@ -82,7 +82,7 @@ test(const Triangulation<dim> &tr,
       fe_values.reinit(cell);
 
       deallog << "Cell nodes:" << std::endl;
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         {
           deallog << i << ": ( ";
           for (unsigned int d = 0; d < dim; ++d)
index 012c5a14a71ef469d9efdb1e7e7777967842a216..c72407f49856f5f407605b0ca59a19b6eb0ca44f 100644 (file)
@@ -54,7 +54,7 @@ test(int n_refinements, const int n_subdivisions, MPI_Comm comm)
       for (auto &cell : basetria.active_cell_iterators())
         {
           // if(cell->is_locally_owned ())
-          for (unsigned int v = 0; v < GeometryInfo<2>::vertices_per_cell; ++v)
+          for (const unsigned int v : GeometryInfo<2>::vertex_indices())
             {
               const double distance_from_center =
                 center.distance(cell->vertex(v));
index 0831a2999eaad88db1a0bbef6efc489984f5ce9b..21f2cfdd53aa4bf3f157b1c5add66194020712e2 100644 (file)
@@ -40,7 +40,7 @@ gmsh_grid(const char *name)
          tria.begin_active();
        c != tria.end();
        ++c, ++index)
-    for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
       hash += (index * i * c->vertex_index(i)) % (tria.n_active_cells() + 1);
   deallog << "  hash=" << hash << std::endl;
 }
index 828df52cce1db5e2476dfad00e263262e4ec9389..19aae363723701ba03761efa8a9e0273e1ae32ee 100644 (file)
@@ -75,8 +75,7 @@ test()
           deallog << "   " << tria_cell << " user flag check:  "
                   << (tria_cell->user_flag_set() ? " (+) " : " (-) ")
                   << std::endl;
-          for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
-               ++v)
+          for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
             {
               deallog << "  vertices for cell  " << tria_cell << " : "
                       << tria_cell->vertex(v) << std::endl;
index 1d2f7b0f49dd180bd5b3dd58e4fc9077eb35f198..932bc0a17193e9975814920fd3f5fdc52ff5b8bc 100644 (file)
@@ -77,8 +77,7 @@ test()
           deallog << "   " << tria_cell << " user flag check:  "
                   << (tria_cell->user_flag_set() ? " (+) " : " (-) ")
                   << std::endl;
-          for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
-               ++v)
+          for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
             {
               deallog << "  vertices for cell  " << tria_cell << " : "
                       << tria_cell->vertex(v) << std::endl;
index b9ce6b15768a83b488dec8f00cf0d09beb20c1e5..0fec10e5be1561386218e15eb15a21f72f960967 100644 (file)
@@ -82,8 +82,7 @@ test()
           deallog << "   " << tria_cell << " user flag check:  "
                   << (tria_cell->user_flag_set() ? " (+) " : " (-) ")
                   << std::endl;
-          for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
-               ++v)
+          for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
             {
               deallog << "  vertices for cell  " << tria_cell << " : "
                       << tria_cell->vertex(v) << std::endl;
index 4868da2cfe4ab368ddc0e45f99398cc6443f0c5b..3f8cf88e79b397a6c2a692fa5746f4a0bfa94aaa 100644 (file)
@@ -88,8 +88,7 @@ test()
           deallog << "   " << tria_cell << " user flag check:  "
                   << (tria_cell->user_flag_set() ? " (+) " : " (-) ")
                   << std::endl;
-          for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
-               ++v)
+          for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
             {
               deallog << "  vertices for cell  " << tria_cell << " : "
                       << tria_cell->vertex(v) << std::endl;
index 37eccb748afc332de0d10bd52316e4330af9461f..9a4e71678dd867cfae3e517162d491d3fc98c16f 100644 (file)
@@ -49,7 +49,7 @@ satisfies_level1_at_vertex_rule(const Triangulation<dim> &tr)
          tr.begin_active();
        cell != tr.end();
        ++cell)
-    for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+    for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
       {
         min_adjacent_cell_level[cell->vertex_index(v)] =
           std::min<unsigned int>(min_adjacent_cell_level[cell->vertex_index(v)],
index c1a12a5701c3f4858c4b3a7dee7a2393cacbc59e..70d09c79be1cffeea85015ec4860e9913e0c3545 100644 (file)
@@ -50,7 +50,7 @@ satisfies_level1_at_vertex_rule(const Triangulation<dim> &tr)
          tr.begin_active();
        cell != tr.end();
        ++cell)
-    for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+    for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
       {
         min_adjacent_cell_level[cell->vertex_index(v)] =
           std::min<unsigned int>(min_adjacent_cell_level[cell->vertex_index(v)],
index 89cc4d077677c40914dcca8dbfd02ed03bd4b588..ac94c384a48bdb9564bcf3b6b4c1432638d5596e 100644 (file)
@@ -46,7 +46,7 @@ satisfies_level1_at_vertex_rule(const Triangulation<dim> &tr)
          tr.begin_active();
        cell != tr.end();
        ++cell)
-    for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+    for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
       {
         min_adjacent_cell_level[cell->vertex_index(v)] =
           std::min<unsigned int>(min_adjacent_cell_level[cell->vertex_index(v)],
index 45a0dd7af6c59c22d9e8c5da0244b25df13f21e0..f1f9908c6daefa4eced7fbdd8cdbcf4bf65289de 100644 (file)
@@ -193,7 +193,7 @@ test()
 
       // Check that all the vertices are within the sphere
       // (sphere with thickness 100. *std::numeric_limits<double>::epsilon())
-      for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+      for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
         AssertThrow(std::fabs(center.distance(tria.begin_active()->vertex(v))) <
                       radius + 100. * std::numeric_limits<double>::epsilon(),
                     ExcInternalError());
index 69e79adbb5ddbe5e9708f78cfec716245940a411..8f04091637b731e3e7ffac135d91c3369d8321ac 100644 (file)
@@ -41,7 +41,7 @@ print_triangulation(const Triangulation<dim, dim> &tria)
                                                   -1)
                 << " ";
 
-      for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+      for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
         deallog << cell.vertex(v) << " ";
 
       deallog << std::endl;
index ce1ad6d3f5ebd11fdbc844ba64bc0a0025a5ad3d..8f8a689cdce6ee23334e28d08b6562e8ad01e32c 100644 (file)
@@ -89,7 +89,7 @@ test2()
          tria.begin_active();
        c != tria.end();
        ++c, ++index)
-    for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
       hash += (index * i * c->vertex_index(i)) % (tria.n_active_cells() + 1);
   deallog << hash << std::endl;
 }
index 8a32da41ec1c1c5602cc3e412f09937ae6d514cb..11724c5cd1f42870518be17ae517395a01aa4466 100644 (file)
@@ -59,7 +59,7 @@ test(const char *filename)
   for (Triangulation<dim>::active_cell_iterator c = tria.begin_active();
        c != tria.end();
        ++c, ++index)
-    for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
       hash += (index * i * c->vertex_index(i)) % (tria.n_active_cells() + 1);
   deallog << "  hash=" << hash << std::endl;
 }
index 7619f7829f87f76a68a8f0f4c59cdca2212dc457..330eaa9985d8c560c33981df863d1e9d2fc8b56a 100644 (file)
@@ -62,7 +62,7 @@ test(const char *filename)
   for (Triangulation<dim>::active_cell_iterator c = tria.begin_active();
        c != tria.end();
        ++c, ++index)
-    for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
       hash += (index * i * c->vertex_index(i)) % (tria.n_active_cells() + 1);
   deallog << "  hash=" << hash << std::endl;
 
index 580de5315bcbc59261e2c1087eab0114457a79bb..a14c476f08aeab5477568a03e73eac3d8974aef0 100644 (file)
@@ -44,7 +44,7 @@ abaqus_grid(const char *name)
          tria.begin_active();
        c != tria.end();
        ++c, ++index)
-    for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
       hash += (index * i * c->vertex_index(i)) % (tria.n_active_cells() + 1);
   deallog << "  hash=" << hash << std::endl;
 }
index 48b4f47abab31baac72185b80b9d00bbf94968fb..f4286ab76da1fb2f7187cc858a1c808e75f17f6e 100644 (file)
@@ -50,7 +50,7 @@ abaqus_grid(const std::string path_and_name,
          tria.begin_active();
        c != tria.end();
        ++c, ++index)
-    for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
       hash += (index * i * c->vertex_index(i)) % (tria.n_active_cells() + 1);
   deallog << "  hash=" << hash << std::endl;
 
index d1ee4fb68a58cbb6f77cf6c198929743411c5530..99e9640a767888a3c7974f4f75570462a95a45c2 100644 (file)
@@ -44,7 +44,7 @@ gmsh_grid(const char *name)
          tria.begin_active();
        c != tria.end();
        ++c, ++index)
-    for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
       hash += (index * i * c->vertex_index(i)) % (tria.n_active_cells() + 1);
   deallog << "  hash=" << hash << std::endl;
 }
index 40117b68bc60640677ac683e42d48ba20957faa1..5acaf5ab1d75a2bced3bdb029dde4594bf709bec 100644 (file)
@@ -61,7 +61,7 @@ gmsh_grid(const char *name_v2, const char *name_v4)
     {
       AssertThrow(cell_v2->material_id() == cell_v4->material_id(),
                   ExcInternalError());
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         {
           AssertThrow((cell_v2->vertex(i) - cell_v4->vertex(i)).norm() < 1.e-10,
                       ExcInternalError());
index f7a191f822e4642155dfd6b9e2ea0ae1c4f10126..f3883c014fbb0eeb0f7fdf9a99c4a6d660ea10b0 100644 (file)
@@ -61,7 +61,7 @@ gmsh_grid(const char *name_v2, const char *name_v41)
     {
       AssertThrow(cell_v2->material_id() == cell_v41->material_id(),
                   ExcInternalError());
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         {
           AssertThrow((cell_v2->vertex(i) - cell_v41->vertex(i)).norm() <
                         1.e-10,
index b7f24a8f2894d3ffea3b4f76a9023faefa9a155e..ba8d90fac69c3fb44871bfa8b39617593b114784 100644 (file)
@@ -99,7 +99,7 @@ gmsh_grid(const char *name_v2, const char *name_v4)
                   ExcInternalError());
       std::set<unsigned int> vertices_v2;
       std::set<unsigned int> vertices_v4;
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         {
           AssertThrow((tria_v2.get_vertices()[cell_v2->vertex_index(i)] -
                        tria_v4.get_vertices()[cell_v2->vertex_index(i)])
index fa7dc27a8c117a886fec8cda5c78c8325b978196..09f7ff3d61dcd02b279f6b79ac392f0f3a1514f7 100644 (file)
@@ -43,7 +43,7 @@ test(bool second_case = false)
       vertices[7](0) = 1;
     }
   std::vector<CellData<dim>> cells(1);
-  for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+  for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
     cells[0].vertices[i] = i;
 
   if (dim == 3 && second_case)
index e990471957148a69665ba4d714c0396d884f3f10..7ab21ac7e3c0e77324c22f697b54924e1a18a4f0 100644 (file)
@@ -63,7 +63,7 @@ test()
 
   for (unsigned int i = 0; i < n_cells; ++i)
     {
-      for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+      for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
         cells[i].vertices[j] = cell_vertices[i][j];
       cells[i].material_id = 0;
     }
index 5cb672dd876eb07d926c4493fa9c6921ad7f1944..8c9944eba6cc0d67f213767226c5bcb2bdc749da 100644 (file)
@@ -63,7 +63,7 @@ test()
 
   for (unsigned int i = 0; i < n_cells; ++i)
     {
-      for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+      for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
         cells[i].vertices[j] = cell_vertices[i][j];
       cells[i].material_id = 0;
     }
index 1f001738a09cde02f8169e6999c920340f7a3d10..4416046fc3cd6b777e92011bbec23019c022175d 100644 (file)
@@ -56,7 +56,7 @@ check(Triangulation<dim, spacedim> &tria)
       AssertDimension(cell1->material_id(), cell2->material_id());
       AssertDimension(cell1->manifold_id(), cell2->manifold_id());
 
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         {
           auto obj1 = cell1->vertex_index(i);
           auto obj2 = cell2->vertex_index(i);
index 1742b975b8dd525e7a6daf7ef7de3f88cdf0fa40..897f6740067b563a32327ba1c1151693b5a991a0 100644 (file)
@@ -48,7 +48,7 @@ create_grid()
 
   for (; cell != endc; ++cell)
     {
-      for (unsigned int v = 0; v < GeometryInfo<2>::vertices_per_cell; ++v)
+      for (const unsigned int v : GeometryInfo<2>::vertex_indices())
         {
           const double distance_from_center = center.distance(cell->vertex(v));
 
index 3e719b2ffbdebe20d277b680048efc1233617440..5faed5daf306e184a5857219b5ee29d398b4d95c 100644 (file)
@@ -49,7 +49,7 @@ create_grid()
 
       for (; cell != endc; ++cell)
         {
-          for (unsigned int v = 0; v < GeometryInfo<2>::vertices_per_cell; ++v)
+          for (const unsigned int v : GeometryInfo<2>::vertex_indices())
             {
               const double distance_from_center =
                 center.distance(cell->vertex(v));
index 3fbf6edd27cbf13e3ec8d28063a70015a8ae1aed..0ab0a36e1d9cbdd9b1eb3a5eb4f867da9f02548a 100644 (file)
@@ -56,7 +56,7 @@ void generate_grid(Triangulation<2> &triangulation)
   /* cell 1 */
   int cell_vertices_1[GeometryInfo<2>::vertices_per_cell] = {4, 5, 6, 7};
 
-  for (unsigned int j = 0; j < GeometryInfo<2>::vertices_per_cell; ++j)
+  for (const unsigned int j : GeometryInfo<2>::vertex_indices())
     {
       cells[0].vertices[j] = cell_vertices_0[j];
       cells[1].vertices[j] = cell_vertices_1[j];
@@ -117,7 +117,7 @@ void generate_grid(Triangulation<3> &triangulation)
   int cell_vertices_1[GeometryInfo<3>::vertices_per_cell] = {
     8, 9, 10, 11, 12, 13, 14, 15};
 
-  for (unsigned int j = 0; j < GeometryInfo<3>::vertices_per_cell; ++j)
+  for (const unsigned int j : GeometryInfo<3>::vertex_indices())
     {
       cells[0].vertices[j] = cell_vertices_0[j];
       cells[1].vertices[j] = cell_vertices_1[j];
index a7863eccc9fd614d6b8a678cec66cb1d0e2e1cd3..f2452c22508fbdeec0fefbe6091a9bfa093fd5e4 100644 (file)
@@ -60,7 +60,7 @@ void generate_grid(Triangulation<2> &triangulation, int orientation)
     {7, 6, 5, 4},
   };
 
-  for (unsigned int j = 0; j < GeometryInfo<2>::vertices_per_cell; ++j)
+  for (const unsigned int j : GeometryInfo<2>::vertex_indices())
     {
       cells[0].vertices[j] = cell_vertices_0[j];
       cells[1].vertices[j] = cell_vertices_1[orientation][j];
@@ -129,7 +129,7 @@ void generate_grid(Triangulation<3> &triangulation, int orientation)
     {15, 13, 14, 12, 11, 9, 10, 8},
   };
 
-  for (unsigned int j = 0; j < GeometryInfo<3>::vertices_per_cell; ++j)
+  for (const unsigned int j : GeometryInfo<3>::vertex_indices())
     {
       cells[0].vertices[j] = cell_vertices_0[j];
       cells[1].vertices[j] = cell_vertices_1[orientation][j];
index fb85be1dcf5c6495ba2c24f6aadaf632460ab16b..b6d2c02056272d658272ae9820d958f56e7e3c2e 100644 (file)
@@ -93,7 +93,7 @@ test_hypercube(unsigned int ref, unsigned int max_bbox)
   // Looking if every point is at least inside a bounding box
   for (; cell < endc; ++cell)
     if (cell->is_locally_owned())
-      for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+      for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
         {
           bool inside_a_box = false;
           for (unsigned int i = 0; i < local_bbox.size(); ++i)
index b7165628f60f454d710a1c793751a2a26d86b262..796c6d88dca42e8080fa22bebf0013a4e23b4e1a 100644 (file)
@@ -61,7 +61,7 @@ flatten_triangulation(Triangulation<dim> &tria_in, Triangulation<dim> &tria_out)
   unsigned int cell_counter = 0;
   for (; cell != endc; ++cell)
     {
-      for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+      for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
         {
           cells[cell_counter].vertices[j] = cell->vertex_index(j);
         }
index c747f86d561ee6256574f9568865a2f57a3907cf..87864eb9490bffb719aa26d9a8d9afb5894e8f86 100644 (file)
@@ -43,9 +43,7 @@ main()
 
       if (cylinder_triangulation_offset == Point<2>())
         {
-          for (unsigned int vertex_n = 0;
-               vertex_n < GeometryInfo<2>::vertices_per_cell;
-               ++vertex_n)
+          for (const unsigned int vertex_n : GeometryInfo<2>::vertex_indices())
             if (cell->vertex(vertex_n) == Point<2>())
               {
                 // skip two cells in the bottom left corner
index c235c454d0ef42dd7b499bf7ec3b2854efaf8740..9a9675e261a537ee31dff0ee4409edfb9e37f51b 100644 (file)
@@ -46,7 +46,7 @@ main()
 
   // output all vertices
   for (unsigned int c = 0; c < 2; ++c)
-    for (unsigned int v = 0; v < GeometryInfo<3>::vertices_per_cell; ++v)
+    for (const unsigned int v : GeometryInfo<3>::vertex_indices())
       deallog << "Cell " << c << ", vertex " << v << ": "
               << cells[c]->vertex_index(v) << "  @  " << cells[c]->vertex(v)
               << std::endl;
index acb1e9250a49023f4063d31878a8ed554a612069..d0a79a00f61836e0ea64a6ed336d36268dc76fd0 100644 (file)
@@ -43,9 +43,7 @@ main()
       deallog << "current cell manifold id: " << cell->manifold_id()
               << std::endl;
 
-      for (unsigned int vertex_n = 0;
-           vertex_n < GeometryInfo<1>::vertices_per_cell;
-           ++vertex_n)
+      for (const unsigned int vertex_n : GeometryInfo<1>::vertex_indices())
         {
           deallog << "current vertex: " << cell->vertex(vertex_n) << std::endl;
           deallog << "current vertex manifold id: "
index ca3fe76f22692ba9ebb129d0da78715e70529392..1826f1b7a7a0b01d530c7c9270442ba98601de57 100644 (file)
@@ -46,9 +46,7 @@ main()
                std::cos(weights[2]);
       };
     Tensor<1, GeometryInfo<structdim>::vertices_per_cell> c0;
-    for (unsigned int row_n = 0;
-         row_n < GeometryInfo<structdim>::vertices_per_cell;
-         ++row_n)
+    for (const unsigned int row_n : GeometryInfo<structdim>::vertex_indices())
       c0[row_n] = 1.0;
 
     const std::array<double, 3> exact{
index c580b46ba73424c820142d913519f4bfa34dbd37..6262c79e4207aabb65dff49270a5eabf99de51e6 100644 (file)
@@ -66,7 +66,7 @@ test()
     }
 
   std::vector<CellData<dim>> cells(1);
-  for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+  for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
     cells[0].vertices[i] = i;
   cells[0].material_id = 0;
 
index 716ed2fda61d40c62ca480b15475248174f2f066..c18b1af8209365882fb24a8116066f68886144b3 100644 (file)
@@ -615,7 +615,7 @@ LaplaceProblem<2>::create_coarse_grid()
   std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
   for (unsigned int i = 0; i < n_cells; ++i)
     {
-      for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+      for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
         cells[i].vertices[j] = cell_vertices[i][j];
       cells[i].material_id = 0;
     }
index 483f5cd211dc713f98fb308e83457b9868028c11..c488b1d036e6914c30b7c432e95d6e38054d8881 100644 (file)
@@ -623,7 +623,7 @@ LaplaceProblem<2>::create_coarse_grid()
   std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
   for (unsigned int i = 0; i < n_cells; ++i)
     {
-      for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+      for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
         cells[i].vertices[j] = cell_vertices[i][j];
       cells[i].material_id = 0;
     }
index b6eb8bfd63dd95fd5b5b303cab96be4548bd1e14..01b4851a7c193e2c0c0731202f150b68ba6ea9e6 100644 (file)
@@ -88,9 +88,8 @@ ladutenko_circle(Triangulation<dim> &triangulation,
     {
       if (cell->center().distance(center) < 1e-10)
         {
-          for (unsigned int vertex_n = 0;
-               vertex_n < GeometryInfo<dim>::vertices_per_cell;
-               ++vertex_n)
+          for (const unsigned int vertex_n :
+               GeometryInfo<dim>::vertex_indices())
             {
               cell->vertex(vertex_n) *=
                 core_radius / center.distance(cell->vertex(vertex_n));
@@ -110,7 +109,7 @@ ladutenko_circle(Triangulation<dim> &triangulation,
   cell = triangulation.begin_active();
   for (; cell != endc; ++cell)
     {
-      for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+      for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
         {
           const double dist = center.distance(cell->vertex(v));
           if (dist > core_radius * 1.0001 && dist < radius - 1.0e-5)
index c5be356758a516f5d6d1cc078ce4a058ae6cf4db..cb077889e76d6f148023fbca875d0249ea6383ff 100644 (file)
@@ -86,7 +86,7 @@ test()
          dh.begin_active();
        cell != dh.end();
        ++cell)
-    for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
       {
         // check that the error is
         // somewhat small. it won't
index 824edab2247013245c768969e155720482e24793..b4e749fdb5f504d87b3cb9a432e7b5508bcdac0e 100644 (file)
@@ -163,7 +163,7 @@ test()
            dh.begin_active();
          cell != dh.end();
          ++cell)
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         deallog << cell->vertex(i) << ' '
                 << v(cell->vertex_dof_index(i, 0, cell->active_fe_index()))
                 << std::endl;
@@ -189,7 +189,7 @@ test()
            dh.begin_active();
          cell != dh.end();
          ++cell)
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         deallog << cell->vertex(i) << ' '
                 << v(cell->vertex_dof_index(i, 0, cell->active_fe_index()))
                 << std::endl;
index 1126a6125456059368689a143b8611d8f8b81db7..51285b9d03b4640304d663a65f754d63f825af81 100644 (file)
@@ -89,7 +89,7 @@ test()
          dh.begin_active();
        cell != dh.end();
        ++cell)
-    for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
       {
         // check that the error is
         // somewhat small. it won't
index ff0b5d5b959ba26d8918c69386108d75ca95e2c3..8aad743b4fbe56b60d27883fa53caadb242c7a34 100644 (file)
@@ -136,9 +136,7 @@ namespace Evaluation
                                                        endc = dof_handler.end();
     bool evaluation_point_found                             = false;
     for (; (cell != endc) && !evaluation_point_found; ++cell)
-      for (unsigned int vertex = 0;
-           vertex < GeometryInfo<dim>::vertices_per_cell;
-           ++vertex)
+      for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
         if (cell->vertex(vertex) == evaluation_point)
           {
             point_value = solution(
index 0b0886ca6204659893bad5a059f13720783b5fcc..8ac60518af673f5a11211fe6f3c47101ccc1af3c 100644 (file)
@@ -55,9 +55,7 @@ void make_grid(Triangulation<2> &triangulation)
                                              endc = triangulation.end();
 
       for (; cell != endc; ++cell)
-        for (unsigned int vertex = 0;
-             vertex < GeometryInfo<2>::vertices_per_cell;
-             ++vertex)
+        for (const unsigned int vertex : GeometryInfo<2>::vertex_indices())
           {
             const double distance_from_center =
               center.distance(cell->vertex(vertex));
index 473f9eecefc20d5f37eeb9d8965eb56622708ab6..1f079075172550bce1add2b1ebed9773f9b3a82b 100644 (file)
@@ -422,7 +422,7 @@ namespace Step27
     std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
     for (unsigned int i = 0; i < n_cells; ++i)
       {
-        for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+        for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
           cells[i].vertices[j] = cell_vertices[i][j];
         cells[i].material_id = 0;
       }
index 1341a70d83d8b4c03259d62609c755c6579eaddd..dd4d94b48353b11cd134b50a12bb723cdadbed7f 100644 (file)
@@ -50,8 +50,7 @@ setup_constraints(const DoFHandler<dim> &dof_handler)
     std::vector<std::vector<double>>(
       dim + 1, std::vector<double>(fe.dofs_per_cell, 0.)));
 
-  for (unsigned int vertex = 0; vertex < GeometryInfo<dim>::vertices_per_cell;
-       ++vertex)
+  for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
     {
       Point<dim> v;
       for (unsigned int d = 0; d < dim; ++d)
index d3099287dda426553d7f0014ecf59840899240bb..d2f38240ffdb8076399a277a4a9bad8477eefe13 100644 (file)
@@ -596,7 +596,7 @@ LaplaceProblem<2>::create_coarse_grid()
   std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
   for (unsigned int i = 0; i < n_cells; ++i)
     {
-      for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+      for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
         cells[i].vertices[j] = cell_vertices[i][j];
       cells[i].material_id = 0;
     }
index 79b24132f880795c0c53ae78c0c4c34cfa87b064..e1828882bd8384432cfe62a9f8d92d12b88a86bb 100644 (file)
@@ -35,7 +35,7 @@ test(unsigned int ref = 1)
 {
   std::vector<Point<spacedim>> vertices(GeometryInfo<dim>::vertices_per_cell);
   std::vector<CellData<dim>>   cells(1);
-  for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+  for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
     cells[0].vertices[i] = i;
   cells[0].material_id = 0;
 
index 9d9bb7fa3e166b8ac222674b337328c7ceb8a3b8..cd590f384b599d7e0a9763e20fb92c2f331f699b 100644 (file)
@@ -135,8 +135,7 @@ test()
       std::cout << "step " << step << std::endl;
       for (auto &cell : tria.active_cell_iterators())
         {
-          for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
-               ++v)
+          for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
             {
               if (p.distance(cell->vertex(v)) < 0.03 / (1 << step))
                 {
index 3ad4a3f2e79f8d911a5033c9c9e6d243439ae840..d19e6e7ed552d90712b99bfe24de1dcd81d96ff5 100644 (file)
@@ -191,9 +191,7 @@ test()
                                             endc = dof_handler.end();
     std::vector<bool> vertex_touched(triangulation.n_vertices(), false);
     for (cell = dof_handler.begin_active(); cell != endc; ++cell)
-      for (unsigned int vertex_no = 0;
-           vertex_no < GeometryInfo<dim>::vertices_per_cell;
-           ++vertex_no)
+      for (const unsigned int vertex_no : GeometryInfo<dim>::vertex_indices())
         if (vertex_touched[cell->vertex_index(vertex_no)] == false)
           {
             Point<dim> &   v = cell->vertex(vertex_no);
index 20d228f1098a2a226837daf994089a79f53c16c1..85062d5b675d9bbeab1401bed1c9304b65e97b8f 100644 (file)
@@ -94,7 +94,7 @@ void create_triangulation(Triangulation<2> &tria)
        cell != middle.end();
        ++cell)
     {
-      for (unsigned int v = 0; v < GeometryInfo<2>::vertices_per_cell; ++v)
+      for (const unsigned int v : GeometryInfo<2>::vertex_indices())
         {
           Point<2> &vertex = cell->vertex(v);
           if (std::abs(vertex[0] - X_2) < 1e-10 &&
index ef0f427ded983e9af0c5be3d3c5dea1c1edc079d..e0007396e182e5b16a59350fa6cca75dd431360c 100644 (file)
@@ -66,7 +66,7 @@ void generate_grid(Triangulation<3> &triangulation, int orientation)
     {10, 11, 8, 9, 6, 7, 4, 5},
     {11, 9, 10, 8, 7, 5, 6, 4}};
 
-  for (unsigned int j = 0; j < GeometryInfo<3>::vertices_per_cell; ++j)
+  for (const unsigned int j : GeometryInfo<3>::vertex_indices())
     {
       cells[0].vertices[j] = cell_vertices_0[j];
       cells[1].vertices[j] = cell_vertices_1[orientation][j];
index 11a43b574ca3ebc672a2895aeb1961b1ec5247ab..75b035b2a1c6b83daf24724b437908d642332d7e 100644 (file)
@@ -503,7 +503,7 @@ namespace Step50
            triangulation.begin_active();
          cell != triangulation.end();
          ++cell)
-      for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+      for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
         if (cell->vertex(v)[0] <= 0.5 && cell->vertex(v)[1] <= 0.5)
           cell->set_refine_flag();
     triangulation.execute_coarsening_and_refinement();
index 01d3329f648056077f905e9e463d6c685266e312..34962e1e286d8b69d4ddbb6f3764091577b24a5f 100644 (file)
@@ -49,9 +49,7 @@ test()
   std::map<unsigned int, Point<dim>> non_artificial_vertices_old;
   for (cell = triangulation.begin_active(); cell != endc; ++cell)
     if (!cell->is_artificial())
-      for (unsigned int vertex_no = 0;
-           vertex_no < GeometryInfo<dim>::vertices_per_cell;
-           ++vertex_no)
+      for (const unsigned int vertex_no : GeometryInfo<dim>::vertex_indices())
         non_artificial_vertices_old[cell->vertex_index(vertex_no)] =
           cell->vertex(vertex_no);
 
@@ -60,9 +58,7 @@ test()
     GridTools::get_locally_owned_vertices(triangulation);
   for (cell = triangulation.begin_active(); cell != endc; ++cell)
     if (cell->is_locally_owned())
-      for (unsigned int vertex_no = 0;
-           vertex_no < GeometryInfo<dim>::vertices_per_cell;
-           ++vertex_no)
+      for (const unsigned int vertex_no : GeometryInfo<dim>::vertex_indices())
         {
           const unsigned global_vertex_no = cell->vertex_index(vertex_no);
           if (!vertex_moved[global_vertex_no] &&
@@ -78,9 +74,7 @@ test()
   std::map<unsigned int, Point<dim>> non_artificial_vertices_new;
   for (cell = triangulation.begin_active(); cell != endc; ++cell)
     if (!cell->is_artificial())
-      for (unsigned int vertex_no = 0;
-           vertex_no < GeometryInfo<dim>::vertices_per_cell;
-           ++vertex_no)
+      for (const unsigned int vertex_no : GeometryInfo<dim>::vertex_indices())
         {
           Point<dim> point = cell->vertex(vertex_no);
           point(0) -= 1.e-1;
index 06527c6559b2f6b5ef2b4ade4487bde13498fe7b..c5fb884f6d11239e229f6ec94e0a385affd6c18a 100644 (file)
@@ -41,7 +41,7 @@ create_patches(std::vector<DataOutBase::Patch<dim, spacedim>> &patches)
       const unsigned int nsubp = nsub + 1;
 
       patch.n_subdivisions = nsub;
-      for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+      for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
         for (unsigned int d = 0; d < spacedim; ++d)
           patch.vertices[v](d) =
             p + cell_coordinates[d][v] + ((d >= dim) ? v : 0);
index 4aebaa560a971af7cbb5097df963c0dd049d3b57..682c9a6fb36306ef9ebea1b9fa00211a20f5ce08 100644 (file)
@@ -102,7 +102,7 @@ void generate_grid(parallel::distributed::Triangulation<2> &triangulation,
     {7, 6, 5, 4},
   };
 
-  for (unsigned int j = 0; j < GeometryInfo<2>::vertices_per_cell; ++j)
+  for (const unsigned int j : GeometryInfo<2>::vertex_indices())
     {
       cells[0].vertices[j] = cell_vertices_0[j];
       cells[1].vertices[j] = cell_vertices_1[orientation][j];
@@ -155,7 +155,7 @@ void generate_grid(parallel::distributed::Triangulation<3> &triangulation,
     {15, 13, 14, 12, 11, 9, 10, 8},
   };
 
-  for (unsigned int j = 0; j < GeometryInfo<3>::vertices_per_cell; ++j)
+  for (const unsigned int j : GeometryInfo<3>::vertex_indices())
     {
       cells[0].vertices[j] = cell_vertices_0[j];
       cells[1].vertices[j] = cell_vertices_1[orientation][j];
index 78c3e8d12a82fba2b52c126f300c41d188021af0..968a4a31586b83ce06d1e32ba6572f84cecdfc5f 100644 (file)
@@ -426,7 +426,7 @@ namespace Step27
     std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
     for (unsigned int i = 0; i < n_cells; ++i)
       {
-        for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+        for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
           cells[i].vertices[j] = cell_vertices[i][j];
         cells[i].material_id = 0;
       }
index 3a22f6801f096e485e9548ecba2f957865228806..e4e33242445775b95361d0ec292ffb5ae3b67158 100644 (file)
@@ -85,9 +85,7 @@ test()
           Assert(cell1->subdomain_id() == cell2->subdomain_id(),
                  ExcInternalError());
 
-          for (unsigned int vertex = 0;
-               vertex < GeometryInfo<dim>::vertices_per_cell;
-               ++vertex)
+          for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
             {
               Assert(cell1->vertex(vertex).distance(cell2->vertex(vertex)) <
                        1.e-14,
index 7741928580872751c25c01f36bfa828a90bfcd0b..cbab009fcb7ad46b057c7be41560119e175a849b 100644 (file)
@@ -428,7 +428,7 @@ namespace Step27
     std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
     for (unsigned int i = 0; i < n_cells; ++i)
       {
-        for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+        for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
           cells[i].vertices[j] = cell_vertices[i][j];
         cells[i].material_id = 0;
       }
index c2d9393fe0a8cac74402f94f59bcfe4a98ca77fa..01852a460301e17b9d34090486d0118fdbebbd8a 100644 (file)
@@ -57,7 +57,7 @@ dofs(const DoFHandler<dim> &dof)
       cell->get_mg_dof_indices(indices);
 
       deallog << "Level " << cell->level();
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         deallog << " v" << cell->vertex(i);
       deallog << " dofs ";
       for (unsigned int i = 0; i < indices.size(); ++i)
index de940fa6655bc7ad1a509f1bc816029d27a90d09..0c8965982353d594dd0fa2b59a47e7647ccdaf51 100644 (file)
@@ -63,7 +63,7 @@ test()
          cell = tria.begin_active();
        cell != tria.end();
        ++cell)
-    for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+    for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
       {
         if (dim == 2)
           if (cell->vertex(v)[0] < 0.5 && cell->vertex(v)[1] < 0.5)
index 2f192d7623ab843c861ba018f8b31c0b362b80de..1d04e337907dac19653059e5ab3e0729c33f70a3 100644 (file)
@@ -51,7 +51,7 @@ test()
              dim>::active_cell_iterator cell = tria.begin_active();
            cell != tria.end();
            ++cell)
-        for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+        for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
           {
             if (dim == 2)
               if (cell->vertex(v)[0] < 0.25 && cell->vertex(v)[1] < 0.25)
index 7fc4a3cc2ca95abbee86f819c66b56f1d60a80f8..d23e8c2c7e91b6e42a6471cb82b85ee04eac2d46 100644 (file)
@@ -73,9 +73,7 @@ refine_mesh(Triangulation<dim> &triangulation)
        cell != triangulation.end();
        ++cell)
     {
-      for (unsigned int vertex = 0;
-           vertex < GeometryInfo<dim>::vertices_per_cell;
-           ++vertex)
+      for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
         {
           const Point<dim> p = cell->vertex(vertex);
           const Point<dim> origin =
index f142f095bdf36f6e8fdc0a0d08ef40eb1a9cf4f7..1fee8444be05772d126a8c580360e0d8e2dbe293 100644 (file)
@@ -73,9 +73,7 @@ refine_mesh(Triangulation<dim> &triangulation)
        cell != triangulation.end();
        ++cell)
     {
-      for (unsigned int vertex = 0;
-           vertex < GeometryInfo<dim>::vertices_per_cell;
-           ++vertex)
+      for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
         {
           const Point<dim> p = cell->vertex(vertex);
           const Point<dim> origin =
index 02a1568a76543ff0e606f2586916f91ac2289ff0..551f3f8aa57adcbabfd39a023ce6636db20b3076 100644 (file)
@@ -444,9 +444,7 @@ LaplaceProblem<dim>::refine_local()
        cell != triangulation.end();
        ++cell)
     {
-      for (unsigned int vertex = 0;
-           vertex < GeometryInfo<dim>::vertices_per_cell;
-           ++vertex)
+      for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
         {
           const Point<dim> p = cell->vertex(vertex);
           const Point<dim> origin =
index a65dca123377a109d2e4227eee8acc32a1368a45..aacee5b17f1488e6f24a838ddddf9c1e4cc5646a 100644 (file)
@@ -330,9 +330,7 @@ LaplaceProblem<dim>::refine_local()
        cell != triangulation.end();
        ++cell)
     {
-      for (unsigned int vertex = 0;
-           vertex < GeometryInfo<dim>::vertices_per_cell;
-           ++vertex)
+      for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
         {
           const Point<dim> p = cell->vertex(vertex);
           const Point<dim> origin =
index 15925d54fb160ed6e975277597f2420866b5a5a8..f0565d8fd62b9f2f558b149c29a759062c9112c7 100644 (file)
@@ -401,9 +401,7 @@ LaplaceProblem<dim>::refine_local()
        cell != triangulation.end();
        ++cell)
     {
-      for (unsigned int vertex = 0;
-           vertex < GeometryInfo<dim>::vertices_per_cell;
-           ++vertex)
+      for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
         {
           const Point<dim> p = cell->vertex(vertex);
           const Point<dim> origin =
index 8f056457596dec5f0cb2c1b580164ebad9ef8dbd..8349df53607e23dda6acaafd27a9a7977a41d2ec 100644 (file)
@@ -527,9 +527,7 @@ LaplaceProblem<dim>::refine_grid(const std::string &reftype)
              triangulation.begin_active();
            cell != triangulation.end();
            ++cell)
-        for (unsigned int vertex = 0;
-             vertex < GeometryInfo<dim>::vertices_per_cell;
-             ++vertex)
+        for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
           {
             {
               const Point<dim> p = cell->vertex(vertex);
index 4973316f658285bbe1f73007badd13a1761c40d9..0d2a5486e7b6c5ae35c94d80ac82a9b23fb72e9f 100644 (file)
@@ -546,9 +546,7 @@ LaplaceProblem<dim>::refine_grid(const std::string &reftype)
              triangulation.begin_active();
            cell != triangulation.end();
            ++cell)
-        for (unsigned int vertex = 0;
-             vertex < GeometryInfo<dim>::vertices_per_cell;
-             ++vertex)
+        for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
           {
             {
               const Point<dim> p = cell->vertex(vertex);
index d3d693ed3a5a1e34b6985ce8f25fa5de4db79568..29034a96d698fc2cf9379da78020f5b95292b254 100644 (file)
@@ -517,7 +517,7 @@ namespace Step50
            triangulation.begin_active();
          cell != triangulation.end();
          ++cell)
-      for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+      for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
         if (cell->vertex(v)[0] <= 0.5 && cell->vertex(v)[1] <= 0.5)
           cell->set_refine_flag();
     triangulation.execute_coarsening_and_refinement();
index 554adbd9d5ab43c32cd04d52ad4ace069ac715bd..b585dce166a7142a6d1acad7de10906b8a6d8f90 100644 (file)
@@ -71,9 +71,7 @@ refine_mesh(Triangulation<dim> &triangulation)
        cell != triangulation.end();
        ++cell)
     {
-      for (unsigned int vertex = 0;
-           vertex < GeometryInfo<dim>::vertices_per_cell;
-           ++vertex)
+      for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
         {
           const Point<dim> p = cell->vertex(vertex);
           const Point<dim> origin =
index 12f8c5bae3ffab8ec09034bd05f9d6ce1f3c7f90..5c9db07fd58487efbacfe1ac50211548f75e13d1 100644 (file)
@@ -195,7 +195,7 @@ test()
   std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
   for (unsigned int i = 0; i < n_cells; ++i)
     {
-      for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+      for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
         cells[i].vertices[j] = cell_vertices[i][j];
       cells[i].material_id = 0;
     }
index ecc0f41d29b6ff3f12e2e95434eb85a827f9fc9e..7e492934638942f7bc067fb397fbe301fa2b7bdf 100644 (file)
@@ -82,7 +82,7 @@ test()
   for (typename DoFHandler<dim>::active_cell_iterator cell = dh.begin_active();
        cell != dh.end();
        ++cell)
-    for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
       {
         // check that the error is
         // somewhat small. it won't
index ec8f54efaa94c75bc4be9ac7a8cf5875f725aa77..f7c34e4acd6ed69a84deb6649edce7bea7d85b32 100644 (file)
@@ -147,7 +147,7 @@ test()
            dh.begin_active();
          cell != dh.end();
          ++cell)
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         deallog << cell->vertex(i) << ' ' << v(cell->vertex_dof_index(i, 0))
                 << std::endl;
   }
@@ -172,7 +172,7 @@ test()
            dh.begin_active();
          cell != dh.end();
          ++cell)
-      for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+      for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
         deallog << cell->vertex(i) << ' ' << v(cell->vertex_dof_index(i, 0))
                 << std::endl;
   }
index 92f4226fb4efac0da0b73901a04e9517b3c7dba5..1c290b3f7be02c93547e33173b1b77fc0befc1e6 100644 (file)
@@ -85,7 +85,7 @@ test()
   for (typename DoFHandler<dim>::active_cell_iterator cell = dh.begin_active();
        cell != dh.end();
        ++cell)
-    for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
       {
         // check that the error is
         // somewhat small. it won't
index f4ad8039c4b6312536c66a328c3a9ddd23d2d1ef..6b97bb70a91ad1beeefd8a0c52505b454908dd1a 100644 (file)
@@ -89,7 +89,7 @@ test()
   for (typename DoFHandler<dim>::active_cell_iterator cell = dh.begin_active();
        cell != dh.end();
        ++cell)
-    for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+    for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
       {
         deallog << cell->vertex(i) << ' ' << v(cell->vertex_dof_index(i, 0))
                 << std::endl;
index 7c5942852e9e2cd7d68c3288e48f7d10e25064d8..37ec2256f0d37dca5a5677c4fa318ce9e6f65a9d 100644 (file)
@@ -854,8 +854,7 @@ namespace Step44
             cell = dof_handler_ref.begin_active(),
             endc = dof_handler_ref.end();
           for (; cell != endc; ++cell)
-            for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
-                 ++v)
+            for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
               if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale)
                 {
                   Tensor<1, dim> soln;
index f7814474f868cdddfae0d8d1413b53541ddcd12f..ffe01c822cfe81311f3cfb4b538b5f17e69049c8 100644 (file)
@@ -65,7 +65,7 @@ test_kinematic_tensors()
        cell != dof_handler.end();
        ++cell)
     {
-      for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+      for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
         if (std::abs(cell->vertex(v)[0] - 1.0) < 1e-9)
           soln_t[cell->vertex_dof_index(v, 0)] = 1.0;
     }
index 4fc4acae89bd2b3efd746852bd6f2c2d41ce9f31..b8194a63a87351e48889f217e2f919d162d7d1f4 100644 (file)
@@ -615,8 +615,7 @@ namespace Step18
             cell = dof_handler.begin_active(),
             endc = dof_handler.end();
           for (; cell != endc; ++cell)
-            for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
-                 ++v)
+            for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
               if (cell->vertex(v).distance(soln_pt) < 1e-6)
                 {
                   monitored_vertex_first_dof = cell->vertex_dof_index(v, 0);
@@ -694,7 +693,7 @@ namespace Step18
            dof_handler.begin_active();
          cell != dof_handler.end();
          ++cell)
-      for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+      for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
         if (vertex_touched[cell->vertex_index(v)] == false)
           {
             vertex_touched[cell->vertex_index(v)] = true;
index cfed4d3ce6ee815e5c8ee888515eb8c7894bd66f..f03ea92b8123ff3e540a5d050a04c75547e49fbb 100644 (file)
@@ -631,8 +631,7 @@ namespace Step18
             cell = dof_handler.begin_active(),
             endc = dof_handler.end();
           for (; cell != endc; ++cell)
-            for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
-                 ++v)
+            for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
               if (cell->vertex(v).distance(soln_pt) < 1e-6)
                 {
                   monitored_vertex_first_dof = cell->vertex_dof_index(v, 0);
@@ -710,7 +709,7 @@ namespace Step18
            dof_handler.begin_active();
          cell != dof_handler.end();
          ++cell)
-      for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+      for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
         if (vertex_touched[cell->vertex_index(v)] == false)
           {
             vertex_touched[cell->vertex_index(v)] = true;
index 6ce4ffae8f32a0d9d1a18b4b96b7974af093c5f3..0f830e1f61556c23fbca6292cb0307e100b3668f 100644 (file)
@@ -1025,8 +1025,7 @@ namespace Step44
             cell = dof_handler_ref.begin_active(),
             endc = dof_handler_ref.end();
           for (; cell != endc; ++cell)
-            for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
-                 ++v)
+            for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
               if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale)
                 {
                   Tensor<1, dim> soln;
index 842fc299128e7d664d1f45f701b0693a5002b459..5fb8427f7270c1ad01f3973507832acb5d9d21da 100644 (file)
@@ -825,8 +825,7 @@ namespace Step44
             cell = dof_handler_ref.begin_active(),
             endc = dof_handler_ref.end();
           for (; cell != endc; ++cell)
-            for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
-                 ++v)
+            for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
               if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale)
                 {
                   Tensor<1, dim> soln;
index 4e45ce482ecac04430afafac951e61ed8511f5e6..bd4772bf5a03a72252c24d6118b389b23ca801b0 100644 (file)
@@ -838,8 +838,7 @@ namespace Step44
             cell = dof_handler_ref.begin_active(),
             endc = dof_handler_ref.end();
           for (; cell != endc; ++cell)
-            for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
-                 ++v)
+            for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
               if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale)
                 {
                   Tensor<1, dim> soln;
index 13802efbd395101746bcb2b903edda182b8b8816..a1c8af685d7e183142f792761688491ffdf63f8e 100644 (file)
@@ -29,7 +29,7 @@ test()
 {
   dealii::CellData<structdim> t1;
 
-  for (unsigned int i = 0; i < GeometryInfo<structdim>::vertices_per_cell; i++)
+  for (const unsigned int i : GeometryInfo<structdim>::vertex_indices())
     t1.vertices[i] = i;
   t1.material_id = 0;
   t1.boundary_id = 1;
@@ -41,7 +41,7 @@ test()
   }
 
   // test vertices
-  for (unsigned int i = 0; i < GeometryInfo<structdim>::vertices_per_cell; i++)
+  for (const unsigned int i : GeometryInfo<structdim>::vertex_indices())
     {
       dealii::CellData<structdim> t2 = t1;
       t2.vertices[i]++;
index e71a6c84b32948e2ad9c0e9ce7a9120724f3a160..5747e95adc0a1c21e5cf18bebb61a65f76b83724 100644 (file)
@@ -43,7 +43,7 @@ namespace dealii
                                                       c2 = t2.begin();
     for (; (c1 != t1.end()) && (c2 != t2.end()); ++c1, ++c2)
       {
-        for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+        for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
           {
             if (c1->vertex(v) != c2->vertex(v))
               return false;
index 6b09c9f234919ff0e9ea4bd67330f4808cb8c9fd..f493df122b7d0949612ae61a933dec755121a22e 100644 (file)
@@ -44,7 +44,7 @@ namespace dealii
                                                           c2 = t2.begin();
     for (; (c1 != t1.end()) && (c2 != t2.end()); ++c1, ++c2)
       {
-        for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+        for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
           {
             if (c1->vertex(v) != c2->vertex(v))
               return false;
index 5bf61649e361e599ab98e0ea302c1c14a9f0c12f..dfb812bbb8e5d4e5149f7215a52ee3a808915127 100644 (file)
@@ -45,7 +45,7 @@ namespace dealii
                                                          c2 = t2.begin();
     for (; (c1 != t1.end()) && (c2 != t2.end()); ++c1, ++c2)
       {
-        for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+        for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
           {
             if (c1->vertex(v) != c2->vertex(v))
               return false;
index 086664fcfba1b3212171aa77bca27a6b54bc3cfd..bdbdc4197d5262e3e21099418e5e7a69887db90c 100644 (file)
@@ -47,7 +47,7 @@ namespace dealii
                                                          c2 = t2.begin();
     for (; (c1 != t1.end()) && (c2 != t2.end()); ++c1, ++c2)
       {
-        for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+        for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
           {
             if (c1->vertex(v) != c2->vertex(v))
               return false;

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.