From 1bf2698f4495b02ff4e9816258c2fb3584a32a0c Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 30 Mar 2021 21:32:39 -0600 Subject: [PATCH] Simplify step-15 with the new function. --- examples/step-15/step-15.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/step-15/step-15.cc b/examples/step-15/step-15.cc index 5a8b673d11..fc9a07fcba 100644 --- a/examples/step-15/step-15.cc +++ b/examples/step-15/step-15.cc @@ -541,17 +541,15 @@ namespace Step15 // thing on every cell and so we didn't not want to deal with the question // of whether a particular degree of freedom sits at the boundary in the // integration above. Rather, we will simply set to zero these entries - // after the fact. To this end, we first need to determine which degrees + // after the fact. To this end, we need to determine which degrees // of freedom do in fact belong to the boundary and then loop over all of // those and set the residual entry to zero. This happens in the following - // lines which we have already seen used in step-11: + // lines which we have already seen used in step-11, using the appropriate + // function from namespace DoFTools: hanging_node_constraints.condense(residual); - IndexSet boundary_dofs(dof_handler.n_dofs()); - DoFTools::extract_boundary_dofs(dof_handler, - ComponentMask(), - boundary_dofs); - for (types::global_dof_index i : boundary_dofs) + for (types::global_dof_index i : + DoFTools::extract_boundary_dofs(dof_handler)) residual(i) = 0; // At the end of the function, we return the norm of the residual: -- 2.39.5