From 2ad8fcf40780d25af2e6e37eac5c0367886e759d Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Wed, 21 Jun 2023 13:22:41 -0400 Subject: [PATCH] Fix tests --- tests/bits/anna_4.cc | 6 +++--- tests/bits/anna_6.cc | 12 ++++++------ tests/bits/error_estimator_01.cc | 2 +- tests/bits/error_estimator_02.cc | 2 +- tests/bits/periodicity_04.cc | 4 ++-- tests/bits/step-11.cc | 2 +- tests/codim_one/error_estimator_01.cc | 2 +- tests/dofs/extract_dofs_by_component_04.cc | 4 ++-- tests/dofs/interpolate_boundary_values_01.cc | 4 ++-- tests/fe/fe_q_dg0.cc | 4 ++-- tests/hp/step-11.cc | 2 +- tests/mpi/constraint_matrix_condense_01.cc | 2 +- tests/mpi/constraint_matrix_trilinos_bug.cc | 4 ++-- tests/mpi/extract_boundary_dofs.cc | 2 +- tests/mpi/extract_constant_modes_01.cc | 8 ++++---- tests/mpi/extract_constant_modes_02.cc | 2 +- tests/mpi/extract_constant_modes_03.cc | 2 +- tests/mpi/p4est_2d_constraintmatrix_03.cc | 4 ++-- tests/numerics/project_boundary_01.cc | 2 +- tests/simplex/extract_boundary_dofs.cc | 2 +- tests/trilinos/precondition_amg_dgp_01.cc | 2 +- tests/vector_tools/boundaries.cc | 2 +- tests/vector_tools/boundaries_complex.cc | 2 +- tests/vector_tools/boundaries_complex_hp.cc | 2 +- 24 files changed, 40 insertions(+), 40 deletions(-) diff --git a/tests/bits/anna_4.cc b/tests/bits/anna_4.cc index 78ec8bc811..bd7832a1ad 100644 --- a/tests/bits/anna_4.cc +++ b/tests/bits/anna_4.cc @@ -167,13 +167,13 @@ FindBug::dirichlet_conditions() // on which components of the // FESystem we want to impose // Dirichlet BC. - std::vector component_mask(2); + ComponentMask component_mask(2, false); // Dirichlet-BC for the // Q1-Component - component_mask[0] = true; + component_mask.set(0, true); // no Dirichlet-BC for the // DG-component - component_mask[1] = false; + component_mask.set(1, false); // This is just for the final // output-test diff --git a/tests/bits/anna_6.cc b/tests/bits/anna_6.cc index e6ba0617ec..5bf44d638a 100644 --- a/tests/bits/anna_6.cc +++ b/tests/bits/anna_6.cc @@ -172,13 +172,13 @@ void ImposeBC::test_extract_boundary_DoFs() { std::map boundary_values; - std::vector bc_component_select(dim + 1); + ComponentMask bc_component_select(dim + 1, false); // extract boundary DoFs for the Nedelec-component // and impose zero boundary condition - bc_component_select[0] = true; - bc_component_select[1] = true; - bc_component_select[2] = false; + bc_component_select.set(0, true); + bc_component_select.set(1, true); + bc_component_select.set(2, false); const std::set boundary_ids = {0}; const IndexSet ned_boundary_dofs = @@ -199,12 +199,12 @@ void ImposeBC::test_interpolate_BC() { std::map boundary_values; - std::vector bc_component_select(dim + 1, false); + ComponentMask bc_component_select(dim + 1, false); // impose inhomogeneous boundary condition // on the scalar variable - bc_component_select.back() = true; + bc_component_select.set(dim, true); VectorTools::interpolate_boundary_values(dof_handler, 0, diff --git a/tests/bits/error_estimator_01.cc b/tests/bits/error_estimator_01.cc index 7a183bac46..6e78482188 100644 --- a/tests/bits/error_estimator_01.cc +++ b/tests/bits/error_estimator_01.cc @@ -168,7 +168,7 @@ check() neumann_bc, v, this_error, - std::vector(), + ComponentMask(), nullptr, MultithreadInfo::n_threads(), subdomain); diff --git a/tests/bits/error_estimator_02.cc b/tests/bits/error_estimator_02.cc index 12ee6bb496..2fb42abfc5 100644 --- a/tests/bits/error_estimator_02.cc +++ b/tests/bits/error_estimator_02.cc @@ -168,7 +168,7 @@ check() neumann_bc, v, this_error, - std::vector(), + ComponentMask(), nullptr, MultithreadInfo::n_threads(), numbers::invalid_unsigned_int, diff --git a/tests/bits/periodicity_04.cc b/tests/bits/periodicity_04.cc index 04b44fb9c7..bbfa67299b 100644 --- a/tests/bits/periodicity_04.cc +++ b/tests/bits/periodicity_04.cc @@ -65,8 +65,8 @@ test() dof_handler.distribute_dofs(fe); DoFRenumbering::component_wise(dof_handler); - std::vector mask(2, true); - mask[1] = false; + ComponentMask mask(2, true); + mask.set(1, false); AffineConstraints cm; DoFTools::make_periodicity_constraints( dof_handler.begin(0)->face(0), diff --git a/tests/bits/step-11.cc b/tests/bits/step-11.cc index 452cb69e01..dc47e5d303 100644 --- a/tests/bits/step-11.cc +++ b/tests/bits/step-11.cc @@ -105,7 +105,7 @@ LaplaceProblem::setup_system() system_rhs.reinit(dof_handler.n_dofs()); const IndexSet boundary_dofs = - DoFTools::extract_boundary_dofs(dof_handler, std::vector(1, true)); + DoFTools::extract_boundary_dofs(dof_handler, ComponentMask(1, true)); const unsigned int first_boundary_dof = *boundary_dofs.begin(); diff --git a/tests/codim_one/error_estimator_01.cc b/tests/codim_one/error_estimator_01.cc index 41fb781542..ffe7820f13 100644 --- a/tests/codim_one/error_estimator_01.cc +++ b/tests/codim_one/error_estimator_01.cc @@ -168,7 +168,7 @@ check() neumann_bc, v, this_error, - std::vector(), + ComponentMask(), nullptr, MultithreadInfo::n_threads(), subdomain); diff --git a/tests/dofs/extract_dofs_by_component_04.cc b/tests/dofs/extract_dofs_by_component_04.cc index 54b2620a0f..7f72fad184 100644 --- a/tests/dofs/extract_dofs_by_component_04.cc +++ b/tests/dofs/extract_dofs_by_component_04.cc @@ -64,9 +64,9 @@ check() for (unsigned int int_mask = 0; int_mask < (1U << element.n_components()); ++int_mask) { - std::vector component_mask(element.n_components()); + ComponentMask component_mask(element.n_components(), false); for (unsigned int c = 0; c < element.n_components(); ++c) - component_mask[c] = (int_mask & (1 << c)); + component_mask.set(c, (int_mask & (1 << c))); std::vector> constant_modes; DoFTools::extract_constant_modes(dof, component_mask, constant_modes); diff --git a/tests/dofs/interpolate_boundary_values_01.cc b/tests/dofs/interpolate_boundary_values_01.cc index 787e76f51f..5f1df80f1f 100644 --- a/tests/dofs/interpolate_boundary_values_01.cc +++ b/tests/dofs/interpolate_boundary_values_01.cc @@ -134,8 +134,8 @@ void FindBug::dirichlet_conditions() { std::map dirichlet_dofs; - std::vector component_mask(dim + 1, false); - component_mask[dim] = true; + ComponentMask component_mask(dim + 1, false); + component_mask.set(dim, true); // This is just for the final // output-test diff --git a/tests/fe/fe_q_dg0.cc b/tests/fe/fe_q_dg0.cc index 7f882e5083..64acc0479a 100644 --- a/tests/fe/fe_q_dg0.cc +++ b/tests/fe/fe_q_dg0.cc @@ -421,8 +421,8 @@ namespace Step22 { constraints.clear(); - std::vector component_mask(dim + 1, true); - component_mask[dim] = false; + ComponentMask component_mask(dim + 1, true); + component_mask.set(dim, false); DoFTools::make_hanging_node_constraints(dof_handler, constraints); diff --git a/tests/hp/step-11.cc b/tests/hp/step-11.cc index 849939f3f7..34c4a41181 100644 --- a/tests/hp/step-11.cc +++ b/tests/hp/step-11.cc @@ -108,7 +108,7 @@ LaplaceProblem::setup_system() system_rhs.reinit(dof_handler.n_dofs()); const IndexSet boundary_dofs = - DoFTools::extract_boundary_dofs(dof_handler, std::vector(1, true)); + DoFTools::extract_boundary_dofs(dof_handler, ComponentMask(1, true)); const unsigned int first_boundary_dof = *boundary_dofs.begin(); diff --git a/tests/mpi/constraint_matrix_condense_01.cc b/tests/mpi/constraint_matrix_condense_01.cc index c196827623..6d9019d5a0 100644 --- a/tests/mpi/constraint_matrix_condense_01.cc +++ b/tests/mpi/constraint_matrix_condense_01.cc @@ -60,7 +60,7 @@ test() constraints.clear(); { const IndexSet boundary_dofs = - DoFTools::extract_boundary_dofs(dof_handler, std::vector(1, true)); + DoFTools::extract_boundary_dofs(dof_handler, ComponentMask(1, true)); unsigned int first_nboundary_dof = 0; while (boundary_dofs.is_element(first_nboundary_dof)) diff --git a/tests/mpi/constraint_matrix_trilinos_bug.cc b/tests/mpi/constraint_matrix_trilinos_bug.cc index e74c83c379..33e1a8b236 100644 --- a/tests/mpi/constraint_matrix_trilinos_bug.cc +++ b/tests/mpi/constraint_matrix_trilinos_bug.cc @@ -94,9 +94,9 @@ test() AffineConstraints cm(relevant_set); DoFTools::make_hanging_node_constraints(dofh, cm); - std::vector velocity_mask(dim + 1, true); + ComponentMask velocity_mask(dim + 1, true); - velocity_mask[dim] = false; + velocity_mask.set(dim, false); VectorTools::interpolate_boundary_values( dofh, 0, Functions::ZeroFunction(dim + 1), cm, velocity_mask); diff --git a/tests/mpi/extract_boundary_dofs.cc b/tests/mpi/extract_boundary_dofs.cc index 7b428257da..a41da1323b 100644 --- a/tests/mpi/extract_boundary_dofs.cc +++ b/tests/mpi/extract_boundary_dofs.cc @@ -44,7 +44,7 @@ test() dofh.distribute_dofs(fe); IndexSet boundary_dofs = - DoFTools::extract_boundary_dofs(dofh, std::vector(1, true)); + DoFTools::extract_boundary_dofs(dofh, ComponentMask(1, true)); if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) boundary_dofs.write(deallog.get_file_stream()); diff --git a/tests/mpi/extract_constant_modes_01.cc b/tests/mpi/extract_constant_modes_01.cc index 4fd2f3f3af..3cd58ced11 100644 --- a/tests/mpi/extract_constant_modes_01.cc +++ b/tests/mpi/extract_constant_modes_01.cc @@ -64,8 +64,8 @@ test() if (myid == 0) for (unsigned int c = 0; c < fe.n_components(); ++c) { - std::vector mask(fe.n_components(), false); - mask[c] = true; + ComponentMask mask(fe.n_components(), false); + mask.set(c, true); std::vector> constant_modes; DoFTools::extract_constant_modes(dofh, mask, constant_modes); @@ -83,8 +83,8 @@ test() if (myid == 0) for (unsigned int c = 0; c < fe.n_components(); ++c) { - std::vector mask(fe.n_components(), false); - mask[c] = true; + ComponentMask mask(fe.n_components(), false); + mask.set(c, true); std::vector> constant_modes; DoFTools::extract_constant_modes(dofh, mask, constant_modes); diff --git a/tests/mpi/extract_constant_modes_02.cc b/tests/mpi/extract_constant_modes_02.cc index b74da02b64..1698ed8138 100644 --- a/tests/mpi/extract_constant_modes_02.cc +++ b/tests/mpi/extract_constant_modes_02.cc @@ -61,7 +61,7 @@ test() // extract constant modes and print if (myid == 0) { - std::vector mask(fe.n_components(), true); + ComponentMask mask(fe.n_components(), true); std::vector> constant_modes; DoFTools::extract_constant_modes(dofh, mask, constant_modes); diff --git a/tests/mpi/extract_constant_modes_03.cc b/tests/mpi/extract_constant_modes_03.cc index c66ef48922..4321aec8e2 100644 --- a/tests/mpi/extract_constant_modes_03.cc +++ b/tests/mpi/extract_constant_modes_03.cc @@ -79,7 +79,7 @@ test(unsigned int fe_nothing_index) if (myid == 0) { - std::vector mask(1, true); + ComponentMask mask(1, true); std::vector> constant_modes; DoFTools::extract_constant_modes(dofh, mask, constant_modes); diff --git a/tests/mpi/p4est_2d_constraintmatrix_03.cc b/tests/mpi/p4est_2d_constraintmatrix_03.cc index cd673308f9..d500cc1d4e 100644 --- a/tests/mpi/p4est_2d_constraintmatrix_03.cc +++ b/tests/mpi/p4est_2d_constraintmatrix_03.cc @@ -106,9 +106,9 @@ test() AffineConstraints cm(relevant_set); DoFTools::make_hanging_node_constraints(dofh, cm); - std::vector velocity_mask(dim + 1, true); + ComponentMask velocity_mask(dim + 1, true); - velocity_mask[dim] = false; + velocity_mask.set(dim, false); VectorTools::interpolate_boundary_values( dofh, 0, Functions::ZeroFunction(dim + 1), cm, velocity_mask); diff --git a/tests/numerics/project_boundary_01.cc b/tests/numerics/project_boundary_01.cc index 9008eddfe0..f0fd6e1f4e 100644 --- a/tests/numerics/project_boundary_01.cc +++ b/tests/numerics/project_boundary_01.cc @@ -170,7 +170,7 @@ check() deallog << "Interpolated boundary values" << std::endl; std::map interpolated_bv; VectorTools::interpolate_boundary_values( - mapping, dof, function_map, interpolated_bv, std::vector()); + mapping, dof, function_map, interpolated_bv, ComponentMask()); write_map(interpolated_bv); deallog << "Projected boundary values" << std::endl; diff --git a/tests/simplex/extract_boundary_dofs.cc b/tests/simplex/extract_boundary_dofs.cc index aff5bc8e15..31e51b6b41 100644 --- a/tests/simplex/extract_boundary_dofs.cc +++ b/tests/simplex/extract_boundary_dofs.cc @@ -50,7 +50,7 @@ test() dofh.distribute_dofs(fe); IndexSet boundary_dofs = - DoFTools::extract_boundary_dofs(dofh, std::vector(1, true)); + DoFTools::extract_boundary_dofs(dofh, ComponentMask(1, true)); if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) boundary_dofs.write(deallog.get_file_stream()); diff --git a/tests/trilinos/precondition_amg_dgp_01.cc b/tests/trilinos/precondition_amg_dgp_01.cc index fb7d7872f8..ddfee1d8f1 100644 --- a/tests/trilinos/precondition_amg_dgp_01.cc +++ b/tests/trilinos/precondition_amg_dgp_01.cc @@ -199,7 +199,7 @@ Step4::solve() TrilinosWrappers::PreconditionAMG preconditioner; TrilinosWrappers::PreconditionAMG::AdditionalData data; DoFTools::extract_constant_modes(dof_handler, - std::vector(1, true), + ComponentMask(1, true), data.constant_modes); data.smoother_sweeps = 2; { diff --git a/tests/vector_tools/boundaries.cc b/tests/vector_tools/boundaries.cc index 906f69cb13..401525b258 100644 --- a/tests/vector_tools/boundaries.cc +++ b/tests/vector_tools/boundaries.cc @@ -149,7 +149,7 @@ check() deallog << "Interpolated boundary values" << std::endl; std::map interpolated_bv; VectorTools::interpolate_boundary_values( - mapping, dof, function_map, interpolated_bv, std::vector()); + mapping, dof, function_map, interpolated_bv, ComponentMask()); write_map(interpolated_bv); // project boundary values diff --git a/tests/vector_tools/boundaries_complex.cc b/tests/vector_tools/boundaries_complex.cc index d806160037..ee10eba214 100644 --- a/tests/vector_tools/boundaries_complex.cc +++ b/tests/vector_tools/boundaries_complex.cc @@ -157,7 +157,7 @@ check() deallog << "Interpolated boundary values" << std::endl; std::map> interpolated_bv; VectorTools::interpolate_boundary_values( - mapping, dof, function_map, interpolated_bv, std::vector()); + mapping, dof, function_map, interpolated_bv, ComponentMask()); write_map(interpolated_bv); // project boundary values diff --git a/tests/vector_tools/boundaries_complex_hp.cc b/tests/vector_tools/boundaries_complex_hp.cc index febc677a68..5912e3ae72 100644 --- a/tests/vector_tools/boundaries_complex_hp.cc +++ b/tests/vector_tools/boundaries_complex_hp.cc @@ -158,7 +158,7 @@ check() deallog << "Interpolated boundary values" << std::endl; std::map> interpolated_bv; VectorTools::interpolate_boundary_values( - mappings, dof, function_map, interpolated_bv, std::vector()); + mappings, dof, function_map, interpolated_bv, ComponentMask()); write_map(interpolated_bv); } -- 2.39.5