From d14d0397d6c76e9a7a0c95abe1268183a1f65499 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Wed, 4 May 2022 22:43:33 +0200 Subject: [PATCH] Use renumbering of DoFs for step-37 benchmark --- tests/performance/timing_step_37.cc | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/performance/timing_step_37.cc b/tests/performance/timing_step_37.cc index e901033bb8..e63057b32a 100644 --- a/tests/performance/timing_step_37.cc +++ b/tests/performance/timing_step_37.cc @@ -34,6 +34,7 @@ #include #include +#include #include #include @@ -412,6 +413,35 @@ LaplaceProblem::setup_dofs() VectorTools::interpolate_boundary_values( mapping, dof_handler, 0, Functions::ZeroFunction(), constraints); constraints.close(); + + // Renumber DoFs + typename MatrixFree::AdditionalData additional_data; + additional_data.tasks_parallel_scheme = + MatrixFree::AdditionalData::none; + + std::set dirichlet_boundary; + dirichlet_boundary.insert(0); + mg_constrained_dofs.initialize(dof_handler); + mg_constrained_dofs.make_zero_boundary_constraints(dof_handler, + dirichlet_boundary); + + for (unsigned int level = 0; level < triangulation.n_global_levels(); ++level) + { + IndexSet relevant_dofs; + DoFTools::extract_locally_relevant_level_dofs(dof_handler, + level, + relevant_dofs); + AffineConstraints level_constraints; + level_constraints.reinit(relevant_dofs); + level_constraints.add_lines( + mg_constrained_dofs.get_boundary_indices(level)); + level_constraints.close(); + additional_data.mg_level = level; + + DoFRenumbering::matrix_free_data_locality(dof_handler, + level_constraints, + additional_data); + } } -- 2.39.5