From 334e1ca2bf0d2cb40a621cdd5bc47d253ab2407f Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 30 Mar 2021 21:30:38 -0600 Subject: [PATCH] Adjust tests. --- tests/fe/fe_q_dg0.cc | 2 +- tests/mpi/constraint_matrix_condense_01.cc | 6 ++---- tests/mpi/extract_boundary_dofs.cc | 7 +++---- tests/simplex/extract_boundary_dofs.cc | 7 +++---- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/tests/fe/fe_q_dg0.cc b/tests/fe/fe_q_dg0.cc index 8b98c87b8e..466ae87fe9 100644 --- a/tests/fe/fe_q_dg0.cc +++ b/tests/fe/fe_q_dg0.cc @@ -431,7 +431,7 @@ namespace Step22 /*std::vector boundary_dofs (dof_handler.n_dofs(), false); - std::vectorboundary_mask (dim+1, false); + std::vector boundary_mask (dim+1, false); boundary_mask[dim]=true; DoFTools::extract_boundary_dofs (dof_handler,boundary_mask,boundary_dofs); diff --git a/tests/mpi/constraint_matrix_condense_01.cc b/tests/mpi/constraint_matrix_condense_01.cc index 9c64aeb6e3..46d0612f36 100644 --- a/tests/mpi/constraint_matrix_condense_01.cc +++ b/tests/mpi/constraint_matrix_condense_01.cc @@ -59,10 +59,8 @@ test() AffineConstraints constraints(locally_relevant_dofs); constraints.clear(); { - IndexSet boundary_dofs(dof_handler.n_dofs()); - DoFTools::extract_boundary_dofs(dof_handler, - std::vector(1, true), - boundary_dofs); + const IndexSet boundary_dofs = + DoFTools::extract_boundary_dofs(dof_handler, std::vector(1, true)); unsigned int first_nboundary_dof = 0; while (boundary_dofs.is_element(first_nboundary_dof)) diff --git a/tests/mpi/extract_boundary_dofs.cc b/tests/mpi/extract_boundary_dofs.cc index 06f9168e70..64d96e4c00 100644 --- a/tests/mpi/extract_boundary_dofs.cc +++ b/tests/mpi/extract_boundary_dofs.cc @@ -43,15 +43,14 @@ test() DoFHandler dofh(tr); dofh.distribute_dofs(fe); - IndexSet relevant_set, boundary_dofs; - DoFTools::extract_boundary_dofs(dofh, - std::vector(1, true), - boundary_dofs); + const IndexSet boundary_dofs = + DoFTools::extract_boundary_dofs(dofh, std::vector(1, true)); if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) boundary_dofs.write(deallog.get_file_stream()); // the result of extract_boundary_dofs is supposed to be a subset of the // locally relevant dofs, so test this + IndexSet relevant_set; DoFTools::extract_locally_relevant_dofs(dofh, relevant_set); boundary_dofs.subtract_set(relevant_set); AssertThrow(boundary_dofs.n_elements() == 0, ExcInternalError()); diff --git a/tests/simplex/extract_boundary_dofs.cc b/tests/simplex/extract_boundary_dofs.cc index 2de79fa1b0..2db61b378a 100644 --- a/tests/simplex/extract_boundary_dofs.cc +++ b/tests/simplex/extract_boundary_dofs.cc @@ -49,15 +49,14 @@ test() DoFHandler dofh(tr); dofh.distribute_dofs(fe); - IndexSet relevant_set, boundary_dofs; - DoFTools::extract_boundary_dofs(dofh, - std::vector(1, true), - boundary_dofs); + IndexSet boundary_dofs = + DoFTools::extract_boundary_dofs(dofh, std::vector(1, true)); if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) boundary_dofs.write(deallog.get_file_stream()); // the result of extract_boundary_dofs is supposed to be a subset of the // locally relevant dofs, so test this + IndexSet relevant_set; DoFTools::extract_locally_relevant_dofs(dofh, relevant_set); boundary_dofs.subtract_set(relevant_set); AssertThrow(boundary_dofs.n_elements() == 0, ExcInternalError()); -- 2.39.5