]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Replace remaining occurences of DoFHandler::locally_owned_dofs_per_processor() in... 12310/head
authorMarc Fehling <mafehling.git@gmail.com>
Wed, 26 May 2021 01:43:45 +0000 (19:43 -0600)
committerMarc Fehling <mafehling.git@gmail.com>
Wed, 26 May 2021 02:14:03 +0000 (20:14 -0600)
tests/mpi/hp_constraints_consistent_01.cc
tests/mpi/hp_constraints_consistent_02.cc
tests/mpi/hp_constraints_consistent_03.cc
tests/mpi/petsc_step-27.cc
tests/mpi/trilinos_step-27.cc

index b37045a17dded17c39ffa946b6a3efac62679033..98d742f5ea5a8988aa13266011e56caa8c8ceacb 100644 (file)
@@ -114,6 +114,9 @@ test(const unsigned int degree_center,
   constraints.close();
 
   // ------ verify -----
+  std::vector<IndexSet> 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;
 }
index ab40d3f1dbb9d489869885a2edcfb3c7ed602d51..03ec304b8fda3021445afe79d9613a71c7d52660 100644 (file)
@@ -120,6 +120,9 @@ test(const unsigned int degree_center,
   constraints.close();
 
   // ------ verify -----
+  std::vector<IndexSet> 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;
 }
index d547d16f6b1516ec42b7edf0cd6b6b365c1ffcfc..4a133fff7cd5dc53f3d1fe9a3895b88a7ef6d323 100644 (file)
@@ -134,6 +134,9 @@ test(const unsigned int degree_center,
   constraints.close();
 
   // ------ verify -----
+  std::vector<IndexSet> 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;
 }
index 1da46a3a931a9170abadf116cf45a418ccb788c9..8a0638321e3c8606fb1e5b3d5fd486384271b866 100644 (file)
@@ -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<IndexSet> 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();
 
index 1aaa77c55a93d88a9ea6af51fef96119f50bc458..bdfec757703f83b3d6c711806bc09fea867c1c94 100644 (file)
@@ -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<IndexSet> 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();
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.