if (cell->is_ghost())
{
cell->get_dof_indices(indices);
- 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))
{
const typename DoFHandler<dim, spacedim>::cell_iterator
(constraints.n_constraints() == 0));
if (hanging_nodes_not_allowed)
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
Assert(cell1->at_boundary(face) ||
cell1->neighbor(face)->level() == cell1->level(),
ExcHangingNodesNotAllowed());
(cell->get_fe().dofs_per_vertex != 0) || (fe2.dofs_per_vertex != 0);
if (hanging_nodes_not_allowed)
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
Assert(cell->at_boundary(face) ||
cell->neighbor(face)->level() == cell->level(),
ExcHangingNodesNotAllowed());
(subdomain_id == numbers::invalid_subdomain_id))
{
if (hanging_nodes_not_allowed)
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
Assert(cell->at_boundary(face) ||
cell->neighbor(face)->level() == cell->level(),
ExcHangingNodesNotAllowed());
std::vector<typename MeshType::active_cell_iterator> &active_neighbors)
{
active_neighbors.clear();
- for (unsigned int n = 0;
- n < GeometryInfo<MeshType::dimension>::faces_per_cell;
- ++n)
+ for (const unsigned int n :
+ GeometryInfo<MeshType::dimension>::face_indices())
if (!cell->at_boundary(n))
{
if (MeshType::dimension == 1)
template <int structdim>
inline TriaObject<structdim>::TriaObject()
{
- for (unsigned int i = 0; i < GeometryInfo<structdim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<structdim>::face_indices())
faces[i] = -1;
}
cell_type.size() * GeometryInfo<dim>::faces_per_cell);
std::size_t storage_length = 0;
for (unsigned int i = 0; i < cell_type.size(); ++i)
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
if (cell_type[i] <= affine)
{
cell != dof_handler.end(additional_data.mg_level + 1);
++cell)
if (cell->level_subdomain_id() == task_info.my_pid)
- for (unsigned int f = 0;
- f < GeometryInfo<dim>::faces_per_cell;
- ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if ((cell->at_boundary(f) == false ||
cell->has_periodic_neighbor(f) == true) &&
cell->level() >
info.post_cell(dof_info);
if (integrate_interior_face || integrate_boundary)
- for (unsigned int face_no = 0;
- face_no <
- GeometryInfo<
- ITERATOR::AccessorType::Container::dimension>::faces_per_cell;
- ++face_no)
+ for (const unsigned int face_no : GeometryInfo<
+ ITERATOR::AccessorType::Container::dimension>::face_indices())
{
typename ITERATOR::AccessorType::Container::face_iterator face =
cell->face(face_no);
cell_worker(cell, scratch, copy);
if (flags & (work_on_faces | work_on_boundary))
- for (unsigned int face_no = 0;
- face_no < GeometryInfo<CellIteratorBaseType::AccessorType::
- Container::dimension>::faces_per_cell;
- ++face_no)
+ for (const unsigned int face_no :
+ GeometryInfo<CellIteratorBaseType::AccessorType::Container::
+ dimension>::face_indices())
{
if (cell->at_boundary(face_no) &&
!cell->has_periodic_neighbor(face_no))
// adjust patch neighbors
for (unsigned int i = old_n_patches; i < patches.size(); ++i)
- for (unsigned int n = 0; n < GeometryInfo<patch_dim>::faces_per_cell; ++n)
+ for (const unsigned int n : GeometryInfo<patch_dim>::face_indices())
if (patches[i].neighbors[n] != Patch::no_neighbor)
patches[i].neighbors[n] += old_n_patches;
}
(cell->material_id() == material_id)))
{
// 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())
{
Assert(face_integrals.find(cell->face(face_no)) !=
face_integrals.end(),
cell = dof.begin_active();
cell != dof.end();
++cell)
- for (unsigned int direction = 0;
- direction < GeometryInfo<dim>::faces_per_cell;
- ++direction)
+ for (const unsigned int direction :
+ GeometryInfo<dim>::face_indices())
if (cell->at_boundary(direction) &&
(function_map.find(cell->face(direction)->boundary_id()) !=
function_map.end()))
endc = dof.end();
for (; cell != endc; ++cell)
if (!cell->is_artificial())
- 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 FiniteElement<dim, spacedim> &fe = cell->get_fe();
{
for (; cell != dof_handler.end(); ++cell)
if (cell->at_boundary() && cell->is_locally_owned())
- 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)->boundary_id() == boundary_component)
{
// if the FE is a
const unsigned int degree = superdegree - 1;
hp::QCollection<dim> edge_quadrature_collection;
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
for (unsigned int line = 0;
line < GeometryInfo<dim>::lines_per_face;
++line)
for (; cell != dof_handler.end(); ++cell)
if (cell->at_boundary() && cell->is_locally_owned())
- 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)->boundary_id() == boundary_component)
{
// if the FE is a
{
for (; cell != dof_handler.end(); ++cell)
if (cell->at_boundary() && cell->is_locally_owned())
- 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)->boundary_id() == boundary_component)
{
// if the FE is a FE_Nothing object there is no work to do
const QGauss<dim - 2> reference_edge_quadrature(
2 * fe_collection[i].degree);
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face :
+ GeometryInfo<dim>::face_indices())
for (unsigned int line = 0;
line < GeometryInfo<dim>::lines_per_face;
++line)
for (; cell != dof_handler.end(); ++cell)
if (cell->at_boundary() && cell->is_locally_owned())
- 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)->boundary_id() == boundary_component)
{
// if the FE is a FE_Nothing object there is no work to do
{
if (cell->at_boundary() && cell->is_locally_owned())
{
- 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)->boundary_id() ==
boundary_component)
{
const QGauss<dim - 2> reference_edge_quadrature(
2 * fe_collection[i].degree + 1);
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face :
+ GeometryInfo<dim>::face_indices())
{
for (unsigned int line = 0;
line < GeometryInfo<dim>::lines_per_face;
{
if (cell->at_boundary() && cell->is_locally_owned())
{
- 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)->boundary_id() ==
boundary_component)
cell != dof_handler.end();
++cell)
if (cell->at_boundary() && cell->is_locally_owned())
- 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)->boundary_id() == boundary_component)
{
// if the FE is a
cell != dof_handler.end();
++cell)
if (cell->at_boundary() && cell->is_locally_owned())
- 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)->boundary_id() == boundary_component)
{
// This is only implemented, if the FE is a
cell != dof_handler.end();
++cell)
if (cell->at_boundary() && cell->is_locally_owned())
- 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)->boundary_id() == boundary_component)
{
// This is only
cell != dof_handler.end();
++cell)
if (cell->at_boundary() && cell->is_locally_owned())
- 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)->boundary_id() == boundary_component)
{
// This is only
std::set<types::boundary_id>::iterator b_id;
for (; cell != endc; ++cell)
if (!cell->is_artificial())
- 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())
if ((b_id = boundary_ids.find(cell->face(face_no)->boundary_id())) !=
boundary_ids.end())
{
cell != dof_handler.end();
++cell)
if (!cell->is_artificial())
- 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())
if ((b_id = boundary_ids.find(cell->face(face_no)->boundary_id())) !=
boundary_ids.end())
{
{
if (cell->is_locally_owned() && cell->at_boundary())
{
- for (unsigned int iface = 0;
- iface < dealii::GeometryInfo<dim>::faces_per_cell;
- ++iface)
+ for (const unsigned int iface :
+ dealii::GeometryInfo<dim>::face_indices())
{
const auto face = cell->face(iface);
if (face->at_boundary())
{
if (cell->is_locally_owned() && cell->at_boundary())
{
- for (unsigned int iface = 0;
- iface < dealii::GeometryInfo<dim>::faces_per_cell;
- ++iface)
+ for (const unsigned int iface :
+ dealii::GeometryInfo<dim>::face_indices())
{
const auto face = cell->face(iface);
const unsigned int boundary_id = face->boundary_id();
// for the four sides
if (dof_handler.get_fe().dofs_per_line > 0)
- for (unsigned int side = 0; side < GeometryInfo<2>::faces_per_cell;
- ++side)
+ for (const unsigned int side : GeometryInfo<2>::face_indices())
{
const typename DoFHandler<2, spacedim>::line_iterator line =
cell->line(side);
// for the four sides
if (cell->get_fe().dofs_per_line > 0)
- for (unsigned int side = 0; side < GeometryInfo<2>::faces_per_cell;
- ++side)
+ for (const unsigned int side : GeometryInfo<2>::face_indices())
{
typename DoFHandler<dim, spacedim>::line_iterator line =
cell->line(side);
for (cell = dof_handler.begin(level); cell != endc; ++cell)
if (cell->level_subdomain_id() !=
numbers::artificial_subdomain_id)
- for (unsigned int line = 0;
- line < GeometryInfo<2>::faces_per_cell;
- ++line)
+ for (const unsigned int line :
+ GeometryInfo<2>::face_indices())
cell->face(line)->set_user_flag();
for (typename DoFHandler<2, spacedim>::cell_iterator cell =
// only work on cells that are either locally owned or at least ghost
// cells
if (cell->is_artificial() == false)
- for (unsigned int face = 0;
- face < GeometryInfo<DoFHandlerType::dimension>::faces_per_cell;
- ++face)
+ for (const unsigned int face :
+ GeometryInfo<DoFHandlerType::dimension>::face_indices())
if (cell->at_boundary(face))
if (!check_boundary_id ||
(boundary_ids.find(cell->face(face)->boundary_id()) !=
dof_handler.begin_active();
cell != dof_handler.end();
++cell)
- for (unsigned int face = 0;
- face < GeometryInfo<DoFHandlerType::dimension>::faces_per_cell;
- ++face)
+ for (const unsigned int face :
+ GeometryInfo<DoFHandlerType::dimension>::face_indices())
if (cell->at_boundary(face))
if (!check_boundary_id ||
(boundary_ids.find(cell->face(face)->boundary_id()) !=
for (const auto &cell : dof_handler.active_cell_iterators())
if (!cell->is_artificial())
{
- 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())
{
const typename dealii::DoFHandler<dim,
dof_handler.begin_active(),
endc = dof_handler.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0;
- f < GeometryInfo<DoFHandlerType::dimension>::faces_per_cell;
- ++f)
+ for (const unsigned int f :
+ GeometryInfo<DoFHandlerType::dimension>::face_indices())
if (cell->at_boundary(f))
{
const unsigned int dofs_per_face = cell->get_fe().dofs_per_face;
dof_handler.begin_active(),
endc = dof_handler.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0;
- f < GeometryInfo<DoFHandlerType::dimension>::faces_per_cell;
- ++f)
+ for (const unsigned int f :
+ GeometryInfo<DoFHandlerType::dimension>::face_indices())
if (boundary_ids.find(cell->face(f)->boundary_id()) !=
boundary_ids.end())
{
std::fill(exclude.begin(), exclude.end(), false);
const unsigned int dpf = fe.dofs_per_face;
- for (unsigned int face = 0;
- face < GeometryInfo<DoFHandlerType::dimension>::faces_per_cell;
- ++face)
+ for (const unsigned int face :
+ GeometryInfo<DoFHandlerType::dimension>::face_indices())
if (cell->at_boundary(face) ||
cell->neighbor(face)->level() != cell->level())
for (unsigned int i = 0; i < dpf; ++i)
// Now remove all degrees of freedom on the domain boundary
// from the exclusion list
if (boundary_dofs)
- for (unsigned int face = 0;
- face <
- GeometryInfo<DoFHandlerType::dimension>::faces_per_cell;
- ++face)
+ for (const unsigned int face :
+ GeometryInfo<DoFHandlerType::dimension>::face_indices())
if (cell->at_boundary(face))
for (unsigned int i = 0; i < dpf; ++i)
exclude[fe.face_to_cell_index(i, face)] = false;
cell_dofs.resize(fe.dofs_per_cell);
cell->get_dof_indices(cell_dofs);
- 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<dim, spacedim>::face_iterator face =
cell->face(face_no);
typename DoFHandlerType::active_cell_iterator cell = dof.begin_active(),
endc = dof.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0;
- f < GeometryInfo<DoFHandlerType::dimension>::faces_per_cell;
- ++f)
+ for (const unsigned int f :
+ GeometryInfo<DoFHandlerType::dimension>::face_indices())
if (cell->at_boundary(f))
{
const unsigned int dofs_per_face = cell->get_fe().dofs_per_face;
typename DoFHandlerType::active_cell_iterator cell = dof.begin_active(),
endc = dof.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0;
- f < GeometryInfo<DoFHandlerType::dimension>::faces_per_cell;
- ++f)
+ for (const unsigned int f :
+ GeometryInfo<DoFHandlerType::dimension>::face_indices())
if (boundary_ids.find(cell->face(f)->boundary_id()) !=
boundary_ids.end())
{
sparsity,
keep_constrained_dofs);
- for (unsigned int face = 0;
- face < GeometryInfo<DoFHandlerType::dimension>::faces_per_cell;
- ++face)
+ for (const unsigned int face :
+ GeometryInfo<DoFHandlerType::dimension>::face_indices())
{
typename DoFHandlerType::face_iterator cell_face =
cell->face(face);
keep_constrained_dofs,
bool_int_dof_mask);
// Loop over all interior neighbors
- 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())
{
const typename DoFHandler<dim, spacedim>::face_iterator
cell_face = cell->face(face_n);
bool_int_and_flux_dof_mask[cell->active_fe_index()]);
// Loop over interior faces
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
const typename dealii::hp::DoFHandler<dim,
spacedim>::face_iterator
{2, 3, 0, 1},
{6, 7, 4, 5}};
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
// Set up the right hand side
// for the horizontal shape
std::vector<Vector<double>>::const_iterator value =
support_point_values.begin();
- for (unsigned int face = 0; face < dealii::GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : dealii::GeometryInfo<dim>::face_indices())
{
for (unsigned int q = 0; q < q_points_per_face; ++q)
{
dim - 1, std::vector<Tensor<1, spacedim>>(n_original_q_points));
// Compute tangentials to the unit cell.
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
data.unit_tangentials[i].resize(n_original_q_points);
std::fill(data.unit_tangentials[i].begin(),
std::vector<Tensor<1, spacedim>>(n_original_q_points));
// Compute tangentials to the unit cell.
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
unit_tangentials[i].resize(n_original_q_points);
std::fill(unit_tangentials[i].begin(),
std::vector<Tensor<1, spacedim>>(n_original_q_points));
// Compute tangentials to the unit cell.
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
unit_tangentials[i].resize(n_original_q_points);
std::fill(unit_tangentials[i].begin(),
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())
cell->face(face)->set_boundary_id(face);
// grid around the cylinder to the new TFI manifold id.
if (cell->manifold_id() == tfi_manifold_id)
{
- for (unsigned int face_n = 0;
- face_n < GeometryInfo<2>::faces_per_cell;
- ++face_n)
+ for (const unsigned int face_n : GeometryInfo<2>::face_indices())
{
const auto &face = cell->face(face_n);
if (face->at_boundary() &&
std::numeric_limits<double>::epsilon() * 10000;
if (colorize)
for (const auto &cell : tria.active_cell_iterators())
- for (unsigned int face_n = 0; face_n < GeometryInfo<2>::faces_per_cell;
- ++face_n)
+ for (const unsigned int face_n : GeometryInfo<2>::face_indices())
{
const auto face = cell->face(face_n);
if (face->at_boundary())
for (const auto &cell : cylinder_tria.active_cell_iterators())
{
cell->set_manifold_id(tfi_manifold_id);
- for (unsigned int face_n = 0; face_n < GeometryInfo<2>::faces_per_cell;
- ++face_n)
+ for (const unsigned int face_n : GeometryInfo<2>::face_indices())
if (!cell->face(face_n)->at_boundary())
cell->face(face_n)->set_manifold_id(tfi_manifold_id);
}
};
if (colorize)
for (const auto &cell : triangulation.active_cell_iterators())
- 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())
{
auto face = cell->face(face_n);
if (face->at_boundary())
// cell is at boundary and we are to treat curved boundaries. so
// loop over all faces and draw them as small pieces of lines
{
- 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 dealii::Triangulation<dim,
spacedim>::face_iterator
}
else
{
- 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 dealii::Triangulation<dim,
spacedim>::face_iterator
// generate the info from
// them
for (const auto &cell : tria.active_cell_iterators())
- 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 dealii::Triangulation<dim, spacedim>::
face_iterator face = cell->face(face_no);
// Save face data
if (dim > 1)
{
- 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())
face_data.insert_face_data(cell->face(face_n));
}
// Save line data
endc = triangulation.end();
for (; cell != endc; ++cell)
if (!cell->is_artificial())
- 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())
{
Iterator::AccessorType::structure_dimension;
double diameter = object->diameter();
- for (unsigned int f = 0; f < GeometryInfo<structdim>::faces_per_cell;
- ++f)
+ for (const unsigned int f : GeometryInfo<structdim>::face_indices())
for (unsigned int e = f + 1;
e < GeometryInfo<structdim>::faces_per_cell;
++e)
std::vector<typename MeshType::active_cell_iterator> patch;
patch.push_back(cell);
- for (unsigned int face_number = 0;
- face_number < GeometryInfo<MeshType::dimension>::faces_per_cell;
- ++face_number)
+ for (const unsigned int face_number :
+ GeometryInfo<MeshType::dimension>::face_indices())
if (cell->face(face_number)->at_boundary() == false)
{
if (cell->neighbor(face_number)->has_children() == false)
// face (or line).
// Take care of dofs on neighbor faces
- for (unsigned int f = 0;
- f < GeometryInfo<DoFHandlerType::dimension>::faces_per_cell;
- ++f)
+ for (const unsigned int f :
+ GeometryInfo<DoFHandlerType::dimension>::face_indices())
{
if (cell->face(f)->has_children())
{
make_array_view(weights.begin(), weights.end());
const auto points_view = make_array_view(points.begin(), points.end());
- for (unsigned int face = 0; face < GeometryInfo<3>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<3>::face_indices())
{
const double my_weight = linear_shapes[face];
const unsigned int face_even = face - face % 2;
vertex,
triangulation.vertices.size()));
- for (unsigned int line = 0;
- line < GeometryInfo<dim>::faces_per_cell;
- ++line)
+ for (const unsigned int line : GeometryInfo<dim>::face_indices())
{
// given a line vertex number (0,1) on a specific line
// we get the cell vertex number (0-4) through the
0)]);
}
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
// set up a list of the lines to be
// used for this face. check the
bool face_orientation[GeometryInfo<dim>::faces_per_cell];
bool face_flip[GeometryInfo<dim>::faces_per_cell];
bool face_rotation[GeometryInfo<dim>::faces_per_cell];
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
for (unsigned int l = 0;
l < GeometryInfo<dim>::lines_per_face;
// set orientation flag for
// each of the faces
- for (unsigned int quad = 0;
- quad < GeometryInfo<dim>::faces_per_cell;
- ++quad)
+ for (const unsigned int quad : GeometryInfo<dim>::face_indices())
{
cell->set_face_orientation(quad, face_orientation[quad]);
cell->set_face_flip(quad, face_flip[quad]);
// coinciding lines once)
std::multimap<unsigned int, std::pair<unsigned int, unsigned int>>
cell_to_face_lines;
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
for (unsigned int line = 0;
line < GeometryInfo<dim>::lines_per_face;
++line)
// can delete them. first for quads (and
// their inner lines).
- for (unsigned int quad_no = 0;
- quad_no < GeometryInfo<dim>::faces_per_cell;
- ++quad_no)
+ for (const unsigned int quad_no : GeometryInfo<dim>::face_indices())
{
typename Triangulation<dim, spacedim>::quad_iterator quad =
cell->face(quad_no);
h < triangulation.levels[l]
->cells.cells.size();
++h)
- for (unsigned int q = 0;
- q < GeometryInfo<dim>::faces_per_cell;
- ++q)
+ for (const unsigned int q :
+ GeometryInfo<dim>::face_indices())
{
const int index = triangulation.levels[l]
->cells.cells[h]
// lines 0-7 already exist, create only the four interior
// lines 8-11
unsigned int l = 0;
- 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())
for (unsigned int c = 0; c < 2; ++c, ++l)
new_lines[l] = cell->line(face_no)->child(c);
Assert(l == 8, ExcInternalError());
// refine them is rather difficult for lines so we
// only flag them and after visiting all cells, we
// decide which lines need refinement;
- for (unsigned int line_no = 0;
- line_no < GeometryInfo<dim>::faces_per_cell;
- ++line_no)
+ for (const unsigned int line_no :
+ GeometryInfo<dim>::face_indices())
{
if (GeometryInfo<dim>::face_refinement_case(
cell->refine_flag_set(), line_no) ==
// these is difficult so we only flag them and after
// visiting all cells, we decide which faces need
// which refinement;
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face :
+ GeometryInfo<dim>::face_indices())
{
typename Triangulation<dim, spacedim>::face_iterator
aface = acell->face(face);
h <
triangulation.levels[l]->cells.cells.size();
++h)
- for (unsigned int q = 0;
- q < GeometryInfo<dim>::faces_per_cell;
- ++q)
+ for (const unsigned int q :
+ GeometryInfo<dim>::face_indices())
{
const int face_index =
triangulation.levels[l]
// face_rotation flags. however, the latter two
// are set to false by default as this is the
// standard value
- for (unsigned int f = 0;
- f < GeometryInfo<dim>::faces_per_cell;
- ++f)
+ for (const unsigned int f :
+ GeometryInfo<dim>::face_indices())
{
new_hexes[i]->set_face_orientation(f, true);
new_hexes[i]->set_face_flip(f, false);
// face_orientation, face_flip and face_rotation,
// which are inherited from the corresponding face
// of the mother cube
- for (unsigned int f = 0;
- f < GeometryInfo<dim>::faces_per_cell;
- ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
for (unsigned int s = 0;
s < std::max(GeometryInfo<dim - 1>::n_children(
GeometryInfo<dim>::face_refinement_case(
// anisotropic refinement. Therefore, we have a closer
// look
const RefinementCase<dim> ref_case = cell->refine_flag_set();
- 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())
if (cell->face(face_no)->at_boundary())
{
// this is the critical face at the boundary.
// there were any unrefined neighbors at all, see if any
// of those will have to be refined as well
if (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) &&
(face_will_be_refined_by_neighbor(cell, face) == false) &&
(cell->neighbor(face)->has_children() == false) &&
// cycle
unsigned int unrefined_neighbors = 0, total_neighbors = 0;
- for (unsigned int n = 0;
- n < GeometryInfo<dim>::faces_per_cell;
- ++n)
+ for (const unsigned int n :
+ GeometryInfo<dim>::face_indices())
{
const cell_iterator neighbor = cell->neighbor(n);
if (neighbor.state() == IteratorState::valid)
// neighbors and find the number
// the hard way
{
- 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())
if (neighbor_cell->face_index(face_no) == this_face_index)
return face_no;
// we need to loop over all faces
// and subfaces and find the
// number the hard way
- for (unsigned int face_no = 0;
- face_no < GeometryInfo<2>::faces_per_cell;
- ++face_no)
+ for (const unsigned int face_no : GeometryInfo<2>::face_indices())
{
if (face_no != face_no_guess)
{
// if the guess was false, then we need to loop over all faces and
// subfaces and find the number the hard way
- for (unsigned int face_no = 0;
- face_no < GeometryInfo<3>::faces_per_cell;
- ++face_no)
+ for (const unsigned int face_no : GeometryInfo<3>::face_indices())
{
if (face_no == face_no_guess)
continue;
cell_info.id = cell->id().template to_binary<dim>();
// 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();
for (const auto &cell : dof_handler.active_cell_iterators())
if (!cell->is_artificial())
- 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)->user_flag_set() == false)
{
// Ok, face has not been visited. So we need to
for (const auto &cell : dof_handler.active_cell_iterators())
if (!cell->is_artificial())
- 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)->user_flag_set())
{
// Same decision tree as before
const unsigned int level = cell->level();
local_dofs.resize(fe.dofs_per_face);
- 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())
if (cell->at_boundary(face_no) == true)
{
const typename DoFHandler<dim, spacedim>::face_iterator face =
if (dof.get_triangulation().locally_owned_subdomain() ==
numbers::invalid_subdomain_id ||
cell->level_subdomain_id() != numbers::artificial_subdomain_id)
- 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())
{
if (cell->at_boundary(face_no) == false)
continue;
cell_dofs_interface.end(),
false);
- for (unsigned int face_nr = 0;
- face_nr < GeometryInfo<dim>::faces_per_cell;
- ++face_nr)
+ for (const unsigned int face_nr : GeometryInfo<dim>::face_indices())
{
const typename DoFHandler<dim, spacedim>::face_iterator face =
cell->face(face_nr);
std::fill(cell_dofs.begin(), cell_dofs.end(), false);
- for (unsigned int face_nr = 0;
- face_nr < GeometryInfo<dim>::faces_per_cell;
- ++face_nr)
+ for (const unsigned int face_nr : GeometryInfo<dim>::face_indices())
{
const typename DoFHandler<dim, spacedim>::face_iterator face =
cell->face(face_nr);
}
- for (unsigned int f = 0;
- f < GeometryInfo<DoFHandlerType::dimension>::faces_per_cell;
- ++f)
+ for (const unsigned int f :
+ GeometryInfo<DoFHandlerType::dimension>::face_indices())
{
// let's look up whether the neighbor behind that face is noted in the
// table of cells which we treat. this can only happen if the neighbor
cell = this->triangulation->begin_active();
for (; cell != this->triangulation->end(); ++cell)
if (cell->is_locally_owned())
- for (unsigned int f = 0; f < GeometryInfo<dimension>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dimension>::face_indices())
if (!surface_only || cell->face(f)->at_boundary())
return FaceDescriptor(cell, f);
// check all the faces of this active cell. but skip it altogether
// if it isn't locally owned
if (active_cell->is_locally_owned())
- for (unsigned int f = 0; f < GeometryInfo<dimension>::faces_per_cell;
- ++f)
+ for (const unsigned int f : GeometryInfo<dimension>::face_indices())
if (!surface_only || active_cell->face(f)->at_boundary())
{
face.first = active_cell;
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)->at_boundary() == true &&
cell->face(face)->center()[1] == 1.0 * parameters.scale)
Assert(i_group <= J_dof, ExcInternalError());
}
}
- 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() == true &&
cell->face(face)->boundary_id() == 6)
{
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)->at_boundary() == true &&
cell->face(face)->center()[1] == 1.0 * parameters.scale)
Assert(i_group <= J_dof, ExcInternalError());
}
}
- 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() == true &&
cell->face(face)->boundary_id() == 6)
{
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)->at_boundary() == true &&
cell->face(face)->center()[1] == 1.0 * parameters.scale)
lqph[q_point]->get_Psi(F, p_tilde[q_point], J_tilde[q_point]) *
JxW;
}
- 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() == true &&
cell->face(face)->boundary_id() == 6)
{
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)->at_boundary() == true &&
cell->face(face)->center()[1] == 1.0 * parameters.scale)
Assert(i_group <= J_dof, ExcInternalError());
}
}
- 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() == true &&
cell->face(face)->boundary_id() == 6)
{
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)->at_boundary() == true &&
cell->face(face)->center()[1] == 1.0 * parameters.scale)
Assert(i_group <= J_dof, ExcInternalError());
}
}
- 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() == true &&
cell->face(face)->boundary_id() == 6)
{
DoFHandler<3>::active_cell_iterator cell = dof_handler.begin_active();
for (; cell != dof_handler.end(); ++cell)
- for (unsigned int face_no = 0; face_no < GeometryInfo<3>::faces_per_cell;
- ++face_no)
+ for (const unsigned int face_no : GeometryInfo<3>::face_indices())
if (!cell->at_boundary(face_no) && cell->face(face_no)->has_children())
for (unsigned int subface_no = 0;
subface_no < cell->face(face_no)->number_of_children();
patches[0].vertices[vertex_number](2) = -1. + 2. * iz;
++vertex_number;
}
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
patches[0].neighbors[i] = numbers::invalid_unsigned_int;
patches[0].patch_index = 0;
patches[0].n_subdivisions = sub;
patches[0].vertices[vertex_number](2) = -1. + 2. * iz;
++vertex_number;
}
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
patches[0].neighbors[i] = numbers::invalid_unsigned_int;
patches[0].patch_index = 0;
patches[0].n_subdivisions = sub;
test()
{
// Output normal directions for each face
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
deallog << "Face " << f << ": n = ( ";
for (unsigned int d = 0; d < dim; ++d)
void
test()
{
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
const Tensor<1, dim> unit_normal_vector =
GeometryInfo<dim>::unit_normal_vector[i];
deallog << "quads_per_face " << GeometryInfo<dim>::quads_per_face
<< std::endl;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
deallog << "face normal" << f << ' '
<< (GeometryInfo<dim>::unit_normal_orientation[f] > 0. ? '+' : '-')
<< "x" << GeometryInfo<dim>::unit_normal_direction[f] << std::endl;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
deallog << "face_children" << f << "[true ]";
for (unsigned int v = 0; v < GeometryInfo<dim>::max_children_per_face;
deallog << std::endl;
}
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
deallog << "face_vertices" << f << "[true ]";
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face; ++v)
deallog << std::endl;
}
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
deallog << "face_lines" << f << "[true ]";
for (unsigned int v = 1; v <= GeometryInfo<dim>::lines_per_face; ++v)
{
deallog << "Checking in " << dim << "d" << std::endl;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face; ++v)
{
deallog << "Face " << f << ", vertex=" << v << ": ";
}
if (dim == 3)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face; ++v)
{
deallog << "Face " << f << ", vertex=" << v
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell; ++v)
vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
Point<dim> face_vertices[GeometryInfo<dim>::vertices_per_face];
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face; ++v)
vertices[v][0] /= 10;
}
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
Point<dim> face_vertices[GeometryInfo<dim>::vertices_per_face];
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face; ++v)
}
}
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
Point<dim> face_vertices[GeometryInfo<dim>::vertices_per_face];
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face; ++v)
vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
vertices[1] /= 10;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
Point<dim> face_vertices[GeometryInfo<dim>::vertices_per_face];
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face; ++v)
vertices[v] = GeometryInfo<dim>::unit_cell_vertex(v);
std::swap(vertices[0], vertices[1]);
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
Point<dim> face_vertices[GeometryInfo<dim>::vertices_per_face];
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face; ++v)
{
deallog << dim << "D:" << std::endl;
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
deallog << "face " << i << ":" << std::endl;
{
deallog << dim << "D:" << std::endl;
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
deallog << "face " << i << ":" << std::endl;
void
test()
{
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
const Tensor<1, dim> unit_normal_vector =
GeometryInfo<dim>::unit_normal_vector[i];
deallog << "Checking dim " << dim << " 1d-points " << q1.size() << std::endl;
Quadrature<dim - 1> subquadrature(q1);
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
deallog << "Face " << f << std::endl;
deallog << quadrature.point(k) << std::endl;
}
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
for (unsigned int s = 0; s < GeometryInfo<dim>::max_children_per_face; ++s)
{
deallog << "Face " << f << " subface " << s << std::endl;
Quadrature<dim> faces = QProjector<dim>::project_to_all_faces(subquadrature);
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
deallog << "Face " << f << " orientation false" << std::endl;
const typename Triangulation<dim>::active_cell_iterator cell =
triangulation.begin_active();
- 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 Triangulation<dim>::face_iterator face =
cell->face(face_no);
const typename Triangulation<dim>::active_cell_iterator cell =
triangulation.begin_active();
- 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 Triangulation<dim>::face_iterator face =
cell->face(face_no);
triangulation.refine_global(2);
for (const auto &cell : triangulation.active_cell_iterators())
- 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 auto face = cell->face(face_no);
if (face->boundary_id() == 0)
GridGenerator::subdivided_hyper_rectangle(coarse_grid, sub, p1, p2, true);
// set bottom middle edge to use MyManifold
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
for (unsigned int e = 0; e < GeometryInfo<dim - 1>::faces_per_cell; ++e)
if (coarse_grid.begin_active()->face(f)->line(e)->center()[0] == 0)
if (coarse_grid.begin_active()->face(f)->line(e)->center()[1] == 0.5)
for (Triangulation<3>::active_cell_iterator cell = tria.begin_active();
cell != tria.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<3>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<3>::face_indices())
{
if (cell->face(f)->at_boundary() && (Testing::rand() % 5) == 1)
cell->set_refine_flag();
check_neighbors(const Triangulation<2> &tria)
{
Triangulation<2>::cell_iterator cell = tria.begin();
- for (unsigned int f = 0; f < GeometryInfo<2>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<2>::face_indices())
if (cell->neighbor(f).state() == IteratorState::valid)
{
const unsigned int neighbor_neighbor = cell->neighbor_of_neighbor(f);
// and make sure that the
// result of the integration is
// close to zero
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_face_values.reinit(cell, f);
for (unsigned int q = 0; q < q_face.size(); ++q)
// now same for subface
// integration
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
for (unsigned int sf = 0; sf < GeometryInfo<dim>::max_children_per_face;
++sf)
{
// and make sure that the
// result of the integration is
// close to zero
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_face_values.reinit(cell, f);
for (unsigned int q = 0; q < q_face.size(); ++q)
// now same for subface
// integration
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
for (unsigned int sf = 0; sf < GeometryInfo<dim>::max_children_per_face;
++sf)
{
// and make sure that the
// result of the integration is
// close to zero
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_face_values.reinit(cell, f);
for (unsigned int q = 0; q < q_face.size(); ++q)
// now same for subface
// integration
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
for (unsigned int sf = 0; sf < GeometryInfo<dim>::max_children_per_face;
++sf)
{
// and make sure that the
// result of the integration is
// close to zero
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_face_values.reinit(cell, f);
for (unsigned int q = 0; q < q_face.size(); ++q)
// now same for subface
// integration
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
for (unsigned int sf = 0; sf < GeometryInfo<dim>::max_children_per_face;
++sf)
{
// and make sure that the
// result of the integration is
// close to zero
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
{
fe_face_values.reinit(cell, f);
// now same for subface
// integration
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
for (unsigned int sf = 0;
sf < GeometryInfo<dim>::max_children_per_face;
// and make sure that the
// result of the integration is
// close to zero
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
{
fe_face_values.reinit(cell, f);
// now same for subface
// integration
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
for (unsigned int sf = 0;
sf < GeometryInfo<dim>::max_children_per_face;
// and make sure that the
// result of the integration is
// close to zero
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
{
fe_face_values.reinit(cell, f);
// now same for subface
// integration
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
for (unsigned int sf = 0;
sf < GeometryInfo<dim>::max_children_per_face;
// and make sure that the
// result of the integration is
// close to zero
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
{
fe_face_values.reinit(cell, f);
// now same for subface
// integration
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
for (unsigned int sf = 0;
sf < GeometryInfo<dim>::max_children_per_face;
for (DoFHandler<3>::cell_iterator cell = dof_handler.begin();
cell != dof_handler.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<3>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<3>::face_indices())
if (!cell->at_boundary(f))
{
const unsigned int nn = cell->neighbor_of_neighbor(f);
void
check(const FiniteElement<dim> &fe)
{
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell; face++)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
for (unsigned int i = 0; i < fe.dofs_per_cell; i++)
if (fe.has_support_on_face(i, face))
deallog << "Basis function " << i << " has support on face " << face
for (; cell != endc; ++cell)
{
- for (unsigned int f = 0; f < GeometryInfo<2>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<2>::face_indices())
{
if (!cell->face(f)->at_boundary())
{
rhs_values[q_point] * fe_values.JxW(q_point));
}
- 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() &&
(cell->face(face)->boundary_id() == 1))
{
triangulation.begin(),
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)->center()(0) == -1) ||
(cell->face(face)->center()(1) == -1))
cell->face(face)->set_boundary_id(1);
endc = dof_handler.end();
long double perimeter = 0;
for (; cell != endc; ++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())
if (cell->face(face_no)->at_boundary())
{
x_fe_face_values.reinit(cell, face_no);
endc = dof_handler.end();
long double perimeter = 0;
for (; cell != endc; ++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())
if (cell->face(face_no)->at_boundary())
{
x_fe_face_values.reinit(cell, face_no);
cell->get_dof_indices(dofs);
- 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())
{
typename DoFHandler<dim>::face_iterator face = cell->face(face_no);
cell->get_dof_indices(dofs);
- 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())
{
typename DoFHandler<dim>::face_iterator face = cell->face(face_no);
for (active_cell_iterator cell = dual_solver.dof_handler.begin_active();
cell != dual_solver.dof_handler.end();
++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())
face_integrals[cell->face(face_no)] = -1e20;
error_indicators.reinit(
for (active_cell_iterator cell = dual_solver.dof_handler.begin_active();
cell != dual_solver.dof_handler.end();
++cell, ++present_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())
{
Assert(face_integrals.find(cell->face(face_no)) !=
face_integrals.end(),
cell_data,
error_indicators);
- 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())
{
if (cell->face(face_no)->at_boundary())
{
, fe_local_support_on_face(GeometryInfo<dim>::faces_per_cell)
, fe_support_on_face(GeometryInfo<dim>::faces_per_cell)
{
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
for (unsigned int i = 0; i < fe_local.dofs_per_cell; ++i)
{
if (fe_local.has_support_on_face(i, face))
}
}
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
for (unsigned int i = 0; i < fe.dofs_per_cell; ++i)
{
if (fe.has_support_on_face(i, face))
}
}
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
scratch.fe_face_values_local.reinit(loc_cell, face);
scratch.fe_face_values.reinit(cell, face);
typename Triangulation<dim>::cell_iterator cell = triangulation.begin(),
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)->at_boundary())
for (unsigned int d = 0; d < dim; ++d)
if ((std::fabs(cell->face(face)->center()(d) - (1)) < 1e-12))
, fe_local_support_on_face(GeometryInfo<dim>::faces_per_cell)
, fe_support_on_face(GeometryInfo<dim>::faces_per_cell)
{
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
for (unsigned int i = 0; i < fe_local.dofs_per_cell; ++i)
{
if (fe_local.has_support_on_face(i, face))
}
}
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
for (unsigned int i = 0; i < fe.dofs_per_cell; ++i)
{
if (fe.has_support_on_face(i, face))
}
}
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
scratch.fe_face_values_local.reinit(loc_cell, face);
scratch.fe_face_values.reinit(cell, face);
typename Triangulation<dim>::cell_iterator cell = triangulation.begin(),
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)->at_boundary())
for (unsigned int d = 0; d < dim; ++d)
if ((std::fabs(cell->face(face)->center()(d) - (1)) < 1e-12))
rhs_values[q_point] * fe_values.JxW(q_point));
}
- 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() &&
(cell->face(face)->boundary_id() == 1))
{
triangulation.begin(),
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)->center()(0) == -1) ||
(cell->face(face)->center()(1) == -1))
cell->face(face)->set_boundary_id(1);
// and make sure that the
// result of the integration is
// close to zero
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
{
fe_face_values.reinit(cell, f);
// now same for subface
// integration
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
for (unsigned int sf = 0;
sf < GeometryInfo<dim>::max_children_per_face;
// and make sure that the
// result of the integration is
// close to zero
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
{
fe_face_values.reinit(cell, f);
// now same for subface
// integration
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
for (unsigned int sf = 0;
sf < GeometryInfo<dim>::max_children_per_face;
// and make sure that the
// result of the integration is
// close to zero
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
{
fe_face_values.reinit(cell, f);
// now same for subface
// integration
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
for (unsigned int sf = 0;
sf < GeometryInfo<dim>::max_children_per_face;
// and make sure that the
// result of the integration is
// close to zero
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
{
fe_face_values.reinit(cell, f);
// now same for subface
// integration
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
for (unsigned int sf = 0;
sf < GeometryInfo<dim>::max_children_per_face;
++cell)
{
bool done = false;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
{
cell->face(f)->set_boundary_id(1);
volume_mesh.begin_active();
cell != volume_mesh.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_boundary_ids(1);
GridTools::copy_boundary_to_manifold_id(volume_mesh);
volume_mesh.begin_active();
cell != volume_mesh.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f) && (cell->center()[dim - 1] > 0))
cell->face(f)->set_all_boundary_ids(1);
triangulation.begin_active();
cell != triangulation.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
{
if (cell->face(f)->boundary_id() == 0)
triangulation.begin_active();
cell != triangulation.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
{
if (cell->face(f)->boundary_id() == 0)
deallog << "Cell = " << cell << std::endl;
deallog << " direction_flag = " << cell->direction_flag() << std::endl;
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
deallog << " face = " << face
<< " (neighbor = " << cell->neighbor(face) << ")"
deallog << "Cell = " << cell << std::endl;
deallog << " direction_flag = " << cell->direction_flag() << std::endl;
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
deallog << " face = " << face
<< " (neighbor = " << cell->neighbor(face) << ")"
dof_handler.begin_active();
cell != dof_handler.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face; ++v)
for (unsigned int i = 0; i < fe.dofs_per_vertex; ++i)
dof_handler.begin_active();
cell != dof_handler.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face; ++v)
for (unsigned int i = 0; i < fe.dofs_per_vertex; ++i)
dof_handler.begin_active();
cell != dof_handler.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f) &&
(cell->face(f)->boundary_id() == boundary_id))
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face;
dof_handler.begin_active();
cell != dof_handler.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f) &&
(cell->face(f)->boundary_id() == boundary_id))
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face;
dof_handler.begin_active();
cell != dof_handler.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f) &&
(cell->face(f)->boundary_id() == boundary_id))
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face;
dof_handler.begin_active();
cell != dof_handler.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f) &&
(cell->face(f)->boundary_id() == boundary_id))
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face;
Triangulation<dim> tria;
GridGenerator::hyper_ball(tria);
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())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
p.vertices[i](j) =
PatchInfo<dim>::vertices[i][j] + PatchInfo<dim>::offsets[c][j];
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
p.neighbors[i] = (unsigned int)PatchInfo<dim>::neighbors[c][i];
unsigned int ndata = 1;
}
if (cell->at_boundary())
- for (unsigned int face_no = 0;
- face_no < GeometryInfo<2>::faces_per_cell;
- ++face_no)
+ for (const unsigned int face_no : GeometryInfo<2>::face_indices())
{
face = cell->face(face_no);
// insert a modifiued value for
Triangulation<2>::face_iterator face_2;
// Look for the two outermost faces:
- for (unsigned int j = 0; j < GeometryInfo<2>::faces_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<2>::face_indices())
{
if (cell_1->face(j)->center()(1) > 2.9)
face_1 = cell_1->face(j);
Triangulation<3>::face_iterator face_2;
// Look for the two outermost faces:
- for (unsigned int j = 0; j < GeometryInfo<3>::faces_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<3>::face_indices())
{
if (cell_1->face(j)->center()(2) > 2.9)
face_1 = cell_1->face(j);
cell != dof_handler.end(0);
++cell)
{
- for (unsigned int j = 0; j < GeometryInfo<dim>::faces_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<dim>::face_indices())
{
if (cell->face(j)->center()(dim == 2 ? 1 : 2) > 2.9)
face_1 = cell->face(j);
Triangulation<2>::face_iterator face_2;
// Look for the two outermost faces:
- for (unsigned int j = 0; j < GeometryInfo<2>::faces_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<2>::face_indices())
{
if (cell_1->face(j)->center()(1) > 2.9)
face_1 = cell_1->face(j);
Triangulation<2>::face_iterator face_2;
// Look for the two outermost faces:
- for (unsigned int j = 0; j < GeometryInfo<2>::faces_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<2>::face_indices())
{
if (cell_1->face(j)->center()(1) > 2.9)
face_1 = cell_1->face(j);
Triangulation<2>::face_iterator face_2;
// Look for the two outermost faces:
- for (unsigned int j = 0; j < GeometryInfo<2>::faces_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<2>::face_indices())
{
if (cell_1->face(j)->center()(1) > 2.9)
face_1 = cell_1->face(j);
Triangulation<2>::face_iterator face_2;
// Look for the two outermost faces:
- for (unsigned int j = 0; j < GeometryInfo<2>::faces_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<2>::face_indices())
{
if (cell_1->face(j)->center()(1) > 2.9)
face_1 = cell_1->face(j);
Triangulation<3>::face_iterator face_2;
// Look for the two outermost faces:
- for (unsigned int j = 0; j < GeometryInfo<3>::faces_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<3>::face_indices())
{
if (cell_1->face(j)->center()(2) > 2.9)
face_1 = cell_1->face(j);
cell != dof_handler.end(0);
++cell)
{
- for (unsigned int j = 0; j < GeometryInfo<dim>::faces_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<dim>::face_indices())
{
if (cell->face(j)->center()(dim == 2 ? 1 : 2) > 2.9)
face_1 = cell->face(j);
void
set_boundary_ids(Triangulation<dim> &tria)
{
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
tria.begin_active()->face(f)->set_boundary_id(f);
}
face->set_manifold_id(42);
for (const auto &cell : tr.active_cell_iterators())
- 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())
Assert(cell->face(face_n)->manifold_id() == 42, ExcInternalError());
deallog << "OK" << std::endl;
triangulation.begin_active();
cell != triangulation.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if ((cell->face(f)->center()[2] != -4) &&
(cell->face(f)->center()[2] != 7) && (cell->face(f)->at_boundary()))
cell->face(f)->set_boundary_id(1);
for (active_cell_iterator cell = dual_solver.dof_handler.begin_active();
cell != dual_solver.dof_handler.end();
++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())
face_integrals[cell->face(face_no)] = -1e20;
error_indicators.reinit(
for (active_cell_iterator cell = dual_solver.dof_handler.begin_active();
cell != dual_solver.dof_handler.end();
++cell, ++present_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())
{
Assert(face_integrals.find(cell->face(face_no)) !=
face_integrals.end(),
cell_data,
error_indicators);
- 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())
{
if (cell->face(face_no)->at_boundary())
{
endc = dof.end();
std::vector<types::global_dof_index> face_dof_indices(fe.dofs_per_face);
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
{
cell->face(f)->get_dof_indices(face_dof_indices);
endc = dof.end();
std::vector<types::global_dof_index> face_dof_indices(fe.dofs_per_face);
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
{
cell->face(f)->get_dof_indices(face_dof_indices);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_boundary_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_boundary_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_boundary_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_boundary_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_manifold_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_manifold_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_manifold_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_manifold_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_boundary_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_boundary_id(1);
for (Triangulation<dim>::cell_iterator cell = tr.begin(); cell != tr.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary() &&
std::abs(cell->face(f)->center()[0] + 1.) < 1e-12 &&
std::abs(cell->face(f)->center()[1]) < 1e-12)
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_boundary_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_boundary_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_boundary_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_boundary_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_manifold_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_manifold_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_manifold_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_manifold_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_boundary_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_boundary_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_boundary_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_boundary_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_boundary_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_boundary_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_manifold_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_manifold_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_manifold_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_manifold_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_boundary_id(1);
tr.set_manifold(1, boundary);
// set boundary id on cell 1
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (tr.begin_active()->at_boundary(f))
tr.begin_active()->face(f)->set_boundary_id(1);
endc = dof.end();
std::vector<types::global_dof_index> face_dof_indices(fe.dofs_per_face);
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
{
cell->face(f)->get_dof_indices(face_dof_indices);
std::vector<types::global_dof_index> face_dof_indices(
dof_handler.get_fe().dofs_per_face);
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<2>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<2>::face_indices())
{
cell->face(f)->get_dof_indices(face_dof_indices);
for (unsigned int i = 0; i < dof_handler.get_fe().dofs_per_face; ++i)
finel,
q,
UpdateFlags(update_gradients | update_hessians));
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell; ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
fe.reinit(c, face);
}
Tensor<1, dim> boundary_integral;
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
fe_face_values.reinit(cell, face);
for (unsigned int q = 0;
for (unsigned int i = 0; i < fe_data->dofs_per_face; ++i)
deallog << ' ' << fe_data->face_to_cell_index(i, 0);
deallog << std::endl;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
deallog << "face_to_cell_index:";
for (unsigned int i = 0; i < fe_data->dofs_per_face; ++i)
deallog << std::endl;
}
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
deallog << "support on face " << f << ':';
for (unsigned int s = 0; s < fe_data->dofs_per_cell; ++s)
}
Tensor<3, dim> boundary_integral;
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
fe_face_values.reinit(cell, face);
for (unsigned int q = 0;
}
Tensor<3, dim> boundary_integral;
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
fe_face_values.reinit(cell, face);
for (unsigned int q = 0;
}
Tensor<1, dim> boundary_integral;
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
fe_face_values.reinit(cell, face);
for (unsigned int q = 0;
}
Tensor<2, dim> boundary_integral;
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
fe_face_values.reinit(cell, face);
for (unsigned int q = 0;
dof_handler.begin_active(),
endc = dof_handler.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())
{
fe_face_values.reinit(cell, face);
const unsigned int n_q_points = quadrature.size();
fe_values_system.shape_grad_component(i, q_point, 1),
fe_values_system.shape_hessian_component(i, q_point, 1));
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
fe_face_values_enriched.reinit(cell_enriched, face);
fe_face_values_system.reinit(cell_system, face);
fe_values_system.shape_grad_component(i, q_point, 3),
fe_values_system.shape_hessian_component(i, q_point, 3));
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
fe_face_values_enriched.reinit(cell_enriched, face);
fe_face_values_system.reinit(cell_system, face);
cell != dof_handler.end();
++cell)
if (cell_is_pou(cell))
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (!cell->at_boundary(f))
{
bool face_is_on_interface = false;
update_gradients | update_hessians |
update_normal_vectors));
- for (unsigned int face_nr = 0; face_nr < GeometryInfo<dim>::faces_per_cell;
- ++face_nr)
+ for (const unsigned int face_nr : GeometryInfo<dim>::face_indices())
{
deallog << "Face=" << face_nr << std::endl;
fe_values.reinit(cell, face_nr);
q,
UpdateFlags(update_quadrature_points | update_JxW_values | update_values |
update_gradients | update_hessians | update_normal_vectors));
- for (unsigned int face_nr = 0; face_nr < GeometryInfo<dim>::faces_per_cell;
- ++face_nr)
+ for (const unsigned int face_nr : GeometryInfo<dim>::face_indices())
for (unsigned int sub_nr = 0;
sub_nr < GeometryInfo<dim>::max_children_per_face;
++sub_nr)
}
Tensor<1, dim> boundary_integral;
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
fe_face_values.reinit(cell, face);
for (unsigned int q = 0;
}
Tensor<2, dim> boundary_integral;
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
fe_face_values.reinit(cell, face);
for (unsigned int q = 0;
}
Tensor<1, dim> boundary_integral;
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
fe_face_values.reinit(cell, face);
for (unsigned int q = 0;
}
}
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
fe_face_values.reinit(cell, face);
const std::vector<double> &face_JxW_values =
}
Tensor<3, dim> boundary_integral;
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
fe_face_values.reinit(cell, face);
for (unsigned int q = 0;
for (unsigned int j = i + 1; j < dofs_per_cell; ++j)
local_matrix(i, j) = local_matrix(j, i);
- 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())
{
typename DoFHandler<dim>::face_iterator face = cell->face(face_no);
if (face->at_boundary() == false)
}
Tensor<1, dim> boundary_integral;
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
fe_face_values.reinit(cell, face);
for (unsigned int q = 0;
}
Tensor<2, dim> boundary_integral;
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
fe_face_values.reinit(cell, face);
for (unsigned int q = 0;
}
Tensor<3, dim> boundary_integral;
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
fe_face_values.reinit(cell, face);
for (unsigned int q = 0;
}
Tensor<1, dim> boundary_integral;
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
fe_face_values.reinit(cell, face);
for (unsigned int q = 0;
}
Tensor<2, dim> boundary_integral;
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
fe_face_values.reinit(cell, face);
for (unsigned int q = 0;
Quadrature<dim - 1> q(face_points, dummy_weights);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
std::vector<Point<dim>> q_points(q.get_points().size());
QProjector<dim>::project_to_face(q, i, q_points);
Quadrature<dim - 1> qg(face_g_points, dummy_g_weights);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
std::vector<Point<dim>> q_points(qg.get_points().size());
QProjector<dim>::project_to_face(qg, i, q_points);
}
Tensor<3, dim> boundary_integral;
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
fe_face_values.reinit(cell, face);
for (unsigned int q = 0;
fe_val_m.get_function_values(interpolant, values_m);
Assert(values[0] == values_m[0], ExcInternalError())
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_f_val.reinit(cell, f);
fe_f_val_m.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_val.reinit(cell, f);
for (typename DoFHandler<dim>::active_cell_iterator c = dof.begin_active();
c != dof.end();
++c)
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
deallog << "cell " << c << " face " << face;
if (c->at_boundary(face))
cell->get_dof_indices(local_dof_indices);
fe_v.reinit(cell);
- for (unsigned int f = 0; f < GeometryInfo<2>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<2>::face_indices())
{
if (!cell->face(f)->at_boundary())
{
{
cell->get_dof_indices(local_dof_indices);
- for (unsigned int f = 0; f < GeometryInfo<2>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<2>::face_indices())
{
if (!cell->face(f)->at_boundary())
{
// the normal component of the
// shape function, possibly
// pointing in negative direction.
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell; ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
for (unsigned int k = 0; k < other.dofs_per_face; ++k)
{
for (unsigned int i = 0; i < n_dofs; ++i)
UpdateFlags flags = update_values | update_gradients;
FEFaceValues<dim> vals(mapping, fe, sub_quadrature, flags);
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell; ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
QProjector<dim>::project_to_face(sub_quadrature, face, points);
vals.reinit(dof.begin_active(), face);
sprintf(fname, "Face%dd-%s", dim, name);
deallog.push(fname);
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
if (!c->face(f)->has_children())
{
for (auto cell : dofh.active_cell_iterators())
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f) == false)
{
fiv.reinit(cell,
deallog << "** interface between cell 0 and 1 **\n";
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (!cell->at_boundary(f))
{
fiv.reinit(cell,
auto cell = dofh.begin();
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (!cell->at_boundary(f))
{
fiv.reinit(cell,
auto cell = dofh.begin(1);
++cell;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (!cell->at_boundary(f))
{
if (!cell->neighbor_is_coarser(f))
deallog << "** interface between cell 0 and 1 **\n";
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (!cell->at_boundary(f))
{
fiv.reinit(cell,
auto cell = dofh.begin(1);
++cell;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (!cell->at_boundary(f))
{
if (!cell->neighbor_is_coarser(f))
auto cell = dofh.begin();
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (!cell->at_boundary(f))
{
fiv.reinit(cell,
}
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (!cell->at_boundary(f))
{
fiv.reinit(cell,
auto cell = tria.begin();
auto endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int face_number = 0;
- face_number < GeometryInfo<dim>::faces_per_cell;
- ++face_number)
+ for (const unsigned int face_number : GeometryInfo<dim>::face_indices())
if (std::fabs(cell->face(face_number)->center()(0) - left) < 1e-12)
cell->face(face_number)->set_all_boundary_ids(1);
else if (std::fabs(cell->face(face_number)->center()(0) - right) <
for (auto &cell : tria.active_cell_iterators())
{
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
if (mymap.find(cell->face(i)) == mymap.end())
{
<< std::endl;
bool manifold_ids_are_zero = cell->manifold_id() == 0;
- for (unsigned int face_n = 0; face_n < GeometryInfo<2>::faces_per_cell;
- ++face_n)
+ for (const unsigned int face_n : GeometryInfo<2>::face_indices())
manifold_ids_are_zero &= cell->face(face_n)->manifold_id() == 0;
AssertThrow(manifold_ids_are_zero, ExcInternalError());
- for (unsigned int face_n = 0; face_n < GeometryInfo<2>::faces_per_cell;
- ++face_n)
+ for (const unsigned int face_n : GeometryInfo<2>::face_indices())
if (cell->face(face_n)->at_boundary())
deallog << "boundary face center distance to origin: "
<< (cell->face(face_n)->center(/*respect_manifold*/ true) -
<< cell->vertex(6) << ", " << cell->vertex(7) << std::endl;
bool manifold_ids_are_zero = cell->manifold_id() == 0;
- for (unsigned int face_n = 0; face_n < GeometryInfo<3>::faces_per_cell;
- ++face_n)
+ for (const unsigned int face_n : GeometryInfo<3>::face_indices())
manifold_ids_are_zero &= cell->face(face_n)->manifold_id() == 0;
AssertThrow(manifold_ids_are_zero, ExcInternalError());
- for (unsigned int face_n = 0; face_n < GeometryInfo<3>::faces_per_cell;
- ++face_n)
+ for (const unsigned int face_n : GeometryInfo<3>::face_indices())
if (cell->face(face_n)->at_boundary())
deallog << "boundary face center distance to origin: "
<< (cell->face(face_n)->center(/*respect_manifold*/ true) -
<< std::endl;
bool manifold_ids_are_zero = cell->manifold_id() == 0;
- for (unsigned int face_n = 0; face_n < GeometryInfo<2>::faces_per_cell;
- ++face_n)
+ for (const unsigned int face_n : GeometryInfo<2>::face_indices())
manifold_ids_are_zero &= cell->face(face_n)->manifold_id() == 0;
AssertThrow(manifold_ids_are_zero, ExcInternalError());
- for (unsigned int face_n = 0; face_n < GeometryInfo<2>::faces_per_cell;
- ++face_n)
+ for (const unsigned int face_n : GeometryInfo<2>::face_indices())
if (cell->face(face_n)->at_boundary())
deallog << "boundary face center distance to origin: "
<< (cell->face(face_n)->center(true) - center).norm()
<< cell->vertex(6) << ", " << cell->vertex(7) << std::endl;
bool manifold_ids_are_zero = cell->manifold_id() == 0;
- for (unsigned int face_n = 0; face_n < GeometryInfo<3>::faces_per_cell;
- ++face_n)
+ for (const unsigned int face_n : GeometryInfo<3>::face_indices())
manifold_ids_are_zero &= cell->face(face_n)->manifold_id() == 0;
AssertThrow(manifold_ids_are_zero, ExcInternalError());
- for (unsigned int face_n = 0; face_n < GeometryInfo<3>::faces_per_cell;
- ++face_n)
+ for (const unsigned int face_n : GeometryInfo<3>::face_indices())
if (cell->face(face_n)->at_boundary())
{
deallog << "boundary face center distance to origin: "
if (cell->at_boundary())
{
cell->set_manifold_id(1);
- for (unsigned int face_n = 0; face_n < GeometryInfo<2>::faces_per_cell;
- ++face_n)
+ for (const unsigned int face_n : GeometryInfo<2>::face_indices())
if (!cell->face(face_n)->at_boundary())
cell->face(face_n)->set_manifold_id(1);
}
for (const auto &cell : triangulation_3.active_cell_iterators())
{
cell_centers[cell->manifold_id()].push_back(cell->center());
- for (unsigned int face_n = 0; face_n < GeometryInfo<3>::faces_per_cell;
- ++face_n)
+ for (const unsigned int face_n : GeometryInfo<3>::face_indices())
face_centers[cell->face(face_n)->manifold_id()].push_back(
cell->face(face_n)->center());
for (unsigned int line_n = 0; line_n < GeometryInfo<3>::lines_per_cell;
{
deallog << "2d cell " << c
<< " has the following face orientations:" << std::endl;
- for (unsigned int l = 0; l < GeometryInfo<2>::faces_per_cell; ++l)
+ for (const unsigned int l : GeometryInfo<2>::face_indices())
deallog << " " << (c->face_orientation(l) ? "true" : "false")
<< std::endl;
}
<< "3d cell " << c
<< " has the following face orientation/flips and edge orientations:"
<< std::endl;
- for (unsigned int f = 0; f < GeometryInfo<3>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<3>::face_indices())
deallog << " face=" << f
<< (c->face_orientation(f) ? " -> true" : " -> false")
<< (c->face_flip(f) ? "/true" : "/false") << std::endl;
{
deallog << "2d cell " << c
<< " has the following face orientations:" << std::endl;
- for (unsigned int l = 0; l < GeometryInfo<2>::faces_per_cell; ++l)
+ for (const unsigned int l : GeometryInfo<2>::face_indices())
deallog << " " << (c->face_orientation(l) ? "true" : "false")
<< std::endl;
}
<< "3d cell " << c
<< " has the following face orientation/flips and edge orientations:"
<< std::endl;
- for (unsigned int f = 0; f < GeometryInfo<3>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<3>::face_indices())
deallog << " face=" << f
<< (c->face_orientation(f) ? " -> true" : " -> false")
<< (c->face_flip(f) ? "/true" : "/false") << std::endl;
{
deallog << "2d cell " << c
<< " has the following face orientations:" << std::endl;
- for (unsigned int l = 0; l < GeometryInfo<2>::faces_per_cell; ++l)
+ for (const unsigned int l : GeometryInfo<2>::face_indices())
deallog << " " << (c->face_orientation(l) ? "true" : "false")
<< std::endl;
}
<< "3d cell " << c
<< " has the following face orientation/flips and edge orientations:"
<< std::endl;
- for (unsigned int f = 0; f < GeometryInfo<3>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<3>::face_indices())
deallog << " face=" << f
<< (c->face_orientation(f) ? " -> true" : " -> false")
<< (c->face_flip(f) ? "/true" : "/false") << std::endl;
for (Triangulation<3>::active_cell_iterator cell = tria.begin_active();
cell != tria.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<3>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<3>::face_indices())
if (cell->face_orientation(f) == false)
{
++misoriented_faces;
std::set<typename Triangulation<dim, spacedim>::active_face_iterator>
face_set;
for (const auto &cell : tria.active_cell_iterators())
- 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 (cell->face(face_n)->at_boundary() &&
cell->face(face_n)->manifold_id() == manifold_id)
face_set.insert(cell->face(face_n));
for (; cell != endc; ++cell)
{
deallog << cell << std::endl;
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
deallog << face << ": "
<< (cell->face_orientation(face) ? "true " : "false ")
{
deallog << cell.material_id() << " ";
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
deallog << (cell.face(f)->at_boundary() ? cell.face(f)->boundary_id() :
-1)
<< " ";
for (; cell != tr.end(); ++cell)
{
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
if (cell->face(f)->at_boundary())
deallog << "half_hyper_shell<" << dim << ">:: cell "
{
deallog << "cell:" << std::endl;
- 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() &&
cell->face(face)->boundary_id() != 0)
std::vector<Tuple> boundary_faces;
for (const auto &cell : triangulation.active_cell_iterators())
- 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 (cell->face(face_n)->at_boundary())
boundary_faces.push_back(
std::make_tuple(cell->face(face_n)->center(),
std::vector<Tuple> boundary_faces;
for (const auto &cell : triangulation.active_cell_iterators())
- 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 (cell->face(face_n)->at_boundary())
boundary_faces.push_back(
std::make_tuple(cell->face(face_n)->center(),
std::vector<Tuple> boundary_faces;
for (const auto &cell : triangulation.active_cell_iterators())
- 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 (cell->face(face_n)->at_boundary())
boundary_faces.push_back(
std::make_tuple(cell->face(face_n)->center(),
std::vector<Tuple> boundary_faces;
for (const auto &cell : triangulation.active_cell_iterators())
- 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 (cell->face(face_n)->at_boundary())
boundary_faces.push_back(
std::make_tuple(cell->face(face_n)->center(),
tria.begin_active();
c != tria.end();
++c)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (c->face(f)->at_boundary())
for (unsigned int e = 0; e < GeometryInfo<dim>::lines_per_face; ++e)
c->face(f)->line(e)->set_manifold_id(0);
tria.begin_active();
cell != tria.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
AssertThrow(cell->face(f)->at_boundary() == cell->at_boundary(f),
ExcInternalError());
tria.begin_active();
cell != tria.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
deallog << cell->face(f) << ' ' << (int)cell->face(f)->boundary_id()
<< ' ' << cell->face(f)->center().norm() << std::endl;
for (typename Triangulation<dim>::cell_iterator cell = tria.begin();
cell != tria.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
for (unsigned int l = 0; l < GeometryInfo<dim>::lines_per_face; ++l)
AssertThrow(cell->face(f)->line(l)->boundary_id() ==
AssertThrow((cell_v2->vertex(i) - cell_v4->vertex(i)).norm() < 1.e-10,
ExcInternalError());
}
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
AssertThrow(cell_v2->face(i)->boundary_id() ==
cell_v4->face(i)->boundary_id(),
1.e-10,
ExcInternalError());
}
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
AssertThrow(cell_v2->face(i)->boundary_id() ==
cell_v41->face(i)->boundary_id(),
AssertThrow(vertices_v2 == vertices_v4, ExcInternalError());
std::map<Point<dim>, types::boundary_id, PointComparator<dim>> faces_v2;
std::map<Point<dim>, types::boundary_id, PointComparator<dim>> faces_v4;
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
faces_v2[cell_v2->face(i)->center()] =
cell_v2->face(i)->boundary_id();
cell = tria.begin_active();
for (; cell != endc; ++cell)
{
- for (unsigned int f = 0; f < GeometryInfo<2>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<2>::face_indices())
if (cell->face(f)->manifold_id() != numbers::flat_manifold_id)
deallog << cell << " (" << f << ") "
<< int(cell->face(f)->manifold_id()) << std::endl;
{
deallog << "cell->manifold_id: " << cell->manifold_id() << std::endl;
if (dim > 1)
- 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())
deallog << "cell->face(" << face_no
<< ")->manifold_id: " << cell->face(face_no)->manifold_id()
<< std::endl;
tria.begin_active();
cell != tria.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
deallog << cell << ' ' << f << ": " << (int)cell->face(f)->boundary_id()
<< std::endl;
AssertDimension(obj1->boundary_id(), obj2->boundary_id());
}
if (dim > 1)
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
auto obj1 = cell1->face(i);
auto obj2 = cell2->face(i);
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)->at_boundary())
{
Triangulation<2>::face_iterator face_2;
// Look for the two outermost faces:
- for (unsigned int j = 0; j < GeometryInfo<2>::faces_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<2>::face_indices())
{
if (cell_1->face(j)->center()(1) > 2.9)
face_1 = cell_1->face(j);
Triangulation<3>::face_iterator face_2;
// Look for the two outermost faces:
- for (unsigned int j = 0; j < GeometryInfo<3>::faces_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<3>::face_indices())
{
if (cell_1->face(j)->center()(2) > 2.9)
face_1 = cell_1->face(j);
Triangulation<2>::face_iterator face_2;
// Look for the two outermost faces:
- for (unsigned int j = 0; j < GeometryInfo<2>::faces_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<2>::face_indices())
{
if (cell_1->face(j)->center()(1) > 2.9)
face_1 = cell_1->face(j);
Triangulation<3>::face_iterator face_2;
// Look for the two outermost faces:
- for (unsigned int j = 0; j < GeometryInfo<3>::faces_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<3>::face_indices())
{
if (cell_1->face(j)->center()(2) > 2.9)
face_1 = cell_1->face(j);
for (; cell != endc; ++cell)
{
if (cell->at_boundary())
- 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())
{
face = cell->face(face_no);
if (face->at_boundary())
for (; cell != endc; ++cell)
if (cell->at_boundary() == true)
- 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() == true)
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face;
++v)
for (; cell != endc; ++cell)
if (cell->at_boundary() == true)
- 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() == true)
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face;
++v)
Triangulation<dim>::face_iterator face;
for (cell = tria.begin_active(); cell != endc; ++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())
{
face = cell->face(face_no);
if (face->at_boundary())
for (; cell != endc; ++cell)
{
if (cell->at_boundary())
- 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())
{
face = cell->face(face_no);
if (face->at_boundary())
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())
boundary_count[cell->face(face)->boundary_id()]++;
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())
boundary_count[cell->face(face)->boundary_id()]++;
if (cell->material_id() == 2)
{
cell->set_manifold_id(tfi_id);
- for (unsigned int face_n = 0;
- face_n < GeometryInfo<2>::faces_per_cell;
- ++face_n)
+ for (const unsigned int face_n : GeometryInfo<2>::face_indices())
{
if (cell->face(face_n)->at_boundary())
cell->face(face_n)->set_manifold_id(polar_id);
std::vector<Point<2> *> inner_pointers;
for (const auto &cell : result_2.active_cell_iterators())
{
- for (unsigned int face_n = 0; face_n < GeometryInfo<2>::faces_per_cell;
- ++face_n)
+ for (const unsigned int face_n : GeometryInfo<2>::face_indices())
{
if (cell->face(face_n)->manifold_id() == polar_id)
{
{
if (cell->at_boundary())
{
- for (unsigned int face_n = 0;
- face_n < GeometryInfo<2>::faces_per_cell;
- ++face_n)
+ for (const unsigned int face_n : GeometryInfo<2>::face_indices())
{
auto face = cell->face(face_n);
if (face->at_boundary())
unsigned int boundary_face_count = 0;
for (const auto &cell : tria_2.active_cell_iterators())
- for (unsigned int f = 0; f < GeometryInfo<spacedim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<spacedim>::face_indices())
if (cell->face(f)->at_boundary())
++boundary_face_count;
++cell)
{
std::set<unsigned int> vertices;
- for (unsigned int f = 0; f < GeometryInfo<3>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<3>::face_indices())
{
vertices.insert(cell->face(f)->vertex_index(0));
vertices.insert(cell->face(f)->vertex_index(1));
{
for (Triangulation<3>::cell_iterator cell = tria.begin(); cell != tria.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<3>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<3>::face_indices())
if (!cell->at_boundary())
{
const Triangulation<3>::cell_iterator neighbor = cell->neighbor(f);
const unsigned int nb_nb = cell->neighbor_of_neighbor(f);
bool found = false;
- for (unsigned int ff = 0; ff < GeometryInfo<3>::faces_per_cell; ++ff)
+ for (const unsigned int ff : GeometryInfo<3>::face_indices())
if (neighbor->neighbor(ff) == cell)
{
AssertThrow(found == false, ExcInternalError());
{
Triangulation<3>::active_cell_iterator cell = tria.begin_active();
for (; cell != tria.end(); ++cell)
- for (unsigned int face_no = 0; face_no < GeometryInfo<3>::faces_per_cell;
- ++face_no)
+ for (const unsigned int face_no : GeometryInfo<3>::face_indices())
if (!cell->at_boundary(face_no) &&
cell->neighbor(face_no)->has_children())
for (unsigned int subface_no = 0;
DoFHandler<3>::active_cell_iterator cell = dof_handler.begin_active();
for (; cell != dof_handler.end(); ++cell)
- for (unsigned int face_no = 0; face_no < GeometryInfo<3>::faces_per_cell;
- ++face_no)
+ for (const unsigned int face_no : GeometryInfo<3>::face_indices())
if (!cell->at_boundary(face_no) &&
cell->neighbor(face_no)->has_children())
for (unsigned int subface_no = 0;
DoFHandler<3>::active_cell_iterator cell = dof_handler.begin_active();
for (; cell != dof_handler.end(); ++cell)
- for (unsigned int face_no = 0; face_no < GeometryInfo<3>::faces_per_cell;
- ++face_no)
+ for (const unsigned int face_no : GeometryInfo<3>::face_indices())
if (!cell->at_boundary(face_no) &&
cell->neighbor(face_no)->has_children())
for (unsigned int subface_no = 0;
// and make sure that the
// result of the integration is
// close to zero
- for (unsigned int f = 0; f < GeometryInfo<3>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<3>::face_indices())
{
fe_face_values.reinit(cell, f);
for (unsigned int q = 0; q < q_face.size(); ++q)
// now same for subface
// integration
- for (unsigned int f = 0; f < GeometryInfo<3>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<3>::face_indices())
for (unsigned int sf = 0; sf < GeometryInfo<3>::max_children_per_face;
++sf)
{
// active cells on the refined side don't
// have any children)
for (unsigned int cell_no = 0; cell != endc; ++cell, ++cell_no)
- 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 Triangulation<dim>::face_iterator face = cell->face(face_no);
for (DoFHandler<3>::cell_iterator cell = dof_handler.begin();
cell != dof_handler.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<3>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<3>::face_indices())
if (!cell->at_boundary(f))
{
const unsigned int nn = cell->neighbor_of_neighbor(f);
DoFHandler<3>::active_cell_iterator cell = dof_handler.begin_active();
for (; cell != dof_handler.end(); ++cell)
- for (unsigned int face_no = 0; face_no < GeometryInfo<3>::faces_per_cell;
- ++face_no)
+ for (const unsigned int face_no : GeometryInfo<3>::face_indices())
if (!cell->at_boundary(face_no))
{
if (cell->neighbor(face_no)->has_children())
for (Triangulation<3>::active_cell_iterator cell = tria.begin_active();
cell != tria.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<3>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<3>::face_indices())
if (cell->face_orientation(f) == false)
++count;
return count;
// active ones
for (Triangulation<3>::cell_iterator cell = tria.begin(); cell != tria.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<3>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<3>::face_indices())
if (cell->has_children())
for (unsigned int c = 0; c < GeometryInfo<3>::max_children_per_face;
++c)
for (DoFHandler<3>::cell_iterator cell = dof_handler.begin();
cell != dof_handler.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<3>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<3>::face_indices())
if (!cell->at_boundary(f))
{
const unsigned int nn = cell->neighbor_of_neighbor(f);
for (DoFHandler<3>::cell_iterator cell = dof_handler.begin();
cell != dof_handler.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<3>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<3>::face_indices())
if (!cell->at_boundary(f))
{
const unsigned int nn = cell->neighbor_of_neighbor(f);
unsigned int face_counter = 0;
for (auto &cell : tria.active_cell_iterators())
{
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
auto face = cell->face(i);
if (mymap.find(cell->face(i)) == mymap.end())
create_triangulation(case_no, tria);
const Triangulation<3>::active_cell_iterator cell = tria.begin_active();
Triangulation<3>::face_iterator face;
- for (unsigned int face_no = 0; face_no < GeometryInfo<3>::faces_per_cell;
- ++face_no)
+ for (const unsigned int face_no : GeometryInfo<3>::face_indices())
{
face = cell->face(face_no);
boundary.get_normals_at_vertices(face, normals);
create_triangulation(case_no, tria);
const Triangulation<2>::active_cell_iterator cell = tria.begin_active();
Triangulation<2>::face_iterator face;
- for (unsigned int face_no = 0; face_no < GeometryInfo<2>::faces_per_cell;
- ++face_no)
+ for (const unsigned int face_no : GeometryInfo<2>::face_indices())
{
face = cell->face(face_no);
boundary.get_normals_at_vertices(face, normals);
Triangulation<3>::active_cell_iterator cell = tria.begin_active();
for (; cell != tria.end(); ++cell)
- for (unsigned int face_no = 0; face_no < GeometryInfo<3>::faces_per_cell;
- ++face_no)
+ for (const unsigned int face_no : GeometryInfo<3>::face_indices())
if (cell->at_boundary(face_no))
{
Triangulation<3>::face_iterator face = cell->face(face_no);
Triangulation<2>::active_cell_iterator cell = tria.begin_active();
for (; cell != tria.end(); ++cell)
- for (unsigned int face_no = 0; face_no < GeometryInfo<2>::faces_per_cell;
- ++face_no)
+ for (const unsigned int face_no : GeometryInfo<2>::face_indices())
if (cell->at_boundary(face_no))
{
Triangulation<2>::face_iterator face = cell->face(face_no);
create_triangulation(case_no, tria);
const Triangulation<3>::active_cell_iterator cell = tria.begin_active();
Triangulation<3>::face_iterator face;
- for (unsigned int face_no = 0; face_no < GeometryInfo<3>::faces_per_cell;
- ++face_no)
+ for (const unsigned int face_no : GeometryInfo<3>::face_indices())
{
face = cell->face(face_no);
boundary.get_normals_at_vertices(face, normals);
create_triangulation(case_no, tria);
const Triangulation<2>::active_cell_iterator cell = tria.begin_active();
Triangulation<2>::face_iterator face;
- for (unsigned int face_no = 0; face_no < GeometryInfo<2>::faces_per_cell;
- ++face_no)
+ for (const unsigned int face_no : GeometryInfo<2>::face_indices())
{
face = cell->face(face_no);
boundary.get_normals_at_vertices(face, normals);
create_triangulation(case_no, tria);
const Triangulation<3>::active_cell_iterator cell = tria.begin_active();
Triangulation<3>::face_iterator face;
- for (unsigned int face_no = 0; face_no < GeometryInfo<3>::faces_per_cell;
- ++face_no)
+ for (const unsigned int face_no : GeometryInfo<3>::face_indices())
{
deallog << " Face" << face_no << std::endl;
face = cell->face(face_no);
Triangulation<3>::active_cell_iterator cell = tria.begin_active();
for (; cell != tria.end(); ++cell)
- for (unsigned int face_no = 0; face_no < GeometryInfo<3>::faces_per_cell;
- ++face_no)
+ for (const unsigned int face_no : GeometryInfo<3>::face_indices())
if (cell->at_boundary(face_no))
{
deallog << " Face" << face_no << std::endl;
unsigned int neighbor_count = 0;
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())
if (cell->has_periodic_neighbor(f))
++neighbor_count;
if (dim == 2)
{
subcelldata.boundary_lines.resize(GeometryInfo<dim>::faces_per_cell);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
subcelldata.boundary_lines[i].vertices[0] = i;
subcelldata.boundary_lines[i].vertices[1] = (i + 1) % 4;
else if (dim == 3)
{
subcelldata.boundary_quads.resize(GeometryInfo<dim>::faces_per_cell);
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_face;
++i)
for (typename Triangulation<dim>::cell_iterator it = tr.begin();
it != tr.end();
++it)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (it->face(f)->user_flag_set() == false)
{
deallog << '.';
for (typename Triangulation<dim>::cell_iterator it = tr.begin();
it != tr.end();
++it)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (it->face(f)->user_flag_set() == false)
{
deallog << '.';
for (typename Triangulation<dim>::cell_iterator it = tr.begin();
it != tr.end();
++it)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (it->face(f)->user_flag_set() == false)
{
it->face(f)->set_user_pointer(p++);
it->clear_user_index();
if (dim > 1)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
it->face(f)->clear_user_index();
if (dim > 2)
for (typename Triangulation<dim>::cell_iterator it = tr.begin();
it != tr.end();
++it)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (it->face(f)->user_flag_set() == false)
{
it->face(f)->set_user_index(p++);
deallog << "cell uses fe index " << fe_index << ": "
<< index_is_active << std::endl;
- for (unsigned int face_n = 0;
- face_n < GeometryInfo<1>::faces_per_cell;
- ++face_n)
+ for (const unsigned int face_n : GeometryInfo<1>::face_indices())
{
AssertThrow(&cell->face(face_n)->get_fe(fe_index) ==
&fe_collection[fe_index],
cell = dof_handler.begin_active();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
deallog << "cell=" << cell << ", face=" << f
<< ", fe_index=" << cell->active_fe_index() << ", dofs=";
dof_handler.begin_active();
cell != dof_handler.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))
{
Assert(cell->get_fe().dofs_per_face ==
{
const unsigned int fe_index = cell->active_fe_index();
local_face_dof_indices.resize(fe_collection[fe_index].dofs_per_face);
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (!cell->at_boundary(f)) // that's enough for our simple mesh
{
deallog << "cell=" << cell << " face=" << f << std::endl;
{
const unsigned int fe_index = cell->active_fe_index();
local_face_dof_indices.resize(fe_collection[fe_index].dofs_per_face);
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (std::abs(cell->face(f)->center()[0]) < 0.1)
{
// deallog << "cell="<<cell<<" face="<<f<<std::endl;
dof_handler.begin_active();
cell != dof_handler.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
deallog << "face=" << cell->face(f) << std::endl;
deallog << "n=" << cell->face(f)->n_active_fe_indices() << std::endl;
endc = dof_handler.end();
long double perimeter = 0;
for (; cell != endc; ++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())
if (cell->face(face_no)->at_boundary())
{
x_fe_face_values.reinit(cell, face_no);
cell->get_dof_indices(dofs);
- 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())
{
typename hp::DoFHandler<dim>::face_iterator face =
cell->face(face_no);
cell->get_dof_indices(dofs);
- 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())
{
typename hp::DoFHandler<dim>::face_iterator face =
cell->face(face_no);
rhs_values[q_point] * fe_values.JxW(q_point));
}
- 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() &&
(cell->face(face)->boundary_id() == 1))
{
triangulation.begin(),
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)->center()(0) == -1) ||
(cell->face(face)->center()(1) == -1))
cell->face(face)->set_boundary_id(1);
face_quadrature,
update_values | update_gradients |
update_normal_vectors | update_JxW_values);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
deallog << "boundary_matrix " << i << std::endl;
fef1.reinit(cell1, i);
face_quadrature,
update_values | update_gradients |
update_normal_vectors | update_JxW_values);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
deallog << "boundary_matrix " << i << std::endl;
fev1.reinit(cell1, i);
face_quadrature,
update_values | update_gradients |
update_normal_vectors | update_JxW_values);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
deallog << "boundary_matrix " << i << std::endl;
fef1.reinit(cell1, i);
face_quadrature,
update_values | update_gradients |
update_normal_vectors | update_JxW_values);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
deallog << "boundary_matrix " << i << std::endl;
fef1.reinit(cell1, i);
face_quadrature,
update_values | update_gradients |
update_normal_vectors | update_JxW_values);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
deallog << "boundary_matrix " << i << std::endl;
fef1.reinit(cell1, i);
face_quadrature,
update_values | update_gradients |
update_normal_vectors | update_JxW_values);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
deallog << "boundary_matrix " << i << std::endl;
fef1.reinit(cell1, i);
deallog << "curl_matrix" << std::endl;
curl_check.print(deallog, 10);
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell; ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
fe_face_values.reinit(cell, face);
nitsche_curl_matrix<dim>(
if (int(cell->material_id()) == 1)
{
// Only loop over cells in the fluid region
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
if (!cell->at_boundary(f))
{
triangulation.begin_active();
cell != triangulation.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->center()[dim - 1] == 0)
cell->face(f)->set_all_boundary_ids(1);
triangulation.refine_global(4 - dim);
// check that FlatManifold returns the middle of the cell.
deallog << "Cell: " << cell << std::endl;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
const typename Triangulation<dim, spacedim>::face_iterator &face =
cell->face(f);
// check that FlatManifold returns the middle of the cell.
deallog << "Cell: " << cell << std::endl;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
const typename Triangulation<dim, spacedim>::face_iterator &face =
cell->face(f);
for (cell = tria.begin_active(); cell != tria.end(); ++cell)
{
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
deallog << "face: " << cell->face(f)
<< ", boundary_id: " << (int)cell->face(f)->boundary_id()
deallog << "cell: " << cell << ", material_id: " << cell->material_id()
<< ", manifold_id: " << cell->manifold_id() << std::endl;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
deallog << "face: " << cell->face(f)
<< ", boundary_id: " << cell->face(f)->boundary_id()
<< ", manifold_id: " << cell->face(f)->manifold_id()
{
// check that FlatManifold returns the middle of the cell.
deallog << "Cell: " << cell << std::endl;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
const typename Triangulation<dim, spacedim>::face_iterator &face =
cell->face(f);
Tensor<1, dim> n;
for (const auto &cell : tria.active_cell_iterators())
{
- 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())
{
fe_face_values.reinit(cell, face);
{
deallog << "C: " << cell << ", mid: " << (int)cell->manifold_id()
<< std::endl;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
deallog << "f: " << cell->face(f)
<< ", mid: " << (int)cell->face(f)->manifold_id() << std::endl;
}
{
deallog << "C: " << cell << ", mid: " << (int)cell->manifold_id()
<< std::endl;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
deallog << "f: " << cell->face(f)
<< ", mid: " << (int)cell->face(f)->manifold_id() << std::endl;
}
{
deallog << "C: " << cell << ", mid: " << (int)cell->manifold_id()
<< std::endl;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
deallog << "f: " << cell->face(f)
<< ", mid: " << (int)cell->face(f)->manifold_id() << std::endl;
}
tria.begin_active()->set_manifold_id(3);
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
tria.begin_active()->face(f)->set_manifold_id(2);
tria.refine_global(1);
{
deallog << "C: " << cell << ", mid: " << (int)cell->manifold_id()
<< std::endl;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
deallog << "f: " << cell->face(f)
<< ", mid: " << (int)cell->face(f)->manifold_id() << std::endl;
}
for (cell = tria.begin_active(); cell != tria.end(); ++cell)
{
deallog << "C: " << cell << std::endl;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
deallog << "F: " << cell->face(f)
<< ", mid: " << (int)cell->face(f)->manifold_id() << std::endl;
}
if (dim < spacedim && cell->center().distance(center) < radius)
cell->set_all_manifold_ids(1);
else
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->center().distance(center) < radius)
cell->face(f)->set_all_manifold_ids(1);
for (cell = tria.begin_active(); cell != tria.end(); ++cell)
{
deallog << "C: " << cell << std::endl;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
deallog << "F: " << cell->face(f)
<< ", mid: " << (int)cell->face(f)->manifold_id() << std::endl;
}
{
deallog << "C: " << cell << ", manifold id: " << (int)cell->manifold_id()
<< std::endl;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
deallog << "f: " << cell->face(f)
<< ", boundary id: " << (int)cell->face(f)->boundary_id()
{
deallog << "C: " << cell << ", manifold id: " << (int)cell->manifold_id()
<< std::endl;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
deallog << "f: " << cell->face(f)
<< ", boundary id: " << (int)cell->face(f)->boundary_id()
e < static_cast<signed int>(GeometryInfo<dim>::lines_per_cell);
++e)
cell->line(e)->set_manifold_id(e);
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
cell->face(f)->set_boundary_id(f);
for (signed int e = 0;
<< ", material_id: " << (int)cell->material_id()
<< ", manifold_id: " << (int)cell->manifold_id() << std::endl;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
deallog << "face: " << cell->face(f)
<< ", boundary_id: " << (int)cell->face(f)->boundary_id()
<< ", manifold_id: " << (int)cell->face(f)->manifold_id()
<< ", material_id: " << (int)cell->material_id()
<< ", manifold_id: " << (int)cell->manifold_id() << std::endl;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
deallog << "face: " << cell->face(f)
<< ", boundary_id: " << (int)cell->face(f)->boundary_id()
<< ", manifold_id: " << (int)cell->face(f)->manifold_id()
tria.set_manifold(0, spherical);
for (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())
if (cell->at_boundary(f))
{
if (std::abs(cell->face(f)->vertex(1).norm() - 1.) < 1e-1)
}
}
for (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())
if (cell->at_boundary(f))
{
// the first choice will contain perturbations in the normal because
update_normal_vectors | update_quadrature_points);
for (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())
{
fe_values.reinit(cell, f);
update_normal_vectors | update_quadrature_points);
for (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())
if (cell->at_boundary(f))
{
fe_values.reinit(cell, f);
deallog << cell->line(line)->center(/*respect_manifold=*/true)
<< std::endl;
deallog << "Faces on cell with center: " << cell->center() << std::endl;
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
deallog << cell->face(face)->center(/*respect_manifold=*/true)
<< std::endl;
deallog << "Center with manifold: " << cell->center(true) << std::endl;
- 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))
{
std::vector<Point<spacedim>> points;
cell != tria.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))
{
bool cell_at_surfaces = true;
<< std::endl;
}
deallog << "Faces on cell with center: " << cell->center() << std::endl;
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
deallog << cell->face(face)->center(/*respect_manifold=*/true)
<< std::endl;
deallog << "Center with manifold: " << cell->center(true) << std::endl;
deallog << "Manifold id: " << cell->manifold_id() << std::endl;
- 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))
{
std::vector<Point<spacedim>> points;
{
if (cell->at_boundary())
cell->set_all_manifold_ids(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))
{
bool cell_at_surfaces = true;
cell != tria.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))
{
bool cell_at_surfaces = true;
deallog << cell->line(line)->center(/*respect_manifold=*/true)
<< std::endl;
deallog << "Faces on cell with center: " << cell->center() << std::endl;
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
deallog << cell->face(face)->center(/*respect_manifold=*/true)
<< std::endl;
deallog << "Center with manifold: " << cell->center(true) << std::endl;
- 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))
{
std::vector<Point<spacedim>> points;
cell != tria.end();
++cell)
{
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
bool face_at_sphere_boundary = true;
for (unsigned int v = 0; v < GeometryInfo<dim - 1>::vertices_per_cell;
cell != tria.end();
++cell)
{
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
bool face_at_sphere_boundary = true;
for (unsigned int v = 0; v < GeometryInfo<dim - 1>::vertices_per_cell;
1); // not faces ... for Transfinite interpolation
for (unsigned int k = 0; k < gp.n_balls; ++k)
{
- for (unsigned int f = 0; f < GeometryInfo<2>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<2>::face_indices())
{
const Point<2> p0 = cell->face(f)->vertex(0),
p1 = cell->face(f)->vertex(1);
for (auto &cell : tria.active_cell_iterators())
{
deallog << "Face centers:" << std::endl;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
deallog << cell->face(f)->center(true) << std::endl;
deallog << std::endl;
}
for (auto &cell : tria.active_cell_iterators())
{
deallog << "Face centers:" << std::endl;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
deallog << cell->face(f)->center(true) << std::endl;
deallog << std::endl;
}
for (auto &cell : tria.cell_iterators())
{
bool cell_at_boundary = false;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell_at_boundary = true;
if (cell_at_boundary == false)
cell != tria.end();
++cell)
{
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
deallog << "Center: " << cell->face(f)->center(true)
<< ", Norm: " << cell->face(f)->center(true).norm()
cell != tria.end();
++cell)
{
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
deallog << "Center: " << cell->face(f)->center(true, true)
<< ", Norm: " << cell->face(f)->center(true, true).norm()
std::map<int, int> manifold_id_count;
for (const auto &cell : triangulation.active_cell_iterators())
{
- 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())
{
const types::manifold_id curved_manifold_id = 1;
for (const auto &cell : tria.active_cell_iterators())
{
- 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())
{
update_gradients | update_hessians |
update_normal_vectors));
- for (unsigned int face_nr = 0; face_nr < GeometryInfo<dim>::faces_per_cell;
- ++face_nr)
+ for (const unsigned int face_nr : GeometryInfo<dim>::face_indices())
{
deallog << "Face=" << face_nr << std::endl;
fe_values.reinit(cell, face_nr);
q,
UpdateFlags(update_quadrature_points | update_JxW_values | update_values |
update_gradients | update_hessians | update_normal_vectors));
- for (unsigned int face_nr = 0; face_nr < GeometryInfo<dim>::faces_per_cell;
- ++face_nr)
+ for (const unsigned int face_nr : GeometryInfo<dim>::face_indices())
for (unsigned int sub_nr = 0;
sub_nr < GeometryInfo<dim>::max_children_per_face;
++sub_nr)
update_gradients | update_hessians |
update_normal_vectors));
- for (unsigned int face_nr = 0; face_nr < GeometryInfo<dim>::faces_per_cell;
- ++face_nr)
+ for (const unsigned int face_nr : GeometryInfo<dim>::face_indices())
{
deallog << "Face=" << face_nr << std::endl;
fe_values.reinit(cell, face_nr);
q,
UpdateFlags(update_quadrature_points | update_JxW_values | update_values |
update_gradients | update_hessians | update_normal_vectors));
- for (unsigned int face_nr = 0; face_nr < GeometryInfo<dim>::faces_per_cell;
- ++face_nr)
+ for (const unsigned int face_nr : GeometryInfo<dim>::face_indices())
for (unsigned int sub_nr = 0;
sub_nr < GeometryInfo<dim>::max_children_per_face;
++sub_nr)
update_JxW_values |
update_normal_vectors));
- for (unsigned int face_nr = 0; face_nr < GeometryInfo<dim>::faces_per_cell;
- ++face_nr)
+ for (const unsigned int face_nr : GeometryInfo<dim>::face_indices())
{
fe_values.reinit(cell, face_nr);
q,
UpdateFlags(update_quadrature_points |
update_normal_vectors));
- for (unsigned int face_nr = 0; face_nr < GeometryInfo<dim>::faces_per_cell;
- ++face_nr)
+ for (const unsigned int face_nr : GeometryInfo<dim>::face_indices())
for (unsigned int sub_nr = 0;
sub_nr < GeometryInfo<dim>::max_children_per_face;
++sub_nr)
for (DoFHandler<2>::active_cell_iterator cell = dof_handler.begin_active();
cell != dof_handler.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<2>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<2>::face_indices())
if (cell->face(f)->at_boundary())
{
c1_values.reinit(cell, f);
typename Triangulation<dim, spacedim>::active_cell_iterator cell =
triangulation.begin_active();
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
fe_values_mapping.reinit(cell, f);
fe_values_q.reinit(cell, f);
triangulation.begin_active();
cell != triangulation.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
const double xc = cell->face(f)->center()[0] - 1.5;
const double yc = cell->face(f)->center()[1] - 2.5;
triangulation.begin_active();
cell != triangulation.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
const double xc = cell->face(f)->center()[0] - 1.5;
const double yc = cell->face(f)->center()[1] - 2.5;
triangulation.begin_active();
cell != triangulation.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
{
fe_v.reinit(cell, f);
<< ", and unit coordinates: "
<< mapping.transform_real_to_unit_cell(cell, testp) << std::endl;
for (; cell != endc; ++cell)
- for (unsigned int face = 0; face < GeometryInfo<2>::faces_per_cell; ++face)
+ for (const unsigned int face : GeometryInfo<2>::face_indices())
{
deallog << "For face: " << face << ", the test point projects to: "
<< mapping.project_real_point_to_unit_point_on_face(cell,
<< ", and unit coordinates: "
<< mapping.transform_real_to_unit_cell(cell, testp) << std::endl;
for (; cell != endc; ++cell)
- for (unsigned int face = 0; face < GeometryInfo<3>::faces_per_cell; ++face)
+ for (const unsigned int face : GeometryInfo<3>::face_indices())
{
deallog << "For face: " << face << ", the test point projects to: "
<< mapping.project_real_point_to_unit_point_on_face(cell,
<< mapping.transform_real_to_unit_cell(cell, testp) << std::endl;
for (; cell != endc; ++cell)
- for (unsigned int face = 0; face < GeometryInfo<3>::faces_per_cell; ++face)
+ for (const unsigned int face : GeometryInfo<3>::face_indices())
{
deallog << "For face: " << face << ", the test point projects to: "
<< mapping.project_real_point_to_unit_point_on_face(cell,
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
local_diagonal_vector[phif.static_dofs_per_cell];
for (unsigned int i = 0; i < phif.static_dofs_per_cell; ++i)
local_diagonal_vector[i] = 0.;
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
phif.reinit(cell, face);
VectorizedArray<number> sigmaF =
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
for (typename Triangulation<dim>::cell_iterator cell = tria.begin();
cell != tria.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_boundary_ids(f);
std::vector<
parallel::distributed::Triangulation<mydim> tria(MPI_COMM_WORLD);
GridGenerator::hyper_cube(tria);
- for (unsigned int f = 0; f < GeometryInfo<mydim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<mydim>::face_indices())
tria.begin_active()->face(f)->set_all_boundary_ids(f);
std::vector<
GridTools::PeriodicFacePair<typename Triangulation<mydim>::cell_iterator>>
triangulation.begin();
cell != triangulation.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
{
if (std::abs(cell->face(f)->center()[2]) < 1e-12)
for (typename Triangulation<dim>::cell_iterator cell = tria.begin();
cell != tria.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_boundary_ids(f);
std::vector<
for (typename Triangulation<dim>::cell_iterator cell = tria.begin();
cell != tria.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_boundary_ids(f);
std::vector<
for (typename Triangulation<dim>::cell_iterator cell = tria.begin();
cell != tria.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_boundary_ids(f);
std::vector<
for (typename Triangulation<dim>::cell_iterator cell = tria.begin();
cell != tria.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_boundary_ids(f);
std::vector<
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
phi.integrate(false, true);
local_diagonal_vector[i] = phi.begin_dof_values()[i];
}
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
phif.reinit(cell, face);
VectorizedArray<number> sigmaF =
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
const FiniteElement<dim> &fe = cell->get_fe();
local_dofs.resize(fe.dofs_per_face);
- 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())
if (cell->at_boundary(face_no) == true)
{
const typename DoFHandler<dim>::face_iterator face =
const FiniteElement<dim> &fe = cell->get_fe();
local_dofs.resize(fe.dofs_per_face);
- 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())
if (cell->at_boundary(face_no) == true)
{
const typename DoFHandler<dim>::face_iterator face =
const FiniteElement<dim> &fe = cell->get_fe();
local_dofs.resize(fe.dofs_per_face);
- 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())
if (cell->at_boundary(face_no) == true)
{
const typename DoFHandler<dim>::face_iterator face =
typename Triangulation<dim>::active_cell_iterator cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(0);
tria.set_manifold(0, manifold);
ExcInternalError());
// deallog << "c " << cell_data[lane] << std::endl;
- for (unsigned int face = 0;
- face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (const unsigned int face : GeometryInfo<dim>::face_indices())
{
fe_eval_m.reinit(cell, face);
fe_eval_p.reinit(cell, face);
constraints.distribute_local_to_global(
c.matrices[0], c.vectors[0], c.local_dof_indices[0], matrix, rhs);
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
constraints.distribute_local_to_global(c.matrices[1 + f],
c.local_dof_indices[0],
c.local_dof_indices[1 + f],
{
if (current_cell->is_locally_owned())
{
- 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())
{
const int neighbor_index = current_cell->neighbor_index(face_n);
if (neighbor_index != -1) // interior face
tr.begin_active();
cell != tr.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_manifold_ids(numbers::flat_manifold_id);
// static const SphericalManifold<dim> boundary_shell;
// verify that our scenario is initialized correctly
// by checking the number of neighbors of the center cell
unsigned int n_neighbors = 0;
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
if (static_cast<unsigned int>(cell->neighbor_index(i)) !=
numbers::invalid_unsigned_int)
++n_neighbors;
// verify that our scenario is initialized correctly
// by checking the number of neighbors of the center cell
unsigned int n_neighbors = 0;
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
if (static_cast<unsigned int>(cell->neighbor_index(i)) !=
numbers::invalid_unsigned_int)
++n_neighbors;
// verify that our scenario is initialized correctly
// by checking the number of neighbors of the center cell
unsigned int n_neighbors = 0;
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
if (static_cast<unsigned int>(cell->neighbor_index(i)) !=
numbers::invalid_unsigned_int)
++n_neighbors;
else if (cell->id().to_string() == "0_0:")
{
// set different boundary id on leftmost cell
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
cell->face(f)->set_boundary_id(1);
{
if (cell->level_subdomain_id() != tr.locally_owned_subdomain())
continue;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell;
- ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
if (cell->at_boundary(f))
continue;
{
if (cell->level_subdomain_id() != tr.locally_owned_subdomain())
continue;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell;
- ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
if (cell->at_boundary(f))
continue;
for (typename Triangulation<dim>::cell_iterator cell = tria.begin();
cell != tria.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))
{
if (face >= 2)
for (typename Triangulation<dim>::cell_iterator cell = tria.begin();
cell != tria.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))
cell->face(face)->set_all_boundary_ids(face);
for (typename Triangulation<dim>::cell_iterator cell = tria.begin();
cell != tria.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))
{
if (face >= 2)
for (typename Triangulation<dim>::cell_iterator cell = tria.begin();
cell != tria.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (f / 2 != 1 && cell->at_boundary(f))
cell->face(f)->set_all_boundary_ids(f + 10);
for (typename Triangulation<dim>::cell_iterator cell = tria.begin();
cell != tria.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_boundary_ids(f + 10);
for (typename Triangulation<dim>::cell_iterator cell = tria.begin();
cell != tria.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
cell->face(f)->set_all_boundary_ids(f);
continue;
}
- for (unsigned int n = 0; n < GeometryInfo<dim>::faces_per_cell; ++n)
+ for (const unsigned int n : GeometryInfo<dim>::face_indices())
{
if (cell->at_boundary(n))
continue;
continue;
}
- for (unsigned int n = 0; n < GeometryInfo<dim>::faces_per_cell;
- ++n)
+ for (const unsigned int n : GeometryInfo<dim>::face_indices())
{
if (cell->at_boundary(n))
continue;
ExcInternalError());
}
else
- for (unsigned int n = 0; n < GeometryInfo<dim>::faces_per_cell; ++n)
+ for (const unsigned int n : GeometryInfo<dim>::face_indices())
{
if (cell->at_boundary(n))
continue;
// first collect all points locally
for (; cell != endc; ++cell)
if (cell->is_locally_owned() && cell->at_boundary())
- 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 DoFHandler<dim>::face_iterator face =
cell->face(face_no);
typename Triangulation<dim>::face_iterator face_2;
// Look for the two outermost faces:
- for (unsigned int j = 0; j < GeometryInfo<dim>::faces_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<dim>::face_indices())
{
if (cell_1->face(j)->center()(dim - 1) > 2.9)
face_1 = cell_1->face(j);
endc = triangulation.end();
for (; cell != endc; ++cell)
{
- for (unsigned int f = 0; f < GeometryInfo<3>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<3>::face_indices())
{
const Point<3> face_center = cell->face(f)->center();
if (cell->face(f)->at_boundary())
// mark faces
for (auto &cell : triangulation.active_cell_iterators())
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
const Point<dim> &face_center = cell->face(f)->center();
if (cell->face(f)->at_boundary())
// mark faces
for (auto &cell : triangulation.active_cell_iterators())
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
const Point<dim> &face_center = cell->face(f)->center();
if (cell->face(f)->at_boundary())
std::set<types::global_dof_index> starting_indices;
for (const auto &cell : dofh.active_cell_iterators())
if (cell->is_locally_owned())
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (!cell->at_boundary(f) && cell->neighbor(f)->is_ghost())
{
// we've identified a subdomain interface. use these DoFs
{
if (cell->is_locally_owned())
{
- 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()) ||
(cell->neighbor(face)->is_active() &&
{
if (cell->is_locally_owned())
{
- 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()) ||
(cell->neighbor(face)->is_active() &&
for (const auto level_cell : dof_handler.cell_iterators_on_level(level))
{
// Iterate over all faces
- for (unsigned int i_face = 0;
- i_face < GeometryInfo<dim>::faces_per_cell;
- ++i_face)
+ for (const unsigned int i_face : GeometryInfo<dim>::face_indices())
{
if ((level_cell->at_boundary(i_face) &&
!level_cell->has_periodic_neighbor(i_face)) ||
for (const auto level_cell : dof_handler.cell_iterators_on_level(level))
{
// Iterate over all faces
- for (unsigned int i_face = 0;
- i_face < GeometryInfo<dim>::faces_per_cell;
- ++i_face)
+ for (const unsigned int i_face : GeometryInfo<dim>::face_indices())
{
if (!level_cell->has_periodic_neighbor(i_face) ||
level_cell->periodic_neighbor(i_face)->level() !=
indices.resize(cell->get_fe().dofs_per_face);
deallog << "Level " << cell->level() << std::endl;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
typename DoFHandler<dim>::face_iterator face = cell->face(f);
face->get_mg_dof_indices(cell->level(), indices);
++cell)
{
cell->get_mg_dof_indices(dof_indices);
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
cell->face(f)->get_mg_dof_indices(cell->level(), face_indices);
if (cell->face(f)->at_boundary())
++cell)
{
cell->get_mg_dof_indices(dof_indices);
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
cell->face(f)->get_mg_dof_indices(cell->level(), face_indices);
if (cell->face(f)->at_boundary())
triangulation.begin_active();
cell != triangulation.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if ((cell->face(f)->center()[2] != -4) &&
(cell->face(f)->center()[2] != 7) && (cell->face(f)->at_boundary()))
cell->face(f)->set_boundary_id(1);
triangulation.begin_active();
cell != triangulation.end();
++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())
AssertThrow(cell->at_boundary(face_no) ==
cell->face(face_no)->at_boundary(),
ExcInternalError());
DoFHandler<dim> dof(tr);
dof.distribute_dofs(fe);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
deallog << "FE=" << fe.get_name() << ", case=" << i << std::endl;
Triangulation<dim> tr;
GridGenerator::hyper_cube(tr);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
tr.begin_active()->face(i)->set_boundary_id(i);
tr.refine_global(2);
DoFHandler<dim> dof(tr);
dof.distribute_dofs(fe);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
deallog << "FE=" << fe.get_name() << ", case=" << i << std::endl;
Triangulation<dim> tr;
GridGenerator::hyper_cube(tr);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
tr.begin_active()->face(i)->set_boundary_id(i);
tr.refine_global(2);
DoFRenumbering::component_wise(dof);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
deallog << "FE=" << fe.get_name() << ", case=" << i << std::endl;
Triangulation<3>::cell_iterator cell = tria.begin();
for (; cell != tria.end(); ++cell)
- for (unsigned int f = 0; f < GeometryInfo<3>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<3>::face_indices())
{
if (!cell->face(f)->at_boundary())
continue;
{
if (cell->is_locally_owned())
{
- 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())
{
hp::DoFHandler<dim> dof(tr);
dof.distribute_dofs(fe);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
deallog << "FE=" << fe[0].get_name() << ", case=" << i << std::endl;
Triangulation<dim> tr;
GridGenerator::hyper_cube(tr);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
tr.begin_active()->face(i)->set_boundary_id(i);
tr.refine_global(2);
hp::DoFHandler<dim> dof(tr);
dof.distribute_dofs(fe);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
deallog << "FE=" << fe[0].get_name() << ", case=" << i << std::endl;
Triangulation<dim> tr;
GridGenerator::hyper_cube(tr);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
tr.begin_active()->face(i)->set_boundary_id(i);
tr.refine_global(2);
DoFRenumbering::component_wise(dof);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
deallog << "FE=" << fe[0].get_name() << ", case=" << i << std::endl;
DoFHandler<dim> dof(tr);
dof.distribute_dofs(fe);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
deallog << "FE=" << fe.get_name() << ", case=" << i << std::endl;
Triangulation<dim> tr;
GridGenerator::hyper_cube(tr);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
tr.begin_active()->face(i)->set_boundary_id(i);
tr.refine_global(2);
DoFHandler<dim> dof(tr);
dof.distribute_dofs(fe);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
deallog << "FE=" << fe.get_name() << ", case=" << i << std::endl;
Triangulation<dim> tr;
GridGenerator::hyper_cube(tr);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
tr.begin_active()->face(i)->set_boundary_id(i);
tr.refine_global(2);
cell->set_active_fe_index(cell->index() % 2);
dof.distribute_dofs(fe);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
deallog << "FE=" << fe[0].get_name() << ", case=" << i << std::endl;
Triangulation<dim> tr;
GridGenerator::hyper_cube(tr);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
tr.begin_active()->face(i)->set_boundary_id(i);
tr.refine_global(2);
Functions::ConstantFunction<dim> constant_function(1., dim);
std::map<types::boundary_id, const Function<dim> *> function_map;
- for (unsigned int j = 0; j < GeometryInfo<dim>::faces_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<dim>::face_indices())
function_map[j] = &constant_function;
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
deallog << "FE=" << fe.get_name() << ", case=" << i << std::endl;
typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
endc = dof.end();
for (; cell != endc; ++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())
if (cell->face(face_no)->at_boundary())
{
typename DoFHandler<dim>::face_iterator face = cell->face(face_no);
Triangulation<dim> tr;
GridGenerator::hyper_cube(tr);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
tr.begin_active()->face(i)->set_boundary_id(i);
tr.refine_global(2);
std::vector<double> cell_pres_values(face_quadrature.size());
for (const auto &cell : dof_handler.active_cell_iterators())
{
- 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())
{
auto face = cell->face(face_n);
if (face->at_boundary())
Functions::ConstantFunction<dim> constant_function(1., dim);
std::map<types::boundary_id, const Function<dim> *> function_map;
- for (unsigned int j = 0; j < GeometryInfo<dim>::faces_per_cell; ++j)
+ for (const unsigned int j : GeometryInfo<dim>::face_indices())
function_map[j] = &constant_function;
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
{
deallog << "FE=" << fe.get_name() << ", case=" << i << std::endl;
typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
endc = dof.end();
for (; cell != endc; ++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())
if (cell->face(face_no)->at_boundary())
{
typename DoFHandler<dim>::face_iterator face = cell->face(face_no);
Triangulation<dim> tr;
GridGenerator::hyper_cube(tr);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (const unsigned int i : GeometryInfo<dim>::face_indices())
tr.begin_active()->face(i)->set_boundary_id(i);
tr.refine_global(2);
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)->at_boundary() == true &&
cell->face(face)->center()[1] == 1.0 * parameters.scale)
Assert(i_group <= J_dof, ExcInternalError());
}
}
- 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() == true &&
cell->face(face)->boundary_id() == 6)
{
triangulation.begin_active();
cell != triangulation.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
{
const Point<dim> face_center = cell->face(f)->center();
triangulation.begin_active();
cell != triangulation.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
{
const Point<dim> face_center = cell->face(f)->center();
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)->at_boundary() == true &&
cell->face(face)->center()[1] == 1.0 * parameters.scale)
Assert(i_group <= J_dof, ExcInternalError());
}
}
- 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() == true &&
cell->face(face)->boundary_id() == 6)
{
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)->at_boundary() == true &&
cell->face(face)->center()[1] == 1.0 * parameters.scale)
Assert(i_group <= J_dof, ExcInternalError());
}
}
- 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() == true &&
cell->face(face)->boundary_id() == 6)
{
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)->at_boundary() == true &&
cell->face(face)->center()[1] == 1.0 * parameters.scale)
Assert(i_group <= J_dof, ExcInternalError());
}
}
- 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() == true &&
cell->face(face)->boundary_id() == 6)
{
return false;
}
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
if (c1->face(f)->at_boundary() != c2->face(f)->at_boundary())
return false;
if (local_dofs_1 != local_dofs_2)
return false;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
std::vector<types::global_dof_index> local_dofs_1(
c1->get_fe().dofs_per_face);
{
typename Triangulation<dim, spacedim>::cell_iterator c1 = t1.begin();
for (; c1 != t1.end(); ++c1)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (c1->at_boundary(f))
c1->face(f)->set_boundary_id(42);
}
return false;
}
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
if (c1->face(f)->at_boundary() != c2->face(f)->at_boundary())
return false;
if (local_dofs_1 != local_dofs_2)
return false;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
std::vector<types::global_dof_index> local_dofs_1(
c1->get_fe().dofs_per_face);
{
typename Triangulation<dim, spacedim>::cell_iterator c1 = t1.begin();
for (; c1 != t1.end(); ++c1)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (c1->at_boundary(f))
c1->face(f)->set_boundary_id(42);
}
return false;
}
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
if (c1->face(f)->at_boundary() != c2->face(f)->at_boundary())
return false;
{
typename Triangulation<dim, spacedim>::cell_iterator c1 = t1.begin();
for (; c1 != t1.end(); ++c1)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (c1->at_boundary(f))
{
c1->face(f)->set_boundary_id(42);
return false;
}
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
{
if (c1->face(f)->at_boundary() != c2->face(f)->at_boundary())
return false;
{
typename Triangulation<dim, spacedim>::cell_iterator c1 = t1.begin();
for (; c1 != t1.end(); ++c1)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (c1->at_boundary(f))
c1->face(f)->set_boundary_id(42);
}
{
if (current_cell->is_locally_owned())
{
- 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())
{
const int neighbor_index = current_cell->neighbor_index(face_n);
if (neighbor_index != -1) // interior face