Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use range-based for loops. #5265

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ namespace aspect
// magnitude, and the face area.
for (const auto &cell : this->get_dof_handler().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 : cell->face_indices())
for (const auto current_boundary_id : boundary_indicators)
if (cell->face(f)->at_boundary() && cell->face(f)->boundary_id() == current_boundary_id)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,13 @@ namespace aspect
// We only want the output at the top boundary, so only compute it if the current cell
// has a face at the top boundary.
bool cell_at_top_boundary = false;
for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
for (const unsigned int f : cell->face_indices())
if (cell->at_boundary(f) &&
(this->get_geometry_model().translate_id_to_symbol_name (cell->face(f)->boundary_id()) == "top"))
cell_at_top_boundary = true;
{
cell_at_top_boundary = true;
break;
}

if (cell_at_top_boundary)
for (unsigned int q=0; q<computed_quantities.size(); ++q)
Expand Down