Skip to content

Commit

Permalink
Add a comment and move if statements into braces
Browse files Browse the repository at this point in the history
  • Loading branch information
kronbichler committed May 31, 2022
1 parent f75b433 commit bedf652
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions include/deal.II/matrix_free/hanging_nodes_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,13 +381,20 @@ namespace internal
// on a level coarser than the finest one.
bool all_cells_on_same_level = true;
for (const auto &cell : triangulation.active_cell_iterators())
if (cell->level() == static_cast<int>(triangulation.n_levels()) - 1)
break;
else if (!cell->is_artificial())
{
all_cells_on_same_level = false;
{
// If we reached the finest level and still not found a
// non-artificial cell, we do not have cells on different level, and
// hence we can stop.
if (cell->level() == static_cast<int>(triangulation.n_levels()) - 1)
break;
}
else if (!cell->is_artificial())
{
// We found a cell that has not triggered the other `if` above,
// so we are a level coarser than other cells
all_cells_on_same_level = false;
break;
}
}
if (all_cells_on_same_level)
return;

Expand Down

0 comments on commit bedf652

Please sign in to comment.