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

Simplify step-48 a bit. #16033

Merged
merged 1 commit into from
Sep 22, 2023
Merged
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
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_iterators())
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_iterators())
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;
Comment on lines -397 to +392
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is now available in the base class (and virtual so that the parallel class can overload it).


dof_handler.distribute_dofs(fe);

Expand Down