From b2db97b75ed9fc50c3760e36829faac2af396282 Mon Sep 17 00:00:00 2001 From: Marc Fehling Date: Sun, 4 Aug 2019 08:47:57 -0600 Subject: [PATCH] mpi/step-27: Check consistency of AffineConstraints. --- tests/mpi/petsc_step-27.cc | 13 +++++++++++++ tests/mpi/trilinos_step-27.cc | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/tests/mpi/petsc_step-27.cc b/tests/mpi/petsc_step-27.cc index c36531d968..1fba613fcf 100644 --- a/tests/mpi/petsc_step-27.cc +++ b/tests/mpi/petsc_step-27.cc @@ -229,6 +229,19 @@ namespace Step27 0, Functions::ZeroFunction(), constraints); +#ifdef DEBUG + // We have not dealt with chains of constraints on ghost cells yet. + // Thus, we are content with verifying their consistency for now. + IndexSet locally_active_dofs; + DoFTools::extract_locally_active_dofs(dof_handler, locally_active_dofs); + AssertThrow(constraints.is_consistent_in_parallel( + dof_handler.locally_owned_dofs_per_processor(), + locally_active_dofs, + mpi_communicator, + /*verbose=*/true), + ExcMessage( + "AffineConstraints object contains inconsistencies!")); +#endif constraints.close(); DynamicSparsityPattern dsp(locally_relevant_dofs); diff --git a/tests/mpi/trilinos_step-27.cc b/tests/mpi/trilinos_step-27.cc index cca0b94db8..44d553f904 100644 --- a/tests/mpi/trilinos_step-27.cc +++ b/tests/mpi/trilinos_step-27.cc @@ -229,6 +229,19 @@ namespace Step27 0, Functions::ZeroFunction(), constraints); +#ifdef DEBUG + // We did not think about hp constraints on ghost cells yet. + // Thus, we are content with verifying their consistency for now. + IndexSet locally_active_dofs; + DoFTools::extract_locally_active_dofs(dof_handler, locally_active_dofs); + AssertThrow(constraints.is_consistent_in_parallel( + dof_handler.locally_owned_dofs_per_processor(), + locally_active_dofs, + mpi_communicator, + /*verbose=*/true), + ExcMessage( + "AffineConstraints object contains inconsistencies!")); +#endif constraints.close(); DynamicSparsityPattern dsp(locally_relevant_dofs); -- 2.39.5