]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Minor updates to step-15. 11985/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 31 Mar 2021 01:52:17 +0000 (19:52 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 31 Mar 2021 01:53:22 +0000 (19:53 -0600)
examples/step-15/step-15.cc

index eeab634d80074057346dcb1f14bbb788340ead67..87c6c94e301716b01bd21a9f8b698e16883380db 100644 (file)
@@ -557,13 +557,12 @@ namespace Step15
     // lines which we have already seen used in step-11:
     hanging_node_constraints.condense(residual);
 
-    std::vector<bool> 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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.