From b25d145ca499784801987fbc0b48b0d38510519b Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 27 Jan 2020 15:40:14 -0700 Subject: [PATCH] Avoid use of deprecated DoFTools functions in tests/. --- .../step-44-helper_res_lin_01.h | 5 +-- .../step-44-helper_scalar_01.h | 5 +-- .../step-44-helper_var_form_01.h | 5 +-- .../step-44-helper_vector_01.h | 5 +-- tests/adolc/step-44.cc | 5 +-- tests/bits/anna_3.cc | 12 +++--- tests/bits/anna_6.cc | 4 +- tests/bits/count_dofs_per_block_01.cc | 24 ++++++------ tests/bits/count_dofs_per_block_02.cc | 24 ++++++------ tests/bits/count_dofs_per_component_hp_01.cc | 8 ++-- tests/bits/count_dofs_per_component_hp_02.cc | 4 +- .../count_dofs_per_block_01.cc | 6 +-- .../count_dofs_per_component_01.cc | 6 +-- .../hp_count_dofs_per_block_01.cc | 6 +-- .../hp_count_dofs_per_component_01.cc | 6 +-- tests/dofs/dof_tools_00a.cc | 39 +++++++++---------- tests/dofs/dof_tools_01c.cc | 4 +- tests/dofs/dof_tools_01d.cc | 6 +-- tests/dofs/dof_tools_02c.cc | 6 +-- tests/dofs/dof_tools_02d.cc | 6 +-- tests/dofs/dof_tools_04.cc | 10 ++--- tests/dofs/dof_tools_04a.cc | 11 +++--- tests/dofs/dof_tools_07.cc | 7 ++-- tests/dofs/dof_tools_17c.cc | 4 +- tests/dofs/dof_tools_17d.cc | 6 +-- tests/dofs/dof_tools_18c.cc | 4 +- tests/dofs/dof_tools_18d.cc | 6 +-- tests/dofs/extract_dofs_by_component_05.cc | 6 +-- tests/dofs/extract_dofs_by_component_05_hp.cc | 6 +-- tests/dofs/extract_dofs_by_component_06.cc | 6 +-- tests/dofs/extract_dofs_by_component_06_hp.cc | 6 +-- tests/examples/step-56.cc | 6 +-- tests/fe/fe_q_dg0.cc | 6 +-- tests/fe/fe_values_view_21.cc | 4 +- tests/fe/fe_values_view_21_nonsymmetric.cc | 4 +- tests/fe/fe_values_view_22.cc | 4 +- tests/fe/fe_values_view_tensor_01.cc | 4 +- tests/gla/block_mat_02.cc | 12 ++---- tests/gla/block_mat_03.cc | 12 +++--- tests/hp/count_dofs_per_block_01.cc | 24 ++++++------ tests/hp/count_dofs_per_block_02.cc | 24 ++++++------ tests/hp/fe_nothing_18.cc | 3 +- tests/hp/solution_transfer_15.cc | 6 +-- tests/lac/block_linear_operator_01.cc | 4 +- tests/lac/block_linear_operator_02.cc | 4 +- tests/lac/block_linear_operator_06.cc | 4 +- tests/lac/constraints_block_01.cc | 8 +--- tests/lac/linear_operator_03.cc | 4 +- tests/lac/linear_operator_13.cc | 3 +- tests/lac/linear_operator_14.cc | 3 +- tests/lac/schur_complement_03.cc | 6 +-- tests/matrix_free/copy_feevaluation.cc | 6 +-- tests/matrix_free/matrix_vector_stokes.cc | 4 +- .../matrix_free/matrix_vector_stokes_base.cc | 4 +- .../matrix_free/matrix_vector_stokes_flux.cc | 6 +-- .../matrix_vector_stokes_noflux.cc | 6 +-- .../matrix_vector_stokes_notempl.cc | 6 +-- .../matrix_free/matrix_vector_stokes_qdg0.cc | 4 +- .../matrix_free/matrix_vector_stokes_qdg0b.cc | 4 +- tests/mpi/count_dofs_per_block_01.cc | 6 +-- tests/mpi/count_dofs_per_block_02.cc | 6 +-- tests/mpi/count_dofs_per_component_01.cc | 6 +-- tests/mpi/muelu_periodicity.cc | 6 +-- .../parallel_vector_back_interpolate_02.cc | 4 +- tests/mpi/periodicity_02.cc | 6 +-- tests/mpi/periodicity_03.cc | 6 +-- tests/mpi/project_bv_div_conf.cc | 6 +-- tests/mpi/solution_transfer_03.cc | 6 +-- tests/multigrid/transfer_block.cc | 5 ++- tests/multigrid/transfer_block_select.cc | 4 +- tests/multigrid/transfer_compare_01.cc | 4 +- tests/multigrid/transfer_select.cc | 9 +++-- tests/multigrid/transfer_system_05.cc | 6 +-- .../multigrid/transfer_system_adaptive_09.cc | 6 +-- tests/numerics/point_value_history_02.cc | 2 +- tests/optimization/step-44.h | 5 +-- ...-standard_tensors-material_push_forward.cc | 5 +-- .../step-44-standard_tensors-spatial.cc | 5 +-- tests/physics/step-44.cc | 5 +-- tests/quick_tests/p4est.cc | 8 ++-- tests/trilinos/assemble_matrix_parallel_04.cc | 4 +- tests/trilinos/assemble_matrix_parallel_06.cc | 4 +- .../trilinos/trilinos_sparsity_pattern_02.cc | 6 +-- tests/umfpack/umfpack_04.cc | 4 +- 84 files changed, 268 insertions(+), 309 deletions(-) diff --git a/tests/ad_common_tests/step-44-helper_res_lin_01.h b/tests/ad_common_tests/step-44-helper_res_lin_01.h index 68b1842b94..0016072141 100644 --- a/tests/ad_common_tests/step-44-helper_res_lin_01.h +++ b/tests/ad_common_tests/step-44-helper_res_lin_01.h @@ -866,9 +866,8 @@ namespace Step44 dof_handler_ref.distribute_dofs(fe); DoFRenumbering::Cuthill_McKee(dof_handler_ref); DoFRenumbering::component_wise(dof_handler_ref, block_component); - DoFTools::count_dofs_per_block(dof_handler_ref, - dofs_per_block, - block_component); + dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler_ref, block_component); std::cout << "Triangulation:" << "\n\t Number of active cells: " << triangulation.n_active_cells() diff --git a/tests/ad_common_tests/step-44-helper_scalar_01.h b/tests/ad_common_tests/step-44-helper_scalar_01.h index 51378aae85..7117e17973 100644 --- a/tests/ad_common_tests/step-44-helper_scalar_01.h +++ b/tests/ad_common_tests/step-44-helper_scalar_01.h @@ -1269,9 +1269,8 @@ namespace Step44 dof_handler_ref.distribute_dofs(fe); DoFRenumbering::Cuthill_McKee(dof_handler_ref); DoFRenumbering::component_wise(dof_handler_ref, block_component); - DoFTools::count_dofs_per_block(dof_handler_ref, - dofs_per_block, - block_component); + dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler_ref, block_component); std::cout << "Triangulation:" << "\n\t Number of active cells: " << triangulation.n_active_cells() diff --git a/tests/ad_common_tests/step-44-helper_var_form_01.h b/tests/ad_common_tests/step-44-helper_var_form_01.h index b633cf479b..4921d1f4be 100644 --- a/tests/ad_common_tests/step-44-helper_var_form_01.h +++ b/tests/ad_common_tests/step-44-helper_var_form_01.h @@ -832,9 +832,8 @@ namespace Step44 dof_handler_ref.distribute_dofs(fe); DoFRenumbering::Cuthill_McKee(dof_handler_ref); DoFRenumbering::component_wise(dof_handler_ref, block_component); - DoFTools::count_dofs_per_block(dof_handler_ref, - dofs_per_block, - block_component); + dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler_ref, block_component); std::cout << "Triangulation:" << "\n\t Number of active cells: " << triangulation.n_active_cells() diff --git a/tests/ad_common_tests/step-44-helper_vector_01.h b/tests/ad_common_tests/step-44-helper_vector_01.h index 2085055768..d3f34e496d 100644 --- a/tests/ad_common_tests/step-44-helper_vector_01.h +++ b/tests/ad_common_tests/step-44-helper_vector_01.h @@ -867,9 +867,8 @@ namespace Step44 dof_handler_ref.distribute_dofs(fe); DoFRenumbering::Cuthill_McKee(dof_handler_ref); DoFRenumbering::component_wise(dof_handler_ref, block_component); - DoFTools::count_dofs_per_block(dof_handler_ref, - dofs_per_block, - block_component); + dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler_ref, block_component); std::cout << "Triangulation:" << "\n\t Number of active cells: " << triangulation.n_active_cells() diff --git a/tests/adolc/step-44.cc b/tests/adolc/step-44.cc index a89b71c0a8..0769b9eac9 100644 --- a/tests/adolc/step-44.cc +++ b/tests/adolc/step-44.cc @@ -1104,9 +1104,8 @@ namespace Step44 dof_handler_ref.distribute_dofs(fe); DoFRenumbering::Cuthill_McKee(dof_handler_ref); DoFRenumbering::component_wise(dof_handler_ref, block_component); - DoFTools::count_dofs_per_block(dof_handler_ref, - dofs_per_block, - block_component); + dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler_ref, block_component); std::cout << "Triangulation:" << "\n\t Number of active cells: " << triangulation.n_active_cells() diff --git a/tests/bits/anna_3.cc b/tests/bits/anna_3.cc index 56fb5fa7da..909fc7a9e6 100644 --- a/tests/bits/anna_3.cc +++ b/tests/bits/anna_3.cc @@ -16,7 +16,7 @@ // check some things about Nedelec elements, here that -// DoFTools::component_select and DoFTools::count_dofs_per_component +// DoFTools::component_select and DoFTools::count_dofs_per_fe_component // works // // this program is a modified version of one by Anna Schneebeli, @@ -91,17 +91,17 @@ SystemTest::check() { deallog << "Checking for component " << c << std::endl; std::vector x(fe.n_components(), false); - x[c] = true; - IndexSet sel = DoFTools::extract_dofs(dof_handler, ComponentMask(x)); + x[c] = true; + const IndexSet sel = + DoFTools::extract_dofs(dof_handler, ComponentMask(x)); for (unsigned int i = 0; i < sel.size(); ++i) if (sel.is_element(i)) deallog << " DoF " << i << std::endl; }; - std::vector dofs_per_component( - fe.n_components(), static_cast(0)); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_component); + const std::vector dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler); deallog << "DoFs per component: "; for (unsigned int i = 0; i < fe.n_components(); ++i) deallog << dofs_per_component[i] << ' '; diff --git a/tests/bits/anna_6.cc b/tests/bits/anna_6.cc index b0850182d0..80391b5e15 100644 --- a/tests/bits/anna_6.cc +++ b/tests/bits/anna_6.cc @@ -154,8 +154,8 @@ void ImposeBC::get_ready() { dof_handler.distribute_dofs(fe); - std::vector dofs_per_comp(fe.n_components()); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_comp); + const std::vector dofs_per_comp = + DoFTools::count_dofs_per_fe_component(dof_handler); // For an FESystem with Nedelec-elements as // first component and bilinear elements as diff --git a/tests/bits/count_dofs_per_block_01.cc b/tests/bits/count_dofs_per_block_01.cc index a56a1c1d60..1181ca3fda 100644 --- a/tests/bits/count_dofs_per_block_01.cc +++ b/tests/bits/count_dofs_per_block_01.cc @@ -75,14 +75,14 @@ check() // no grouping { - std::vector dpc(dim + 1); - DoFTools::count_dofs_per_component(dof_handler, dpc); + const std::vector dpc = + DoFTools::count_dofs_per_fe_component(dof_handler); print(dpc); } { - std::vector dpc(dim + 1); - DoFTools::count_dofs_per_block(dof_handler, dpc); + const std::vector dpc = + DoFTools::count_dofs_per_fe_block(dof_handler); print(dpc); } @@ -92,8 +92,8 @@ check() { std::vector group(dim + 1, 0); group[dim] = 1; - std::vector dpc(2); - DoFTools::count_dofs_per_component(dof_handler, dpc, false, group); + const std::vector dpc = + DoFTools::count_dofs_per_fe_component(dof_handler, false, group); Assert(dpc.size() == 2, ExcInternalError()); print(dpc); } @@ -101,8 +101,8 @@ check() { std::vector group(dim + 1, 0); group[dim] = 1; - std::vector dpc(2); - DoFTools::count_dofs_per_block(dof_handler, dpc, group); + const std::vector dpc = + DoFTools::count_dofs_per_fe_block(dof_handler, group); Assert(dpc.size() == 2, ExcInternalError()); print(dpc); } @@ -112,8 +112,8 @@ check() { std::vector group(dim + 1, 2 * dim); group[dim] = 0; - std::vector dpc(2 * dim + 1); - DoFTools::count_dofs_per_component(dof_handler, dpc, false, group); + const std::vector dpc = + DoFTools::count_dofs_per_fe_component(dof_handler, false, group); Assert(dpc.size() == 2 * dim + 1, ExcInternalError()); print(dpc); } @@ -121,8 +121,8 @@ check() { std::vector group(dim + 1, 2 * dim); group[dim] = 0; - std::vector dpc(2 * dim + 1); - DoFTools::count_dofs_per_block(dof_handler, dpc, group); + const std::vector dpc = + DoFTools::count_dofs_per_fe_block(dof_handler, group); Assert(dpc.size() == 2 * dim + 1, ExcInternalError()); print(dpc); } diff --git a/tests/bits/count_dofs_per_block_02.cc b/tests/bits/count_dofs_per_block_02.cc index 19e17106e4..f4a556ce01 100644 --- a/tests/bits/count_dofs_per_block_02.cc +++ b/tests/bits/count_dofs_per_block_02.cc @@ -73,14 +73,14 @@ check() // no grouping { - std::vector dpc(dim + 1); - DoFTools::count_dofs_per_component(dof_handler, dpc); + const std::vector dpc = + DoFTools::count_dofs_per_fe_component(dof_handler); print(dpc); } { - std::vector dpc(2); - DoFTools::count_dofs_per_block(dof_handler, dpc); + const std::vector dpc = + DoFTools::count_dofs_per_fe_block(dof_handler); print(dpc); } @@ -90,8 +90,8 @@ check() { std::vector group(dim + 1, 0); group[dim] = 1; - std::vector dpc(2); - DoFTools::count_dofs_per_component(dof_handler, dpc, false, group); + const std::vector dpc = + DoFTools::count_dofs_per_fe_component(dof_handler, false, group); Assert(dpc.size() == 2, ExcInternalError()); print(dpc); } @@ -99,8 +99,8 @@ check() { std::vector group(2, 0); group[1] = 1; - std::vector dpc(2); - DoFTools::count_dofs_per_block(dof_handler, dpc, group); + const std::vector dpc = + DoFTools::count_dofs_per_fe_block(dof_handler, group); Assert(dpc.size() == 2, ExcInternalError()); print(dpc); } @@ -110,8 +110,8 @@ check() { std::vector group(dim + 1, 2 * dim); group[dim] = 0; - std::vector dpc(2 * dim + 1); - DoFTools::count_dofs_per_component(dof_handler, dpc, false, group); + const std::vector dpc = + DoFTools::count_dofs_per_fe_component(dof_handler, false, group); Assert(dpc.size() == 2 * dim + 1, ExcInternalError()); print(dpc); } @@ -119,8 +119,8 @@ check() { std::vector group(2, 2 * dim); group[1] = 0; - std::vector dpc(2 * dim + 1); - DoFTools::count_dofs_per_block(dof_handler, dpc, group); + const std::vector dpc = + DoFTools::count_dofs_per_fe_block(dof_handler, group); Assert(dpc.size() == 2 * dim + 1, ExcInternalError()); print(dpc); } diff --git a/tests/bits/count_dofs_per_component_hp_01.cc b/tests/bits/count_dofs_per_component_hp_01.cc index 97095f1c84..ab34c4addd 100644 --- a/tests/bits/count_dofs_per_component_hp_01.cc +++ b/tests/bits/count_dofs_per_component_hp_01.cc @@ -61,10 +61,10 @@ test() dof_handler.distribute_dofs(fe_system); // count dofs per component and show them on the screen - std::vector dofs_per_component(3, 0); - std::vector dofs_per_component_hp(3, 0); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_component); - DoFTools::count_dofs_per_component(hp_dof_handler, dofs_per_component_hp); + const std::vector dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler); + const std::vector dofs_per_component_hp = + DoFTools::count_dofs_per_fe_component(hp_dof_handler); for (unsigned int i = 0; i < 3; i++) { diff --git a/tests/bits/count_dofs_per_component_hp_02.cc b/tests/bits/count_dofs_per_component_hp_02.cc index 267b8482dd..ceb9a267b9 100644 --- a/tests/bits/count_dofs_per_component_hp_02.cc +++ b/tests/bits/count_dofs_per_component_hp_02.cc @@ -68,8 +68,8 @@ test() hp_dof_handler.distribute_dofs(fe_collection); // count dofs per component and show them on the screen - std::vector dofs_per_component_hp(3, 0); - DoFTools::count_dofs_per_component(hp_dof_handler, dofs_per_component_hp); + const std::vector dofs_per_component_hp = + DoFTools::count_dofs_per_fe_component(hp_dof_handler); for (unsigned int i = 0; i < 3; i++) { diff --git a/tests/distributed_grids/count_dofs_per_block_01.cc b/tests/distributed_grids/count_dofs_per_block_01.cc index b191ee1c0b..3c40cd8c01 100644 --- a/tests/distributed_grids/count_dofs_per_block_01.cc +++ b/tests/distributed_grids/count_dofs_per_block_01.cc @@ -15,7 +15,7 @@ -// Test DoFTools::count_dofs_per_block +// Test DoFTools::count_dofs_per_fe_block #include @@ -90,8 +90,8 @@ test() triangulation.execute_coarsening_and_refinement(); dof_handler.distribute_dofs(fe); - std::vector dofs_per_block(fe.n_components()); - DoFTools::count_dofs_per_block(dof_handler, dofs_per_block); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler); AssertThrow(std::accumulate(dofs_per_block.begin(), dofs_per_block.end(), diff --git a/tests/distributed_grids/count_dofs_per_component_01.cc b/tests/distributed_grids/count_dofs_per_component_01.cc index db55074fbf..b35a66f074 100644 --- a/tests/distributed_grids/count_dofs_per_component_01.cc +++ b/tests/distributed_grids/count_dofs_per_component_01.cc @@ -15,7 +15,7 @@ -// Test DoFTools::count_dofs_per_component +// Test DoFTools::count_dofs_per_fe_component #include @@ -55,8 +55,8 @@ test() triangulation.refine_global(2); dof_handler.distribute_dofs(fe); - std::vector dofs_per_component(fe.n_components()); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_component); + const std::vector dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler); Assert(std::accumulate(dofs_per_component.begin(), dofs_per_component.end(), diff --git a/tests/distributed_grids/hp_count_dofs_per_block_01.cc b/tests/distributed_grids/hp_count_dofs_per_block_01.cc index 5e1bee7fa0..4fc125149b 100644 --- a/tests/distributed_grids/hp_count_dofs_per_block_01.cc +++ b/tests/distributed_grids/hp_count_dofs_per_block_01.cc @@ -15,7 +15,7 @@ -// Test DoFTools::count_dofs_per_block +// Test DoFTools::count_dofs_per_fe_block // // like the test without the hp_ prefix, but for hp::DoFHandler @@ -98,8 +98,8 @@ test() triangulation.execute_coarsening_and_refinement(); dof_handler.distribute_dofs(fe); - std::vector dofs_per_block(fe.n_components()); - DoFTools::count_dofs_per_block(dof_handler, dofs_per_block); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler); AssertThrow(std::accumulate(dofs_per_block.begin(), dofs_per_block.end(), diff --git a/tests/distributed_grids/hp_count_dofs_per_component_01.cc b/tests/distributed_grids/hp_count_dofs_per_component_01.cc index c7cb8c4065..280ccd8a68 100644 --- a/tests/distributed_grids/hp_count_dofs_per_component_01.cc +++ b/tests/distributed_grids/hp_count_dofs_per_component_01.cc @@ -15,7 +15,7 @@ -// Test DoFTools::count_dofs_per_component +// Test DoFTools::count_dofs_per_fe_component // // like the test without the hp_ prefix, but for hp::DoFHandler @@ -63,8 +63,8 @@ test() triangulation.refine_global(2); dof_handler.distribute_dofs(fe); - std::vector dofs_per_component(fe.n_components()); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_component); + const std::vector dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler); Assert(std::accumulate(dofs_per_component.begin(), dofs_per_component.end(), diff --git a/tests/dofs/dof_tools_00a.cc b/tests/dofs/dof_tools_00a.cc index 0033f5ddb8..d3787af7ff 100644 --- a/tests/dofs/dof_tools_00a.cc +++ b/tests/dofs/dof_tools_00a.cc @@ -32,14 +32,14 @@ check_this(const DoFHandlerType &dof_handler) deallog << "n_dofs:" << dof_handler.n_dofs() << std::endl; - std::vector dofs_per_component(n_components); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_component); + std::vector dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler); for (unsigned int i = 0; i < n_components; ++i) deallog << ' ' << dofs_per_component[i]; deallog << std::endl; - DoFTools::count_dofs_per_component(dof_handler, dofs_per_component, true); + dofs_per_component = DoFTools::count_dofs_per_fe_component(dof_handler, true); for (unsigned int i = 0; i < n_components; ++i) deallog << ' ' << dofs_per_component[i]; @@ -48,21 +48,20 @@ check_this(const DoFHandlerType &dof_handler) if (n_components > 1) { std::vector target_component(n_components, 0U); - dofs_per_component.resize(1); - DoFTools::count_dofs_per_component(dof_handler, - dofs_per_component, - false, - target_component); + dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler, + false, + target_component); for (unsigned int i = 0; i < std::min(n_components, (unsigned int)dofs_per_component.size()); ++i) deallog << ' ' << dofs_per_component[i]; deallog << std::endl; - DoFTools::count_dofs_per_component(dof_handler, - dofs_per_component, - true, - target_component); + dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler, + true, + target_component); for (unsigned int i = 0; i < std::min(n_components, (unsigned int)dofs_per_component.size()); ++i) @@ -73,19 +72,19 @@ check_this(const DoFHandlerType &dof_handler) target_component[i] = 1; dofs_per_component.resize(2); - DoFTools::count_dofs_per_component(dof_handler, - dofs_per_component, - false, - target_component); + dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler, + false, + target_component); for (unsigned int i = 0; i < std::min(n_components, (unsigned int)dofs_per_component.size()); ++i) deallog << ' ' << dofs_per_component[i]; deallog << std::endl; - DoFTools::count_dofs_per_component(dof_handler, - dofs_per_component, - true, - target_component); + dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler, + true, + target_component); for (unsigned int i = 0; i < std::min(n_components, (unsigned int)dofs_per_component.size()); ++i) diff --git a/tests/dofs/dof_tools_01c.cc b/tests/dofs/dof_tools_01c.cc index 7eac410894..778cc21c3c 100644 --- a/tests/dofs/dof_tools_01c.cc +++ b/tests/dofs/dof_tools_01c.cc @@ -43,8 +43,8 @@ check_this(const DoFHandlerType &dof_handler) // create sparsity pattern const unsigned int n_components = dof_handler.get_fe().n_components(); BlockSparsityPattern sp(n_components, n_components); - std::vector dofs_per_component(n_components); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_component); + const std::vector dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler); for (unsigned int i = 0; i < n_components; ++i) for (unsigned int j = 0; j < n_components; ++j) sp.block(i, j).reinit(dofs_per_component[i], diff --git a/tests/dofs/dof_tools_01d.cc b/tests/dofs/dof_tools_01d.cc index 94d067ed68..2f21c1ed00 100644 --- a/tests/dofs/dof_tools_01d.cc +++ b/tests/dofs/dof_tools_01d.cc @@ -42,9 +42,9 @@ check_this(const DoFHandlerType &dof_handler) // create sparsity pattern const unsigned int n_components = dof_handler.get_fe().n_components(); - BlockDynamicSparsityPattern sp(n_components, n_components); - std::vector dofs_per_component(n_components); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_component); + BlockDynamicSparsityPattern sp(n_components, n_components); + const std::vector dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler); for (unsigned int i = 0; i < n_components; ++i) for (unsigned int j = 0; j < n_components; ++j) sp.block(i, j).reinit(dofs_per_component[i], dofs_per_component[j]); diff --git a/tests/dofs/dof_tools_02c.cc b/tests/dofs/dof_tools_02c.cc index 40268cac5a..0d0b3349bf 100644 --- a/tests/dofs/dof_tools_02c.cc +++ b/tests/dofs/dof_tools_02c.cc @@ -51,9 +51,9 @@ check_this(const DoFHandlerType &dof_handler) return; // create sparsity pattern - BlockSparsityPattern sp(n_components, n_components); - std::vector dofs_per_component(n_components); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_component); + BlockSparsityPattern sp(n_components, n_components); + const std::vector dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler); for (unsigned int i = 0; i < n_components; ++i) for (unsigned int j = 0; j < n_components; ++j) sp.block(i, j).reinit(dofs_per_component[i], diff --git a/tests/dofs/dof_tools_02d.cc b/tests/dofs/dof_tools_02d.cc index 954316825b..2dbc131fe0 100644 --- a/tests/dofs/dof_tools_02d.cc +++ b/tests/dofs/dof_tools_02d.cc @@ -51,9 +51,9 @@ check_this(const DoFHandlerType &dof_handler) return; // create sparsity pattern - BlockDynamicSparsityPattern sp(n_components, n_components); - std::vector dofs_per_component(n_components); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_component); + BlockDynamicSparsityPattern sp(n_components, n_components); + const std::vector dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler); for (unsigned int i = 0; i < n_components; ++i) for (unsigned int j = 0; j < n_components; ++j) sp.block(i, j).reinit(dofs_per_component[i], dofs_per_component[j]); diff --git a/tests/dofs/dof_tools_04.cc b/tests/dofs/dof_tools_04.cc index 85ce2da32a..70a84a45af 100644 --- a/tests/dofs/dof_tools_04.cc +++ b/tests/dofs/dof_tools_04.cc @@ -29,20 +29,18 @@ check_this(const DoFHandlerType &dof_handler) { const types::global_dof_index n_dofs = dof_handler.n_dofs(); - std::vector hanging_node_dofs(n_dofs); - DoFTools::extract_hanging_node_dofs(dof_handler, hanging_node_dofs); + const IndexSet hanging_node_dofs = + DoFTools::extract_hanging_node_dofs(dof_handler); AffineConstraints constraints; DoFTools::make_hanging_node_constraints(dof_handler, constraints); constraints.close(); for (types::global_dof_index dof = 0; dof < n_dofs; ++dof) - if (hanging_node_dofs[dof]) + if (hanging_node_dofs.is_element(dof)) AssertThrow(constraints.is_constrained(dof), ExcInternalError()); - AssertThrow((unsigned int)std::count(hanging_node_dofs.begin(), - hanging_node_dofs.end(), - true) == constraints.n_constraints(), + AssertThrow(hanging_node_dofs.n_elements() == constraints.n_constraints(), ExcInternalError()); output_bool_vector(hanging_node_dofs); } diff --git a/tests/dofs/dof_tools_04a.cc b/tests/dofs/dof_tools_04a.cc index b3e347a404..e93b7e211b 100644 --- a/tests/dofs/dof_tools_04a.cc +++ b/tests/dofs/dof_tools_04a.cc @@ -53,20 +53,19 @@ check_this(const DoFHandler &dof_handler) IndexSet locally_relevant_dofs; DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs); - std::vector is_hanging_node_constrained(n_dofs); - DoFTools::extract_hanging_node_dofs(dof_handler, is_hanging_node_constrained); + const IndexSet is_hanging_node_constrained = + DoFTools::extract_hanging_node_dofs(dof_handler); AffineConstraints constraints(locally_relevant_dofs); DoFTools::make_hanging_node_constraints(dof_handler, constraints); constraints.close(); for (const auto &dof : locally_relevant_dofs) - if (is_hanging_node_constrained[dof]) + if (is_hanging_node_constrained.is_element(dof)) AssertThrow(constraints.is_constrained(dof), ExcInternalError()); - AssertThrow((unsigned int)(std::count(is_hanging_node_constrained.begin(), - is_hanging_node_constrained.end(), - true)) == constraints.n_constraints(), + AssertThrow(is_hanging_node_constrained.n_elements() == + constraints.n_constraints(), ExcInternalError()); deallog << "OK" << std::endl; diff --git a/tests/dofs/dof_tools_07.cc b/tests/dofs/dof_tools_07.cc index 0128961d87..e5c6182816 100644 --- a/tests/dofs/dof_tools_07.cc +++ b/tests/dofs/dof_tools_07.cc @@ -19,7 +19,7 @@ #include "dof_tools_common_fake_hp.h" // check -// DoFTools::count_dofs_per_component +// DoFTools::count_dofs_per_fe_component @@ -27,9 +27,8 @@ template void check_this(const DoFHandlerType &dof_handler) { - std::vector n_dofs( - dof_handler.get_fe().n_components()); - DoFTools::count_dofs_per_component(dof_handler, n_dofs); + const std::vector n_dofs = + DoFTools::count_dofs_per_fe_component(dof_handler); for (unsigned int i = 0; i < n_dofs.size(); ++i) deallog << n_dofs[i] << " "; deallog << std::endl; diff --git a/tests/dofs/dof_tools_17c.cc b/tests/dofs/dof_tools_17c.cc index 4b53b9aa51..460273bcef 100644 --- a/tests/dofs/dof_tools_17c.cc +++ b/tests/dofs/dof_tools_17c.cc @@ -43,8 +43,8 @@ check_this(const DoFHandlerType &dof_handler) // create sparsity pattern const unsigned int n_components = dof_handler.get_fe().n_components(); BlockSparsityPattern sp(n_components, n_components); - std::vector dofs_per_component(n_components); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_component); + const std::vector dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler); for (unsigned int i = 0; i < n_components; ++i) for (unsigned int j = 0; j < n_components; ++j) sp.block(i, j).reinit(dofs_per_component[i], diff --git a/tests/dofs/dof_tools_17d.cc b/tests/dofs/dof_tools_17d.cc index 682017f944..2742f8c41d 100644 --- a/tests/dofs/dof_tools_17d.cc +++ b/tests/dofs/dof_tools_17d.cc @@ -42,9 +42,9 @@ check_this(const DoFHandlerType &dof_handler) // create sparsity pattern const unsigned int n_components = dof_handler.get_fe().n_components(); - BlockDynamicSparsityPattern sp(n_components, n_components); - std::vector dofs_per_component(n_components); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_component); + BlockDynamicSparsityPattern sp(n_components, n_components); + const std::vector dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler); for (unsigned int i = 0; i < n_components; ++i) for (unsigned int j = 0; j < n_components; ++j) sp.block(i, j).reinit(dofs_per_component[i], dofs_per_component[j]); diff --git a/tests/dofs/dof_tools_18c.cc b/tests/dofs/dof_tools_18c.cc index 19f4ce600c..43c242aeb7 100644 --- a/tests/dofs/dof_tools_18c.cc +++ b/tests/dofs/dof_tools_18c.cc @@ -64,8 +64,8 @@ check_this(const DoFHandlerType &dof_handler) // create sparsity pattern const unsigned int n_components = dof_handler.get_fe().n_components(); BlockSparsityPattern sp(n_components, n_components); - std::vector dofs_per_component(n_components); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_component); + const std::vector dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler); for (unsigned int i = 0; i < n_components; ++i) for (unsigned int j = 0; j < n_components; ++j) sp.block(i, j).reinit(dofs_per_component[i], diff --git a/tests/dofs/dof_tools_18d.cc b/tests/dofs/dof_tools_18d.cc index 98680f0bba..83fb811a19 100644 --- a/tests/dofs/dof_tools_18d.cc +++ b/tests/dofs/dof_tools_18d.cc @@ -63,9 +63,9 @@ check_this(const DoFHandlerType &dof_handler) // create sparsity pattern const unsigned int n_components = dof_handler.get_fe().n_components(); - BlockDynamicSparsityPattern sp(n_components, n_components); - std::vector dofs_per_component(n_components); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_component); + BlockDynamicSparsityPattern sp(n_components, n_components); + const std::vector dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler); for (unsigned int i = 0; i < n_components; ++i) for (unsigned int j = 0; j < n_components; ++j) sp.block(i, j).reinit(dofs_per_component[i], dofs_per_component[j]); diff --git a/tests/dofs/extract_dofs_by_component_05.cc b/tests/dofs/extract_dofs_by_component_05.cc index 0eeb2bff95..e5a1938b16 100644 --- a/tests/dofs/extract_dofs_by_component_05.cc +++ b/tests/dofs/extract_dofs_by_component_05.cc @@ -20,7 +20,7 @@ // // this particular test checks the call path to // internal::extract_dofs_by_component from -// DoFTools::count_dofs_per_component with argument only_once=false +// DoFTools::count_dofs_per_fe_component with argument only_once=false #include @@ -59,8 +59,8 @@ check() DoFHandler dof(tr); dof.distribute_dofs(element); - std::vector count(element.n_components()); - DoFTools::count_dofs_per_component(dof, count, false); + const std::vector count = + DoFTools::count_dofs_per_fe_component(dof, false); for (unsigned int d = 0; d < count.size(); ++d) deallog << count[d] << std::endl; diff --git a/tests/dofs/extract_dofs_by_component_05_hp.cc b/tests/dofs/extract_dofs_by_component_05_hp.cc index 667d68b543..6f672b7243 100644 --- a/tests/dofs/extract_dofs_by_component_05_hp.cc +++ b/tests/dofs/extract_dofs_by_component_05_hp.cc @@ -20,7 +20,7 @@ // // this particular test checks the call path to // internal::extract_dofs_by_component from -// DoFTools::count_dofs_per_component with argument only_once=false +// DoFTools::count_dofs_per_fe_component with argument only_once=false #include @@ -60,8 +60,8 @@ check() dof.begin_active()->set_active_fe_index(1); dof.distribute_dofs(element); - std::vector count(element.n_components()); - DoFTools::count_dofs_per_component(dof, count, false); + const std::vector count = + DoFTools::count_dofs_per_fe_component(dof, false); for (unsigned int d = 0; d < count.size(); ++d) deallog << count[d] << std::endl; diff --git a/tests/dofs/extract_dofs_by_component_06.cc b/tests/dofs/extract_dofs_by_component_06.cc index 9f3d7c9bc4..ef51d06012 100644 --- a/tests/dofs/extract_dofs_by_component_06.cc +++ b/tests/dofs/extract_dofs_by_component_06.cc @@ -20,7 +20,7 @@ // // this particular test checks the call path to // internal::extract_dofs_by_component from -// DoFTools::count_dofs_per_component with argument only_once=true +// DoFTools::count_dofs_per_fe_component with argument only_once=true #include @@ -59,8 +59,8 @@ check() DoFHandler dof(tr); dof.distribute_dofs(element); - std::vector count(element.n_components()); - DoFTools::count_dofs_per_component(dof, count, true); + const std::vector count = + DoFTools::count_dofs_per_fe_component(dof, true); for (unsigned int d = 0; d < count.size(); ++d) deallog << count[d] << std::endl; diff --git a/tests/dofs/extract_dofs_by_component_06_hp.cc b/tests/dofs/extract_dofs_by_component_06_hp.cc index 66812cdd94..58ae82eb71 100644 --- a/tests/dofs/extract_dofs_by_component_06_hp.cc +++ b/tests/dofs/extract_dofs_by_component_06_hp.cc @@ -20,7 +20,7 @@ // // this particular test checks the call path to // internal::extract_dofs_by_component from -// DoFTools::count_dofs_per_component with argument only_once=true +// DoFTools::count_dofs_per_fe_component with argument only_once=true #include @@ -60,8 +60,8 @@ check() dof.begin_active()->set_active_fe_index(1); dof.distribute_dofs(element); - std::vector count(element.n_components()); - DoFTools::count_dofs_per_component(dof, count, true); + const std::vector count = + DoFTools::count_dofs_per_fe_component(dof, true); for (unsigned int d = 0; d < count.size(); ++d) deallog << count[d] << std::endl; diff --git a/tests/examples/step-56.cc b/tests/examples/step-56.cc index 1af69b445c..9aae51087d 100644 --- a/tests/examples/step-56.cc +++ b/tests/examples/step-56.cc @@ -564,10 +564,8 @@ namespace Step56 } } - std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block(dof_handler, - dofs_per_block, - block_component); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, block_component); const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1]; { diff --git a/tests/fe/fe_q_dg0.cc b/tests/fe/fe_q_dg0.cc index 4b3375f4d7..34e67283fd 100644 --- a/tests/fe/fe_q_dg0.cc +++ b/tests/fe/fe_q_dg0.cc @@ -469,10 +469,8 @@ namespace Step22 constraints.close(); - std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block(dof_handler, - dofs_per_block, - block_component); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, block_component); const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1]; deallog << " Number of active cells: " << triangulation.n_active_cells() diff --git a/tests/fe/fe_values_view_21.cc b/tests/fe/fe_values_view_21.cc index 4769ec92c6..83f3c5c151 100644 --- a/tests/fe/fe_values_view_21.cc +++ b/tests/fe/fe_values_view_21.cc @@ -116,8 +116,8 @@ MixedElastoPlasticity::make_grid_and_dofs() DoFRenumbering::component_wise(dof_handler); // total number of dof per block component - std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, block_component); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, block_component); const unsigned int n_stress_dof = dofs_per_block[0]; const unsigned int n_gamma_dof = dofs_per_block[1]; diff --git a/tests/fe/fe_values_view_21_nonsymmetric.cc b/tests/fe/fe_values_view_21_nonsymmetric.cc index 66021e8a17..3ff4ed027d 100644 --- a/tests/fe/fe_values_view_21_nonsymmetric.cc +++ b/tests/fe/fe_values_view_21_nonsymmetric.cc @@ -117,8 +117,8 @@ MixedElastoPlasticity::make_grid_and_dofs() DoFRenumbering::component_wise(dof_handler); // total number of dof per block component - std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, block_component); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, block_component); const unsigned int n_stress_dof = dofs_per_block[0]; const unsigned int n_gamma_dof = dofs_per_block[1]; diff --git a/tests/fe/fe_values_view_22.cc b/tests/fe/fe_values_view_22.cc index 9461c81244..f6e8f1d481 100644 --- a/tests/fe/fe_values_view_22.cc +++ b/tests/fe/fe_values_view_22.cc @@ -110,8 +110,8 @@ MixedElastoPlasticity::make_grid_and_dofs() DoFRenumbering::component_wise(dof_handler); - std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, block_component); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, block_component); const unsigned int n_stress_dof = dofs_per_block[0]; const unsigned int n_gamma_dof = dofs_per_block[1]; diff --git a/tests/fe/fe_values_view_tensor_01.cc b/tests/fe/fe_values_view_tensor_01.cc index eb9e7b4ee7..81f2fa8b5d 100644 --- a/tests/fe/fe_values_view_tensor_01.cc +++ b/tests/fe/fe_values_view_tensor_01.cc @@ -114,8 +114,8 @@ MixedElastoPlasticity::make_grid_and_dofs() DoFRenumbering::component_wise(dof_handler); // total number of dof per block component - std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, block_component); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, block_component); const unsigned int n_stress_dof = dofs_per_block[0]; const unsigned int n_gamma_dof = dofs_per_block[1]; diff --git a/tests/gla/block_mat_02.cc b/tests/gla/block_mat_02.cc index db286a5c79..a4d3bc01ca 100644 --- a/tests/gla/block_mat_02.cc +++ b/tests/gla/block_mat_02.cc @@ -77,10 +77,8 @@ test() stokes_dof_handler.distribute_dofs(stokes_fe); DoFRenumbering::component_wise(stokes_dof_handler, stokes_sub_blocks); - std::vector stokes_dofs_per_block(2); - DoFTools::count_dofs_per_block(stokes_dof_handler, - stokes_dofs_per_block, - stokes_sub_blocks); + const std::vector stokes_dofs_per_block = + DoFTools::count_dofs_per_fe_block(stokes_dof_handler, stokes_sub_blocks); const unsigned int n_u = stokes_dofs_per_block[0], n_p = stokes_dofs_per_block[1]; @@ -174,10 +172,8 @@ test_LA_Trilinos() stokes_dof_handler.distribute_dofs(stokes_fe); DoFRenumbering::component_wise(stokes_dof_handler, stokes_sub_blocks); - std::vector stokes_dofs_per_block(2); - DoFTools::count_dofs_per_block(stokes_dof_handler, - stokes_dofs_per_block, - stokes_sub_blocks); + const std::vector stokes_dofs_per_block = + DoFTools::count_dofs_per_fe_block(stokes_dof_handler, stokes_sub_blocks); const unsigned int n_u = stokes_dofs_per_block[0], n_p = stokes_dofs_per_block[1]; diff --git a/tests/gla/block_mat_03.cc b/tests/gla/block_mat_03.cc index e516a5118f..9682fb128d 100644 --- a/tests/gla/block_mat_03.cc +++ b/tests/gla/block_mat_03.cc @@ -70,10 +70,10 @@ test() dof_handler.distribute_dofs(fe); DoFRenumbering::block_wise(dof_handler); - std::vector dofs_per_block(fe.n_blocks()); - std::vector sub_blocks(fe.n_blocks(), 0); + std::vector sub_blocks(fe.n_blocks(), 0); sub_blocks[1] = 1; - DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, sub_blocks); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, sub_blocks); deallog << "size: " << dofs_per_block[0] << " " << dofs_per_block[1] << std::endl; @@ -176,10 +176,10 @@ test_alt() dof_handler.distribute_dofs(fe); DoFRenumbering::block_wise(dof_handler); - std::vector dofs_per_block(fe.n_blocks()); - std::vector sub_blocks(fe.n_blocks(), 0); + std::vector sub_blocks(fe.n_blocks(), 0); sub_blocks[1] = 1; - DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, sub_blocks); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, sub_blocks); deallog << "size: " << dofs_per_block[0] << " " << dofs_per_block[1] << std::endl; diff --git a/tests/hp/count_dofs_per_block_01.cc b/tests/hp/count_dofs_per_block_01.cc index a7894688ec..4fd03a4485 100644 --- a/tests/hp/count_dofs_per_block_01.cc +++ b/tests/hp/count_dofs_per_block_01.cc @@ -85,14 +85,14 @@ check() // no grouping { - std::vector dpc(dim + 1); - DoFTools::count_dofs_per_component(dof_handler, dpc); + const std::vector dpc = + DoFTools::count_dofs_per_fe_component(dof_handler); print(dpc); } { - std::vector dpc(dim + 1); - DoFTools::count_dofs_per_block(dof_handler, dpc); + const std::vector dpc = + DoFTools::count_dofs_per_fe_block(dof_handler); print(dpc); } @@ -102,8 +102,8 @@ check() { std::vector group(dim + 1, 0); group[dim] = 1; - std::vector dpc(2); - DoFTools::count_dofs_per_component(dof_handler, dpc, false, group); + const std::vector dpc = + DoFTools::count_dofs_per_fe_component(dof_handler, false, group); Assert(dpc.size() == 2, ExcInternalError()); print(dpc); } @@ -111,8 +111,8 @@ check() { std::vector group(dim + 1, 0); group[dim] = 1; - std::vector dpc(2); - DoFTools::count_dofs_per_block(dof_handler, dpc, group); + const std::vector dpc = + DoFTools::count_dofs_per_fe_block(dof_handler, group); Assert(dpc.size() == 2, ExcInternalError()); print(dpc); } @@ -122,8 +122,8 @@ check() { std::vector group(dim + 1, 2 * dim); group[dim] = 0; - std::vector dpc(2 * dim + 1); - DoFTools::count_dofs_per_component(dof_handler, dpc, false, group); + const std::vector dpc = + DoFTools::count_dofs_per_fe_component(dof_handler, false, group); Assert(dpc.size() == 2 * dim + 1, ExcInternalError()); print(dpc); } @@ -131,8 +131,8 @@ check() { std::vector group(dim + 1, 2 * dim); group[dim] = 0; - std::vector dpc(2 * dim + 1); - DoFTools::count_dofs_per_block(dof_handler, dpc, group); + const std::vector dpc = + DoFTools::count_dofs_per_fe_block(dof_handler, group); Assert(dpc.size() == 2 * dim + 1, ExcInternalError()); print(dpc); } diff --git a/tests/hp/count_dofs_per_block_02.cc b/tests/hp/count_dofs_per_block_02.cc index b0ff720885..ac48215af0 100644 --- a/tests/hp/count_dofs_per_block_02.cc +++ b/tests/hp/count_dofs_per_block_02.cc @@ -85,14 +85,14 @@ check() // no grouping { - std::vector dpc(dim + 1); - DoFTools::count_dofs_per_component(dof_handler, dpc); + const std::vector dpc = + DoFTools::count_dofs_per_fe_component(dof_handler); print(dpc); } { - std::vector dpc(dim + 1); - DoFTools::count_dofs_per_block(dof_handler, dpc); + const std::vector dpc = + DoFTools::count_dofs_per_fe_block(dof_handler); print(dpc); } @@ -102,8 +102,8 @@ check() { std::vector group(dim + 1, 0); group[dim] = 1; - std::vector dpc(2); - DoFTools::count_dofs_per_component(dof_handler, dpc, false, group); + const std::vector dpc = + DoFTools::count_dofs_per_fe_component(dof_handler, false, group); Assert(dpc.size() == 2, ExcInternalError()); print(dpc); } @@ -111,8 +111,8 @@ check() { std::vector group(dim + 1, 0); group[dim] = 1; - std::vector dpc(2); - DoFTools::count_dofs_per_block(dof_handler, dpc, group); + const std::vector dpc = + DoFTools::count_dofs_per_fe_block(dof_handler, group); Assert(dpc.size() == 2, ExcInternalError()); print(dpc); } @@ -122,8 +122,8 @@ check() { std::vector group(dim + 1, 2 * dim); group[dim] = 0; - std::vector dpc(2 * dim + 1); - DoFTools::count_dofs_per_component(dof_handler, dpc, false, group); + const std::vector dpc = + DoFTools::count_dofs_per_fe_component(dof_handler, false, group); Assert(dpc.size() == 2 * dim + 1, ExcInternalError()); print(dpc); } @@ -131,8 +131,8 @@ check() { std::vector group(dim + 1, 2 * dim); group[dim] = 0; - std::vector dpc(2 * dim + 1); - DoFTools::count_dofs_per_block(dof_handler, dpc, group); + const std::vector dpc = + DoFTools::count_dofs_per_fe_block(dof_handler, group); Assert(dpc.size() == 2 * dim + 1, ExcInternalError()); print(dpc); } diff --git a/tests/hp/fe_nothing_18.cc b/tests/hp/fe_nothing_18.cc index e58e6d5ba4..68b0519698 100644 --- a/tests/hp/fe_nothing_18.cc +++ b/tests/hp/fe_nothing_18.cc @@ -354,7 +354,8 @@ ElasticProblem::setup_system() dof_handler); // do renumberring; must be done // right after distributing DoF !!! DoFRenumbering::component_wise(dof_handler, block_component); - DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, block_component); + dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, block_component); deallog << "dofs per block: U=" << dofs_per_block[u_block] << " L=" << dofs_per_block[lambda_block] << std::endl; diff --git a/tests/hp/solution_transfer_15.cc b/tests/hp/solution_transfer_15.cc index 20eb8b3548..c3ea1fd389 100644 --- a/tests/hp/solution_transfer_15.cc +++ b/tests/hp/solution_transfer_15.cc @@ -61,9 +61,9 @@ initialize_indexsets(IndexSet & locally_owned_dofs, locally_relevant_dofs = DoFTools::locally_relevant_dofs_per_subdomain( dof_handler)[this_mpi_process]; - const unsigned int n_blocks = block_component.size(); - std::vector dofs_per_block(n_blocks); - DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, block_component); + const unsigned int n_blocks = block_component.size(); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, block_component); locally_owned_partitioning.clear(); locally_relevant_partitioning.clear(); diff --git a/tests/lac/block_linear_operator_01.cc b/tests/lac/block_linear_operator_01.cc index 1034778ef9..9546191702 100644 --- a/tests/lac/block_linear_operator_01.cc +++ b/tests/lac/block_linear_operator_01.cc @@ -58,8 +58,8 @@ main() dof_handler.distribute_dofs(fe); - std::vector dofs_per_component(2); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_component); + const std::vector dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler); const unsigned int n_u = dofs_per_component[0], n_p = dofs_per_component[1]; BlockDynamicSparsityPattern dsp(2, 2); diff --git a/tests/lac/block_linear_operator_02.cc b/tests/lac/block_linear_operator_02.cc index c3752eaf77..050fb41f0f 100644 --- a/tests/lac/block_linear_operator_02.cc +++ b/tests/lac/block_linear_operator_02.cc @@ -58,8 +58,8 @@ main() dof_handler.distribute_dofs(fe); - std::vector dpc(3); - DoFTools::count_dofs_per_component(dof_handler, dpc); + const std::vector dpc = + DoFTools::count_dofs_per_fe_component(dof_handler); BlockDynamicSparsityPattern dsp(3, 3); for (unsigned int i = 0; i < 3; ++i) diff --git a/tests/lac/block_linear_operator_06.cc b/tests/lac/block_linear_operator_06.cc index b7d329e8ee..e404aa3d4e 100644 --- a/tests/lac/block_linear_operator_06.cc +++ b/tests/lac/block_linear_operator_06.cc @@ -58,8 +58,8 @@ main() dof_handler.distribute_dofs(fe); - std::vector dofs_per_component(2); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_component); + const std::vector dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler); const unsigned int n_u = dofs_per_component[0], n_p = dofs_per_component[1]; BlockDynamicSparsityPattern dsp(2, 2); diff --git a/tests/lac/constraints_block_01.cc b/tests/lac/constraints_block_01.cc index 12118c218e..36bf111ac8 100644 --- a/tests/lac/constraints_block_01.cc +++ b/tests/lac/constraints_block_01.cc @@ -147,12 +147,8 @@ main() block_component[comp] = 2; } // comp - std::vector dofs_per_block( - 3, 0); // 3 blocks, count dofs: - DoFTools::count_dofs_per_component(dh, - dofs_per_block, - false, - block_component); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_component(dh, false, block_component); DoFRenumbering::component_wise(dh, block_component); diff --git a/tests/lac/linear_operator_03.cc b/tests/lac/linear_operator_03.cc index 4f4ea0d37b..d791e26f40 100644 --- a/tests/lac/linear_operator_03.cc +++ b/tests/lac/linear_operator_03.cc @@ -68,8 +68,8 @@ main() dof_handler.distribute_dofs(fe); - std::vector dofs_per_component(2); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_component); + const std::vector dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler); const unsigned int n_u = dofs_per_component[0], n_p = dofs_per_component[1]; BlockDynamicSparsityPattern dsp(2, 2); diff --git a/tests/lac/linear_operator_13.cc b/tests/lac/linear_operator_13.cc index dc73444199..b4b9eb1172 100644 --- a/tests/lac/linear_operator_13.cc +++ b/tests/lac/linear_operator_13.cc @@ -79,7 +79,8 @@ build_matrix_vector(TrilinosWrappers::BlockSparseMatrix &matrix, // Setup system dof_handler.distribute_dofs(fe); DoFRenumbering::component_wise(dof_handler, block_component); - DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, block_component); + dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, block_component); std::vector partitioning(2); partitioning[0] = complete_index_set(dofs_per_block[0]); partitioning[1] = complete_index_set(dofs_per_block[1]); diff --git a/tests/lac/linear_operator_14.cc b/tests/lac/linear_operator_14.cc index 8050551f60..dcc248963c 100644 --- a/tests/lac/linear_operator_14.cc +++ b/tests/lac/linear_operator_14.cc @@ -97,7 +97,8 @@ build_matrix_vector(TrilinosWrappers::BlockSparseMatrix &matrix, // Setup system dof_handler.distribute_dofs(fe); DoFRenumbering::component_wise(dof_handler, block_component); - DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, block_component); + dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, block_component); locally_owned_dofs = dof_handler.locally_owned_dofs(); locally_owned_partitioning.push_back( diff --git a/tests/lac/schur_complement_03.cc b/tests/lac/schur_complement_03.cc index 7056e4dc7b..668bedf618 100644 --- a/tests/lac/schur_complement_03.cc +++ b/tests/lac/schur_complement_03.cc @@ -181,10 +181,8 @@ namespace Step22 fe.component_mask(velocities)); } constraints.close(); - std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block(dof_handler, - dofs_per_block, - block_component); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, block_component); const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1]; deallog << " Number of active cells: " << triangulation.n_active_cells() << std::endl diff --git a/tests/matrix_free/copy_feevaluation.cc b/tests/matrix_free/copy_feevaluation.cc index 3ba33e1fdf..c4b526815a 100644 --- a/tests/matrix_free/copy_feevaluation.cc +++ b/tests/matrix_free/copy_feevaluation.cc @@ -187,10 +187,8 @@ test() DoFTools::make_hanging_node_constraints(dof_handler_p, constraints_p); constraints_p.close(); - std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block(dof_handler, - dofs_per_block, - stokes_sub_blocks); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, stokes_sub_blocks); // std::cout << "Number of active cells: " // << triangulation.n_active_cells() diff --git a/tests/matrix_free/matrix_vector_stokes.cc b/tests/matrix_free/matrix_vector_stokes.cc index 1f20c774a4..a450fae2d4 100644 --- a/tests/matrix_free/matrix_vector_stokes.cc +++ b/tests/matrix_free/matrix_vector_stokes.cc @@ -161,8 +161,8 @@ test() constraints.close(); - std::vector dofs_per_block(dim + 1); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_block); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_component(dof_handler); // std::cout << " Number of active cells: " // << triangulation.n_active_cells() diff --git a/tests/matrix_free/matrix_vector_stokes_base.cc b/tests/matrix_free/matrix_vector_stokes_base.cc index 2bfdbab30b..7cdcf65218 100644 --- a/tests/matrix_free/matrix_vector_stokes_base.cc +++ b/tests/matrix_free/matrix_vector_stokes_base.cc @@ -149,8 +149,8 @@ test() DoFTools::make_hanging_node_constraints(dof_p, constraints_p); constraints_p.close(); - std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block(dof, dofs_per_block, stokes_sub_blocks); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof, stokes_sub_blocks); { BlockDynamicSparsityPattern csp(2, 2); diff --git a/tests/matrix_free/matrix_vector_stokes_flux.cc b/tests/matrix_free/matrix_vector_stokes_flux.cc index 6dde5249e8..2c7cfe2ec6 100644 --- a/tests/matrix_free/matrix_vector_stokes_flux.cc +++ b/tests/matrix_free/matrix_vector_stokes_flux.cc @@ -170,10 +170,8 @@ test() constraints); constraints.close(); - std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block(dof_handler, - dofs_per_block, - stokes_sub_blocks); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, stokes_sub_blocks); { BlockDynamicSparsityPattern csp(2, 2); diff --git a/tests/matrix_free/matrix_vector_stokes_noflux.cc b/tests/matrix_free/matrix_vector_stokes_noflux.cc index bd6650b1ca..42fb68d9f3 100644 --- a/tests/matrix_free/matrix_vector_stokes_noflux.cc +++ b/tests/matrix_free/matrix_vector_stokes_noflux.cc @@ -182,10 +182,8 @@ test() DoFTools::make_hanging_node_constraints(dof_handler_p, constraints_p); constraints_p.close(); - std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block(dof_handler, - dofs_per_block, - stokes_sub_blocks); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, stokes_sub_blocks); // std::cout << "Number of active cells: " // << triangulation.n_active_cells() diff --git a/tests/matrix_free/matrix_vector_stokes_notempl.cc b/tests/matrix_free/matrix_vector_stokes_notempl.cc index 008795ed05..6b1280a699 100644 --- a/tests/matrix_free/matrix_vector_stokes_notempl.cc +++ b/tests/matrix_free/matrix_vector_stokes_notempl.cc @@ -178,10 +178,8 @@ test(const unsigned int fe_degree) DoFTools::make_hanging_node_constraints(dof_handler_p, constraints_p); constraints_p.close(); - std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block(dof_handler, - dofs_per_block, - stokes_sub_blocks); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, stokes_sub_blocks); // std::cout << "Number of active cells: " // << triangulation.n_active_cells() diff --git a/tests/matrix_free/matrix_vector_stokes_qdg0.cc b/tests/matrix_free/matrix_vector_stokes_qdg0.cc index a5bf54c394..125491ab6d 100644 --- a/tests/matrix_free/matrix_vector_stokes_qdg0.cc +++ b/tests/matrix_free/matrix_vector_stokes_qdg0.cc @@ -163,8 +163,8 @@ test() constraints.close(); - std::vector dofs_per_block(dim + 1); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_block); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_component(dof_handler); // std::cout << " Number of active cells: " // << triangulation.n_active_cells() diff --git a/tests/matrix_free/matrix_vector_stokes_qdg0b.cc b/tests/matrix_free/matrix_vector_stokes_qdg0b.cc index 7b47c103f5..1da5e8026c 100644 --- a/tests/matrix_free/matrix_vector_stokes_qdg0b.cc +++ b/tests/matrix_free/matrix_vector_stokes_qdg0b.cc @@ -160,8 +160,8 @@ test(const unsigned int fe_degree) constraints.close(); - std::vector dofs_per_block(dim + 1); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_block); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_component(dof_handler); // std::cout << " Number of active cells: " // << triangulation.n_active_cells() diff --git a/tests/mpi/count_dofs_per_block_01.cc b/tests/mpi/count_dofs_per_block_01.cc index c7cfdbece8..008bcd7619 100644 --- a/tests/mpi/count_dofs_per_block_01.cc +++ b/tests/mpi/count_dofs_per_block_01.cc @@ -15,7 +15,7 @@ -// test DoFTools::count_dofs_per_block in parallel +// test DoFTools::count_dofs_per_fe_block in parallel #include @@ -55,8 +55,8 @@ test() DoFHandler dof_handler(triangulation); dof_handler.distribute_dofs(fe); - std::vector dofs_per_block(fe.n_blocks()); - DoFTools::count_dofs_per_block(dof_handler, dofs_per_block); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler); if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) for (unsigned int i = 0; i < fe.n_blocks(); ++i) diff --git a/tests/mpi/count_dofs_per_block_02.cc b/tests/mpi/count_dofs_per_block_02.cc index b191ee1c0b..3c40cd8c01 100644 --- a/tests/mpi/count_dofs_per_block_02.cc +++ b/tests/mpi/count_dofs_per_block_02.cc @@ -15,7 +15,7 @@ -// Test DoFTools::count_dofs_per_block +// Test DoFTools::count_dofs_per_fe_block #include @@ -90,8 +90,8 @@ test() triangulation.execute_coarsening_and_refinement(); dof_handler.distribute_dofs(fe); - std::vector dofs_per_block(fe.n_components()); - DoFTools::count_dofs_per_block(dof_handler, dofs_per_block); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler); AssertThrow(std::accumulate(dofs_per_block.begin(), dofs_per_block.end(), diff --git a/tests/mpi/count_dofs_per_component_01.cc b/tests/mpi/count_dofs_per_component_01.cc index c7a5094bae..a6b505db63 100644 --- a/tests/mpi/count_dofs_per_component_01.cc +++ b/tests/mpi/count_dofs_per_component_01.cc @@ -15,7 +15,7 @@ -// Test DoFTools::count_dofs_per_component +// Test DoFTools::count_dofs_per_fe_component #include @@ -55,8 +55,8 @@ test() triangulation.refine_global(2); dof_handler.distribute_dofs(fe); - std::vector dofs_per_component(fe.n_components()); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_component); + const std::vector dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler); AssertThrow(std::accumulate(dofs_per_component.begin(), dofs_per_component.end(), diff --git a/tests/mpi/muelu_periodicity.cc b/tests/mpi/muelu_periodicity.cc index 9e49099e4a..b70717adf0 100644 --- a/tests/mpi/muelu_periodicity.cc +++ b/tests/mpi/muelu_periodicity.cc @@ -324,9 +324,9 @@ namespace Step22 DoFRenumbering::component_wise(dof_handler, block_component); std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block(dof_handler, - dofs_per_block, - block_component); + DoFTools::count_dofs_per_fe_block(dof_handler, + dofs_per_block, + block_component); const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1]; { diff --git a/tests/mpi/parallel_vector_back_interpolate_02.cc b/tests/mpi/parallel_vector_back_interpolate_02.cc index 185c0ebba2..50d795b08e 100644 --- a/tests/mpi/parallel_vector_back_interpolate_02.cc +++ b/tests/mpi/parallel_vector_back_interpolate_02.cc @@ -71,8 +71,8 @@ test() std::vector owned_partitioning1; std::vector relevant_partitioning1; { - std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block(dof1, dofs_per_block); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof1); const unsigned int n1 = dofs_per_block[0], n2 = dofs_per_block[1]; owned_partitioning1.push_back(locally_owned_dofs1.get_view(0, n1)); diff --git a/tests/mpi/periodicity_02.cc b/tests/mpi/periodicity_02.cc index a817b1e935..d87d7d6a42 100644 --- a/tests/mpi/periodicity_02.cc +++ b/tests/mpi/periodicity_02.cc @@ -325,10 +325,8 @@ namespace Step22 block_component[dim] = 1; DoFRenumbering::component_wise(dof_handler, block_component); - std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block(dof_handler, - dofs_per_block, - block_component); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, block_component); const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1]; { diff --git a/tests/mpi/periodicity_03.cc b/tests/mpi/periodicity_03.cc index 508f817c4e..0fa2e88982 100644 --- a/tests/mpi/periodicity_03.cc +++ b/tests/mpi/periodicity_03.cc @@ -253,10 +253,8 @@ namespace Step22 block_component[dim] = 1; DoFRenumbering::component_wise(dof_handler, block_component); - std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block(dof_handler, - dofs_per_block, - block_component); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, block_component); const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1]; { diff --git a/tests/mpi/project_bv_div_conf.cc b/tests/mpi/project_bv_div_conf.cc index c27328143b..1d7873f575 100644 --- a/tests/mpi/project_bv_div_conf.cc +++ b/tests/mpi/project_bv_div_conf.cc @@ -168,10 +168,8 @@ namespace ResFlow // Renumber to yield block structure DoFRenumbering::block_wise(dof_handler); - std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block(dof_handler, - dofs_per_block, - resflow_sub_blocks); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, resflow_sub_blocks); const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1]; pcout << " Number of degrees of freedom: " << dof_handler.n_dofs() << " (" diff --git a/tests/mpi/solution_transfer_03.cc b/tests/mpi/solution_transfer_03.cc index 738bbe74eb..f93e50564d 100644 --- a/tests/mpi/solution_transfer_03.cc +++ b/tests/mpi/solution_transfer_03.cc @@ -59,9 +59,9 @@ initialize_indexsets(IndexSet & locally_owned_dofs, locally_relevant_dofs = DoFTools::locally_relevant_dofs_per_subdomain( dof_handler)[this_mpi_process]; - const unsigned int n_blocks = block_component.size(); - std::vector dofs_per_block(n_blocks); - DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, block_component); + const unsigned int n_blocks = block_component.size(); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, block_component); locally_owned_partitioning.clear(); locally_relevant_partitioning.clear(); diff --git a/tests/multigrid/transfer_block.cc b/tests/multigrid/transfer_block.cc index 8fdaa259bb..a9b2490409 100644 --- a/tests/multigrid/transfer_block.cc +++ b/tests/multigrid/transfer_block.cc @@ -100,8 +100,9 @@ check_block(const FiniteElement &fe, mgdof.distribute_dofs(fe); mgdof.distribute_mg_dofs(); DoFRenumbering::component_wise(mgdof); - vector ndofs(fe.n_blocks()); - DoFTools::count_dofs_per_block(mgdof, ndofs); + const vector ndofs = + DoFTools::count_dofs_per_fe_block(mgdof); + Assert(ndofs.size() == fe.n_blocks(), ExcInternalError()); for (unsigned int l = 0; l < tr.n_levels(); ++l) DoFRenumbering::component_wise(mgdof, l); diff --git a/tests/multigrid/transfer_block_select.cc b/tests/multigrid/transfer_block_select.cc index 55ad85dc32..a6abdd36a8 100644 --- a/tests/multigrid/transfer_block_select.cc +++ b/tests/multigrid/transfer_block_select.cc @@ -86,8 +86,8 @@ check_select(const FiniteElement &fe, unsigned int selected) mgdof.distribute_dofs(fe); mgdof.distribute_mg_dofs(); DoFRenumbering::component_wise(mgdof); - vector ndofs(fe.n_blocks()); - DoFTools::count_dofs_per_block(mgdof, ndofs); + const vector ndofs = + DoFTools::count_dofs_per_fe_block(mgdof); for (unsigned int l = 0; l < tr.n_levels(); ++l) DoFRenumbering::component_wise(mgdof, l); diff --git a/tests/multigrid/transfer_compare_01.cc b/tests/multigrid/transfer_compare_01.cc index a1f1003a75..4494cdbc0a 100644 --- a/tests/multigrid/transfer_compare_01.cc +++ b/tests/multigrid/transfer_compare_01.cc @@ -144,8 +144,8 @@ check_block(const FiniteElement &fe) } // Store sizes - vector ndofs(fe.n_blocks()); - DoFTools::count_dofs_per_block(mgdof, ndofs); + const vector ndofs = + DoFTools::count_dofs_per_fe_block(mgdof); std::vector> mg_ndofs( mgdof.get_triangulation().n_levels(), std::vector(fe.n_blocks())); diff --git a/tests/multigrid/transfer_select.cc b/tests/multigrid/transfer_select.cc index 426c816710..b02e010c63 100644 --- a/tests/multigrid/transfer_select.cc +++ b/tests/multigrid/transfer_select.cc @@ -59,9 +59,12 @@ check_select(const FiniteElement &fe, mgdof.distribute_dofs(fe); mgdof.distribute_mg_dofs(); DoFRenumbering::component_wise(mgdof, target_component); - vector ndofs( - *std::max_element(target_component.begin(), target_component.end()) + 1); - DoFTools::count_dofs_per_component(mgdof, ndofs, true, target_component); + const vector ndofs = + DoFTools::count_dofs_per_fe_component(mgdof, true, target_component); + Assert(ndofs.size() == + *std::max_element(target_component.begin(), target_component.end()) + + 1, + ExcInternalError()); for (unsigned int l = 0; l < tr.n_levels(); ++l) DoFRenumbering::component_wise(mgdof, l, mg_target_component); diff --git a/tests/multigrid/transfer_system_05.cc b/tests/multigrid/transfer_system_05.cc index fd5c45e38b..432b3256ca 100644 --- a/tests/multigrid/transfer_system_05.cc +++ b/tests/multigrid/transfer_system_05.cc @@ -73,10 +73,8 @@ check(const FiniteElement &fe, const unsigned int selected_block) block_component, block_component); - std::vector dofs_per_block(3); - DoFTools::count_dofs_per_block(mg_dof_handler, - dofs_per_block, - block_component); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(mg_dof_handler, block_component); std::vector> mg_dofs_per_block( tr.n_levels(), std::vector(3)); MGTools::count_dofs_per_block(mg_dof_handler, diff --git a/tests/multigrid/transfer_system_adaptive_09.cc b/tests/multigrid/transfer_system_adaptive_09.cc index b8b338406a..ff6c650153 100644 --- a/tests/multigrid/transfer_system_adaptive_09.cc +++ b/tests/multigrid/transfer_system_adaptive_09.cc @@ -119,10 +119,8 @@ check(const FiniteElement &fe, const unsigned int selected_block) block_component, block_component); - std::vector dofs_per_block(3); - DoFTools::count_dofs_per_block(mg_dof_handler, - dofs_per_block, - block_component); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(mg_dof_handler, block_component); std::vector> mg_dofs_per_block( tr.n_levels(), std::vector(3)); MGTools::count_dofs_per_block(mg_dof_handler, diff --git a/tests/numerics/point_value_history_02.cc b/tests/numerics/point_value_history_02.cc index 8ea3dbba76..dd887e88d2 100644 --- a/tests/numerics/point_value_history_02.cc +++ b/tests/numerics/point_value_history_02.cc @@ -184,7 +184,7 @@ TestPointValueHistory::run() // // BlockVector // std::vector dofs_per_block(2); - // DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, + // DoFTools::count_dofs_per_fe_block(dof_handler, dofs_per_block, // block_component); const unsigned int n_u = dofs_per_block[0], // n_p = dofs_per_block[1]; // BlockVector solution; diff --git a/tests/optimization/step-44.h b/tests/optimization/step-44.h index e3a37d4764..24c8aad494 100644 --- a/tests/optimization/step-44.h +++ b/tests/optimization/step-44.h @@ -1135,9 +1135,8 @@ namespace Step44 dof_handler_ref.distribute_dofs(fe); DoFRenumbering::Cuthill_McKee(dof_handler_ref); DoFRenumbering::component_wise(dof_handler_ref, block_component); - DoFTools::count_dofs_per_block(dof_handler_ref, - dofs_per_block, - block_component); + dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler_ref, block_component); std::cout << "Triangulation:" << "\n\t Number of active cells: " << triangulation.n_active_cells() diff --git a/tests/physics/step-44-standard_tensors-material_push_forward.cc b/tests/physics/step-44-standard_tensors-material_push_forward.cc index dbe238c94a..68ad00d3a5 100644 --- a/tests/physics/step-44-standard_tensors-material_push_forward.cc +++ b/tests/physics/step-44-standard_tensors-material_push_forward.cc @@ -1300,9 +1300,8 @@ namespace Step44 dof_handler_ref.distribute_dofs(fe); DoFRenumbering::Cuthill_McKee(dof_handler_ref); DoFRenumbering::component_wise(dof_handler_ref, block_component); - DoFTools::count_dofs_per_block(dof_handler_ref, - dofs_per_block, - block_component); + dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler_ref, block_component); pcout << "Triangulation:" << "\n\t Number of active cells: " << triangulation.n_active_cells() << "\n\t Number of degrees of freedom: " << dof_handler_ref.n_dofs() diff --git a/tests/physics/step-44-standard_tensors-spatial.cc b/tests/physics/step-44-standard_tensors-spatial.cc index 2414e99529..0cb3691bae 100644 --- a/tests/physics/step-44-standard_tensors-spatial.cc +++ b/tests/physics/step-44-standard_tensors-spatial.cc @@ -1100,9 +1100,8 @@ namespace Step44 dof_handler_ref.distribute_dofs(fe); DoFRenumbering::Cuthill_McKee(dof_handler_ref); DoFRenumbering::component_wise(dof_handler_ref, block_component); - DoFTools::count_dofs_per_block(dof_handler_ref, - dofs_per_block, - block_component); + dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler_ref, block_component); pcout << "Triangulation:" << "\n\t Number of active cells: " << triangulation.n_active_cells() << "\n\t Number of degrees of freedom: " << dof_handler_ref.n_dofs() diff --git a/tests/physics/step-44.cc b/tests/physics/step-44.cc index 250f6556a3..b142dcaa0c 100644 --- a/tests/physics/step-44.cc +++ b/tests/physics/step-44.cc @@ -1113,9 +1113,8 @@ namespace Step44 dof_handler_ref.distribute_dofs(fe); DoFRenumbering::Cuthill_McKee(dof_handler_ref); DoFRenumbering::component_wise(dof_handler_ref, block_component); - DoFTools::count_dofs_per_block(dof_handler_ref, - dofs_per_block, - block_component); + dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler_ref, block_component); pcout << "Triangulation:" << "\n\t Number of active cells: " << triangulation.n_active_cells() << "\n\t Number of degrees of freedom: " << dof_handler_ref.n_dofs() diff --git a/tests/quick_tests/p4est.cc b/tests/quick_tests/p4est.cc index 2005908812..9b1a7ec6c9 100644 --- a/tests/quick_tests/p4est.cc +++ b/tests/quick_tests/p4est.cc @@ -15,7 +15,7 @@ -// Test DoFTools::count_dofs_per_component +// Test DoFTools::count_dofs_per_fe_component #include @@ -54,15 +54,15 @@ test() triangulation.refine_global(2); dof_handler.distribute_dofs(fe); - std::vector dofs_per_component(fe.n_components()); - DoFTools::count_dofs_per_component(dof_handler, dofs_per_component); + const std::vector dofs_per_component = + DoFTools::count_dofs_per_fe_component(dof_handler); Assert(std::accumulate(dofs_per_component.begin(), dofs_per_component.end(), 0U) == dof_handler.n_dofs(), ExcInternalError()); - unsigned int myid = Utilities::MPI::this_mpi_process(MPI_COMM_WORLD); + const unsigned int myid = Utilities::MPI::this_mpi_process(MPI_COMM_WORLD); if (myid == 0) { deallog << "Total number of dofs: " << dof_handler.n_dofs() << std::endl; diff --git a/tests/trilinos/assemble_matrix_parallel_04.cc b/tests/trilinos/assemble_matrix_parallel_04.cc index c76bb7707c..822ccee602 100644 --- a/tests/trilinos/assemble_matrix_parallel_04.cc +++ b/tests/trilinos/assemble_matrix_parallel_04.cc @@ -289,8 +289,8 @@ LaplaceProblem::setup_system() relevant_total; DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_total); - std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, blocks); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, blocks); locally_owned[0] = locally_owned_total.get_view(0, dofs_per_block[0]); locally_owned[1] = locally_owned_total.get_view(dofs_per_block[0], dof_handler.n_dofs()); diff --git a/tests/trilinos/assemble_matrix_parallel_06.cc b/tests/trilinos/assemble_matrix_parallel_06.cc index 735c81d1ef..3619e87af8 100644 --- a/tests/trilinos/assemble_matrix_parallel_06.cc +++ b/tests/trilinos/assemble_matrix_parallel_06.cc @@ -291,8 +291,8 @@ LaplaceProblem::setup_system() relevant_total; DoFTools::extract_locally_relevant_dofs(dof_handler, relevant_total); - std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block(dof_handler, dofs_per_block, blocks); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, blocks); locally_owned[0] = locally_owned_total.get_view(0, dofs_per_block[0]); locally_owned[1] = locally_owned_total.get_view(dofs_per_block[0], dof_handler.n_dofs()); diff --git a/tests/trilinos/trilinos_sparsity_pattern_02.cc b/tests/trilinos/trilinos_sparsity_pattern_02.cc index 58e0df4ef0..e9fe99f521 100644 --- a/tests/trilinos/trilinos_sparsity_pattern_02.cc +++ b/tests/trilinos/trilinos_sparsity_pattern_02.cc @@ -90,10 +90,8 @@ namespace Step22 block_component[dim] = 1; DoFRenumbering::component_wise(dof_handler, block_component); - std::vector dofs_per_block(2); - DoFTools::count_dofs_per_block(dof_handler, - dofs_per_block, - block_component); + const std::vector dofs_per_block = + DoFTools::count_dofs_per_fe_block(dof_handler, block_component); const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1]; { diff --git a/tests/umfpack/umfpack_04.cc b/tests/umfpack/umfpack_04.cc index ccc1e7ab82..28895ed494 100644 --- a/tests/umfpack/umfpack_04.cc +++ b/tests/umfpack/umfpack_04.cc @@ -129,8 +129,8 @@ test() deallog << "Number of dofs = " << dof_handler.n_dofs() << std::endl; - std::vector size(dim); - DoFTools::count_dofs_per_component(dof_handler, size); + const std::vector size = + DoFTools::count_dofs_per_fe_component(dof_handler); BlockSparsityPattern b_sparsity_pattern; SparsityPattern sparsity_pattern; -- 2.39.5