From b0b2d773ee4f6efeed5b07183d4acce1ffbb970b Mon Sep 17 00:00:00 2001 From: Marc Fehling Date: Tue, 25 May 2021 19:43:45 -0600 Subject: [PATCH] Replace remaining occurences of DoFHandler::locally_owned_dofs_per_processor() in the tests folder. --- tests/mpi/hp_constraints_consistent_01.cc | 17 ++++++++++------- tests/mpi/hp_constraints_consistent_02.cc | 17 ++++++++++------- tests/mpi/hp_constraints_consistent_03.cc | 17 ++++++++++------- tests/mpi/petsc_step-27.cc | 18 +++++++++++------- tests/mpi/trilinos_step-27.cc | 18 +++++++++++------- 5 files changed, 52 insertions(+), 35 deletions(-) diff --git a/tests/mpi/hp_constraints_consistent_01.cc b/tests/mpi/hp_constraints_consistent_01.cc index b37045a17d..98d742f5ea 100644 --- a/tests/mpi/hp_constraints_consistent_01.cc +++ b/tests/mpi/hp_constraints_consistent_01.cc @@ -114,6 +114,9 @@ test(const unsigned int degree_center, constraints.close(); // ------ verify ----- + std::vector locally_owned_dofs_per_processor = + Utilities::MPI::all_gather(dh.get_communicator(), dh.locally_owned_dofs()); + IndexSet locally_active_dofs; DoFTools::extract_locally_active_dofs(dh, locally_active_dofs); @@ -122,13 +125,13 @@ test(const unsigned int degree_center, deallog << "constraints:" << std::endl; constraints.print(deallog.get_file_stream()); } - deallog << "consistent? " - << constraints.is_consistent_in_parallel( - dh.locally_owned_dofs_per_processor(), - locally_active_dofs, - MPI_COMM_WORLD, - true) - << std::endl; + deallog + << "consistent? " + << constraints.is_consistent_in_parallel(locally_owned_dofs_per_processor, + locally_active_dofs, + MPI_COMM_WORLD, + true) + << std::endl; deallog << "OK" << std::endl; } diff --git a/tests/mpi/hp_constraints_consistent_02.cc b/tests/mpi/hp_constraints_consistent_02.cc index ab40d3f1db..03ec304b8f 100644 --- a/tests/mpi/hp_constraints_consistent_02.cc +++ b/tests/mpi/hp_constraints_consistent_02.cc @@ -120,6 +120,9 @@ test(const unsigned int degree_center, constraints.close(); // ------ verify ----- + std::vector locally_owned_dofs_per_processor = + Utilities::MPI::all_gather(dh.get_communicator(), dh.locally_owned_dofs()); + IndexSet locally_active_dofs; DoFTools::extract_locally_active_dofs(dh, locally_active_dofs); @@ -128,13 +131,13 @@ test(const unsigned int degree_center, deallog << "constraints:" << std::endl; constraints.print(deallog.get_file_stream()); } - deallog << "consistent? " - << constraints.is_consistent_in_parallel( - dh.locally_owned_dofs_per_processor(), - locally_active_dofs, - MPI_COMM_WORLD, - true) - << std::endl; + deallog + << "consistent? " + << constraints.is_consistent_in_parallel(locally_owned_dofs_per_processor, + locally_active_dofs, + MPI_COMM_WORLD, + true) + << std::endl; deallog << "OK" << std::endl; } diff --git a/tests/mpi/hp_constraints_consistent_03.cc b/tests/mpi/hp_constraints_consistent_03.cc index d547d16f6b..4a133fff7c 100644 --- a/tests/mpi/hp_constraints_consistent_03.cc +++ b/tests/mpi/hp_constraints_consistent_03.cc @@ -134,6 +134,9 @@ test(const unsigned int degree_center, constraints.close(); // ------ verify ----- + std::vector locally_owned_dofs_per_processor = + Utilities::MPI::all_gather(dh.get_communicator(), dh.locally_owned_dofs()); + IndexSet locally_active_dofs; DoFTools::extract_locally_active_dofs(dh, locally_active_dofs); @@ -142,13 +145,13 @@ test(const unsigned int degree_center, deallog << "constraints:" << std::endl; constraints.print(deallog.get_file_stream()); } - deallog << "consistent? " - << constraints.is_consistent_in_parallel( - dh.locally_owned_dofs_per_processor(), - locally_active_dofs, - MPI_COMM_WORLD, - true) - << std::endl; + deallog + << "consistent? " + << constraints.is_consistent_in_parallel(locally_owned_dofs_per_processor, + locally_active_dofs, + MPI_COMM_WORLD, + true) + << std::endl; deallog << "OK" << std::endl; } diff --git a/tests/mpi/petsc_step-27.cc b/tests/mpi/petsc_step-27.cc index 1da46a3a93..8a0638321e 100644 --- a/tests/mpi/petsc_step-27.cc +++ b/tests/mpi/petsc_step-27.cc @@ -228,15 +228,19 @@ namespace Step27 #ifdef DEBUG // We have not dealt with chains of constraints on ghost cells yet. // Thus, we are content with verifying their consistency for now. + std::vector locally_owned_dofs_per_processor = + Utilities::MPI::all_gather(dof_handler.get_communicator(), + dof_handler.locally_owned_dofs()); + 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!")); + + AssertThrow( + constraints.is_consistent_in_parallel(locally_owned_dofs_per_processor, + locally_active_dofs, + mpi_communicator, + /*verbose=*/true), + ExcMessage("AffineConstraints object contains inconsistencies!")); #endif constraints.close(); diff --git a/tests/mpi/trilinos_step-27.cc b/tests/mpi/trilinos_step-27.cc index 1aaa77c55a..bdfec75770 100644 --- a/tests/mpi/trilinos_step-27.cc +++ b/tests/mpi/trilinos_step-27.cc @@ -228,15 +228,19 @@ namespace Step27 #ifdef DEBUG // We did not think about hp-constraints on ghost cells yet. // Thus, we are content with verifying their consistency for now. + std::vector locally_owned_dofs_per_processor = + Utilities::MPI::all_gather(dof_handler.get_communicator(), + dof_handler.locally_owned_dofs()); + 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!")); + + AssertThrow( + constraints.is_consistent_in_parallel(locally_owned_dofs_per_processor, + locally_active_dofs, + mpi_communicator, + /*verbose=*/true), + ExcMessage("AffineConstraints object contains inconsistencies!")); #endif constraints.close(); -- 2.39.5