#include <boost/range/irange.hpp>
+#include <array>
#include <cstdint>
*/
static constexpr unsigned int faces_per_cell = 0;
+ /**
+ * Return an object that can be thought of as an array containing all
+ * indices from zero to `faces_per_cell`. This allows to write code
+ * using range-based for loops of the following kind:
+ * @code
+ * for (auto &cell : triangulation.active_cell_iterators())
+ * for (auto face_index : GeometryInfo<dim>::face_indices)
+ * if (cell->face(face_index)->at_boundary())
+ * ... do something ...
+ * @endcode
+ * Here, we are looping over all faces of all cells, with `face_index`
+ * taking on all valid indices.
+ *
+ * Of course, since this class is for the case `dim==0`, the
+ * returned object is actually an empty array.
+ */
+ static std::array<unsigned int, 0>
+ face_indices();
+
/**
* Maximum number of children of a refined face, i.e. the number of children
* of an isotropically refined face.
+inline std::array<unsigned int, 0>
+GeometryInfo<0>::face_indices()
+{
+ return {};
+}
+
+
+
template <int dim>
-boost::integer_range<unsigned int>
+inline boost::integer_range<unsigned int>
GeometryInfo<dim>::face_indices()
{
return boost::irange(0U, faces_per_cell);
}
+
template <int dim>
inline Point<dim>
GeometryInfo<dim>::unit_cell_vertex(const unsigned int)
face_iterators;
const unsigned int dim = DoFHandlerType::dimension;
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<dim>::face_indices())
face_iterators[i] =
dealii::internal::DoFCellAccessorImplementation::get_face(
*this, i, std::integral_constant<int, dim>());
GeometryInfo<dim>::faces_per_cell>
face_iterators;
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<dim>::face_indices())
face_iterators[i] =
dealii::internal::CellAccessorImplementation::get_face(*this, i);
&triangulation, cell_levels[i].first, cell_levels[i].second);
if (use_active_cells)
Assert(dcell->is_active(), ExcNotImplemented());
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
{
if (dcell->at_boundary(f) && !dcell->has_periodic_neighbor(f))
face_is_owned[dcell->face(f)->index()] =
new_indices.clear();
typename dealii::Triangulation<dim>::cell_iterator dcell(
&tria, cell_level_index[cell].first, cell_level_index[cell].second);
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
{
// Only inner faces couple different cells
if (dcell->at_boundary(f) == false &&
{
face_to_cell_index_nodal.reinit(GeometryInfo<dim>::faces_per_cell,
dofs_per_component_on_face);
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
{
const unsigned int direction = f / 2;
const unsigned int stride =
{
face_to_cell_index_hermite.reinit(GeometryInfo<dim>::faces_per_cell,
2 * dofs_per_component_on_face);
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
{
const unsigned int direction = f / 2;
const unsigned int stride =
: cell(seed)
, cell_valid(true)
{
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<dim>::face_indices())
{
exterior[i] = seed;
interior[i] = seed;
: cell(other.cell)
, cell_valid(other.cell_valid)
{
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<dim>::face_indices())
{
exterior[i] = other.exterior[i];
interior[i] = other.interior[i];
DoFInfoBox<dim, DOFINFO>::reset()
{
cell_valid = false;
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<dim>::face_indices())
{
interior_face_available[i] = false;
exterior_face_available[i] = false;
return;
assembler.assemble(cell);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<dim>::face_indices())
{
// Only do something if data available
if (interior_face_available[i])
DoFInfoBox<dim, DOFINFO> dof_info(dinfo);
assembler.initialize_info(dof_info.cell, false);
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<dim>::face_indices())
{
assembler.initialize_info(dof_info.interior[i], true);
assembler.initialize_info(dof_info.exterior[i], true);
for (; cell != endc; ++cell)
if (cell->level_subdomain_id() != numbers::artificial_subdomain_id)
{
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
if (cell->has_periodic_neighbor(f) &&
cell->periodic_neighbor(f)->level() == cell->level())
{
endc = dof_handler.end();
std::vector<types::global_dof_index> face_dof_indices;
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
{
face_dof_indices.resize(cell->get_fe().dofs_per_face);
std::vector<double> rhs_values(n_q_points);
for (; cell != endc; ++cell)
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (unsigned int face : GeometryInfo<dim>::face_indices())
if (cell->face(face)->at_boundary() &&
(boundary_ids.empty() ||
(boundary_ids.find(cell->face(face)->boundary_id()) !=
Vector<double>(n_components));
for (; cell != endc; ++cell)
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (unsigned int face : GeometryInfo<dim>::face_indices())
if (cell->face(face)->at_boundary() &&
(boundary_ids.empty() ||
(boundary_ids.find(cell->face(face)->boundary_id()) !=
std::vector<double> rhs_values;
for (; cell != endc; ++cell)
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (unsigned int face : GeometryInfo<dim>::face_indices())
if (cell->face(face)->at_boundary() &&
(boundary_ids.empty() ||
(boundary_ids.find(cell->face(face)->boundary_id()) !=
std::vector<Vector<double>> rhs_values;
for (; cell != endc; ++cell)
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (unsigned int face : GeometryInfo<dim>::face_indices())
if (cell->face(face)->at_boundary() &&
(boundary_ids.empty() ||
(boundary_ids.find(cell->face(face)->boundary_id()) !=
cell = dof.begin_active();
cell != dof.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
{
if (cell->at_boundary(f))
{
const hp::MappingCollection<dim> mapping_collection(mapping);
hp::QCollection<dim> face_quadrature_collection;
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (unsigned int face : GeometryInfo<dim>::face_indices())
face_quadrature_collection.push_back(
QProjector<dim>::project_to_face(reference_face_quadrature, face));
const QGauss<dim - 1> reference_face_quadrature(
2 * fe_collection[i].degree);
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (unsigned int face : GeometryInfo<dim>::face_indices())
face_quadrature_collection.push_back(
QProjector<dim>::project_to_face(reference_face_quadrature, face));
}
const hp::MappingCollection<dim> mapping_collection(mapping);
hp::QCollection<dim> quadrature_collection;
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (unsigned int face : GeometryInfo<dim>::face_indices())
quadrature_collection.push_back(
QProjector<dim>::project_to_face(face_quadrature, face));
face_quadrature_collection.push_back(quadrature);
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;
- ++face)
+ for (unsigned int face : GeometryInfo<dim>::face_indices())
quadrature_collection.push_back(
QProjector<dim>::project_to_face(quadrature, face));
}
// all the other data has a constructor of its own, except for the "neighbors"
// field, which we set to invalid values.
{
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<dim>::face_indices())
neighbors[i] = no_neighbor;
AssertIndexRange(dim, spacedim + 1);
if (vertices[i].distance(patch.vertices[i]) > epsilon)
return false;
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<dim>::face_indices())
if (neighbors[i] != patch.neighbors[i])
return false;
// adjust patch neighbors
for (unsigned int i = old_n_patches; i < patches.size(); ++i)
- for (unsigned int n = 0; n < GeometryInfo<dim>::faces_per_cell; ++n)
+ for (unsigned int n : GeometryInfo<dim>::face_indices())
if (patches[i].neighbors[n] !=
dealii::DataOutBase::Patch<dim, spacedim>::no_neighbor)
patches[i].neighbors[n] += old_n_patches;
out << patch.vertices[GeometryInfo<dim>::ucd_to_deal[i]] << ' ';
out << '\n';
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<dim>::face_indices())
out << patch.neighbors[i] << ' ';
out << '\n';
for (unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
in >> patch.vertices[GeometryInfo<dim>::ucd_to_deal[i]];
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<dim>::face_indices())
in >> patch.neighbors[i];
in >> patch.patch_index >> patch.n_subdivisions;
// Normal vectors point in the +x, +y, and +z directions for
// consistent orientation across edges
std::vector<Tensor<1, dim>> normals;
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<dim>::face_indices())
{
Tensor<1, dim> normal;
normal[i / 2] = 1;
// face. In dimension three, we need to split the face in two triangles, so
// we use once the first dim vertices of each face, and the second time the
// the dim vertices of each face starting from 1.
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
for (unsigned int start = 0; start < (dim > 2 ? 2 : 1); ++start)
{
for (unsigned int i = 0; i < dim; ++i)
// neighborship information. if a cell is at a boundary, then enter
// the index of the cell itself here
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary() == false)
connectivity
->tree_to_tree[index * GeometryInfo<dim>::faces_per_cell + f] =
// fill tree_to_face, which is essentially neighbor_to_neighbor;
// however, we have to remap the resulting face number as well
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary() == false)
{
switch (dim)
for (const auto &cell : dof_handler.active_cell_iterators())
if (!cell->is_artificial())
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
{
const typename dealii::DoFHandler<dim, spacedim>::face_iterator
face = cell->face(f);
const unsigned int n_face_points = q_base.size();
// First, compute interpolation on
// subfaces
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell; ++face)
+ for (unsigned int face : GeometryInfo<dim>::face_indices())
{
// The shape functions of the
// child cell are evaluated
std::fill(nodal_values.begin(), nodal_values.end(), 0.);
const unsigned int n_face_points = boundary_weights.size(0);
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell; ++face)
+ for (unsigned int face : GeometryInfo<dim>::face_indices())
for (unsigned int k = 0; k < n_face_points; ++k)
for (unsigned int i = 0; i < boundary_weights.size(1); ++i)
{
support_point_values[k + start_cell_points][d];
// Face integral of ABF terms
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell; ++face)
+ for (unsigned int face : GeometryInfo<dim>::face_indices())
{
const double n_orient = GeometryInfo<dim>::unit_normal_orientation[face];
for (unsigned int fp = 0; fp < n_face_points; ++fp)
unsigned int dbase = 0;
// The index of the first generalized support point on this face or the cell
unsigned int pbase = 0;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
{
// Old version with no moments in 2D. See comment below in
// initialize_support_points()
ExcDimensionMismatch(nodal_values.size(), this->dofs_per_cell));
std::vector<Tensor<1, dim>> normals;
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<dim>::face_indices())
{
Tensor<1, dim> normal;
normal[i / 2] = 1;
FE_FaceP<dim, spacedim>::get_constant_modes() const
{
Table<2, bool> constant_modes(1, this->dofs_per_cell);
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell; ++face)
+ for (unsigned int face : GeometryInfo<dim>::face_indices())
constant_modes(0, face * this->dofs_per_face) = true;
return std::pair<Table<2, bool>, std::vector<unsigned int>>(
constant_modes, std::vector<unsigned int>(1, 0));
const unsigned int n_face_points = q_base.size();
// First, compute interpolation on
// subfaces
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell; ++face)
+ for (unsigned int face : GeometryInfo<dim>::face_indices())
{
// The shape functions of the
// child cell are evaluated
std::fill(nodal_values.begin(), nodal_values.end(), 0.);
const unsigned int n_face_points = boundary_weights.size(0);
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell; ++face)
+ for (unsigned int face : GeometryInfo<dim>::face_indices())
for (unsigned int k = 0; k < n_face_points; ++k)
for (unsigned int i = 0; i < boundary_weights.size(1); ++i)
{
dynamic_cast<const TransfiniteInterpolationManifold<dim, spacedim> *>(
&cell->get_manifold()) == nullptr)
{
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
if (&cell->face(f)->get_manifold() != &cell->get_manifold())
all_manifold_ids_are_equal = false;
static void set_boundary_ids(Triangulation<2> &tria)
{
for (auto cell : tria.active_cell_iterators())
- for (unsigned int f = 0; f < GeometryInfo<2>::faces_per_cell; ++f)
+ for (unsigned int f : GeometryInfo<2>::face_indices())
{
if (cell->face(f)->at_boundary() == false)
continue;
// simple task
const typename Triangulation<dim, spacedim>::cell_iterator cell =
tria.begin();
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
cell->face(f)->set_boundary_id(f);
}
}
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 (unsigned int f : GeometryInfo<3>::face_indices())
{
if (!cell->face(f)->at_boundary())
continue;
for (auto &cell : tria.cell_iterators())
{
// identify faces on torus surface and set manifold to 1
- for (unsigned int f = 0; f < GeometryInfo<3>::faces_per_cell; ++f)
+ for (unsigned int f : GeometryInfo<3>::face_indices())
{
// faces 4 and 5 are those with normal vector aligned with torus
// centerline
for (; cell != endc; ++cell)
{
Point<2> cell_center = cell->center();
- for (unsigned int f = 0; f < GeometryInfo<2>::faces_per_cell; ++f)
+ for (unsigned int f : GeometryInfo<2>::face_indices())
if (cell->face(f)->boundary_id() == 0)
{
Point<2> face_center = cell->face(f)->center();
for (; cell != endc; ++cell)
{
Point<dim> cell_center = cell->center();
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->boundary_id() == 0)
{
Point<dim> face_center = cell->face(f)->center();
std::vector<Point<spacedim>> points;
unsigned int n_cells = 1;
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<dim>::face_indices())
n_cells += sizes[i];
std::vector<CellData<dim>> cells(n_cells);
while (cell != end)
{
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<dim>::face_indices())
{
if (cell->face(i)->boundary_id() ==
numbers::internal_face_boundary_id)
while (cell != end)
{
- for (unsigned int i = 0; i < GeometryInfo<2>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<2>::face_indices())
{
if (cell->face(i)->boundary_id() ==
numbers::internal_face_boundary_id)
tria.set_all_manifold_ids_on_boundary(0);
for (; cell != end; ++cell)
- for (unsigned int i = 0; i < GeometryInfo<3>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<3>::face_indices())
if (cell->at_boundary(i))
{
if (cell->face(i)->center()(0) > half_length - 1.e-5)
tria.set_all_manifold_ids_on_boundary(0);
while (cell != end)
{
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<dim>::face_indices())
{
if (cell->face(i)->boundary_id() ==
numbers::internal_face_boundary_id)
// set to one
while (cell != end)
{
- for (unsigned int i = 0; i < GeometryInfo<3>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<3>::face_indices())
{
if (!cell->at_boundary(i))
continue;
// to all faces in a first step.
Triangulation<3>::cell_iterator cell = tria.begin();
for (; cell != tria.end(); ++cell)
- for (unsigned int i = 0; i < GeometryInfo<3>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<3>::face_indices())
if (cell->at_boundary(i))
cell->face(i)->set_all_boundary_ids(2);
// boundary. Then decide whether the center is nearer to the inner
// or outer boundary to set the correct boundary id.
for (cell = tria.begin(); cell != tria.end(); ++cell)
- for (unsigned int i = 0; i < GeometryInfo<3>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<3>::face_indices())
if (cell->at_boundary(i))
{
const Triangulation<3>::face_iterator face = cell->face(i);
std::vector<bool> treated_vertices(triangulation.n_vertices(), false);
for (; cell != endc; ++cell)
{
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
{
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face;
cell = triangulation.begin_active();
for (; cell != endc; ++cell)
{
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
{
double dx = cell->face(f)->center()(0) - center(0);
std::vector<bool> treated_vertices(triangulation.n_vertices(), false);
for (; cell != endc; ++cell)
{
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
{
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_face;
cell = triangulation.begin_active();
for (; cell != endc; ++cell)
{
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
{
double dx = cell->face(f)->center()(0);
volume_mesh.begin(0);
cell != volume_mesh.end(0);
++cell)
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<dim>::face_indices())
{
const typename MeshType<dim, spacedim>::face_iterator face =
cell->face(i);
triangulation.begin_active();
cell != triangulation.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<1>::faces_per_cell; ++f)
+ for (unsigned int f : GeometryInfo<1>::face_indices())
if (boundary_ids.find(cell->vertex_index(f)) != boundary_ids.end())
{
AssertThrow(
for (const auto &cell : tria.active_cell_iterators())
{
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
{
typename Triangulation<dim, spacedim>::face_iterator face =
cell->face(f);
for (const auto &cell : tria.active_cell_iterators())
{
// Little trick to get -1 for the interior
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
{
out << ' '
<< static_cast<std::make_signed<types::boundary_id>::type>(
patch.data(3, vertex) = tria.locally_owned_subdomain();
}
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
patch.neighbors[f] = numbers::invalid_unsigned_int;
patches.push_back(patch);
}
endc = tria.end();
for (; cell != endc; ++cell)
{
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<dim>::face_indices())
{
const typename Triangulation<dim, spacedim>::face_iterator &face =
cell->face(i);
cell = triangulation.begin_active();
for (; cell != endc; ++cell)
{
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<dim>::face_indices())
{
if ((cell->at_boundary(i) == false) &&
(cell->neighbor(i)->is_active()))
// received.
if (cell->is_ghost())
{
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<dim>::face_indices())
{
if (cell->at_boundary(i) == false)
{
{
const unsigned int index = cell->active_cell_index();
cell_connectivity.add(index, index);
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
if ((cell->at_boundary(f) == false) &&
(cell->neighbor(f)->has_children() == false))
{
// distorted but the neighbor is even more refined, then the face had
// been deformed before already, and had been ignored at the time; we
// should then also be able to ignore it this time as well
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
{
Assert(cell->face(f)->has_children(), ExcInternalError());
Assert(cell->face(f)->refinement_case() ==
tria.begin_active();
cell != tria.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
for (unsigned int e = 0; e < GeometryInfo<dim>::lines_per_face; ++e)
{
tria.begin_active();
cell != tria.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
{
const auto bid = cell->face(f)->boundary_id();
cell->set_manifold_id(cell->material_id());
if (compute_face_ids == true)
{
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
{
if (cell->at_boundary(f) == false)
cell->face(f)->set_manifold_id(
for (const auto &cell : tria.active_cell_iterators())
{
unsigned int boundary_face_counter = 0;
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
boundary_face_counter++;
if (boundary_face_counter > dim)
cell != mesh.end(0);
++cell)
{
- for (unsigned int i = 0; i < GeometryInfo<dim>::faces_per_cell; ++i)
+ for (unsigned int i : GeometryInfo<dim>::face_indices())
{
const typename MeshType::face_iterator face = cell->face(i);
if (face->at_boundary() && face->boundary_id() == b_id1)
cell = triangulation.begin(),
endc = triangulation.end();
for (; cell != endc; ++cell)
- for (unsigned int q = 0; q < GeometryInfo<dim>::faces_per_cell; ++q)
+ for (unsigned int q : GeometryInfo<dim>::face_indices())
++quad_cell_count[cell->quad_index(q)];
return quad_cell_count;
}
endc =
triangulation.end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
{
const typename Triangulation<dim, spacedim>::face_iterator face =
cell->face(f);
// left_right_offset in this case as we want
// the offset of the neighbor, not our own.
for (cell = triangulation.begin(); cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
{
const unsigned int offset =
(cell->direction_flag() ?
triangulation.begin_active();
cell != triangulation.end();
++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
{
(*triangulation.vertex_to_manifold_id_map_1d)
[cell->face(f)->vertex_index()] = numbers::flat_manifold_id;
cell->child(c);
for (unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
--line_cell_count[child->line_index(l)];
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
--quad_cell_count[child->quad_index(f)];
}
cell->child(child)->clear_user_data();
cell->child(child)->clear_user_flag();
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
{
// set flags denoting deviations from
// standard orientation of faces back
return true;
const RefinementCase<dim> ref_case = cell->refinement_case();
- for (unsigned int n = 0; n < GeometryInfo<dim>::faces_per_cell; ++n)
+ for (unsigned int n : GeometryInfo<dim>::face_indices())
{
// if the cell is not refined along that face, coarsening
// will not change anything, so do nothing. the same
endc = this->end();
for (; cell != endc; ++cell)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary())
cell->face(f)->set_all_manifold_ids(m_number);
}
for (; cell != endc; ++cell)
{
// loop on faces
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
if (cell->face(f)->at_boundary() &&
cell->face(f)->boundary_id() == b_id)
{
// count all neighbors that will be refined along the face of our
// cell after the next step
unsigned int count = 0;
- for (unsigned int n = 0; n < GeometryInfo<dim>::faces_per_cell; ++n)
+ for (unsigned int n : GeometryInfo<dim>::face_indices())
{
const typename Triangulation<dim, spacedim>::cell_iterator neighbor =
cell->neighbor(n);
for (; cell != endc; ++cell)
if (cell->is_locally_owned() && cell->at_boundary())
{
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f))
{
const unsigned int dofs_per_face = cell->get_fe().dofs_per_face;
for (; cell != endc; ++cell)
if (cell->is_locally_owned() && cell->at_boundary())
{
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
if (cell->at_boundary(f) &&
(boundary_ids.find(cell->face(f)->boundary_id()) !=
boundary_ids.end()))
DoFTools::dof_couplings_from_component_couplings(fe, flux_mask);
for (unsigned int i = 0; i < total_dofs; ++i)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
support_on_face(i, f) = fe.has_support_on_face(i, f);
// Clear user flags because we will
DoFTools::dof_couplings_from_component_couplings(fe, flux_mask);
for (unsigned int i = 0; i < dofs_per_cell; ++i)
- for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
+ for (auto f : GeometryInfo<dim>::face_indices())
support_on_face(i, f) = fe.has_support_on_face(i, f);
for (; cell != endc; ++cell)
unsigned int face_index;
for (const auto &cell : triangulation.active_cell_iterators())
- for (unsigned int f = 0; f < GeometryInfo<2>::faces_per_cell; ++f)
+ for (unsigned int f : GeometryInfo<2>::face_indices())
if (cell->face(f)->at_boundary())
{
// get global face and vertex indices