]> https://gitweb.dealii.org/ - dealii.git/commitdiff
avoid deprecated function 14585/head
authorTimo Heister <timo.heister@gmail.com>
Mon, 19 Dec 2022 14:44:47 +0000 (09:44 -0500)
committerTimo Heister <timo.heister@gmail.com>
Mon, 19 Dec 2022 19:07:10 +0000 (14:07 -0500)
tests/quick_tests/step.cc

index 0cc0f7f0294ab7dab99d70ef9549ac9cfec9fbe4..12495f2cee52f0dc12c389b0310f19447137f4b1 100644 (file)
@@ -108,19 +108,15 @@ LaplaceProblem<dim>::setup_system()
   solution.reinit(dof_handler.n_dofs());
   system_rhs.reinit(dof_handler.n_dofs());
 
-  std::vector<bool> boundary_dofs(dof_handler.n_dofs(), false);
-  DoFTools::extract_boundary_dofs(dof_handler,
-                                  std::vector<bool>(1, true),
-                                  boundary_dofs);
+  IndexSet boundary_dofs =
+    DoFTools::extract_boundary_dofs(dof_handler, std::vector<bool>(1, true));
 
-  const unsigned int first_boundary_dof =
-    std::distance(boundary_dofs.begin(),
-                  std::find(boundary_dofs.begin(), boundary_dofs.end(), true));
+  const types::global_dof_index first_boundary_dof = *boundary_dofs.begin();
 
   mean_value_constraints.clear();
   mean_value_constraints.add_line(first_boundary_dof);
   for (unsigned int i = first_boundary_dof + 1; i < dof_handler.n_dofs(); ++i)
-    if (boundary_dofs[i] == true)
+    if (boundary_dofs.is_element(i))
       mean_value_constraints.add_entry(first_boundary_dof, i, -1);
   mean_value_constraints.close();
 

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.