From 8642af6c9f7b3708ea36a38862df10071a004873 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 30 Mar 2021 19:52:17 -0600 Subject: [PATCH] Minor updates to step-15. --- examples/step-15/step-15.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/step-15/step-15.cc b/examples/step-15/step-15.cc index eeab634d80..87c6c94e30 100644 --- a/examples/step-15/step-15.cc +++ b/examples/step-15/step-15.cc @@ -557,13 +557,12 @@ namespace Step15 // lines which we have already seen used in step-11: hanging_node_constraints.condense(residual); - std::vector boundary_dofs(dof_handler.n_dofs()); + IndexSet boundary_dofs(dof_handler.n_dofs()); DoFTools::extract_boundary_dofs(dof_handler, ComponentMask(), boundary_dofs); - for (unsigned int i = 0; i < dof_handler.n_dofs(); ++i) - if (boundary_dofs[i] == true) - residual(i) = 0; + for (types::global_dof_index i : boundary_dofs) + residual(i) = 0; // At the end of the function, we return the norm of the residual: return residual.l2_norm(); @@ -611,7 +610,7 @@ namespace Step15 GridGenerator::hyper_ball(triangulation); triangulation.refine_global(2); - setup_system(true); + setup_system(/*first time=*/true); set_boundary_values(); // The Newton iteration starts next. During the first step we do not have -- 2.39.5