From: Wolfgang Bangerth Date: Thu, 5 Mar 2020 01:46:51 +0000 (-0700) Subject: Use GeometryInfo::vertex_indices() in tests/. X-Git-Tag: v9.2.0-rc1~454^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9622%2Fhead;p=dealii.git Use GeometryInfo::vertex_indices() in tests/. --- diff --git a/tests/ad_common_tests/step-44-helper_res_lin_01.h b/tests/ad_common_tests/step-44-helper_res_lin_01.h index 6372cbb4b9..d0ec99f915 100644 --- a/tests/ad_common_tests/step-44-helper_res_lin_01.h +++ b/tests/ad_common_tests/step-44-helper_res_lin_01.h @@ -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::vertices_per_cell; - ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale) { Tensor<1, dim> soln; diff --git a/tests/ad_common_tests/step-44-helper_scalar_01.h b/tests/ad_common_tests/step-44-helper_scalar_01.h index 6bc36540e8..b7e0d05ee2 100644 --- a/tests/ad_common_tests/step-44-helper_scalar_01.h +++ b/tests/ad_common_tests/step-44-helper_scalar_01.h @@ -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::vertices_per_cell; - ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale) { Tensor<1, dim> soln; diff --git a/tests/ad_common_tests/step-44-helper_var_form_01.h b/tests/ad_common_tests/step-44-helper_var_form_01.h index 4988f19ef5..23c133df8e 100644 --- a/tests/ad_common_tests/step-44-helper_var_form_01.h +++ b/tests/ad_common_tests/step-44-helper_var_form_01.h @@ -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::vertices_per_cell; - ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale) { Tensor<1, dim> soln; diff --git a/tests/ad_common_tests/step-44-helper_vector_01.h b/tests/ad_common_tests/step-44-helper_vector_01.h index bb416e79b3..03f6e2fdfd 100644 --- a/tests/ad_common_tests/step-44-helper_vector_01.h +++ b/tests/ad_common_tests/step-44-helper_vector_01.h @@ -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::vertices_per_cell; - ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale) { Tensor<1, dim> soln; diff --git a/tests/adolc/step-44.cc b/tests/adolc/step-44.cc index a549e37c77..f1e9de190f 100644 --- a/tests/adolc/step-44.cc +++ b/tests/adolc/step-44.cc @@ -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::vertices_per_cell; - ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale) { Tensor<1, dim> soln; diff --git a/tests/base/geometry_info_2.cc b/tests/base/geometry_info_2.cc index 23c6f5c629..9e87421b4f 100644 --- a/tests/base/geometry_info_2.cc +++ b/tests/base/geometry_info_2.cc @@ -99,7 +99,7 @@ test() for (unsigned int f = 0; f < GeometryInfo::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::line_to_cell_vertices(f, v); deallog << std::endl; } diff --git a/tests/base/geometry_info_4.cc b/tests/base/geometry_info_4.cc index a0e3b9b285..61363039e5 100644 --- a/tests/base/geometry_info_4.cc +++ b/tests/base/geometry_info_4.cc @@ -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::vertices_per_cell; ++i) - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int i : GeometryInfo::vertex_indices()) + for (const unsigned int v : GeometryInfo::vertex_indices()) { const double phi_i = GeometryInfo::d_linear_shape_function( GeometryInfo::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::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { double s = 0; - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) s += GeometryInfo::d_linear_shape_function( GeometryInfo::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::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) s += GeometryInfo::d_linear_shape_function(center, i); AssertThrow(s == 1, ExcInternalError()); diff --git a/tests/base/geometry_info_5.cc b/tests/base/geometry_info_5.cc index df1a52ae54..bdc31af2c9 100644 --- a/tests/base/geometry_info_5.cc +++ b/tests/base/geometry_info_5.cc @@ -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::vertices_per_cell; ++i) - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int i : GeometryInfo::vertex_indices()) + for (const unsigned int v : GeometryInfo::vertex_indices()) { const Tensor<1, dim> phi_i_grad = GeometryInfo::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::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { Tensor<1, dim> s; - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) s += GeometryInfo::d_linear_shape_function_gradient( GeometryInfo::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::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) s += GeometryInfo::d_linear_shape_function_gradient(center, i); AssertThrow(s.norm() == 0, ExcInternalError()); diff --git a/tests/base/geometry_info_6.cc b/tests/base/geometry_info_6.cc index 0d82218838..1c36853334 100644 --- a/tests/base/geometry_info_6.cc +++ b/tests/base/geometry_info_6.cc @@ -35,12 +35,12 @@ test() // that case { Point vertices[GeometryInfo::vertices_per_cell]; - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) vertices[v] = GeometryInfo::unit_cell_vertex(v); Tensor<0, dim> determinants[GeometryInfo::vertices_per_cell]; GeometryInfo::alternating_form_at_vertices(vertices, determinants); - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { deallog << "Reference cell: " << determinants[v] << std::endl; AssertThrow(static_cast(determinants[v]) == 1, @@ -52,7 +52,7 @@ test() // in the x-direction by a factor of 10 { Point vertices[GeometryInfo::vertices_per_cell]; - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { vertices[v] = GeometryInfo::unit_cell_vertex(v); vertices[v][0] /= 10; @@ -60,7 +60,7 @@ test() Tensor<0, dim> determinants[GeometryInfo::vertices_per_cell]; GeometryInfo::alternating_form_at_vertices(vertices, determinants); - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { deallog << "Squashed cell: " << determinants[v] << std::endl; AssertThrow(static_cast(determinants[v]) == 0.1, @@ -75,7 +75,7 @@ test() // 1d) { Point vertices[GeometryInfo::vertices_per_cell]; - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { vertices[v] = GeometryInfo::unit_cell_vertex(v); vertices[v][0] /= 10; @@ -89,7 +89,7 @@ test() Tensor<0, dim> determinants[GeometryInfo::vertices_per_cell]; GeometryInfo::alternating_form_at_vertices(vertices, determinants); - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { deallog << "Squashed+rotated cell: " << determinants[v] << std::endl; AssertThrow(static_cast(determinants[v]) == 0.1, @@ -100,13 +100,13 @@ test() // pinched cell { Point vertices[GeometryInfo::vertices_per_cell]; - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) vertices[v] = GeometryInfo::unit_cell_vertex(v); vertices[1] /= 10; Tensor<0, dim> determinants[GeometryInfo::vertices_per_cell]; GeometryInfo::alternating_form_at_vertices(vertices, determinants); - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) deallog << "Pinched cell: " << determinants[v] << std::endl; } @@ -114,13 +114,13 @@ test() // inverted cell { Point vertices[GeometryInfo::vertices_per_cell]; - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) vertices[v] = GeometryInfo::unit_cell_vertex(v); std::swap(vertices[0], vertices[1]); Tensor<0, dim> determinants[GeometryInfo::vertices_per_cell]; GeometryInfo::alternating_form_at_vertices(vertices, determinants); - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) deallog << "Inverted cell: " << determinants[v] << std::endl; } } diff --git a/tests/base/geometry_info_7.cc b/tests/base/geometry_info_7.cc index f83e7a1483..99af91de8d 100644 --- a/tests/base/geometry_info_7.cc +++ b/tests/base/geometry_info_7.cc @@ -35,7 +35,7 @@ test() // that case { Point vertices[GeometryInfo::vertices_per_cell]; - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) vertices[v] = GeometryInfo::unit_cell_vertex(v); for (const unsigned int f : GeometryInfo::face_indices()) @@ -61,7 +61,7 @@ test() // in the x-direction by a factor of 10 { Point vertices[GeometryInfo::vertices_per_cell]; - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { vertices[v] = GeometryInfo::unit_cell_vertex(v); vertices[v][0] /= 10; @@ -105,7 +105,7 @@ test() // 1d) { Point vertices[GeometryInfo::vertices_per_cell]; - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { vertices[v] = GeometryInfo::unit_cell_vertex(v); vertices[v][0] /= 10; @@ -152,7 +152,7 @@ test() // pinched cell { Point vertices[GeometryInfo::vertices_per_cell]; - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) vertices[v] = GeometryInfo::unit_cell_vertex(v); vertices[1] /= 10; @@ -175,7 +175,7 @@ test() // inverted cell { Point vertices[GeometryInfo::vertices_per_cell]; - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) vertices[v] = GeometryInfo::unit_cell_vertex(v); std::swap(vertices[0], vertices[1]); diff --git a/tests/bits/cylinder_01.cc b/tests/bits/cylinder_01.cc index 53f0fb3a02..f3442c9dcf 100644 --- a/tests/bits/cylinder_01.cc +++ b/tests/bits/cylinder_01.cc @@ -56,7 +56,7 @@ check<2>() triangulation.begin_active(); cell != triangulation.end(); ++cell) - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::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::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) deallog << cell->vertex(i) << std::endl; } diff --git a/tests/bits/cylinder_02.cc b/tests/bits/cylinder_02.cc index c6e64ca2ab..a1949bcb2a 100644 --- a/tests/bits/cylinder_02.cc +++ b/tests/bits/cylinder_02.cc @@ -73,7 +73,7 @@ check() triangulation.begin_active(); cell != triangulation.end(); ++cell) - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) deallog << cell->vertex(i) << std::endl; } diff --git a/tests/bits/cylinder_03.cc b/tests/bits/cylinder_03.cc index 1c0586424a..71ff40266a 100644 --- a/tests/bits/cylinder_03.cc +++ b/tests/bits/cylinder_03.cc @@ -67,7 +67,7 @@ check() triangulation.begin_active(); cell != triangulation.end(); ++cell) - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) deallog << cell->vertex(i) << std::endl; } diff --git a/tests/bits/cylinder_04.cc b/tests/bits/cylinder_04.cc index 9f0e0196d8..309941d954 100644 --- a/tests/bits/cylinder_04.cc +++ b/tests/bits/cylinder_04.cc @@ -70,7 +70,7 @@ check() triangulation.begin_active(); cell != triangulation.end(); ++cell) - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) deallog << cell->vertex(i) << std::endl; } diff --git a/tests/bits/distorted_cells_01.cc b/tests/bits/distorted_cells_01.cc index 29b70e2eca..424b431834 100644 --- a/tests/bits/distorted_cells_01.cc +++ b/tests/bits/distorted_cells_01.cc @@ -42,7 +42,7 @@ void check(const unsigned int testcase) { std::vector> vertices; - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) vertices.push_back(GeometryInfo::unit_cell_vertex(v)); switch (testcase) @@ -63,7 +63,7 @@ check(const unsigned int testcase) std::vector> cells; { CellData cell; - for (unsigned int j = 0; j < GeometryInfo::vertices_per_cell; ++j) + for (const unsigned int j : GeometryInfo::vertex_indices()) cell.vertices[j] = j; cells.push_back(cell); } diff --git a/tests/bits/distorted_cells_07.cc b/tests/bits/distorted_cells_07.cc index ac5e3aa3df..e295cab858 100644 --- a/tests/bits/distorted_cells_07.cc +++ b/tests/bits/distorted_cells_07.cc @@ -42,7 +42,7 @@ void check(const unsigned int testcase) { std::vector> vertices; - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) vertices.push_back(GeometryInfo::unit_cell_vertex(v)); switch (testcase) @@ -59,7 +59,7 @@ check(const unsigned int testcase) std::vector> cells; { CellData cell; - for (unsigned int j = 0; j < GeometryInfo::vertices_per_cell; ++j) + for (const unsigned int j : GeometryInfo::vertex_indices()) cell.vertices[j] = j; cells.push_back(cell); } diff --git a/tests/bits/find_cell_1.cc b/tests/bits/find_cell_1.cc index ad5071d33c..9eef484c59 100644 --- a/tests/bits/find_cell_1.cc +++ b/tests/bits/find_cell_1.cc @@ -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; diff --git a/tests/bits/find_cell_10a.cc b/tests/bits/find_cell_10a.cc index 77216e7810..47146a7dca 100644 --- a/tests/bits/find_cell_10a.cc +++ b/tests/bits/find_cell_10a.cc @@ -68,7 +68,7 @@ void create_coarse_grid(Triangulation<2> &coarse_grid) std::vector> 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; } diff --git a/tests/bits/find_cell_2.cc b/tests/bits/find_cell_2.cc index 6144242326..aad6b678f9 100644 --- a/tests/bits/find_cell_2.cc +++ b/tests/bits/find_cell_2.cc @@ -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; diff --git a/tests/bits/find_cell_3.cc b/tests/bits/find_cell_3.cc index 87c1fe98fe..04471aa2a6 100644 --- a/tests/bits/find_cell_3.cc +++ b/tests/bits/find_cell_3.cc @@ -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; diff --git a/tests/bits/find_cell_4.cc b/tests/bits/find_cell_4.cc index 74788d870b..fb2fe67997 100644 --- a/tests/bits/find_cell_4.cc +++ b/tests/bits/find_cell_4.cc @@ -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; diff --git a/tests/bits/find_cell_5.cc b/tests/bits/find_cell_5.cc index 918a8ebe8b..cae4e5df99 100644 --- a/tests/bits/find_cell_5.cc +++ b/tests/bits/find_cell_5.cc @@ -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; diff --git a/tests/bits/find_cell_8.cc b/tests/bits/find_cell_8.cc index 37cb67403c..e7d9950607 100644 --- a/tests/bits/find_cell_8.cc +++ b/tests/bits/find_cell_8.cc @@ -53,7 +53,7 @@ void create_coarse_grid(Triangulation<2> &coarse_grid) std::vector> 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; diff --git a/tests/bits/find_cell_9.cc b/tests/bits/find_cell_9.cc index 75f88ec896..46730d39f0 100644 --- a/tests/bits/find_cell_9.cc +++ b/tests/bits/find_cell_9.cc @@ -56,7 +56,7 @@ void create_coarse_grid(Triangulation<2> &coarse_grid) std::vector> 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; diff --git a/tests/bits/find_cell_alt_1.cc b/tests/bits/find_cell_alt_1.cc index 12c948c9a2..040867187a 100644 --- a/tests/bits/find_cell_alt_1.cc +++ b/tests/bits/find_cell_alt_1.cc @@ -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; diff --git a/tests/bits/find_cell_alt_2.cc b/tests/bits/find_cell_alt_2.cc index afa539a9ab..c3d7abaaf7 100644 --- a/tests/bits/find_cell_alt_2.cc +++ b/tests/bits/find_cell_alt_2.cc @@ -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 << "] "; diff --git a/tests/bits/find_cell_alt_3.cc b/tests/bits/find_cell_alt_3.cc index a8407f738a..be79c30b80 100644 --- a/tests/bits/find_cell_alt_3.cc +++ b/tests/bits/find_cell_alt_3.cc @@ -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; diff --git a/tests/bits/find_cell_alt_4.cc b/tests/bits/find_cell_alt_4.cc index 4fbf4fd905..5583c37b11 100644 --- a/tests/bits/find_cell_alt_4.cc +++ b/tests/bits/find_cell_alt_4.cc @@ -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; diff --git a/tests/bits/find_cell_alt_5.cc b/tests/bits/find_cell_alt_5.cc index c0999e1efe..0565706d94 100644 --- a/tests/bits/find_cell_alt_5.cc +++ b/tests/bits/find_cell_alt_5.cc @@ -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; diff --git a/tests/bits/find_cell_alt_6.cc b/tests/bits/find_cell_alt_6.cc index de0729f406..203c0c24cf 100644 --- a/tests/bits/find_cell_alt_6.cc +++ b/tests/bits/find_cell_alt_6.cc @@ -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; } diff --git a/tests/bits/find_cell_alt_7.cc b/tests/bits/find_cell_alt_7.cc index c2cd625ecd..1a708592b8 100644 --- a/tests/bits/find_cell_alt_7.cc +++ b/tests/bits/find_cell_alt_7.cc @@ -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 << " ] "; diff --git a/tests/bits/find_cells_adjacent_to_vertex_1.cc b/tests/bits/find_cells_adjacent_to_vertex_1.cc index 0de8f0dec7..7a0271a643 100644 --- a/tests/bits/find_cells_adjacent_to_vertex_1.cc +++ b/tests/bits/find_cells_adjacent_to_vertex_1.cc @@ -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; } diff --git a/tests/bits/step-13.cc b/tests/bits/step-13.cc index 727b8aeecc..5a3d523aed 100644 --- a/tests/bits/step-13.cc +++ b/tests/bits/step-13.cc @@ -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::vertices_per_cell; - ++vertex) + for (const unsigned int vertex : GeometryInfo::vertex_indices()) if (cell->vertex(vertex) == evaluation_point) { point_value = solution(cell->vertex_dof_index(vertex, 0)); diff --git a/tests/bits/step-14.cc b/tests/bits/step-14.cc index 0fb7762c85..f5c785426f 100644 --- a/tests/bits/step-14.cc +++ b/tests/bits/step-14.cc @@ -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::vertices_per_cell; - ++vertex) + for (const unsigned int vertex : GeometryInfo::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::vertices_per_cell; - ++vertex) + for (const unsigned int vertex : GeometryInfo::vertex_indices()) if (cell->vertex(vertex) == evaluation_point) { fe_values.reinit(cell); @@ -1087,7 +1083,7 @@ namespace Data std::vector> cells(n_cells, CellData()); for (unsigned int i = 0; i < n_cells; ++i) { - for (unsigned int j = 0; j < GeometryInfo::vertices_per_cell; ++j) + for (const unsigned int j : GeometryInfo::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::vertices_per_cell; - ++vertex) + for (const unsigned int vertex : GeometryInfo::vertex_indices()) if (cell->vertex(vertex).distance(evaluation_point) < cell->diameter() * 1e-8) { diff --git a/tests/bits/step-2.cc b/tests/bits/step-2.cc index 2c9ee2feb7..7b4c0b82f1 100644 --- a/tests/bits/step-2.cc +++ b/tests/bits/step-2.cc @@ -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)); diff --git a/tests/codim_one/extract_boundary_mesh_02.cc b/tests/codim_one/extract_boundary_mesh_02.cc index e9fb543df8..6f385550d3 100644 --- a/tests/codim_one/extract_boundary_mesh_02.cc +++ b/tests/codim_one/extract_boundary_mesh_02.cc @@ -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::vertices_per_cell; ++k) + for (const unsigned int k : GeometryInfo::vertex_indices()) deallog << " " << cell->vertex(k) << std::endl; deallog << "Volume face: " << face << " with vertices:" << std::endl; - for (unsigned int k = 0; k < GeometryInfo::vertices_per_cell; ++k) + for (const unsigned int k : GeometryInfo::vertex_indices()) deallog << " " << face->vertex(k) << std::endl; Point diff(face->center()); diff --git a/tests/codim_one/extract_boundary_mesh_03.cc b/tests/codim_one/extract_boundary_mesh_03.cc index df96236700..3f526cc09a 100644 --- a/tests/codim_one/extract_boundary_mesh_03.cc +++ b/tests/codim_one/extract_boundary_mesh_03.cc @@ -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::vertices_per_cell; ++k) + for (const unsigned int k : GeometryInfo::vertex_indices()) { deallog << " " << cell->vertex(k) << std::endl; Assert(std::fabs(cell->vertex(k).distance(Point()) - 1) < @@ -63,7 +63,7 @@ test_vertices_orientation( } deallog << "Volume face: " << face << " with vertices:" << std::endl; - for (unsigned int k = 0; k < GeometryInfo::vertices_per_cell; ++k) + for (const unsigned int k : GeometryInfo::vertex_indices()) { deallog << " " << face->vertex(k) << std::endl; Assert(std::fabs(face->vertex(k).distance(Point()) - 1) < diff --git a/tests/codim_one/extract_boundary_mesh_04.cc b/tests/codim_one/extract_boundary_mesh_04.cc index ad70237760..5bf0c3005f 100644 --- a/tests/codim_one/extract_boundary_mesh_04.cc +++ b/tests/codim_one/extract_boundary_mesh_04.cc @@ -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::vertices_per_cell; ++k) + for (const unsigned int k : GeometryInfo::vertex_indices()) { deallog << " " << cell->vertex(k) << std::endl; Assert(std::fabs(cell->vertex(k).distance(Point()) - 1) < @@ -63,7 +63,7 @@ test_vertices_orientation( } deallog << "Volume face: " << face << " with vertices:" << std::endl; - for (unsigned int k = 0; k < GeometryInfo::vertices_per_cell; ++k) + for (const unsigned int k : GeometryInfo::vertex_indices()) { deallog << " " << face->vertex(k) << std::endl; Assert(std::fabs(face->vertex(k).distance(Point()) - 1) < diff --git a/tests/data_out/data_out_curved_cells.cc b/tests/data_out/data_out_curved_cells.cc index 3508caa7f1..782392e274 100644 --- a/tests/data_out/data_out_curved_cells.cc +++ b/tests/data_out/data_out_curved_cells.cc @@ -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.; diff --git a/tests/data_out/data_out_hdf5_02.cc b/tests/data_out/data_out_hdf5_02.cc index 2cb13dd8ec..0c555e3fda 100644 --- a/tests/data_out/data_out_hdf5_02.cc +++ b/tests/data_out/data_out_hdf5_02.cc @@ -41,7 +41,7 @@ create_patches(std::vector> &patches) const unsigned int nsubp = nsub + 1; patch.n_subdivisions = nsub; - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) for (unsigned int d = 0; d < spacedim; ++d) patch.vertices[v](d) = p + cell_coordinates[d][v] + ((d >= dim) ? v : 0); diff --git a/tests/data_out/patches.h b/tests/data_out/patches.h index da6ca77b48..52285f75b8 100644 --- a/tests/data_out/patches.h +++ b/tests/data_out/patches.h @@ -35,7 +35,7 @@ create_patches(std::vector> &patches) const unsigned int nsubp = nsub + 1; patch.n_subdivisions = nsub; - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) for (unsigned int d = 0; d < spacedim; ++d) patch.vertices[v](d) = p + cell_coordinates[d][v] + ((d >= dim) ? v : 0); diff --git a/tests/distributed_grids/3d_coarse_grid_05.cc b/tests/distributed_grids/3d_coarse_grid_05.cc index a71d9eb986..818c529453 100644 --- a/tests/distributed_grids/3d_coarse_grid_05.cc +++ b/tests/distributed_grids/3d_coarse_grid_05.cc @@ -81,7 +81,7 @@ create_disconnected_mesh(Triangulation &tria) } // Prepare cell data - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) cells[0].vertices[i] = i; cells[0].material_id = 0; } @@ -133,7 +133,7 @@ create_disconnected_mesh(Triangulation &tria) } // Prepare cell data - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) cells[1].vertices[i] = GeometryInfo::vertices_per_cell + i; cells[1].material_id = 0; } diff --git a/tests/dofs/dof_tools_21_b.cc b/tests/dofs/dof_tools_21_b.cc index 448eee1764..49cc57596b 100644 --- a/tests/dofs/dof_tools_21_b.cc +++ b/tests/dofs/dof_tools_21_b.cc @@ -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]; diff --git a/tests/dofs/dof_tools_21_b_x.cc b/tests/dofs/dof_tools_21_b_x.cc index bf76667d60..7aa8ea1f97 100644 --- a/tests/dofs/dof_tools_21_b_x.cc +++ b/tests/dofs/dof_tools_21_b_x.cc @@ -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]; diff --git a/tests/dofs/dof_tools_21_b_x_q3.cc b/tests/dofs/dof_tools_21_b_x_q3.cc index 466d949142..029d85cb93 100644 --- a/tests/dofs/dof_tools_21_b_x_q3.cc +++ b/tests/dofs/dof_tools_21_b_x_q3.cc @@ -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]; diff --git a/tests/dofs/dof_tools_21_b_y.cc b/tests/dofs/dof_tools_21_b_y.cc index 2a434aed40..143f80075f 100644 --- a/tests/dofs/dof_tools_21_b_y.cc +++ b/tests/dofs/dof_tools_21_b_y.cc @@ -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]; diff --git a/tests/dofs/dof_tools_21_c.cc b/tests/dofs/dof_tools_21_c.cc index d0464f1556..7b684773bc 100644 --- a/tests/dofs/dof_tools_21_c.cc +++ b/tests/dofs/dof_tools_21_c.cc @@ -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]; diff --git a/tests/fail/circular_01.cc b/tests/fail/circular_01.cc index b94070c6a4..588c10d948 100644 --- a/tests/fail/circular_01.cc +++ b/tests/fail/circular_01.cc @@ -618,7 +618,7 @@ LaplaceProblem<2>::create_coarse_grid() std::vector> cells(n_cells, CellData()); for (unsigned int i = 0; i < n_cells; ++i) { - for (unsigned int j = 0; j < GeometryInfo::vertices_per_cell; ++j) + for (const unsigned int j : GeometryInfo::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> cells(n_cells, CellData()); for (unsigned int i = 0; i < n_cells; ++i) { - for (unsigned int j = 0; j < GeometryInfo::vertices_per_cell; ++j) + for (const unsigned int j : GeometryInfo::vertex_indices()) cells[i].vertices[j] = cell_vertices[i][j]; cells[i].material_id = 0; } diff --git a/tests/fail/hp-step-14.cc b/tests/fail/hp-step-14.cc index a06360d9ea..13f4c1eced 100644 --- a/tests/fail/hp-step-14.cc +++ b/tests/fail/hp-step-14.cc @@ -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::vertices_per_cell; - ++vertex) + for (const unsigned int vertex : GeometryInfo::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::vertices_per_cell; - ++vertex) + for (const unsigned int vertex : GeometryInfo::vertex_indices()) if (cell->vertex(vertex) == evaluation_point) { fe_values.reinit(cell); @@ -1096,7 +1092,7 @@ namespace Data std::vector> cells(n_cells, CellData()); for (unsigned int i = 0; i < n_cells; ++i) { - for (unsigned int j = 0; j < GeometryInfo::vertices_per_cell; ++j) + for (const unsigned int j : GeometryInfo::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::vertices_per_cell; - ++vertex) + for (const unsigned int vertex : GeometryInfo::vertex_indices()) if (cell->vertex(vertex).distance(evaluation_point) < cell->diameter() * 1e-8) { diff --git a/tests/fe/fe_abf_gradient_divergence_theorem.cc b/tests/fe/fe_abf_gradient_divergence_theorem.cc index d2be402e2c..864ea7ed98 100644 --- a/tests/fe/fe_abf_gradient_divergence_theorem.cc +++ b/tests/fe/fe_abf_gradient_divergence_theorem.cc @@ -85,7 +85,7 @@ test(const Triangulation &tr, fe_values.reinit(cell); deallog << "Cell nodes:" << std::endl; - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::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::active_cell_iterator cell = tr.begin_active(); - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { Point &point = cell->vertex(i); if (std::abs(point(dim - 1) - 1.0) < 1e-5) diff --git a/tests/fe/fe_br.cc b/tests/fe/fe_br.cc index 784eccb4da..02a74347e2 100644 --- a/tests/fe/fe_br.cc +++ b/tests/fe/fe_br.cc @@ -76,7 +76,7 @@ test(const Triangulation &tr, fe_values.reinit(cell); deallog << "Cell nodes:" << std::endl; - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::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::active_cell_iterator cell = tr.begin_active(); - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { Point &point = cell->vertex(i); if (std::abs(point(dim - 1) - 1.0) < 1e-5) diff --git a/tests/fe/fe_dgp_3rd_derivative_divergence_theorem.cc b/tests/fe/fe_dgp_3rd_derivative_divergence_theorem.cc index cc3c71a24c..ac76618930 100644 --- a/tests/fe/fe_dgp_3rd_derivative_divergence_theorem.cc +++ b/tests/fe/fe_dgp_3rd_derivative_divergence_theorem.cc @@ -83,7 +83,7 @@ test(const Triangulation &tr, fe_values.reinit(cell); deallog << "Cell nodes:" << std::endl; - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { deallog << i << ": ( "; for (unsigned int d = 0; d < dim; ++d) diff --git a/tests/fe/fe_dgq_3rd_derivative_divergence_theorem.cc b/tests/fe/fe_dgq_3rd_derivative_divergence_theorem.cc index 962c09a18e..d839b38629 100644 --- a/tests/fe/fe_dgq_3rd_derivative_divergence_theorem.cc +++ b/tests/fe/fe_dgq_3rd_derivative_divergence_theorem.cc @@ -82,7 +82,7 @@ test(const Triangulation &tr, fe_values.reinit(cell); deallog << "Cell nodes:" << std::endl; - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { deallog << i << ": ( "; for (unsigned int d = 0; d < dim; ++d) diff --git a/tests/fe/fe_dgq_gradient_divergence_theorem.cc b/tests/fe/fe_dgq_gradient_divergence_theorem.cc index 6301b544cf..fa1edce8da 100644 --- a/tests/fe/fe_dgq_gradient_divergence_theorem.cc +++ b/tests/fe/fe_dgq_gradient_divergence_theorem.cc @@ -84,7 +84,7 @@ test(const Triangulation &tr, fe_values.reinit(cell); deallog << "Cell nodes:" << std::endl; - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { deallog << i << ": ( "; for (unsigned int d = 0; d < dim; ++d) diff --git a/tests/fe/fe_dgq_hessian_divergence_theorem.cc b/tests/fe/fe_dgq_hessian_divergence_theorem.cc index 9c4d12f397..ff4ebcce9c 100644 --- a/tests/fe/fe_dgq_hessian_divergence_theorem.cc +++ b/tests/fe/fe_dgq_hessian_divergence_theorem.cc @@ -84,7 +84,7 @@ test(const Triangulation &tr, fe_values.reinit(cell); deallog << "Cell nodes:" << std::endl; - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { deallog << i << ": ( "; for (unsigned int d = 0; d < dim; ++d) diff --git a/tests/fe/fe_face_orientation_nedelec_0.cc b/tests/fe/fe_face_orientation_nedelec_0.cc index f66e5d37bd..c5e6deaeee 100644 --- a/tests/fe/fe_face_orientation_nedelec_0.cc +++ b/tests/fe/fe_face_orientation_nedelec_0.cc @@ -93,7 +93,7 @@ void create_triangulation(Triangulation<3> &triangulation) std::vector> 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; } diff --git a/tests/fe/fe_nedelec_gradient_divergence_theorem.cc b/tests/fe/fe_nedelec_gradient_divergence_theorem.cc index 51e2f55d86..43ed79b986 100644 --- a/tests/fe/fe_nedelec_gradient_divergence_theorem.cc +++ b/tests/fe/fe_nedelec_gradient_divergence_theorem.cc @@ -84,7 +84,7 @@ test(const Triangulation &tr, fe_values.reinit(cell); deallog << "Cell nodes:" << std::endl; - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { deallog << i << ": ( "; for (unsigned int d = 0; d < dim; ++d) diff --git a/tests/fe/fe_nedelec_hessian_divergence_theorem.cc b/tests/fe/fe_nedelec_hessian_divergence_theorem.cc index eeacf5645a..5859cc52d9 100644 --- a/tests/fe/fe_nedelec_hessian_divergence_theorem.cc +++ b/tests/fe/fe_nedelec_hessian_divergence_theorem.cc @@ -89,7 +89,7 @@ test(const Triangulation &tr, fe_values.reinit(cell); deallog << "Cell nodes:" << std::endl; - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) deallog << i << ": ( " << cell->vertex(i) << " )" << std::endl; bool cell_ok = true; diff --git a/tests/fe/fe_nedelec_sz_gradient_divergence_theorem.cc b/tests/fe/fe_nedelec_sz_gradient_divergence_theorem.cc index f5cd41d371..2ee323e7c1 100644 --- a/tests/fe/fe_nedelec_sz_gradient_divergence_theorem.cc +++ b/tests/fe/fe_nedelec_sz_gradient_divergence_theorem.cc @@ -83,7 +83,7 @@ test(const Triangulation &tr, fe_values.reinit(cell); deallog << "Cell nodes:" << std::endl; - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { deallog << i << ": ( "; for (unsigned int d = 0; d < dim; ++d) diff --git a/tests/fe/fe_project_2d.cc b/tests/fe/fe_project_2d.cc index ae249ea59c..3f56cd1df6 100644 --- a/tests/fe/fe_project_2d.cc +++ b/tests/fe/fe_project_2d.cc @@ -154,7 +154,7 @@ void create_tria(Triangulation<2> &triangulation, std::vector> 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; } diff --git a/tests/fe/fe_project_3d.cc b/tests/fe/fe_project_3d.cc index 7d11f916be..eeb00f8511 100644 --- a/tests/fe/fe_project_3d.cc +++ b/tests/fe/fe_project_3d.cc @@ -216,7 +216,7 @@ void create_tria(Triangulation<3> &triangulation, std::vector> 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; } diff --git a/tests/fe/fe_q_3rd_derivative_divergence_theorem.cc b/tests/fe/fe_q_3rd_derivative_divergence_theorem.cc index 646d21e89c..9e4945e9be 100644 --- a/tests/fe/fe_q_3rd_derivative_divergence_theorem.cc +++ b/tests/fe/fe_q_3rd_derivative_divergence_theorem.cc @@ -82,7 +82,7 @@ test(const Triangulation &tr, fe_values.reinit(cell); deallog << "Cell nodes:" << std::endl; - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { deallog << i << ": ( "; for (unsigned int d = 0; d < dim; ++d) diff --git a/tests/fe/fe_q_gradient_divergence_theorem.cc b/tests/fe/fe_q_gradient_divergence_theorem.cc index 69160aec39..a222169c7a 100644 --- a/tests/fe/fe_q_gradient_divergence_theorem.cc +++ b/tests/fe/fe_q_gradient_divergence_theorem.cc @@ -84,7 +84,7 @@ test(const Triangulation &tr, fe_values.reinit(cell); deallog << "Cell nodes:" << std::endl; - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { deallog << i << ": ( "; for (unsigned int d = 0; d < dim; ++d) diff --git a/tests/fe/fe_q_hessian_divergence_theorem.cc b/tests/fe/fe_q_hessian_divergence_theorem.cc index 38cd5177d0..5423e5e758 100644 --- a/tests/fe/fe_q_hessian_divergence_theorem.cc +++ b/tests/fe/fe_q_hessian_divergence_theorem.cc @@ -84,7 +84,7 @@ test(const Triangulation &tr, fe_values.reinit(cell); deallog << "Cell nodes:" << std::endl; - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { deallog << i << ": ( "; for (unsigned int d = 0; d < dim; ++d) diff --git a/tests/fe/fe_q_hierarchical_3rd_derivative_divergence_theorem.cc b/tests/fe/fe_q_hierarchical_3rd_derivative_divergence_theorem.cc index a4f870f275..dd539441f5 100644 --- a/tests/fe/fe_q_hierarchical_3rd_derivative_divergence_theorem.cc +++ b/tests/fe/fe_q_hierarchical_3rd_derivative_divergence_theorem.cc @@ -83,7 +83,7 @@ test(const Triangulation &tr, fe_values.reinit(cell); deallog << "Cell nodes:" << std::endl; - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { deallog << i << ": ( "; for (unsigned int d = 0; d < dim; ++d) diff --git a/tests/fe/fe_rt_gradient_divergence_theorem.cc b/tests/fe/fe_rt_gradient_divergence_theorem.cc index 859be1200f..3cd161aca1 100644 --- a/tests/fe/fe_rt_gradient_divergence_theorem.cc +++ b/tests/fe/fe_rt_gradient_divergence_theorem.cc @@ -84,7 +84,7 @@ test(const Triangulation &tr, fe_values.reinit(cell); deallog << "Cell nodes:" << std::endl; - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::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::active_cell_iterator cell = tr.begin_active(); - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { Point &point = cell->vertex(i); if (std::abs(point(dim - 1) - 1.0) < 1e-5) diff --git a/tests/fe/fe_rt_hessian_divergence_theorem.cc b/tests/fe/fe_rt_hessian_divergence_theorem.cc index a20a58bea1..e0105a8e49 100644 --- a/tests/fe/fe_rt_hessian_divergence_theorem.cc +++ b/tests/fe/fe_rt_hessian_divergence_theorem.cc @@ -83,7 +83,7 @@ test(const Triangulation &tr, fe_values.reinit(cell); deallog << "Cell nodes:" << std::endl; - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::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::active_cell_iterator cell = tr.begin_active(); - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { Point &point = cell->vertex(i); if (std::abs(point(dim - 1) - 1.0) < 1e-5) diff --git a/tests/fe/fe_system_3rd_derivative_divergence_theorem.cc b/tests/fe/fe_system_3rd_derivative_divergence_theorem.cc index 0053293879..1c8ac04c90 100644 --- a/tests/fe/fe_system_3rd_derivative_divergence_theorem.cc +++ b/tests/fe/fe_system_3rd_derivative_divergence_theorem.cc @@ -82,7 +82,7 @@ test(const Triangulation &tr, fe_values.reinit(cell); deallog << "Cell nodes:" << std::endl; - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { deallog << i << ": ( "; for (unsigned int d = 0; d < dim; ++d) diff --git a/tests/fullydistributed_grids/copy_serial_tria_03.cc b/tests/fullydistributed_grids/copy_serial_tria_03.cc index 012c5a14a7..c72407f498 100644 --- a/tests/fullydistributed_grids/copy_serial_tria_03.cc +++ b/tests/fullydistributed_grids/copy_serial_tria_03.cc @@ -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)); diff --git a/tests/gmsh/create_tria_01.cc b/tests/gmsh/create_tria_01.cc index 0831a2999e..21f2cfdd53 100644 --- a/tests/gmsh/create_tria_01.cc +++ b/tests/gmsh/create_tria_01.cc @@ -40,7 +40,7 @@ gmsh_grid(const char *name) tria.begin_active(); c != tria.end(); ++c, ++index) - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) hash += (index * i * c->vertex_index(i)) % (tria.n_active_cells() + 1); deallog << " hash=" << hash << std::endl; } diff --git a/tests/grid/build_triangulation_from_patch_01.cc b/tests/grid/build_triangulation_from_patch_01.cc index 828df52cce..19aae36372 100644 --- a/tests/grid/build_triangulation_from_patch_01.cc +++ b/tests/grid/build_triangulation_from_patch_01.cc @@ -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::vertices_per_cell; - ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { deallog << " vertices for cell " << tria_cell << " : " << tria_cell->vertex(v) << std::endl; diff --git a/tests/grid/build_triangulation_from_patch_02.cc b/tests/grid/build_triangulation_from_patch_02.cc index 1d2f7b0f49..932bc0a171 100644 --- a/tests/grid/build_triangulation_from_patch_02.cc +++ b/tests/grid/build_triangulation_from_patch_02.cc @@ -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::vertices_per_cell; - ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { deallog << " vertices for cell " << tria_cell << " : " << tria_cell->vertex(v) << std::endl; diff --git a/tests/grid/build_triangulation_from_patch_03.cc b/tests/grid/build_triangulation_from_patch_03.cc index b9ce6b1576..0fec10e5be 100644 --- a/tests/grid/build_triangulation_from_patch_03.cc +++ b/tests/grid/build_triangulation_from_patch_03.cc @@ -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::vertices_per_cell; - ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { deallog << " vertices for cell " << tria_cell << " : " << tria_cell->vertex(v) << std::endl; diff --git a/tests/grid/build_triangulation_from_patch_04.cc b/tests/grid/build_triangulation_from_patch_04.cc index 4868da2cfe..3f8cf88e79 100644 --- a/tests/grid/build_triangulation_from_patch_04.cc +++ b/tests/grid/build_triangulation_from_patch_04.cc @@ -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::vertices_per_cell; - ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { deallog << " vertices for cell " << tria_cell << " : " << tria_cell->vertex(v) << std::endl; diff --git a/tests/grid/coarsening_02.cc b/tests/grid/coarsening_02.cc index 37eccb748a..9a4e71678d 100644 --- a/tests/grid/coarsening_02.cc +++ b/tests/grid/coarsening_02.cc @@ -49,7 +49,7 @@ satisfies_level1_at_vertex_rule(const Triangulation &tr) tr.begin_active(); cell != tr.end(); ++cell) - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { min_adjacent_cell_level[cell->vertex_index(v)] = std::min(min_adjacent_cell_level[cell->vertex_index(v)], diff --git a/tests/grid/coarsening_02_1d.cc b/tests/grid/coarsening_02_1d.cc index c1a12a5701..70d09c79be 100644 --- a/tests/grid/coarsening_02_1d.cc +++ b/tests/grid/coarsening_02_1d.cc @@ -50,7 +50,7 @@ satisfies_level1_at_vertex_rule(const Triangulation &tr) tr.begin_active(); cell != tr.end(); ++cell) - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { min_adjacent_cell_level[cell->vertex_index(v)] = std::min(min_adjacent_cell_level[cell->vertex_index(v)], diff --git a/tests/grid/coarsening_03.cc b/tests/grid/coarsening_03.cc index 89cc4d0776..ac94c384a4 100644 --- a/tests/grid/coarsening_03.cc +++ b/tests/grid/coarsening_03.cc @@ -46,7 +46,7 @@ satisfies_level1_at_vertex_rule(const Triangulation &tr) tr.begin_active(); cell != tr.end(); ++cell) - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { min_adjacent_cell_level[cell->vertex_index(v)] = std::min(min_adjacent_cell_level[cell->vertex_index(v)], diff --git a/tests/grid/enclosing_sphere_01.cc b/tests/grid/enclosing_sphere_01.cc index 45a0dd7af6..f1f9908c6d 100644 --- a/tests/grid/enclosing_sphere_01.cc +++ b/tests/grid/enclosing_sphere_01.cc @@ -193,7 +193,7 @@ test() // Check that all the vertices are within the sphere // (sphere with thickness 100. *std::numeric_limits::epsilon()) - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) AssertThrow(std::fabs(center.distance(tria.begin_active()->vertex(v))) < radius + 100. * std::numeric_limits::epsilon(), ExcInternalError()); diff --git a/tests/grid/grid_generator_airfoil_01.cc b/tests/grid/grid_generator_airfoil_01.cc index 69e79adbb5..8f04091637 100644 --- a/tests/grid/grid_generator_airfoil_01.cc +++ b/tests/grid/grid_generator_airfoil_01.cc @@ -41,7 +41,7 @@ print_triangulation(const Triangulation &tria) -1) << " "; - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) deallog << cell.vertex(v) << " "; deallog << std::endl; diff --git a/tests/grid/grid_in.cc b/tests/grid/grid_in.cc index ce1ad6d3f5..8f8a689cdc 100644 --- a/tests/grid/grid_in.cc +++ b/tests/grid/grid_in.cc @@ -89,7 +89,7 @@ test2() tria.begin_active(); c != tria.end(); ++c, ++index) - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) hash += (index * i * c->vertex_index(i)) % (tria.n_active_cells() + 1); deallog << hash << std::endl; } diff --git a/tests/grid/grid_in_3d.cc b/tests/grid/grid_in_3d.cc index 8a32da41ec..11724c5cd1 100644 --- a/tests/grid/grid_in_3d.cc +++ b/tests/grid/grid_in_3d.cc @@ -59,7 +59,7 @@ test(const char *filename) for (Triangulation::active_cell_iterator c = tria.begin_active(); c != tria.end(); ++c, ++index) - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) hash += (index * i * c->vertex_index(i)) % (tria.n_active_cells() + 1); deallog << " hash=" << hash << std::endl; } diff --git a/tests/grid/grid_in_3d_02.cc b/tests/grid/grid_in_3d_02.cc index 7619f7829f..330eaa9985 100644 --- a/tests/grid/grid_in_3d_02.cc +++ b/tests/grid/grid_in_3d_02.cc @@ -62,7 +62,7 @@ test(const char *filename) for (Triangulation::active_cell_iterator c = tria.begin_active(); c != tria.end(); ++c, ++index) - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) hash += (index * i * c->vertex_index(i)) % (tria.n_active_cells() + 1); deallog << " hash=" << hash << std::endl; diff --git a/tests/grid/grid_in_abaqus_01.cc b/tests/grid/grid_in_abaqus_01.cc index 580de5315b..a14c476f08 100644 --- a/tests/grid/grid_in_abaqus_01.cc +++ b/tests/grid/grid_in_abaqus_01.cc @@ -44,7 +44,7 @@ abaqus_grid(const char *name) tria.begin_active(); c != tria.end(); ++c, ++index) - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) hash += (index * i * c->vertex_index(i)) % (tria.n_active_cells() + 1); deallog << " hash=" << hash << std::endl; } diff --git a/tests/grid/grid_in_abaqus_02.cc b/tests/grid/grid_in_abaqus_02.cc index 48b4f47aba..f4286ab76d 100644 --- a/tests/grid/grid_in_abaqus_02.cc +++ b/tests/grid/grid_in_abaqus_02.cc @@ -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::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) hash += (index * i * c->vertex_index(i)) % (tria.n_active_cells() + 1); deallog << " hash=" << hash << std::endl; diff --git a/tests/grid/grid_in_gmsh_01.cc b/tests/grid/grid_in_gmsh_01.cc index d1ee4fb68a..99e9640a76 100644 --- a/tests/grid/grid_in_gmsh_01.cc +++ b/tests/grid/grid_in_gmsh_01.cc @@ -44,7 +44,7 @@ gmsh_grid(const char *name) tria.begin_active(); c != tria.end(); ++c, ++index) - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) hash += (index * i * c->vertex_index(i)) % (tria.n_active_cells() + 1); deallog << " hash=" << hash << std::endl; } diff --git a/tests/grid/grid_in_gmsh_01_v4.cc b/tests/grid/grid_in_gmsh_01_v4.cc index 40117b68bc..5acaf5ab1d 100644 --- a/tests/grid/grid_in_gmsh_01_v4.cc +++ b/tests/grid/grid_in_gmsh_01_v4.cc @@ -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::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { AssertThrow((cell_v2->vertex(i) - cell_v4->vertex(i)).norm() < 1.e-10, ExcInternalError()); diff --git a/tests/grid/grid_in_gmsh_01_v41.cc b/tests/grid/grid_in_gmsh_01_v41.cc index f7a191f822..f3883c014f 100644 --- a/tests/grid/grid_in_gmsh_01_v41.cc +++ b/tests/grid/grid_in_gmsh_01_v41.cc @@ -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::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { AssertThrow((cell_v2->vertex(i) - cell_v41->vertex(i)).norm() < 1.e-10, diff --git a/tests/grid/grid_in_msh_version_4.cc b/tests/grid/grid_in_msh_version_4.cc index b7f24a8f28..ba8d90fac6 100644 --- a/tests/grid/grid_in_msh_version_4.cc +++ b/tests/grid/grid_in_msh_version_4.cc @@ -99,7 +99,7 @@ gmsh_grid(const char *name_v2, const char *name_v4) ExcInternalError()); std::set vertices_v2; std::set vertices_v4; - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { AssertThrow((tria_v2.get_vertices()[cell_v2->vertex_index(i)] - tria_v4.get_vertices()[cell_v2->vertex_index(i)]) diff --git a/tests/grid/grid_invert.cc b/tests/grid/grid_invert.cc index fa7dc27a8c..09f7ff3d61 100644 --- a/tests/grid/grid_invert.cc +++ b/tests/grid/grid_invert.cc @@ -43,7 +43,7 @@ test(bool second_case = false) vertices[7](0) = 1; } std::vector> cells(1); - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) cells[0].vertices[i] = i; if (dim == 3 && second_case) diff --git a/tests/grid/grid_out_08.cc b/tests/grid/grid_out_08.cc index e990471957..7ab21ac7e3 100644 --- a/tests/grid/grid_out_08.cc +++ b/tests/grid/grid_out_08.cc @@ -63,7 +63,7 @@ test() for (unsigned int i = 0; i < n_cells; ++i) { - for (unsigned int j = 0; j < GeometryInfo::vertices_per_cell; ++j) + for (const unsigned int j : GeometryInfo::vertex_indices()) cells[i].vertices[j] = cell_vertices[i][j]; cells[i].material_id = 0; } diff --git a/tests/grid/grid_out_09.cc b/tests/grid/grid_out_09.cc index 5cb672dd87..8c9944eba6 100644 --- a/tests/grid/grid_out_09.cc +++ b/tests/grid/grid_out_09.cc @@ -63,7 +63,7 @@ test() for (unsigned int i = 0; i < n_cells; ++i) { - for (unsigned int j = 0; j < GeometryInfo::vertices_per_cell; ++j) + for (const unsigned int j : GeometryInfo::vertex_indices()) cells[i].vertices[j] = cell_vertices[i][j]; cells[i].material_id = 0; } diff --git a/tests/grid/grid_out_in_vtk_01.cc b/tests/grid/grid_out_in_vtk_01.cc index 1f001738a0..4416046fc3 100644 --- a/tests/grid/grid_out_in_vtk_01.cc +++ b/tests/grid/grid_out_in_vtk_01.cc @@ -56,7 +56,7 @@ check(Triangulation &tria) AssertDimension(cell1->material_id(), cell2->material_id()); AssertDimension(cell1->manifold_id(), cell2->manifold_id()); - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { auto obj1 = cell1->vertex_index(i); auto obj2 = cell2->vertex_index(i); diff --git a/tests/grid/grid_out_svg_01.cc b/tests/grid/grid_out_svg_01.cc index 1742b975b8..897f674006 100644 --- a/tests/grid/grid_out_svg_01.cc +++ b/tests/grid/grid_out_svg_01.cc @@ -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)); diff --git a/tests/grid/grid_out_svg_02.cc b/tests/grid/grid_out_svg_02.cc index 3e719b2ffb..5faed5daf3 100644 --- a/tests/grid/grid_out_svg_02.cc +++ b/tests/grid/grid_out_svg_02.cc @@ -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)); diff --git a/tests/grid/grid_tools_05.cc b/tests/grid/grid_tools_05.cc index 3fbf6edd27..0ab0a36e1d 100644 --- a/tests/grid/grid_tools_05.cc +++ b/tests/grid/grid_tools_05.cc @@ -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]; diff --git a/tests/grid/grid_tools_06.cc b/tests/grid/grid_tools_06.cc index a7863eccc9..f2452c2250 100644 --- a/tests/grid/grid_tools_06.cc +++ b/tests/grid/grid_tools_06.cc @@ -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]; diff --git a/tests/grid/grid_tools_compute_mesh_predicate_bounding_box_1.cc b/tests/grid/grid_tools_compute_mesh_predicate_bounding_box_1.cc index fb85be1dcf..b6d2c02056 100644 --- a/tests/grid/grid_tools_compute_mesh_predicate_bounding_box_1.cc +++ b/tests/grid/grid_tools_compute_mesh_predicate_bounding_box_1.cc @@ -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::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { bool inside_a_box = false; for (unsigned int i = 0; i < local_bbox.size(); ++i) diff --git a/tests/grid/merge_triangulations_03.cc b/tests/grid/merge_triangulations_03.cc index b7165628f6..796c6d88dc 100644 --- a/tests/grid/merge_triangulations_03.cc +++ b/tests/grid/merge_triangulations_03.cc @@ -61,7 +61,7 @@ flatten_triangulation(Triangulation &tria_in, Triangulation &tria_out) unsigned int cell_counter = 0; for (; cell != endc; ++cell) { - for (unsigned int j = 0; j < GeometryInfo::vertices_per_cell; ++j) + for (const unsigned int j : GeometryInfo::vertex_indices()) { cells[cell_counter].vertices[j] = cell->vertex_index(j); } diff --git a/tests/grid/merge_triangulations_04.cc b/tests/grid/merge_triangulations_04.cc index c747f86d56..87864eb949 100644 --- a/tests/grid/merge_triangulations_04.cc +++ b/tests/grid/merge_triangulations_04.cc @@ -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 diff --git a/tests/grid/mesh_3d_3.cc b/tests/grid/mesh_3d_3.cc index c235c454d0..9a9675e261 100644 --- a/tests/grid/mesh_3d_3.cc +++ b/tests/grid/mesh_3d_3.cc @@ -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; diff --git a/tests/grid/oned_vertex_manifold.cc b/tests/grid/oned_vertex_manifold.cc index acb1e9250a..d0a79a00f6 100644 --- a/tests/grid/oned_vertex_manifold.cc +++ b/tests/grid/oned_vertex_manifold.cc @@ -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: " diff --git a/tests/grid/project_to_object_01.cc b/tests/grid/project_to_object_01.cc index ca3fe76f22..1826f1b7a7 100644 --- a/tests/grid/project_to_object_01.cc +++ b/tests/grid/project_to_object_01.cc @@ -46,9 +46,7 @@ main() std::cos(weights[2]); }; Tensor<1, GeometryInfo::vertices_per_cell> c0; - for (unsigned int row_n = 0; - row_n < GeometryInfo::vertices_per_cell; - ++row_n) + for (const unsigned int row_n : GeometryInfo::vertex_indices()) c0[row_n] = 1.0; const std::array exact{ diff --git a/tests/grid/subcelldata.cc b/tests/grid/subcelldata.cc index c580b46ba7..6262c79e42 100644 --- a/tests/grid/subcelldata.cc +++ b/tests/grid/subcelldata.cc @@ -66,7 +66,7 @@ test() } std::vector> cells(1); - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) cells[0].vertices[i] = i; cells[0].material_id = 0; diff --git a/tests/hp/crash_17.cc b/tests/hp/crash_17.cc index 716ed2fda6..c18b1af820 100644 --- a/tests/hp/crash_17.cc +++ b/tests/hp/crash_17.cc @@ -615,7 +615,7 @@ LaplaceProblem<2>::create_coarse_grid() std::vector> cells(n_cells, CellData()); for (unsigned int i = 0; i < n_cells; ++i) { - for (unsigned int j = 0; j < GeometryInfo::vertices_per_cell; ++j) + for (const unsigned int j : GeometryInfo::vertex_indices()) cells[i].vertices[j] = cell_vertices[i][j]; cells[i].material_id = 0; } diff --git a/tests/hp/crash_18.cc b/tests/hp/crash_18.cc index 483f5cd211..c488b1d036 100644 --- a/tests/hp/crash_18.cc +++ b/tests/hp/crash_18.cc @@ -623,7 +623,7 @@ LaplaceProblem<2>::create_coarse_grid() std::vector> cells(n_cells, CellData()); for (unsigned int i = 0; i < n_cells; ++i) { - for (unsigned int j = 0; j < GeometryInfo::vertices_per_cell; ++j) + for (const unsigned int j : GeometryInfo::vertex_indices()) cells[i].vertices[j] = cell_vertices[i][j]; cells[i].material_id = 0; } diff --git a/tests/hp/distribute_dofs_linear_time.cc b/tests/hp/distribute_dofs_linear_time.cc index b6eb8bfd63..01b4851a7c 100644 --- a/tests/hp/distribute_dofs_linear_time.cc +++ b/tests/hp/distribute_dofs_linear_time.cc @@ -88,9 +88,8 @@ ladutenko_circle(Triangulation &triangulation, { if (cell->center().distance(center) < 1e-10) { - for (unsigned int vertex_n = 0; - vertex_n < GeometryInfo::vertices_per_cell; - ++vertex_n) + for (const unsigned int vertex_n : + GeometryInfo::vertex_indices()) { cell->vertex(vertex_n) *= core_radius / center.distance(cell->vertex(vertex_n)); @@ -110,7 +109,7 @@ ladutenko_circle(Triangulation &triangulation, cell = triangulation.begin_active(); for (; cell != endc; ++cell) { - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { const double dist = center.distance(cell->vertex(v)); if (dist > core_radius * 1.0001 && dist < radius - 1.0e-5) diff --git a/tests/hp/project_01.cc b/tests/hp/project_01.cc index c5be356758..cb077889e7 100644 --- a/tests/hp/project_01.cc +++ b/tests/hp/project_01.cc @@ -86,7 +86,7 @@ test() dh.begin_active(); cell != dh.end(); ++cell) - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { // check that the error is // somewhat small. it won't diff --git a/tests/hp/project_01_curved_boundary.cc b/tests/hp/project_01_curved_boundary.cc index 824edab224..b4e749fdb5 100644 --- a/tests/hp/project_01_curved_boundary.cc +++ b/tests/hp/project_01_curved_boundary.cc @@ -163,7 +163,7 @@ test() dh.begin_active(); cell != dh.end(); ++cell) - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::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::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) deallog << cell->vertex(i) << ' ' << v(cell->vertex_dof_index(i, 0, cell->active_fe_index())) << std::endl; diff --git a/tests/hp/project_02.cc b/tests/hp/project_02.cc index 1126a61254..51285b9d03 100644 --- a/tests/hp/project_02.cc +++ b/tests/hp/project_02.cc @@ -89,7 +89,7 @@ test() dh.begin_active(); cell != dh.end(); ++cell) - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { // check that the error is // somewhat small. it won't diff --git a/tests/hp/step-13.cc b/tests/hp/step-13.cc index ff0b5d5b95..8aad743b4f 100644 --- a/tests/hp/step-13.cc +++ b/tests/hp/step-13.cc @@ -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::vertices_per_cell; - ++vertex) + for (const unsigned int vertex : GeometryInfo::vertex_indices()) if (cell->vertex(vertex) == evaluation_point) { point_value = solution( diff --git a/tests/hp/step-2.cc b/tests/hp/step-2.cc index 0b0886ca62..8ac60518af 100644 --- a/tests/hp/step-2.cc +++ b/tests/hp/step-2.cc @@ -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)); diff --git a/tests/hp/step-27.cc b/tests/hp/step-27.cc index 473f9eecef..1f07907517 100644 --- a/tests/hp/step-27.cc +++ b/tests/hp/step-27.cc @@ -422,7 +422,7 @@ namespace Step27 std::vector> cells(n_cells, CellData()); for (unsigned int i = 0; i < n_cells; ++i) { - for (unsigned int j = 0; j < GeometryInfo::vertices_per_cell; ++j) + for (const unsigned int j : GeometryInfo::vertex_indices()) cells[i].vertices[j] = cell_vertices[i][j]; cells[i].material_id = 0; } diff --git a/tests/lac/constraints_c1.cc b/tests/lac/constraints_c1.cc index 1341a70d83..dd4d94b483 100644 --- a/tests/lac/constraints_c1.cc +++ b/tests/lac/constraints_c1.cc @@ -50,8 +50,7 @@ setup_constraints(const DoFHandler &dof_handler) std::vector>( dim + 1, std::vector(fe.dofs_per_cell, 0.))); - for (unsigned int vertex = 0; vertex < GeometryInfo::vertices_per_cell; - ++vertex) + for (const unsigned int vertex : GeometryInfo::vertex_indices()) { Point v; for (unsigned int d = 0; d < dim; ++d) diff --git a/tests/lac/inhomogeneous_constraints.cc b/tests/lac/inhomogeneous_constraints.cc index d3099287dd..d2f38240ff 100644 --- a/tests/lac/inhomogeneous_constraints.cc +++ b/tests/lac/inhomogeneous_constraints.cc @@ -596,7 +596,7 @@ LaplaceProblem<2>::create_coarse_grid() std::vector> cells(n_cells, CellData()); for (unsigned int i = 0; i < n_cells; ++i) { - for (unsigned int j = 0; j < GeometryInfo::vertices_per_cell; ++j) + for (const unsigned int j : GeometryInfo::vertex_indices()) cells[i].vertices[j] = cell_vertices[i][j]; cells[i].material_id = 0; } diff --git a/tests/manifold/flat_manifold_08.cc b/tests/manifold/flat_manifold_08.cc index 79b24132f8..e1828882bd 100644 --- a/tests/manifold/flat_manifold_08.cc +++ b/tests/manifold/flat_manifold_08.cc @@ -35,7 +35,7 @@ test(unsigned int ref = 1) { std::vector> vertices(GeometryInfo::vertices_per_cell); std::vector> cells(1); - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) cells[0].vertices[i] = i; cells[0].material_id = 0; diff --git a/tests/manifold/flat_manifold_09.cc b/tests/manifold/flat_manifold_09.cc index 9d9bb7fa3e..cd590f384b 100644 --- a/tests/manifold/flat_manifold_09.cc +++ b/tests/manifold/flat_manifold_09.cc @@ -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::vertices_per_cell; - ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { if (p.distance(cell->vertex(v)) < 0.03 / (1 << step)) { diff --git a/tests/mappings/mapping_q_eulerian_09.cc b/tests/mappings/mapping_q_eulerian_09.cc index 3ad4a3f2e7..d19e6e7ed5 100644 --- a/tests/mappings/mapping_q_eulerian_09.cc +++ b/tests/mappings/mapping_q_eulerian_09.cc @@ -191,9 +191,7 @@ test() endc = dof_handler.end(); std::vector vertex_touched(triangulation.n_vertices(), false); for (cell = dof_handler.begin_active(); cell != endc; ++cell) - for (unsigned int vertex_no = 0; - vertex_no < GeometryInfo::vertices_per_cell; - ++vertex_no) + for (const unsigned int vertex_no : GeometryInfo::vertex_indices()) if (vertex_touched[cell->vertex_index(vertex_no)] == false) { Point & v = cell->vertex(vertex_no); diff --git a/tests/mappings/mapping_q_mixed_manifolds_02.cc b/tests/mappings/mapping_q_mixed_manifolds_02.cc index 20d228f109..85062d5b67 100644 --- a/tests/mappings/mapping_q_mixed_manifolds_02.cc +++ b/tests/mappings/mapping_q_mixed_manifolds_02.cc @@ -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 && diff --git a/tests/matrix_free/matrix_vector_faces_25.cc b/tests/matrix_free/matrix_vector_faces_25.cc index ef0f427ded..e0007396e1 100644 --- a/tests/matrix_free/matrix_vector_faces_25.cc +++ b/tests/matrix_free/matrix_vector_faces_25.cc @@ -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]; diff --git a/tests/meshworker/step-50-mesh_loop.cc b/tests/meshworker/step-50-mesh_loop.cc index 11a43b574c..75b035b2a1 100644 --- a/tests/meshworker/step-50-mesh_loop.cc +++ b/tests/meshworker/step-50-mesh_loop.cc @@ -503,7 +503,7 @@ namespace Step50 triangulation.begin_active(); cell != triangulation.end(); ++cell) - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) if (cell->vertex(v)[0] <= 0.5 && cell->vertex(v)[1] <= 0.5) cell->set_refine_flag(); triangulation.execute_coarsening_and_refinement(); diff --git a/tests/mpi/communicate_moved_vertices_03.cc b/tests/mpi/communicate_moved_vertices_03.cc index 01d3329f64..34962e1e28 100644 --- a/tests/mpi/communicate_moved_vertices_03.cc +++ b/tests/mpi/communicate_moved_vertices_03.cc @@ -49,9 +49,7 @@ test() std::map> 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::vertices_per_cell; - ++vertex_no) + for (const unsigned int vertex_no : GeometryInfo::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::vertices_per_cell; - ++vertex_no) + for (const unsigned int vertex_no : GeometryInfo::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> 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::vertices_per_cell; - ++vertex_no) + for (const unsigned int vertex_no : GeometryInfo::vertex_indices()) { Point point = cell->vertex(vertex_no); point(0) -= 1.e-1; diff --git a/tests/mpi/data_out_hdf5_02.cc b/tests/mpi/data_out_hdf5_02.cc index 06527c6559..c5fb884f6d 100644 --- a/tests/mpi/data_out_hdf5_02.cc +++ b/tests/mpi/data_out_hdf5_02.cc @@ -41,7 +41,7 @@ create_patches(std::vector> &patches) const unsigned int nsubp = nsub + 1; patch.n_subdivisions = nsub; - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) for (unsigned int d = 0; d < spacedim; ++d) patch.vertices[v](d) = p + cell_coordinates[d][v] + ((d >= dim) ? v : 0); diff --git a/tests/mpi/periodicity_04.cc b/tests/mpi/periodicity_04.cc index 4aebaa560a..682c9a6fb3 100644 --- a/tests/mpi/periodicity_04.cc +++ b/tests/mpi/periodicity_04.cc @@ -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]; diff --git a/tests/mpi/petsc_step-27.cc b/tests/mpi/petsc_step-27.cc index 78c3e8d12a..968a4a3158 100644 --- a/tests/mpi/petsc_step-27.cc +++ b/tests/mpi/petsc_step-27.cc @@ -426,7 +426,7 @@ namespace Step27 std::vector> cells(n_cells, CellData()); for (unsigned int i = 0; i < n_cells; ++i) { - for (unsigned int j = 0; j < GeometryInfo::vertices_per_cell; ++j) + for (const unsigned int j : GeometryInfo::vertex_indices()) cells[i].vertices[j] = cell_vertices[i][j]; cells[i].material_id = 0; } diff --git a/tests/mpi/tria_copy_triangulation.cc b/tests/mpi/tria_copy_triangulation.cc index 3a22f6801f..e4e3324244 100644 --- a/tests/mpi/tria_copy_triangulation.cc +++ b/tests/mpi/tria_copy_triangulation.cc @@ -85,9 +85,7 @@ test() Assert(cell1->subdomain_id() == cell2->subdomain_id(), ExcInternalError()); - for (unsigned int vertex = 0; - vertex < GeometryInfo::vertices_per_cell; - ++vertex) + for (const unsigned int vertex : GeometryInfo::vertex_indices()) { Assert(cell1->vertex(vertex).distance(cell2->vertex(vertex)) < 1.e-14, diff --git a/tests/mpi/trilinos_step-27.cc b/tests/mpi/trilinos_step-27.cc index 7741928580..cbab009fcb 100644 --- a/tests/mpi/trilinos_step-27.cc +++ b/tests/mpi/trilinos_step-27.cc @@ -428,7 +428,7 @@ namespace Step27 std::vector> cells(n_cells, CellData()); for (unsigned int i = 0; i < n_cells; ++i) { - for (unsigned int j = 0; j < GeometryInfo::vertices_per_cell; ++j) + for (const unsigned int j : GeometryInfo::vertex_indices()) cells[i].vertices[j] = cell_vertices[i][j]; cells[i].material_id = 0; } diff --git a/tests/multigrid/dof_01.cc b/tests/multigrid/dof_01.cc index c2d9393fe0..01852a4603 100644 --- a/tests/multigrid/dof_01.cc +++ b/tests/multigrid/dof_01.cc @@ -57,7 +57,7 @@ dofs(const DoFHandler &dof) cell->get_mg_dof_indices(indices); deallog << "Level " << cell->level(); - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) deallog << " v" << cell->vertex(i); deallog << " dofs "; for (unsigned int i = 0; i < indices.size(); ++i) diff --git a/tests/multigrid/interface_matrix_entry_01.cc b/tests/multigrid/interface_matrix_entry_01.cc index de940fa665..0c89659823 100644 --- a/tests/multigrid/interface_matrix_entry_01.cc +++ b/tests/multigrid/interface_matrix_entry_01.cc @@ -63,7 +63,7 @@ test() cell = tria.begin_active(); cell != tria.end(); ++cell) - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { if (dim == 2) if (cell->vertex(v)[0] < 0.5 && cell->vertex(v)[1] < 0.5) diff --git a/tests/multigrid/max_level_for_coarse_mesh.cc b/tests/multigrid/max_level_for_coarse_mesh.cc index 2f192d7623..1d04e33790 100644 --- a/tests/multigrid/max_level_for_coarse_mesh.cc +++ b/tests/multigrid/max_level_for_coarse_mesh.cc @@ -51,7 +51,7 @@ test() dim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell) - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { if (dim == 2) if (cell->vertex(v)[0] < 0.25 && cell->vertex(v)[1] < 0.25) diff --git a/tests/multigrid/mg_output_dirichlet.cc b/tests/multigrid/mg_output_dirichlet.cc index 7fc4a3cc2c..d23e8c2c7e 100644 --- a/tests/multigrid/mg_output_dirichlet.cc +++ b/tests/multigrid/mg_output_dirichlet.cc @@ -73,9 +73,7 @@ refine_mesh(Triangulation &triangulation) cell != triangulation.end(); ++cell) { - for (unsigned int vertex = 0; - vertex < GeometryInfo::vertices_per_cell; - ++vertex) + for (const unsigned int vertex : GeometryInfo::vertex_indices()) { const Point p = cell->vertex(vertex); const Point origin = diff --git a/tests/multigrid/mg_output_neumann.cc b/tests/multigrid/mg_output_neumann.cc index f142f095bd..1fee8444be 100644 --- a/tests/multigrid/mg_output_neumann.cc +++ b/tests/multigrid/mg_output_neumann.cc @@ -73,9 +73,7 @@ refine_mesh(Triangulation &triangulation) cell != triangulation.end(); ++cell) { - for (unsigned int vertex = 0; - vertex < GeometryInfo::vertices_per_cell; - ++vertex) + for (const unsigned int vertex : GeometryInfo::vertex_indices()) { const Point p = cell->vertex(vertex); const Point origin = diff --git a/tests/multigrid/mg_renumbered_01.cc b/tests/multigrid/mg_renumbered_01.cc index 02a1568a76..551f3f8aa5 100644 --- a/tests/multigrid/mg_renumbered_01.cc +++ b/tests/multigrid/mg_renumbered_01.cc @@ -444,9 +444,7 @@ LaplaceProblem::refine_local() cell != triangulation.end(); ++cell) { - for (unsigned int vertex = 0; - vertex < GeometryInfo::vertices_per_cell; - ++vertex) + for (const unsigned int vertex : GeometryInfo::vertex_indices()) { const Point p = cell->vertex(vertex); const Point origin = diff --git a/tests/multigrid/mg_renumbered_02.cc b/tests/multigrid/mg_renumbered_02.cc index a65dca1233..aacee5b17f 100644 --- a/tests/multigrid/mg_renumbered_02.cc +++ b/tests/multigrid/mg_renumbered_02.cc @@ -330,9 +330,7 @@ LaplaceProblem::refine_local() cell != triangulation.end(); ++cell) { - for (unsigned int vertex = 0; - vertex < GeometryInfo::vertices_per_cell; - ++vertex) + for (const unsigned int vertex : GeometryInfo::vertex_indices()) { const Point p = cell->vertex(vertex); const Point origin = diff --git a/tests/multigrid/mg_renumbered_03.cc b/tests/multigrid/mg_renumbered_03.cc index 15925d54fb..f0565d8fd6 100644 --- a/tests/multigrid/mg_renumbered_03.cc +++ b/tests/multigrid/mg_renumbered_03.cc @@ -401,9 +401,7 @@ LaplaceProblem::refine_local() cell != triangulation.end(); ++cell) { - for (unsigned int vertex = 0; - vertex < GeometryInfo::vertices_per_cell; - ++vertex) + for (const unsigned int vertex : GeometryInfo::vertex_indices()) { const Point p = cell->vertex(vertex); const Point origin = diff --git a/tests/multigrid/step-16-02.cc b/tests/multigrid/step-16-02.cc index 8f05645759..8349df5360 100644 --- a/tests/multigrid/step-16-02.cc +++ b/tests/multigrid/step-16-02.cc @@ -527,9 +527,7 @@ LaplaceProblem::refine_grid(const std::string &reftype) triangulation.begin_active(); cell != triangulation.end(); ++cell) - for (unsigned int vertex = 0; - vertex < GeometryInfo::vertices_per_cell; - ++vertex) + for (const unsigned int vertex : GeometryInfo::vertex_indices()) { { const Point p = cell->vertex(vertex); diff --git a/tests/multigrid/step-16-bdry1.cc b/tests/multigrid/step-16-bdry1.cc index 4973316f65..0d2a5486e7 100644 --- a/tests/multigrid/step-16-bdry1.cc +++ b/tests/multigrid/step-16-bdry1.cc @@ -546,9 +546,7 @@ LaplaceProblem::refine_grid(const std::string &reftype) triangulation.begin_active(); cell != triangulation.end(); ++cell) - for (unsigned int vertex = 0; - vertex < GeometryInfo::vertices_per_cell; - ++vertex) + for (const unsigned int vertex : GeometryInfo::vertex_indices()) { { const Point p = cell->vertex(vertex); diff --git a/tests/multigrid/step-50_02.cc b/tests/multigrid/step-50_02.cc index d3d693ed3a..29034a96d6 100644 --- a/tests/multigrid/step-50_02.cc +++ b/tests/multigrid/step-50_02.cc @@ -517,7 +517,7 @@ namespace Step50 triangulation.begin_active(); cell != triangulation.end(); ++cell) - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) if (cell->vertex(v)[0] <= 0.5 && cell->vertex(v)[1] <= 0.5) cell->set_refine_flag(); triangulation.execute_coarsening_and_refinement(); diff --git a/tests/multigrid/transfer_03.cc b/tests/multigrid/transfer_03.cc index 554adbd9d5..b585dce166 100644 --- a/tests/multigrid/transfer_03.cc +++ b/tests/multigrid/transfer_03.cc @@ -71,9 +71,7 @@ refine_mesh(Triangulation &triangulation) cell != triangulation.end(); ++cell) { - for (unsigned int vertex = 0; - vertex < GeometryInfo::vertices_per_cell; - ++vertex) + for (const unsigned int vertex : GeometryInfo::vertex_indices()) { const Point p = cell->vertex(vertex); const Point origin = diff --git a/tests/numerics/kelly_crash_02.cc b/tests/numerics/kelly_crash_02.cc index 12f8c5bae3..5c9db07fd5 100644 --- a/tests/numerics/kelly_crash_02.cc +++ b/tests/numerics/kelly_crash_02.cc @@ -195,7 +195,7 @@ test() std::vector> cells(n_cells, CellData()); for (unsigned int i = 0; i < n_cells; ++i) { - for (unsigned int j = 0; j < GeometryInfo::vertices_per_cell; ++j) + for (const unsigned int j : GeometryInfo::vertex_indices()) cells[i].vertices[j] = cell_vertices[i][j]; cells[i].material_id = 0; } diff --git a/tests/numerics/project_01.cc b/tests/numerics/project_01.cc index ecc0f41d29..7e49293463 100644 --- a/tests/numerics/project_01.cc +++ b/tests/numerics/project_01.cc @@ -82,7 +82,7 @@ test() for (typename DoFHandler::active_cell_iterator cell = dh.begin_active(); cell != dh.end(); ++cell) - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { // check that the error is // somewhat small. it won't diff --git a/tests/numerics/project_01_curved_boundary.cc b/tests/numerics/project_01_curved_boundary.cc index ec8f54efaa..f7c34e4acd 100644 --- a/tests/numerics/project_01_curved_boundary.cc +++ b/tests/numerics/project_01_curved_boundary.cc @@ -147,7 +147,7 @@ test() dh.begin_active(); cell != dh.end(); ++cell) - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::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::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) deallog << cell->vertex(i) << ' ' << v(cell->vertex_dof_index(i, 0)) << std::endl; } diff --git a/tests/numerics/project_02.cc b/tests/numerics/project_02.cc index 92f4226fb4..1c290b3f7b 100644 --- a/tests/numerics/project_02.cc +++ b/tests/numerics/project_02.cc @@ -85,7 +85,7 @@ test() for (typename DoFHandler::active_cell_iterator cell = dh.begin_active(); cell != dh.end(); ++cell) - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { // check that the error is // somewhat small. it won't diff --git a/tests/numerics/project_03.cc b/tests/numerics/project_03.cc index f4ad8039c4..6b97bb70a9 100644 --- a/tests/numerics/project_03.cc +++ b/tests/numerics/project_03.cc @@ -89,7 +89,7 @@ test() for (typename DoFHandler::active_cell_iterator cell = dh.begin_active(); cell != dh.end(); ++cell) - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; ++i) + for (const unsigned int i : GeometryInfo::vertex_indices()) { deallog << cell->vertex(i) << ' ' << v(cell->vertex_dof_index(i, 0)) << std::endl; diff --git a/tests/optimization/step-44.h b/tests/optimization/step-44.h index 7c5942852e..37ec2256f0 100644 --- a/tests/optimization/step-44.h +++ b/tests/optimization/step-44.h @@ -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::vertices_per_cell; - ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale) { Tensor<1, dim> soln; diff --git a/tests/physics/elasticity-kinematics_01.cc b/tests/physics/elasticity-kinematics_01.cc index f7814474f8..ffe01c822c 100644 --- a/tests/physics/elasticity-kinematics_01.cc +++ b/tests/physics/elasticity-kinematics_01.cc @@ -65,7 +65,7 @@ test_kinematic_tensors() cell != dof_handler.end(); ++cell) { - for (unsigned int v = 0; v < GeometryInfo::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) if (std::abs(cell->vertex(v)[0] - 1.0) < 1e-9) soln_t[cell->vertex_dof_index(v, 0)] = 1.0; } diff --git a/tests/physics/step-18-rotation_matrix.cc b/tests/physics/step-18-rotation_matrix.cc index 4fc4acae89..b8194a63a8 100644 --- a/tests/physics/step-18-rotation_matrix.cc +++ b/tests/physics/step-18-rotation_matrix.cc @@ -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::vertices_per_cell; - ++v) + for (const unsigned int v : GeometryInfo::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::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) if (vertex_touched[cell->vertex_index(v)] == false) { vertex_touched[cell->vertex_index(v)] = true; diff --git a/tests/physics/step-18.cc b/tests/physics/step-18.cc index cfed4d3ce6..f03ea92b81 100644 --- a/tests/physics/step-18.cc +++ b/tests/physics/step-18.cc @@ -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::vertices_per_cell; - ++v) + for (const unsigned int v : GeometryInfo::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::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) if (vertex_touched[cell->vertex_index(v)] == false) { vertex_touched[cell->vertex_index(v)] = true; diff --git a/tests/physics/step-44-standard_tensors-material_push_forward.cc b/tests/physics/step-44-standard_tensors-material_push_forward.cc index 6ce4ffae8f..0f830e1f61 100644 --- a/tests/physics/step-44-standard_tensors-material_push_forward.cc +++ b/tests/physics/step-44-standard_tensors-material_push_forward.cc @@ -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::vertices_per_cell; - ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale) { Tensor<1, dim> soln; diff --git a/tests/physics/step-44-standard_tensors-spatial.cc b/tests/physics/step-44-standard_tensors-spatial.cc index 842fc29912..5fb8427f72 100644 --- a/tests/physics/step-44-standard_tensors-spatial.cc +++ b/tests/physics/step-44-standard_tensors-spatial.cc @@ -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::vertices_per_cell; - ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale) { Tensor<1, dim> soln; diff --git a/tests/physics/step-44.cc b/tests/physics/step-44.cc index 4e45ce482e..bd4772bf5a 100644 --- a/tests/physics/step-44.cc +++ b/tests/physics/step-44.cc @@ -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::vertices_per_cell; - ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale) { Tensor<1, dim> soln; diff --git a/tests/serialization/cell_data_1.cc b/tests/serialization/cell_data_1.cc index 13802efbd3..a1c8af685d 100644 --- a/tests/serialization/cell_data_1.cc +++ b/tests/serialization/cell_data_1.cc @@ -29,7 +29,7 @@ test() { dealii::CellData t1; - for (unsigned int i = 0; i < GeometryInfo::vertices_per_cell; i++) + for (const unsigned int i : GeometryInfo::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::vertices_per_cell; i++) + for (const unsigned int i : GeometryInfo::vertex_indices()) { dealii::CellData t2 = t1; t2.vertices[i]++; diff --git a/tests/serialization/dof_handler_01.cc b/tests/serialization/dof_handler_01.cc index e71a6c84b3..5747e95adc 100644 --- a/tests/serialization/dof_handler_01.cc +++ b/tests/serialization/dof_handler_01.cc @@ -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::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { if (c1->vertex(v) != c2->vertex(v)) return false; diff --git a/tests/serialization/hp_dof_handler_01.cc b/tests/serialization/hp_dof_handler_01.cc index 6b09c9f234..f493df122b 100644 --- a/tests/serialization/hp_dof_handler_01.cc +++ b/tests/serialization/hp_dof_handler_01.cc @@ -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::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { if (c1->vertex(v) != c2->vertex(v)) return false; diff --git a/tests/serialization/triangulation_01.cc b/tests/serialization/triangulation_01.cc index 5bf61649e3..dfb812bbb8 100644 --- a/tests/serialization/triangulation_01.cc +++ b/tests/serialization/triangulation_01.cc @@ -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::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { if (c1->vertex(v) != c2->vertex(v)) return false; diff --git a/tests/serialization/triangulation_02.cc b/tests/serialization/triangulation_02.cc index 086664fcfb..bdbdc4197d 100644 --- a/tests/serialization/triangulation_02.cc +++ b/tests/serialization/triangulation_02.cc @@ -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::vertices_per_cell; ++v) + for (const unsigned int v : GeometryInfo::vertex_indices()) { if (c1->vertex(v) != c2->vertex(v)) return false;