this->interface_constraints.reinit((1 << (dim - 1)) * this->dofs_per_face,
this->dofs_per_face);
unsigned int target_row = 0;
- for (unsigned int d = 0; d < face_embeddings.size(); ++d)
- for (unsigned int i = 0; i < face_embeddings[d].m(); ++i)
+ for (const auto &face_embedding : face_embeddings)
+ for (unsigned int i = 0; i < face_embedding.m(); ++i)
{
- for (unsigned int j = 0; j < face_embeddings[d].n(); ++j)
- this->interface_constraints(target_row, j) = face_embeddings[d](i, j);
+ for (unsigned int j = 0; j < face_embedding.n(); ++j)
+ this->interface_constraints(target_row, j) = face_embedding(i, j);
++target_row;
}
}
dof_handler.get_triangulation().n_vertices(), false);
// Mark vertices that belong to cells in subdomain 1
- for (auto cell : dof_handler.active_cell_iterators())
+ for (const auto &cell : dof_handler.active_cell_iterators())
if (predicate_1(cell)) // True ==> part of subdomain 1
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
++v)
vertices_subdomain_1[cell->vertex_index(v)] = true;
// Find if cells in subdomain 2 and subdomain 1 share vertices.
- for (auto cell : dof_handler.active_cell_iterators())
+ for (const auto &cell : dof_handler.active_cell_iterators())
if (predicate_2(cell)) // True ==> part of subdomain 2
for (unsigned int v = 0; v < GeometryInfo<dim>::vertices_per_cell;
++v)
* of predicates active in the given cell.
*/
unsigned int map_index = 0;
- for (auto cell : dof_handler.active_cell_iterators())
+ for (const auto &cell : dof_handler.active_cell_iterators())
{
// set default FE index ==> no enrichment and no active predicates
cell->set_active_fe_index(0);
*/
// loop through faces
- for (auto cell : dof_handler.active_cell_iterators())
+ for (const auto &cell : dof_handler.active_cell_iterators())
{
const unsigned int fe_index = cell->active_fe_index();
const std::set<unsigned int> fe_set = fe_sets.at(fe_index);
// loop through color sets and create FE_enriched element for each
// of them provided before calling this function, we have color
// enrichment function associated with each color.
- for (unsigned int color_set_id = 0; color_set_id < fe_sets.size();
- ++color_set_id)
+ for (const auto &fe_set : fe_sets)
{
std::vector<const FiniteElement<dim, spacedim> *> vec_fe_enriched(
n_colors, &fe_nothing);
const typename Triangulation<dim, spacedim>::cell_iterator &)>>>
functions(n_colors, {dummy_function});
- for (const auto it : fe_sets[color_set_id])
+ for (const unsigned int color_id : fe_set)
{
- // Given a color id ( = it), corresponding color enrichment
+ // Given a color id, corresponding color enrichment
// function is at index id-1 because color_enrichments are
// indexed from zero and colors are indexed from 1.
- const unsigned int ind = it - 1;
+ const unsigned int ind = color_id - 1;
AssertIndexRange(ind, vec_fe_enriched.size());
AssertIndexRange(ind, functions.size());
for (unsigned int child = 0;
child < GeometryInfo<dim - 1>::max_children_per_cell;
++child)
- for (unsigned int i = 0; i < inner_points.size(); ++i)
+ for (const auto &inner_point : inner_points)
constraint_points.push_back(
- GeometryInfo<dim - 1>::child_to_cell_coordinates(inner_points[i],
+ GeometryInfo<dim - 1>::child_to_cell_coordinates(inner_point,
child));
}
Assert(false, ExcNotImplemented());
}
- for (unsigned int i = 0; i < base_identities.size(); ++i)
- identities.emplace_back(base_identities[i].first + dof_offset,
- base_identities[i].second +
- dof_offset_other);
+ for (const auto &base_identity : base_identities)
+ identities.emplace_back(base_identity.first + dof_offset,
+ base_identity.second + dof_offset_other);
// record the dofs treated above as already taken care of
dof_offset += base.template n_dofs_per_object<structdim>();
k) = base_table.first(c, ind.second);
}
for (unsigned int r = 0; r < element_multiplicity; ++r)
- for (unsigned int c = 0; c < base_table.second.size(); ++c)
+ for (const unsigned int c : base_table.second)
components.push_back(
- comp + r * this->base_elements[i].first->n_components() +
- base_table.second[c]);
+ comp + r * this->base_elements[i].first->n_components() + c);
}
AssertDimension(components.size(), constant_modes.n_rows());
return std::pair<Table<2, bool>, std::vector<unsigned int>>(constant_modes,
Point<2>(t2, s_t2)};
// then transform these points to real coordinates by rotating,
// scaling and shifting
- for (unsigned int i = 0; i < 2; ++i)
+ for (const auto &new_unit_point : new_unit_points)
{
- Point<2> real_point(std::cos(alpha) * new_unit_points[i][0] -
- std::sin(alpha) * new_unit_points[i][1],
- std::sin(alpha) * new_unit_points[i][0] +
- std::cos(alpha) * new_unit_points[i][1]);
+ Point<2> real_point(std::cos(alpha) * new_unit_point[0] -
+ std::sin(alpha) * new_unit_point[1],
+ std::sin(alpha) * new_unit_point[0] +
+ std::cos(alpha) * new_unit_point[1]);
real_point *= h;
real_point += line->vertex(0);
a.push_back(real_point);