* using range-based for loops of the following kind:
* @code
* for (auto &cell : triangulation.active_cell_iterators())
- * for (auto face_index : GeometryInfo<dim>::face_indices)
+ * for (auto face_index : GeometryInfo<dim>::face_indices())
* if (cell->face(face_index)->at_boundary())
* ... do something ...
* @endcode
* using range-based for loops of the following kind:
* @code
* for (auto &cell : triangulation.active_cell_iterators())
- * for (auto face_index : GeometryInfo<dim>::face_indices)
+ * for (auto face_index : GeometryInfo<dim>::face_indices())
* if (cell->face(face_index)->at_boundary())
* ... do something ...
* @endcode
cell = triangulation.begin_active(),
endc = triangulation.end();
for (; cell != endc; ++cell)
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
if (cell->face(face)->has_children() &&
!cell->face(face)->at_boundary())
{
cell = triangulation.begin_active(),
endc = triangulation.end();
for (; cell != endc; ++cell)
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
if (cell->face(face)->has_children() &&
!cell->face(face)->at_boundary())
{
CellAccessor<dim, spacedim>::face_iterator_to_index(
const TriaIterator<TriaAccessor<dim - 1, dim, spacedim>> &face) const
{
- for (unsigned int face_n = 0; face_n < GeometryInfo<dim>::faces_per_cell;
- ++face_n)
+ for (const unsigned int face_n : GeometryInfo<dim>::face_indices())
if (this->face(face_n) == face)
return face_n;
FETools::lexicographic_to_hierarchic_numbering<dim - 1>(
FE_Q<dim - 1>(fe_degree));
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
if ((!cell->at_boundary(face)) &&
(cell->neighbor(face)->has_children() == false))
continue;
typename dealii::Triangulation<dim>::cell_iterator dcell(
&triangulation, cell_levels[i].first, cell_levels[i].second);
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell;
- ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
if (dcell->at_boundary(f) && !dcell->has_periodic_neighbor(f))
continue;
&triangulation,
cell_levels[cell].first,
cell_levels[cell].second);
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell;
- ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
// boundary face
if (face_is_owned[dcell->face(f)->index()] ==
fe_face_values_neigh[i].resize(face_data_by_cells[i].descriptor.size());
for (unsigned int cell = 0; cell < cell_type.size(); ++cell)
for (unsigned int my_q = 0; my_q < face_data_by_cells.size(); ++my_q)
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
if (fe_face_values[my_q][fe_index].get() == nullptr)
fe_face_values[my_q][fe_index].reset(
const bool,
const bool)> &fu) {
for (unsigned int c = 0; c < n_cell_batches(); ++c)
- for (unsigned int d = 0; d < GeometryInfo<dim>::faces_per_cell;
- ++d)
+ for (const unsigned int d : GeometryInfo<dim>::face_indices())
for (unsigned int v = 0;
v < VectorizedArrayType::n_array_elements;
++v)
local_face_integrals.clear();
// loop over all faces of this cell
- for (unsigned int face_no = 0; face_no < GeometryInfo<dim>::faces_per_cell;
- ++face_no)
+ for (const unsigned int face_no : GeometryInfo<dim>::face_indices())
{
const typename DoFHandlerType::face_iterator face = cell->face(face_no);
copy_data.cell_matrix.clear();
copy_data.cell_vector.clear();
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
// check if this face is on that part of the boundary we are
// interested in
if (boundary_functions.find(cell->face(face)->boundary_id()) !=
// inefficient, so we copy the dofs into a set, which enables binary
// searches.
unsigned int pos(0);
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
// check if this face is on that part of
// the boundary we are interested in
copy_data.cell_vector.clear();
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
// check if this face is on that part of
// the boundary we are interested in
if (boundary_functions.find(cell->face(face)->boundary_id()) !=
// inefficient, so we copy the dofs into a set, which enables binary
// searches.
unsigned int pos(0);
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
// check if this face is on that part of
// the boundary we are interested in
if (cell->is_artificial())
continue;
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
if (cell->face(face)->has_children())
{
// in any case, faces can have at most two active fe indices,
if (cell->is_artificial())
continue;
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
if (cell->face(face)->has_children())
{
// first of all, make sure that we treat a case which is
if (cell->is_artificial())
continue;
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
if (cell->face(face)->has_children())
{
// first of all, make sure that we treat a case which is
Table<2, bool> support_on_face(fe.dofs_per_cell,
GeometryInfo<dim>::faces_per_cell);
for (unsigned int i = 0; i < fe.dofs_per_cell; ++i)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
support_on_face(i, f) = fe.has_support_on_face(i, f);
// Convert the int_dof_mask to bool_int_dof_mask so we can pass it
{
const unsigned int fe_index = cell->active_fe_index();
const std::set<unsigned int> fe_set = fe_sets.at(fe_index);
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
// cell shouldn't be at the boundary and
// neighboring cell is not already visited (to avoid visiting
const Quadrature<dim> &face_quadrature =
QProjector<dim>::project_to_all_faces(reference_face_quadrature);
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
for (unsigned int q_point = 0; q_point < n_face_points; ++q_point)
{
this->generalized_support_points[face * n_face_points + q_point +
// ensure a counterclockwise
// orientation of tangentials
static const int tangential_orientation[4] = {-1, 1, 1, -1};
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell;
- ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
Tensor<1, dim> tang;
tang[1 - i / 2] = tangential_orientation[i];
}
else if (dim == 3)
{
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell;
- ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
Tensor<1, dim> tang1, tang2;
// The index of the first cell of the leg.
unsigned int cell_index = 1;
// The legs of the cross
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
const unsigned int oface = GeometryInfo<dim>::opposite_face[face];
const unsigned int dir = GeometryInfo<dim>::unit_normal_direction[face];
<< n_faces << " data follows" << '\n';
for (const auto &cell : tria.active_cell_iterators())
{
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell;
- ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
out << ' ' << cell->face(f)->measure();
out << '\n';
}
<< n_faces << " data follows" << '\n';
for (const auto &cell : tria.active_cell_iterators())
{
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell;
- ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
out << ' ' << cell->face(f)->diameter();
out << '\n';
}
const typename Triangulation<dim, spacedim>::active_cell_iterator endc =
tria.end();
for (; cell != endc; ++cell)
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
if (cell->face(face)->at_boundary())
for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_face;
++i)
continue_refinement = false;
for (const auto &cell : tria.active_cell_iterators())
- for (unsigned int j = 0; j < GeometryInfo<dim>::faces_per_cell; j++)
+ for (const unsigned int j : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(j) == false &&
cell->neighbor(j)->has_children())
{
std::set<types::boundary_id> b_ids;
active_cell_iterator cell = begin_active();
for (; cell != end(); ++cell)
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(face))
b_ids.insert(cell->face(face)->boundary_id());
std::vector<types::boundary_id> boundary_ids(b_ids.begin(), b_ids.end());
{
m_ids.insert(cell->manifold_id());
if (dim > 1)
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(face))
m_ids.insert(cell->face(face)->manifold_id());
}
case 1:
{
bool values[][2] = {{false, true}, {true, false}};
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell;
- ++i)
- for (unsigned int j = 0; j < GeometryInfo<dim>::faces_per_cell;
- ++j)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
+ for (const unsigned int j : GeometryInfo<dim>::face_indices())
correct(i, j) = (values[i][j]);
break;
}
{true, false, false, true},
{true, false, false, true},
{false, true, true, false}};
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell;
- ++i)
- for (unsigned int j = 0; j < GeometryInfo<dim>::faces_per_cell;
- ++j)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
+ for (const unsigned int j : GeometryInfo<dim>::face_indices())
correct(i, j) = (values[i][j]);
break;
}
cell != this_round.end();
++cell)
{
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell;
- ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
if (!((*cell)->face(i)->at_boundary()))
{
for (unsigned int c = 0; c < cell->n_children(); ++c)
cell->child(c)->clear_coarsen_flag();
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
if (!cell->at_boundary(face) &&
(!cell->neighbor(face)->is_active()) &&
(cell_will_be_coarsened(cell->neighbor(face))))
{
// use first algorithm
unsigned int refined_neighbors = 0, unrefined_neighbors = 0;
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
if (!cell->at_boundary(face))
{
if (face_will_be_refined_by_neighbor(cell, face))
if (cell->refine_flag_set())
{
// loop over neighbors of cell
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell;
- ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
// only do something if the face is not at the
// boundary and if the face will be refined with
numbers::invalid_unsigned_int;
// c) save boundary_ids of each face of this cell
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell;
- ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
types::boundary_id boundary_ind =
cell->face(f)->boundary_id();
// and add the missing
// contribution as well as the
// flux contributions.
- for (unsigned int iface = 0; iface < GeometryInfo<dim>::faces_per_cell;
- ++iface)
+ for (const unsigned int iface : GeometryInfo<dim>::face_indices())
{
bool level_boundary = cell->at_boundary(iface);
typename DoFHandler<dim, spacedim>::cell_iterator neighbor;
// and add the missing
// contribution as well as the
// flux contributions.
- for (unsigned int iface = 0; iface < GeometryInfo<dim>::faces_per_cell;
- ++iface)
+ for (const unsigned int iface : GeometryInfo<dim>::face_indices())
{
bool level_boundary = cell->at_boundary(iface);
typename DoFHandler<dim, spacedim>::cell_iterator neighbor;
sparsity.add(dofs_on_this_cell[i], dofs_on_this_cell[j]);
// Loop over all interior neighbors
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
bool use_face = false;
if ((!cell->at_boundary(face)) &&
cell->get_mg_dof_indices(dofs_on_this_cell);
// Loop over all interior neighbors
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
// Neighbor is coarser
bool use_face = false;
sparsity.add(dofs_on_this_cell[i], dofs_on_this_cell[j]);
// Loop over all interior neighbors
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
typename DoFHandler<dim, spacedim>::face_iterator cell_face =
cell->face(face);
cell->get_mg_dof_indices(dofs_on_this_cell);
// Loop over all interior neighbors
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
// Neighbor is coarser
bool use_face = false;