Skip to content

Commit

Permalink
Simplify step-48 a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
bangerth committed Sep 22, 2023
1 parent 46f530f commit 5c81fa4
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions examples/step-48/step-48.cc
Original file line number Diff line number Diff line change
Expand Up @@ -375,31 +375,21 @@ namespace Step48
GridGenerator::hyper_cube(triangulation, -15, 15);
triangulation.refine_global(n_global_refinements);
{
typename Triangulation<dim>::active_cell_iterator
cell = triangulation.begin_active(),
end_cell = triangulation.end();
for (; cell != end_cell; ++cell)
for (const auto &cell : triangulation.active_cell_iterator())
if (cell->is_locally_owned())
if (cell->center().norm() < 11)
cell->set_refine_flag();
triangulation.execute_coarsening_and_refinement();

cell = triangulation.begin_active();
end_cell = triangulation.end();
for (; cell != end_cell; ++cell)
for (const auto &cell : triangulation.active_cell_iterator())
if (cell->is_locally_owned())
if (cell->center().norm() < 6)
cell->set_refine_flag();
triangulation.execute_coarsening_and_refinement();
}

pcout << " Number of global active cells: "
#ifdef DEAL_II_WITH_P4EST
<< triangulation.n_global_active_cells()
#else
<< triangulation.n_active_cells()
#endif
<< std::endl;
<< triangulation.n_global_active_cells() << std::endl;

dof_handler.distribute_dofs(fe);

Expand Down

0 comments on commit 5c81fa4

Please sign in to comment.