cell = dof_handler_ref.begin_active(),
endc = dof_handler_ref.end();
for (; cell != endc; ++cell)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
- ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale)
{
Tensor<1, dim> soln;
cell = dof_handler_ref.begin_active(),
endc = dof_handler_ref.end();
for (; cell != endc; ++cell)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
- ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale)
{
Tensor<1, dim> soln;
cell = dof_handler_ref.begin_active(),
endc = dof_handler_ref.end();
for (; cell != endc; ++cell)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
- ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale)
{
Tensor<1, dim> soln;
cell = dof_handler_ref.begin_active(),
endc = dof_handler_ref.end();
for (; cell != endc; ++cell)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
- ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale)
{
Tensor<1, dim> soln;
cell = dof_handler_ref.begin_active(),
endc = dof_handler_ref.end();
for (; cell != endc; ++cell)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
- ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale)
{
Tensor<1, dim> soln;
for (unsigned int f = 0; f < GeometryInfo<dim>::lines_per_cell; ++f)
{
deallog << "line_vertices" << f;
- for (unsigned int v = 0; v < GeometryInfo<1>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<1>::vertex_indices())
deallog << ' ' << GeometryInfo<dim>::line_to_cell_vertices(f, v);
deallog << std::endl;
}
deallog << "Checking in " << dim << "d" << std::endl;
// check phi_i(v_j) = delta_{ij}
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
const double phi_i = GeometryInfo<dim>::d_linear_shape_function(
GeometryInfo<dim>::unit_cell_vertex(v), i);
// sum_i phi_i(x) == 1
// at all points. do so at every
// vertex, and then at the center
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
double s = 0;
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
s += GeometryInfo<dim>::d_linear_shape_function(
GeometryInfo<dim>::unit_cell_vertex(v), i);
AssertThrow(s == 1, ExcInternalError());
center[i] = 0.5;
double s = 0;
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
s += GeometryInfo<dim>::d_linear_shape_function(center, i);
AssertThrow(s == 1, ExcInternalError());
deallog << "Checking in " << dim << "d" << std::endl;
// check phi_i(v_j) = delta_{ij}
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
const Tensor<1, dim> phi_i_grad =
GeometryInfo<dim>::d_linear_shape_function_gradient(
// gradient of the sum of shape functions
// is zero. do so at every vertex, and then
// at the center
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
Tensor<1, dim> s;
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
s += GeometryInfo<dim>::d_linear_shape_function_gradient(
GeometryInfo<dim>::unit_cell_vertex(v), i);
AssertThrow(s.norm() == 0, ExcInternalError());
center[i] = 0.5;
Tensor<1, dim> s;
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
s += GeometryInfo<dim>::d_linear_shape_function_gradient(center, i);
AssertThrow(s.norm() == 0, ExcInternalError());
// that case
{
Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
Tensor<0, dim> determinants[GeometryInfo<dim>::vertices_per_cell];
GeometryInfo<dim>::alternating_form_at_vertices(vertices, determinants);
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
deallog << "Reference cell: " << determinants[v] << std::endl;
AssertThrow(static_cast<double>(determinants[v]) == 1,
// in the x-direction by a factor of 10
{
Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
vertices[v][0] /= 10;
Tensor<0, dim> determinants[GeometryInfo<dim>::vertices_per_cell];
GeometryInfo<dim>::alternating_form_at_vertices(vertices, determinants);
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
deallog << "Squashed cell: " << determinants[v] << std::endl;
AssertThrow(static_cast<double>(determinants[v]) == 0.1,
// 1d)
{
Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
vertices[v][0] /= 10;
Tensor<0, dim> determinants[GeometryInfo<dim>::vertices_per_cell];
GeometryInfo<dim>::alternating_form_at_vertices(vertices, determinants);
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
deallog << "Squashed+rotated cell: " << determinants[v] << std::endl;
AssertThrow(static_cast<double>(determinants[v]) == 0.1,
// pinched cell
{
Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
vertices[1] /= 10;
Tensor<0, dim> determinants[GeometryInfo<dim>::vertices_per_cell];
GeometryInfo<dim>::alternating_form_at_vertices(vertices, determinants);
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
deallog << "Pinched cell: " << determinants[v] << std::endl;
}
// inverted cell
{
Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
std::swap(vertices[0], vertices[1]);
Tensor<0, dim> determinants[GeometryInfo<dim>::vertices_per_cell];
GeometryInfo<dim>::alternating_form_at_vertices(vertices, determinants);
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
deallog << "Inverted cell: " << determinants[v] << std::endl;
}
}
// that case
{
Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
for (const unsigned int f : GeometryInfo<dim>::face_indices())
// in the x-direction by a factor of 10
{
Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
vertices[v][0] /= 10;
// 1d)
{
Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
vertices[v][0] /= 10;
// pinched cell
{
Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
vertices[1] /= 10;
// inverted cell
{
Point<dim> vertices[GeometryInfo<dim>::vertices_per_cell];
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
std::swap(vertices[0], vertices[1]);
triangulation.begin_active();
cell != triangulation.end();
++cell)
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
deallog << cell->vertex(i) << std::endl;
}
triangulation.begin_active();
cell != triangulation.end();
++cell)
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
deallog << cell->vertex(i) << std::endl;
}
triangulation.begin_active();
cell != triangulation.end();
++cell)
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
deallog << cell->vertex(i) << std::endl;
}
triangulation.begin_active();
cell != triangulation.end();
++cell)
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
deallog << cell->vertex(i) << std::endl;
}
triangulation.begin_active();
cell != triangulation.end();
++cell)
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
deallog << cell->vertex(i) << std::endl;
}
check(const unsigned int testcase)
{
std::vector<Point<dim>> vertices;
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
vertices.push_back(GeometryInfo<dim>::unit_cell_vertex(v));
switch (testcase)
std::vector<CellData<dim>> cells;
{
CellData<dim> cell;
- for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
cell.vertices[j] = j;
cells.push_back(cell);
}
check(const unsigned int testcase)
{
std::vector<Point<dim>> vertices;
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
vertices.push_back(GeometryInfo<dim>::unit_cell_vertex(v));
switch (testcase)
std::vector<CellData<dim>> cells;
{
CellData<dim> cell;
- for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
cell.vertices[j] = j;
cells.push_back(cell);
}
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;
std::vector<CellData<2>> cells(n_cells, CellData<2>());
for (unsigned int i = 0; i < n_cells; ++i)
{
- for (unsigned int j = 0; j < GeometryInfo<2>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<2>::vertex_indices())
cells[i].vertices[j] = cell_vertices[i][j];
cells[i].material_id = 0;
}
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;
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;
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;
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;
std::vector<CellData<2>> cells(n_cells, CellData<2>());
for (unsigned int i = 0; i < n_cells; ++i)
{
- for (unsigned int j = 0; j < GeometryInfo<2>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<2>::vertex_indices())
cells[i].vertices[j] = cell_vertices[i][j];
cells[i].material_id = 0;
}
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;
std::vector<CellData<2>> cells(n_cells, CellData<2>());
for (unsigned int i = 0; i < n_cells; ++i)
{
- for (unsigned int j = 0; j < GeometryInfo<2>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<2>::vertex_indices())
cells[i].vertices[j] = cell_vertices[i][j];
cells[i].material_id = 0;
}
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;
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;
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 << "] ";
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;
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;
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;
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;
}
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 << " ] ";
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;
}
endc = dof_handler.end();
bool evaluation_point_found = false;
for (; (cell != endc) && !evaluation_point_found; ++cell)
- for (unsigned int vertex = 0;
- vertex < GeometryInfo<dim>::vertices_per_cell;
- ++vertex)
+ for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
if (cell->vertex(vertex) == evaluation_point)
{
point_value = solution(cell->vertex_dof_index(vertex, 0));
endc = dof_handler.end();
bool evaluation_point_found = false;
for (; (cell != endc) && !evaluation_point_found; ++cell)
- for (unsigned int vertex = 0;
- vertex < GeometryInfo<dim>::vertices_per_cell;
- ++vertex)
+ for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
if (cell->vertex(vertex).distance(evaluation_point) <
cell->diameter() * 1e-8)
{
endc = dof_handler.end();
unsigned int evaluation_point_hits = 0;
for (; cell != endc; ++cell)
- for (unsigned int vertex = 0;
- vertex < GeometryInfo<dim>::vertices_per_cell;
- ++vertex)
+ for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
if (cell->vertex(vertex) == evaluation_point)
{
fe_values.reinit(cell);
std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
for (unsigned int i = 0; i < n_cells; ++i)
{
- for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
cells[i].vertices[j] = cell_vertices[i][j];
cells[i].material_id = 0;
};
dof_handler.begin_active(),
endc = dof_handler.end();
for (; cell != endc; ++cell)
- for (unsigned int vertex = 0;
- vertex < GeometryInfo<dim>::vertices_per_cell;
- ++vertex)
+ for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
if (cell->vertex(vertex).distance(evaluation_point) <
cell->diameter() * 1e-8)
{
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));
face = surface_to_volume_mapping[cell];
deallog << "Surface cell: " << cell << " with vertices:" << std::endl;
- for (unsigned int k = 0; k < GeometryInfo<s_dim>::vertices_per_cell; ++k)
+ for (const unsigned int k : GeometryInfo<s_dim>::vertex_indices())
deallog << " " << cell->vertex(k) << std::endl;
deallog << "Volume face: " << face << " with vertices:" << std::endl;
- for (unsigned int k = 0; k < GeometryInfo<s_dim>::vertices_per_cell; ++k)
+ for (const unsigned int k : GeometryInfo<s_dim>::vertex_indices())
deallog << " " << face->vertex(k) << std::endl;
Point<spacedim> diff(face->center());
Assert(face->at_boundary(), ExcInternalError());
deallog << "Surface cell: " << cell << " with vertices:" << std::endl;
- for (unsigned int k = 0; k < GeometryInfo<s_dim>::vertices_per_cell; ++k)
+ for (const unsigned int k : GeometryInfo<s_dim>::vertex_indices())
{
deallog << " " << cell->vertex(k) << std::endl;
Assert(std::fabs(cell->vertex(k).distance(Point<spacedim>()) - 1) <
}
deallog << "Volume face: " << face << " with vertices:" << std::endl;
- for (unsigned int k = 0; k < GeometryInfo<s_dim>::vertices_per_cell; ++k)
+ for (const unsigned int k : GeometryInfo<s_dim>::vertex_indices())
{
deallog << " " << face->vertex(k) << std::endl;
Assert(std::fabs(face->vertex(k).distance(Point<spacedim>()) - 1) <
Assert(face->at_boundary(), ExcInternalError());
deallog << "Surface cell: " << cell << " with vertices:" << std::endl;
- for (unsigned int k = 0; k < GeometryInfo<s_dim>::vertices_per_cell; ++k)
+ for (const unsigned int k : GeometryInfo<s_dim>::vertex_indices())
{
deallog << " " << cell->vertex(k) << std::endl;
Assert(std::fabs(cell->vertex(k).distance(Point<spacedim>()) - 1) <
}
deallog << "Volume face: " << face << " with vertices:" << std::endl;
- for (unsigned int k = 0; k < GeometryInfo<s_dim>::vertices_per_cell; ++k)
+ for (const unsigned int k : GeometryInfo<s_dim>::vertex_indices())
{
deallog << " " << face->vertex(k) << std::endl;
Assert(std::fabs(face->vertex(k).distance(Point<spacedim>()) - 1) <
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.;
const unsigned int nsubp = nsub + 1;
patch.n_subdivisions = nsub;
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
for (unsigned int d = 0; d < spacedim; ++d)
patch.vertices[v](d) =
p + cell_coordinates[d][v] + ((d >= dim) ? v : 0);
const unsigned int nsubp = nsub + 1;
patch.n_subdivisions = nsub;
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
for (unsigned int d = 0; d < spacedim; ++d)
patch.vertices[v](d) =
p + cell_coordinates[d][v] + ((d >= dim) ? v : 0);
}
// Prepare cell data
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
cells[0].vertices[i] = i;
cells[0].material_id = 0;
}
}
// Prepare cell data
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
cells[1].vertices[i] = GeometryInfo<dim>::vertices_per_cell + i;
cells[1].material_id = 0;
}
{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];
{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];
/* 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];
/* 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];
/* 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];
{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];
{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];
std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
for (unsigned int i = 0; i < n_cells; ++i)
{
- for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
cells[i].vertices[j] = cell_vertices[i][j];
cells[i].material_id = 0;
}
std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
for (unsigned int i = 0; i < n_cells; ++i)
{
- for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
cells[i].vertices[j] = cell_vertices[i][j];
cells[i].material_id = 0;
}
endc = dof_handler.end();
bool evaluation_point_found = false;
for (; (cell != endc) && !evaluation_point_found; ++cell)
- for (unsigned int vertex = 0;
- vertex < GeometryInfo<dim>::vertices_per_cell;
- ++vertex)
+ for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
if (cell->vertex(vertex).distance(evaluation_point) <
cell->diameter() * 1e-8)
{
endc = dof_handler.end();
unsigned int evaluation_point_hits = 0;
for (; cell != endc; ++cell)
- for (unsigned int vertex = 0;
- vertex < GeometryInfo<dim>::vertices_per_cell;
- ++vertex)
+ for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
if (cell->vertex(vertex) == evaluation_point)
{
fe_values.reinit(cell);
std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
for (unsigned int i = 0; i < n_cells; ++i)
{
- for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
cells[i].vertices[j] = cell_vertices[i][j];
cells[i].material_id = 0;
};
.begin_active(),
endc = dof_handler.end();
for (; cell != endc; ++cell)
- for (unsigned int vertex = 0;
- vertex < GeometryInfo<dim>::vertices_per_cell;
- ++vertex)
+ for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
if (cell->vertex(vertex).distance(evaluation_point) <
cell->diameter() * 1e-8)
{
fe_values.reinit(cell);
deallog << "Cell nodes:" << std::endl;
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
deallog << i << ": ( ";
for (unsigned int d = 0; d < dim; ++d)
GridGenerator::hyper_cube(tr);
typename Triangulation<dim>::active_cell_iterator cell = tr.begin_active();
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
Point<dim> &point = cell->vertex(i);
if (std::abs(point(dim - 1) - 1.0) < 1e-5)
fe_values.reinit(cell);
deallog << "Cell nodes:" << std::endl;
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
deallog << i << ": ( ";
for (unsigned int d = 0; d < dim; ++d)
GridGenerator::hyper_cube(tr);
typename Triangulation<dim>::active_cell_iterator cell = tr.begin_active();
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
Point<dim> &point = cell->vertex(i);
if (std::abs(point(dim - 1) - 1.0) < 1e-5)
fe_values.reinit(cell);
deallog << "Cell nodes:" << std::endl;
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
deallog << i << ": ( ";
for (unsigned int d = 0; d < dim; ++d)
fe_values.reinit(cell);
deallog << "Cell nodes:" << std::endl;
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
deallog << i << ": ( ";
for (unsigned int d = 0; d < dim; ++d)
fe_values.reinit(cell);
deallog << "Cell nodes:" << std::endl;
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
deallog << i << ": ( ";
for (unsigned int d = 0; d < dim; ++d)
fe_values.reinit(cell);
deallog << "Cell nodes:" << std::endl;
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
deallog << i << ": ( ";
for (unsigned int d = 0; d < dim; ++d)
std::vector<CellData<3>> cells(n_cells, CellData<3>());
for (unsigned i = 0; i < n_cells; ++i)
{
- for (unsigned int j = 0; j < GeometryInfo<3>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<3>::vertex_indices())
cells[i].vertices[j] = cell_vertices[i][j];
cells[i].material_id = 0;
}
fe_values.reinit(cell);
deallog << "Cell nodes:" << std::endl;
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
deallog << i << ": ( ";
for (unsigned int d = 0; d < dim; ++d)
fe_values.reinit(cell);
deallog << "Cell nodes:" << std::endl;
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
deallog << i << ": ( " << cell->vertex(i) << " )" << std::endl;
bool cell_ok = true;
fe_values.reinit(cell);
deallog << "Cell nodes:" << std::endl;
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
deallog << i << ": ( ";
for (unsigned int d = 0; d < dim; ++d)
std::vector<CellData<2>> cells(n_cells, CellData<2>());
for (unsigned i = 0; i < cells.size(); ++i)
{
- for (unsigned int j = 0; j < GeometryInfo<2>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<2>::vertex_indices())
cells[i].vertices[j] = cell_vertices[i][j];
cells[i].material_id = 0;
}
std::vector<CellData<3>> cells(n_cells, CellData<3>());
for (unsigned i = 0; i < cells.size(); ++i)
{
- for (unsigned int j = 0; j < GeometryInfo<3>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<3>::vertex_indices())
cells[i].vertices[j] = cell_vertices[i][j];
cells[i].material_id = 0;
}
fe_values.reinit(cell);
deallog << "Cell nodes:" << std::endl;
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
deallog << i << ": ( ";
for (unsigned int d = 0; d < dim; ++d)
fe_values.reinit(cell);
deallog << "Cell nodes:" << std::endl;
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
deallog << i << ": ( ";
for (unsigned int d = 0; d < dim; ++d)
fe_values.reinit(cell);
deallog << "Cell nodes:" << std::endl;
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
deallog << i << ": ( ";
for (unsigned int d = 0; d < dim; ++d)
fe_values.reinit(cell);
deallog << "Cell nodes:" << std::endl;
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
deallog << i << ": ( ";
for (unsigned int d = 0; d < dim; ++d)
fe_values.reinit(cell);
deallog << "Cell nodes:" << std::endl;
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
deallog << i << ": ( ";
for (unsigned int d = 0; d < dim; ++d)
GridGenerator::hyper_cube(tr);
typename Triangulation<dim>::active_cell_iterator cell = tr.begin_active();
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
Point<dim> &point = cell->vertex(i);
if (std::abs(point(dim - 1) - 1.0) < 1e-5)
fe_values.reinit(cell);
deallog << "Cell nodes:" << std::endl;
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
deallog << i << ": (" << cell->vertex(i) << ")" << std::endl;
bool cell_ok = true;
GridGenerator::hyper_cube(tr);
typename Triangulation<dim>::active_cell_iterator cell = tr.begin_active();
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
Point<dim> &point = cell->vertex(i);
if (std::abs(point(dim - 1) - 1.0) < 1e-5)
fe_values.reinit(cell);
deallog << "Cell nodes:" << std::endl;
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
deallog << i << ": ( ";
for (unsigned int d = 0; d < dim; ++d)
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));
tria.begin_active();
c != tria.end();
++c, ++index)
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
hash += (index * i * c->vertex_index(i)) % (tria.n_active_cells() + 1);
deallog << " hash=" << hash << std::endl;
}
deallog << " " << tria_cell << " user flag check: "
<< (tria_cell->user_flag_set() ? " (+) " : " (-) ")
<< std::endl;
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
- ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
deallog << " vertices for cell " << tria_cell << " : "
<< tria_cell->vertex(v) << std::endl;
deallog << " " << tria_cell << " user flag check: "
<< (tria_cell->user_flag_set() ? " (+) " : " (-) ")
<< std::endl;
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
- ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
deallog << " vertices for cell " << tria_cell << " : "
<< tria_cell->vertex(v) << std::endl;
deallog << " " << tria_cell << " user flag check: "
<< (tria_cell->user_flag_set() ? " (+) " : " (-) ")
<< std::endl;
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
- ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
deallog << " vertices for cell " << tria_cell << " : "
<< tria_cell->vertex(v) << std::endl;
deallog << " " << tria_cell << " user flag check: "
<< (tria_cell->user_flag_set() ? " (+) " : " (-) ")
<< std::endl;
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
- ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
deallog << " vertices for cell " << tria_cell << " : "
<< tria_cell->vertex(v) << std::endl;
tr.begin_active();
cell != tr.end();
++cell)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
min_adjacent_cell_level[cell->vertex_index(v)] =
std::min<unsigned int>(min_adjacent_cell_level[cell->vertex_index(v)],
tr.begin_active();
cell != tr.end();
++cell)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
min_adjacent_cell_level[cell->vertex_index(v)] =
std::min<unsigned int>(min_adjacent_cell_level[cell->vertex_index(v)],
tr.begin_active();
cell != tr.end();
++cell)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
min_adjacent_cell_level[cell->vertex_index(v)] =
std::min<unsigned int>(min_adjacent_cell_level[cell->vertex_index(v)],
// Check that all the vertices are within the sphere
// (sphere with thickness 100. *std::numeric_limits<double>::epsilon())
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
AssertThrow(std::fabs(center.distance(tria.begin_active()->vertex(v))) <
radius + 100. * std::numeric_limits<double>::epsilon(),
ExcInternalError());
-1)
<< " ";
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
deallog << cell.vertex(v) << " ";
deallog << std::endl;
tria.begin_active();
c != tria.end();
++c, ++index)
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
hash += (index * i * c->vertex_index(i)) % (tria.n_active_cells() + 1);
deallog << hash << std::endl;
}
for (Triangulation<dim>::active_cell_iterator c = tria.begin_active();
c != tria.end();
++c, ++index)
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
hash += (index * i * c->vertex_index(i)) % (tria.n_active_cells() + 1);
deallog << " hash=" << hash << std::endl;
}
for (Triangulation<dim>::active_cell_iterator c = tria.begin_active();
c != tria.end();
++c, ++index)
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
hash += (index * i * c->vertex_index(i)) % (tria.n_active_cells() + 1);
deallog << " hash=" << hash << std::endl;
tria.begin_active();
c != tria.end();
++c, ++index)
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
hash += (index * i * c->vertex_index(i)) % (tria.n_active_cells() + 1);
deallog << " hash=" << hash << std::endl;
}
tria.begin_active();
c != tria.end();
++c, ++index)
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
hash += (index * i * c->vertex_index(i)) % (tria.n_active_cells() + 1);
deallog << " hash=" << hash << std::endl;
tria.begin_active();
c != tria.end();
++c, ++index)
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
hash += (index * i * c->vertex_index(i)) % (tria.n_active_cells() + 1);
deallog << " hash=" << hash << std::endl;
}
{
AssertThrow(cell_v2->material_id() == cell_v4->material_id(),
ExcInternalError());
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
AssertThrow((cell_v2->vertex(i) - cell_v4->vertex(i)).norm() < 1.e-10,
ExcInternalError());
{
AssertThrow(cell_v2->material_id() == cell_v41->material_id(),
ExcInternalError());
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
AssertThrow((cell_v2->vertex(i) - cell_v41->vertex(i)).norm() <
1.e-10,
ExcInternalError());
std::set<unsigned int> vertices_v2;
std::set<unsigned int> vertices_v4;
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
AssertThrow((tria_v2.get_vertices()[cell_v2->vertex_index(i)] -
tria_v4.get_vertices()[cell_v2->vertex_index(i)])
vertices[7](0) = 1;
}
std::vector<CellData<dim>> cells(1);
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
cells[0].vertices[i] = i;
if (dim == 3 && second_case)
for (unsigned int i = 0; i < n_cells; ++i)
{
- for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
cells[i].vertices[j] = cell_vertices[i][j];
cells[i].material_id = 0;
}
for (unsigned int i = 0; i < n_cells; ++i)
{
- for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
cells[i].vertices[j] = cell_vertices[i][j];
cells[i].material_id = 0;
}
AssertDimension(cell1->material_id(), cell2->material_id());
AssertDimension(cell1->manifold_id(), cell2->manifold_id());
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
auto obj1 = cell1->vertex_index(i);
auto obj2 = cell2->vertex_index(i);
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));
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));
/* 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];
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];
{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];
{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];
// Looking if every point is at least inside a bounding box
for (; cell < endc; ++cell)
if (cell->is_locally_owned())
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
bool inside_a_box = false;
for (unsigned int i = 0; i < local_bbox.size(); ++i)
unsigned int cell_counter = 0;
for (; cell != endc; ++cell)
{
- for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
{
cells[cell_counter].vertices[j] = cell->vertex_index(j);
}
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
// 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;
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: "
std::cos(weights[2]);
};
Tensor<1, GeometryInfo<structdim>::vertices_per_cell> c0;
- for (unsigned int row_n = 0;
- row_n < GeometryInfo<structdim>::vertices_per_cell;
- ++row_n)
+ for (const unsigned int row_n : GeometryInfo<structdim>::vertex_indices())
c0[row_n] = 1.0;
const std::array<double, 3> exact{
}
std::vector<CellData<dim>> cells(1);
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
cells[0].vertices[i] = i;
cells[0].material_id = 0;
std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
for (unsigned int i = 0; i < n_cells; ++i)
{
- for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
cells[i].vertices[j] = cell_vertices[i][j];
cells[i].material_id = 0;
}
std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
for (unsigned int i = 0; i < n_cells; ++i)
{
- for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
cells[i].vertices[j] = cell_vertices[i][j];
cells[i].material_id = 0;
}
{
if (cell->center().distance(center) < 1e-10)
{
- for (unsigned int vertex_n = 0;
- vertex_n < GeometryInfo<dim>::vertices_per_cell;
- ++vertex_n)
+ for (const unsigned int vertex_n :
+ GeometryInfo<dim>::vertex_indices())
{
cell->vertex(vertex_n) *=
core_radius / center.distance(cell->vertex(vertex_n));
cell = triangulation.begin_active();
for (; cell != endc; ++cell)
{
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
const double dist = center.distance(cell->vertex(v));
if (dist > core_radius * 1.0001 && dist < radius - 1.0e-5)
dh.begin_active();
cell != dh.end();
++cell)
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
// check that the error is
// somewhat small. it won't
dh.begin_active();
cell != dh.end();
++cell)
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
deallog << cell->vertex(i) << ' '
<< v(cell->vertex_dof_index(i, 0, cell->active_fe_index()))
<< std::endl;
dh.begin_active();
cell != dh.end();
++cell)
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
deallog << cell->vertex(i) << ' '
<< v(cell->vertex_dof_index(i, 0, cell->active_fe_index()))
<< std::endl;
dh.begin_active();
cell != dh.end();
++cell)
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
// check that the error is
// somewhat small. it won't
endc = dof_handler.end();
bool evaluation_point_found = false;
for (; (cell != endc) && !evaluation_point_found; ++cell)
- for (unsigned int vertex = 0;
- vertex < GeometryInfo<dim>::vertices_per_cell;
- ++vertex)
+ for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
if (cell->vertex(vertex) == evaluation_point)
{
point_value = solution(
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));
std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
for (unsigned int i = 0; i < n_cells; ++i)
{
- for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
cells[i].vertices[j] = cell_vertices[i][j];
cells[i].material_id = 0;
}
std::vector<std::vector<double>>(
dim + 1, std::vector<double>(fe.dofs_per_cell, 0.)));
- for (unsigned int vertex = 0; vertex < GeometryInfo<dim>::vertices_per_cell;
- ++vertex)
+ for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
{
Point<dim> v;
for (unsigned int d = 0; d < dim; ++d)
std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
for (unsigned int i = 0; i < n_cells; ++i)
{
- for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
cells[i].vertices[j] = cell_vertices[i][j];
cells[i].material_id = 0;
}
{
std::vector<Point<spacedim>> vertices(GeometryInfo<dim>::vertices_per_cell);
std::vector<CellData<dim>> cells(1);
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
cells[0].vertices[i] = i;
cells[0].material_id = 0;
std::cout << "step " << step << std::endl;
for (auto &cell : tria.active_cell_iterators())
{
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
- ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
if (p.distance(cell->vertex(v)) < 0.03 / (1 << step))
{
endc = dof_handler.end();
std::vector<bool> vertex_touched(triangulation.n_vertices(), false);
for (cell = dof_handler.begin_active(); cell != endc; ++cell)
- for (unsigned int vertex_no = 0;
- vertex_no < GeometryInfo<dim>::vertices_per_cell;
- ++vertex_no)
+ for (const unsigned int vertex_no : GeometryInfo<dim>::vertex_indices())
if (vertex_touched[cell->vertex_index(vertex_no)] == false)
{
Point<dim> & v = cell->vertex(vertex_no);
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 &&
{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];
triangulation.begin_active();
cell != triangulation.end();
++cell)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
if (cell->vertex(v)[0] <= 0.5 && cell->vertex(v)[1] <= 0.5)
cell->set_refine_flag();
triangulation.execute_coarsening_and_refinement();
std::map<unsigned int, Point<dim>> non_artificial_vertices_old;
for (cell = triangulation.begin_active(); cell != endc; ++cell)
if (!cell->is_artificial())
- for (unsigned int vertex_no = 0;
- vertex_no < GeometryInfo<dim>::vertices_per_cell;
- ++vertex_no)
+ for (const unsigned int vertex_no : GeometryInfo<dim>::vertex_indices())
non_artificial_vertices_old[cell->vertex_index(vertex_no)] =
cell->vertex(vertex_no);
GridTools::get_locally_owned_vertices(triangulation);
for (cell = triangulation.begin_active(); cell != endc; ++cell)
if (cell->is_locally_owned())
- for (unsigned int vertex_no = 0;
- vertex_no < GeometryInfo<dim>::vertices_per_cell;
- ++vertex_no)
+ for (const unsigned int vertex_no : GeometryInfo<dim>::vertex_indices())
{
const unsigned global_vertex_no = cell->vertex_index(vertex_no);
if (!vertex_moved[global_vertex_no] &&
std::map<unsigned int, Point<dim>> non_artificial_vertices_new;
for (cell = triangulation.begin_active(); cell != endc; ++cell)
if (!cell->is_artificial())
- for (unsigned int vertex_no = 0;
- vertex_no < GeometryInfo<dim>::vertices_per_cell;
- ++vertex_no)
+ for (const unsigned int vertex_no : GeometryInfo<dim>::vertex_indices())
{
Point<dim> point = cell->vertex(vertex_no);
point(0) -= 1.e-1;
const unsigned int nsubp = nsub + 1;
patch.n_subdivisions = nsub;
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
for (unsigned int d = 0; d < spacedim; ++d)
patch.vertices[v](d) =
p + cell_coordinates[d][v] + ((d >= dim) ? v : 0);
{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];
{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];
std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
for (unsigned int i = 0; i < n_cells; ++i)
{
- for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
cells[i].vertices[j] = cell_vertices[i][j];
cells[i].material_id = 0;
}
Assert(cell1->subdomain_id() == cell2->subdomain_id(),
ExcInternalError());
- for (unsigned int vertex = 0;
- vertex < GeometryInfo<dim>::vertices_per_cell;
- ++vertex)
+ for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
{
Assert(cell1->vertex(vertex).distance(cell2->vertex(vertex)) <
1.e-14,
std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
for (unsigned int i = 0; i < n_cells; ++i)
{
- for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
cells[i].vertices[j] = cell_vertices[i][j];
cells[i].material_id = 0;
}
cell->get_mg_dof_indices(indices);
deallog << "Level " << cell->level();
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
deallog << " v" << cell->vertex(i);
deallog << " dofs ";
for (unsigned int i = 0; i < indices.size(); ++i)
cell = tria.begin_active();
cell != tria.end();
++cell)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
if (dim == 2)
if (cell->vertex(v)[0] < 0.5 && cell->vertex(v)[1] < 0.5)
dim>::active_cell_iterator cell = tria.begin_active();
cell != tria.end();
++cell)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
if (dim == 2)
if (cell->vertex(v)[0] < 0.25 && cell->vertex(v)[1] < 0.25)
cell != triangulation.end();
++cell)
{
- for (unsigned int vertex = 0;
- vertex < GeometryInfo<dim>::vertices_per_cell;
- ++vertex)
+ for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
{
const Point<dim> p = cell->vertex(vertex);
const Point<dim> origin =
cell != triangulation.end();
++cell)
{
- for (unsigned int vertex = 0;
- vertex < GeometryInfo<dim>::vertices_per_cell;
- ++vertex)
+ for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
{
const Point<dim> p = cell->vertex(vertex);
const Point<dim> origin =
cell != triangulation.end();
++cell)
{
- for (unsigned int vertex = 0;
- vertex < GeometryInfo<dim>::vertices_per_cell;
- ++vertex)
+ for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
{
const Point<dim> p = cell->vertex(vertex);
const Point<dim> origin =
cell != triangulation.end();
++cell)
{
- for (unsigned int vertex = 0;
- vertex < GeometryInfo<dim>::vertices_per_cell;
- ++vertex)
+ for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
{
const Point<dim> p = cell->vertex(vertex);
const Point<dim> origin =
cell != triangulation.end();
++cell)
{
- for (unsigned int vertex = 0;
- vertex < GeometryInfo<dim>::vertices_per_cell;
- ++vertex)
+ for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
{
const Point<dim> p = cell->vertex(vertex);
const Point<dim> origin =
triangulation.begin_active();
cell != triangulation.end();
++cell)
- for (unsigned int vertex = 0;
- vertex < GeometryInfo<dim>::vertices_per_cell;
- ++vertex)
+ for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
{
{
const Point<dim> p = cell->vertex(vertex);
triangulation.begin_active();
cell != triangulation.end();
++cell)
- for (unsigned int vertex = 0;
- vertex < GeometryInfo<dim>::vertices_per_cell;
- ++vertex)
+ for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
{
{
const Point<dim> p = cell->vertex(vertex);
triangulation.begin_active();
cell != triangulation.end();
++cell)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
if (cell->vertex(v)[0] <= 0.5 && cell->vertex(v)[1] <= 0.5)
cell->set_refine_flag();
triangulation.execute_coarsening_and_refinement();
cell != triangulation.end();
++cell)
{
- for (unsigned int vertex = 0;
- vertex < GeometryInfo<dim>::vertices_per_cell;
- ++vertex)
+ for (const unsigned int vertex : GeometryInfo<dim>::vertex_indices())
{
const Point<dim> p = cell->vertex(vertex);
const Point<dim> origin =
std::vector<CellData<dim>> cells(n_cells, CellData<dim>());
for (unsigned int i = 0; i < n_cells; ++i)
{
- for (unsigned int j = 0; j < GeometryInfo<dim>::vertices_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<dim>::vertex_indices())
cells[i].vertices[j] = cell_vertices[i][j];
cells[i].material_id = 0;
}
for (typename DoFHandler<dim>::active_cell_iterator cell = dh.begin_active();
cell != dh.end();
++cell)
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
// check that the error is
// somewhat small. it won't
dh.begin_active();
cell != dh.end();
++cell)
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
deallog << cell->vertex(i) << ' ' << v(cell->vertex_dof_index(i, 0))
<< std::endl;
}
dh.begin_active();
cell != dh.end();
++cell)
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
deallog << cell->vertex(i) << ' ' << v(cell->vertex_dof_index(i, 0))
<< std::endl;
}
for (typename DoFHandler<dim>::active_cell_iterator cell = dh.begin_active();
cell != dh.end();
++cell)
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
// check that the error is
// somewhat small. it won't
for (typename DoFHandler<dim>::active_cell_iterator cell = dh.begin_active();
cell != dh.end();
++cell)
- for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::vertex_indices())
{
deallog << cell->vertex(i) << ' ' << v(cell->vertex_dof_index(i, 0))
<< std::endl;
cell = dof_handler_ref.begin_active(),
endc = dof_handler_ref.end();
for (; cell != endc; ++cell)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
- ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale)
{
Tensor<1, dim> soln;
cell != dof_handler.end();
++cell)
{
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
if (std::abs(cell->vertex(v)[0] - 1.0) < 1e-9)
soln_t[cell->vertex_dof_index(v, 0)] = 1.0;
}
cell = dof_handler.begin_active(),
endc = dof_handler.end();
for (; cell != endc; ++cell)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
- ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
if (cell->vertex(v).distance(soln_pt) < 1e-6)
{
monitored_vertex_first_dof = cell->vertex_dof_index(v, 0);
dof_handler.begin_active();
cell != dof_handler.end();
++cell)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
if (vertex_touched[cell->vertex_index(v)] == false)
{
vertex_touched[cell->vertex_index(v)] = true;
cell = dof_handler.begin_active(),
endc = dof_handler.end();
for (; cell != endc; ++cell)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
- ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
if (cell->vertex(v).distance(soln_pt) < 1e-6)
{
monitored_vertex_first_dof = cell->vertex_dof_index(v, 0);
dof_handler.begin_active();
cell != dof_handler.end();
++cell)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
if (vertex_touched[cell->vertex_index(v)] == false)
{
vertex_touched[cell->vertex_index(v)] = true;
cell = dof_handler_ref.begin_active(),
endc = dof_handler_ref.end();
for (; cell != endc; ++cell)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
- ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale)
{
Tensor<1, dim> soln;
cell = dof_handler_ref.begin_active(),
endc = dof_handler_ref.end();
for (; cell != endc; ++cell)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
- ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale)
{
Tensor<1, dim> soln;
cell = dof_handler_ref.begin_active(),
endc = dof_handler_ref.end();
for (; cell != endc; ++cell)
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
- ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
if (cell->vertex(v).distance(soln_pt) < 1e-6 * parameters.scale)
{
Tensor<1, dim> soln;
{
dealii::CellData<structdim> t1;
- for (unsigned int i = 0; i < GeometryInfo<structdim>::vertices_per_cell; i++)
+ for (const unsigned int i : GeometryInfo<structdim>::vertex_indices())
t1.vertices[i] = i;
t1.material_id = 0;
t1.boundary_id = 1;
}
// test vertices
- for (unsigned int i = 0; i < GeometryInfo<structdim>::vertices_per_cell; i++)
+ for (const unsigned int i : GeometryInfo<structdim>::vertex_indices())
{
dealii::CellData<structdim> t2 = t1;
t2.vertices[i]++;
c2 = t2.begin();
for (; (c1 != t1.end()) && (c2 != t2.end()); ++c1, ++c2)
{
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
if (c1->vertex(v) != c2->vertex(v))
return false;
c2 = t2.begin();
for (; (c1 != t1.end()) && (c2 != t2.end()); ++c1, ++c2)
{
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
if (c1->vertex(v) != c2->vertex(v))
return false;
c2 = t2.begin();
for (; (c1 != t1.end()) && (c2 != t2.end()); ++c1, ++c2)
{
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
if (c1->vertex(v) != c2->vertex(v))
return false;
c2 = t2.begin();
for (; (c1 != t1.end()) && (c2 != t2.end()); ++c1, ++c2)
{
- for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
+ for (const unsigned int v : GeometryInfo<dim>::vertex_indices())
{
if (c1->vertex(v) != c2->vertex(v))
return false;