]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Update tests to new distribute_sparsity_pattern
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Sun, 22 Mar 2020 11:45:10 +0000 (12:45 +0100)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Fri, 10 Apr 2020 14:39:23 +0000 (16:39 +0200)
33 files changed:
tests/dofs/dof_tools_22a.cc
tests/dofs/sparsity_pattern_06.cc
tests/dofs/sparsity_pattern_07.cc
tests/fe/fe_nedelec_singularity_01.cc
tests/fe/fe_nedelec_singularity_02.cc
tests/gla/block_mat_02.cc
tests/gla/block_mat_03.cc
tests/gla/mat_03.cc
tests/lac/linear_operator_12.cc
tests/lac/linear_operator_12a.cc
tests/mpi/distribute_flux_sparsity_pattern.cc
tests/mpi/distribute_sp_01.cc
tests/mpi/distribute_sp_02.cc
tests/mpi/hp_step-4.cc
tests/mpi/hp_step-40.cc
tests/mpi/hp_step-40_variable_01.cc
tests/mpi/interpolate_to_different_mesh_02.cc
tests/mpi/periodicity_01.cc
tests/mpi/petsc_step-27.cc
tests/mpi/step-40.cc
tests/mpi/step-40_cuthill_mckee.cc
tests/mpi/step-40_cuthill_mckee_MPI-subset.cc
tests/mpi/step-40_direct_solver.cc
tests/mpi/trilinos_step-27.cc
tests/petsc_complex/parallel_sparse_matrix_01.cc
tests/physics/step-18-rotation_matrix.cc
tests/physics/step-18.cc
tests/sparsity/dynamic_sparsity_pattern_19.cc
tests/trilinos/direct_solver_2.cc
tests/trilinos/direct_solver_3.cc
tests/trilinos/elide_zeros.cc
tests/trilinos/renumbering_01.cc
tests/trilinos/solver_control_06.cc

index d092899b826a538fbdb0074c82715dcebb28696f..0daf8bb62bcf4e5c78ecf1d7cd3ea5f2c72e5940 100644 (file)
@@ -112,11 +112,10 @@ test()
                                        flux_coupling,
                                        Utilities::MPI::this_mpi_process(
                                          MPI_COMM_WORLD));
-  SparsityTools::distribute_sparsity_pattern(
-    sp,
-    dh.compute_n_locally_owned_dofs_per_processor(),
-    MPI_COMM_WORLD,
-    relevant_partitioning);
+  SparsityTools::distribute_sparsity_pattern(sp,
+                                             dh.locally_owned_dofs(),
+                                             MPI_COMM_WORLD,
+                                             relevant_partitioning);
 
   // Output
   MPI_Barrier(MPI_COMM_WORLD);
index be9c5c158fbe97ffa4878b4d1986541892401106..90eeb0b28fe417b791e7475a41e8fe2942268c5e 100644 (file)
@@ -138,7 +138,7 @@ main(int argc, char **argv)
   dynamic_sparsity_pattern.print(deallog.get_file_stream());
   SparsityTools::distribute_sparsity_pattern(
     dynamic_sparsity_pattern,
-    dof_handler_0.compute_n_locally_owned_dofs_per_processor(),
+    dof_handler_0.locally_owned_dofs(),
     MPI_COMM_WORLD,
     dof_handler_0.locally_owned_dofs());
   dynamic_sparsity_pattern.print(deallog.get_file_stream());
index 2b7634beece5647951d01fd1e22a208d41cd9930..53041479baf662fc02095e7d6d0c6b3ae25a9e17 100644 (file)
@@ -155,7 +155,7 @@ main(int argc, char **argv)
   dynamic_sparsity_pattern.print(deallog.get_file_stream());
   SparsityTools::distribute_sparsity_pattern(
     dynamic_sparsity_pattern,
-    dof_handler_0.compute_n_locally_owned_dofs_per_processor(),
+    dof_handler_0.locally_owned_dofs(),
     MPI_COMM_WORLD,
     dof_handler_0.locally_owned_dofs());
   dynamic_sparsity_pattern.print(deallog.get_file_stream());
index ab7ba689bec3fe1230392937c5a77b1e607f496a..52f3b4428f350ec79c289b33a500915ee9100d23 100644 (file)
@@ -400,11 +400,10 @@ namespace nedelec_singularity
     DynamicSparsityPattern dsp(locally_relevant_dofs);
 
     DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints, false);
-    SparsityTools::distribute_sparsity_pattern(
-      dsp,
-      dof_handler.compute_n_locally_owned_dofs_per_processor(),
-      mpi_communicator,
-      locally_relevant_dofs);
+    SparsityTools::distribute_sparsity_pattern(dsp,
+                                               locally_owned_dofs,
+                                               mpi_communicator,
+                                               locally_relevant_dofs);
 
     system_matrix.reinit(locally_owned_dofs,
                          locally_owned_dofs,
index 064617f4aa8f40891415a27941dae05c10b64e79..3987aebf31ca5208146e7d52c57d445e15243a2f 100644 (file)
@@ -390,11 +390,10 @@ namespace nedelec_singularity
     DynamicSparsityPattern dsp(locally_relevant_dofs);
 
     DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints, false);
-    SparsityTools::distribute_sparsity_pattern(
-      dsp,
-      dof_handler.compute_n_locally_owned_dofs_per_processor(),
-      mpi_communicator,
-      locally_relevant_dofs);
+    SparsityTools::distribute_sparsity_pattern(dsp,
+                                               locally_owned_dofs,
+                                               mpi_communicator,
+                                               locally_relevant_dofs);
 
     system_matrix.reinit(locally_owned_dofs,
                          locally_owned_dofs,
index 1d5eb2945afcdbbd316f4f0557dea3a0718cd075..ed427db14ab1900908d8002daa738ee310d6ad78 100644 (file)
@@ -124,7 +124,7 @@ test()
 
   SparsityTools::distribute_sparsity_pattern(
     sp,
-    stokes_dof_handler.compute_locally_owned_dofs_per_processor(),
+    stokes_dof_handler.locally_owned_dofs(),
     MPI_COMM_WORLD,
     stokes_relevant_set);
 
index 7bfe73dd90120ef72fce530d255907d99ea50f8c..c30fb59b4b3a213894e6e61d552c4a146b292a9e 100644 (file)
@@ -109,11 +109,10 @@ test()
 
   BlockDynamicSparsityPattern bcsp(locally_relevant_partitioning);
   DoFTools::make_sparsity_pattern(dof_handler, bcsp, constraints, false);
-  SparsityTools::distribute_sparsity_pattern(
-    bcsp,
-    dof_handler.compute_locally_owned_dofs_per_processor(),
-    MPI_COMM_WORLD,
-    locally_relevant_dofs);
+  SparsityTools::distribute_sparsity_pattern(bcsp,
+                                             locally_owned_dofs,
+                                             MPI_COMM_WORLD,
+                                             locally_relevant_dofs);
 
   typename LA::MPI::BlockSparseMatrix A;
   A.reinit(locally_owned_partitioning, bcsp, MPI_COMM_WORLD);
index b28d4bd6fc404da31ae58b2476d75cc2846ef0a5..6cf1ab0bd684e8effff015b25da94be69d51fea1 100644 (file)
@@ -84,11 +84,10 @@ test()
                                   false,
                                   Utilities::MPI::this_mpi_process(
                                     MPI_COMM_WORLD));
-  SparsityTools::distribute_sparsity_pattern(
-    sp,
-    dof_handler.compute_n_locally_owned_dofs_per_processor(),
-    MPI_COMM_WORLD,
-    relevant);
+  SparsityTools::distribute_sparsity_pattern(sp,
+                                             owned,
+                                             MPI_COMM_WORLD,
+                                             relevant);
   sp.compress();
   matrix.reinit(owned, owned, sp, MPI_COMM_WORLD);
 
index 929b6bace3ced93df67226197c78aa4b53442c6f..b95f1e6a21e14366fbfb346c6d8f192dc440b2ed 100644 (file)
@@ -198,14 +198,12 @@ Step4<dim>::setup_system()
 
   DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
 
-
   DynamicSparsityPattern dsp(dof_handler.n_dofs());
   DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints, false);
-  SparsityTools::distribute_sparsity_pattern(
-    dsp,
-    dof_handler.compute_n_locally_owned_dofs_per_processor(),
-    MPI_COMM_WORLD,
-    locally_relevant_dofs);
+  SparsityTools::distribute_sparsity_pattern(dsp,
+                                             locally_owned_dofs,
+                                             MPI_COMM_WORLD,
+                                             locally_relevant_dofs);
 
   system_matrix.reinit(locally_owned_dofs,
                        locally_owned_dofs,
index 29174b6b3faa9483dfe724a7c328dd7b4c7e662e..a4f3d161edf0cefb75afec1452dede34edf12776 100644 (file)
@@ -199,14 +199,12 @@ Step4<dim>::setup_system()
 
   DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
 
-
   DynamicSparsityPattern dsp(dof_handler.n_dofs());
   DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints, false);
-  SparsityTools::distribute_sparsity_pattern(
-    dsp,
-    dof_handler.compute_n_locally_owned_dofs_per_processor(),
-    MPI_COMM_WORLD,
-    locally_relevant_dofs);
+  SparsityTools::distribute_sparsity_pattern(dsp,
+                                             locally_owned_dofs,
+                                             MPI_COMM_WORLD,
+                                             locally_relevant_dofs);
 
   system_matrix.reinit(locally_owned_dofs,
                        locally_owned_dofs,
index fc192ccb9d5bcd03e2c5a667f763e9d82addbefa..8d81e63581005e668e5660a043806f09363c2d92 100644 (file)
@@ -130,11 +130,10 @@ namespace LinearAdvectionTest
                                          dynamic_sparsity_pattern,
                                          cell_integral_mask,
                                          flux_integral_mask);
-    SparsityTools::distribute_sparsity_pattern(
-      dynamic_sparsity_pattern,
-      dof_handler.compute_n_locally_owned_dofs_per_processor(),
-      MPI_COMM_WORLD,
-      locally_relevant_dofs);
+    SparsityTools::distribute_sparsity_pattern(dynamic_sparsity_pattern,
+                                               locally_owned_dofs,
+                                               MPI_COMM_WORLD,
+                                               locally_relevant_dofs);
 
     system_matrix.reinit(locally_owned_dofs,
                          locally_owned_dofs,
index 1961922eff9b164eee19efe751d9f8e241536897..6dadf2606a9caba392e14950ea64837211b1d02b 100644 (file)
@@ -15,7 +15,8 @@
 
 
 
-// check SparsityTools::distribute_sparsity_pattern
+// check SparsityTools::distribute_sparsity_pattern with the slow part of
+// supplying the number of rows on all processes
 
 #include <deal.II/base/index_set.h>
 #include <deal.II/base/utilities.h>
index 1d7d14fc37cf3fe0a7eb09af1804a8bb0a978067..f5179851e9828bc869d1c5a7f3c1d4e33b3bf529 100644 (file)
@@ -39,14 +39,12 @@ test_mpi()
   if (myid == 0)
     deallog << "Running on " << numprocs << " CPU(s)." << std::endl;
 
-  unsigned int          num_local = 10;
-  unsigned int          n         = numprocs * num_local;
-  std::vector<IndexSet> locally_owned_dofs_per_cpu(numprocs, IndexSet(n));
-  for (unsigned int i = 0; i < numprocs; ++i)
-    locally_owned_dofs_per_cpu[i].add_range((i)*num_local, (i + 1) * num_local);
-
-  IndexSet locally_rel(n);
-  locally_rel.add_range(myid * num_local, (myid + 1) * num_local);
+  unsigned int num_local = 10;
+  unsigned int n         = numprocs * num_local;
+  IndexSet     locally_owned_dofs(n);
+  locally_owned_dofs.add_range(myid * num_local, (myid + 1) * num_local);
+
+  IndexSet locally_rel(locally_owned_dofs);
   if (myid > 0)
     locally_rel.add_range((myid - 1) * num_local, (myid + 0) * num_local);
   if (myid < numprocs - 1)
@@ -68,7 +66,7 @@ test_mpi()
     }
 
   SparsityTools::distribute_sparsity_pattern(csp,
-                                             locally_owned_dofs_per_cpu,
+                                             locally_owned_dofs,
                                              MPI_COMM_WORLD,
                                              locally_rel);
   /*  {
@@ -113,14 +111,8 @@ test_mpi()
   for (unsigned int i = 0; i < n; ++i)
     csp.add(i, myid);
 
-  std::vector<IndexSet> locally_owned_dofs_per_cpu2(numprocs, IndexSet(n));
-  for (unsigned int i = 0; i < numprocs; ++i)
-    locally_owned_dofs_per_cpu2[i].add_range((i)*num_local,
-                                             (i + 1) * num_local);
-
-
   SparsityTools::distribute_sparsity_pattern(csp,
-                                             locally_owned_dofs_per_cpu2,
+                                             locally_owned_dofs,
                                              MPI_COMM_WORLD,
                                              locally_rel);
 
index b20eaa77dcc2162f2743b9354e914b608dbd7d60..19ceaa85078ae65922bce5eafb357f309a624e4c 100644 (file)
@@ -218,11 +218,10 @@ namespace Step4
 
     DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints, false);
 
-    SparsityTools::distribute_sparsity_pattern(
-      dsp,
-      dof_handler.compute_n_locally_owned_dofs_per_processor(),
-      communicator,
-      locally_relevant_dofs);
+    SparsityTools::distribute_sparsity_pattern(dsp,
+                                               locally_owned_dofs,
+                                               communicator,
+                                               locally_relevant_dofs);
 
     system_matrix.reinit(locally_owned_dofs,
                          locally_owned_dofs,
index b691a79ac00d124ee4867da0cd1b8c45b43df7c7..47df172800ff07c60fbd3bded4f3e2e6ca8890ca 100644 (file)
@@ -158,11 +158,10 @@ namespace Step40
                                dof_handler.n_dofs(),
                                locally_relevant_dofs);
     DoFTools::make_sparsity_pattern(dof_handler, csp, constraints, false);
-    SparsityTools::distribute_sparsity_pattern(
-      csp,
-      dof_handler.compute_n_locally_owned_dofs_per_processor(),
-      mpi_communicator,
-      locally_relevant_dofs);
+    SparsityTools::distribute_sparsity_pattern(csp,
+                                               locally_owned_dofs,
+                                               mpi_communicator,
+                                               locally_relevant_dofs);
     system_matrix.reinit(
       mpi_communicator,
       csp,
index ed20a2cabf65710c5d2424c32e739e8ee02007fc..ccdef1e3ee0252e218d1b3f5c6cc077ef442d0aa 100644 (file)
@@ -164,11 +164,10 @@ namespace Step40
                                dof_handler.n_dofs(),
                                locally_relevant_dofs);
     DoFTools::make_sparsity_pattern(dof_handler, csp, constraints, false);
-    SparsityTools::distribute_sparsity_pattern(
-      csp,
-      dof_handler.compute_n_locally_owned_dofs_per_processor(),
-      mpi_communicator,
-      locally_relevant_dofs);
+    SparsityTools::distribute_sparsity_pattern(csp,
+                                               locally_owned_dofs,
+                                               mpi_communicator,
+                                               locally_relevant_dofs);
     system_matrix.reinit(
       mpi_communicator,
       csp,
index 54f4c677d57f693b8827afd74036dad141a0761e..21977fe85135cecc24d71265c826c8e2f000ac70 100644 (file)
@@ -150,11 +150,10 @@ SeventhProblem<dim>::setup_system()
   constraints.close();
   DynamicSparsityPattern csp(locally_relevant_dofs);
   DoFTools::make_sparsity_pattern(dof_handler, csp, constraints, false);
-  SparsityTools::distribute_sparsity_pattern(
-    csp,
-    dof_handler.compute_n_locally_owned_dofs_per_processor(),
-    mpi_communicator,
-    locally_relevant_dofs);
+  SparsityTools::distribute_sparsity_pattern(csp,
+                                             locally_owned_dofs,
+                                             mpi_communicator,
+                                             locally_relevant_dofs);
   system_matrix.reinit(locally_owned_dofs,
                        locally_owned_dofs,
                        csp,
index ab2c8b2fa9fb6712f8b7d838303668055c22736e..be0454f1679d910ebb916e2d5e5aa90bc3d66e59 100644 (file)
@@ -179,11 +179,10 @@ namespace Step40
                                dof_handler.n_dofs(),
                                locally_relevant_dofs);
     DoFTools::make_sparsity_pattern(dof_handler, csp, constraints, false);
-    SparsityTools::distribute_sparsity_pattern(
-      csp,
-      dof_handler.compute_n_locally_owned_dofs_per_processor(),
-      mpi_communicator,
-      locally_relevant_dofs);
+    SparsityTools::distribute_sparsity_pattern(csp,
+                                               dof_handler.locally_owned_dofs(),
+                                               mpi_communicator,
+                                               locally_relevant_dofs);
     system_matrix.reinit(
       mpi_communicator,
       csp,
index 0cbecbdd8152ada4b0c8dd4a059697cbb927d007..cf875044af8ebdc3dc7a6009049654dc80360283 100644 (file)
@@ -243,11 +243,10 @@ namespace Step27
 
     DynamicSparsityPattern dsp(locally_relevant_dofs);
     DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints, false);
-    SparsityTools::distribute_sparsity_pattern(
-      dsp,
-      dof_handler.compute_n_locally_owned_dofs_per_processor(),
-      mpi_communicator,
-      locally_relevant_dofs);
+    SparsityTools::distribute_sparsity_pattern(dsp,
+                                               locally_owned_dofs,
+                                               mpi_communicator,
+                                               locally_relevant_dofs);
 
     system_matrix.reinit(locally_owned_dofs,
                          locally_owned_dofs,
index 1d247ad6d8ed7ccaacf9c84f4c4a5fdc73843dbb..200f282abaa171cc2d3d8f20d499a3e588eaeeee 100644 (file)
@@ -152,11 +152,10 @@ namespace Step40
                                dof_handler.n_dofs(),
                                locally_relevant_dofs);
     DoFTools::make_sparsity_pattern(dof_handler, csp, constraints, false);
-    SparsityTools::distribute_sparsity_pattern(
-      csp,
-      dof_handler.compute_n_locally_owned_dofs_per_processor(),
-      mpi_communicator,
-      locally_relevant_dofs);
+    SparsityTools::distribute_sparsity_pattern(csp,
+                                               locally_owned_dofs,
+                                               mpi_communicator,
+                                               locally_relevant_dofs);
     system_matrix.reinit(
       mpi_communicator,
       csp,
index 9f6ab9da908351d8b3b08dd6493e40af1bd58a7c..c3cb0e2812eee297a2aaf7222ccaa7378e6cb876 100644 (file)
@@ -214,11 +214,10 @@ namespace Step40
                                dof_handler.n_dofs(),
                                locally_relevant_dofs);
     DoFTools::make_sparsity_pattern(dof_handler, csp, constraints, false);
-    SparsityTools::distribute_sparsity_pattern(
-      csp,
-      dof_handler.compute_n_locally_owned_dofs_per_processor(),
-      mpi_communicator,
-      locally_relevant_dofs);
+    SparsityTools::distribute_sparsity_pattern(csp,
+                                               locally_owned_dofs,
+                                               mpi_communicator,
+                                               locally_relevant_dofs);
     system_matrix.reinit(
       mpi_communicator,
       csp,
index 17268ab6e0cda411ded829b77e5f540d5d5b9b4c..f4bb8844e56a3201be4f9203858c88f6ed452e96 100644 (file)
@@ -215,11 +215,10 @@ namespace Step40
                                dof_handler.n_dofs(),
                                locally_relevant_dofs);
     DoFTools::make_sparsity_pattern(dof_handler, csp, constraints, false);
-    SparsityTools::distribute_sparsity_pattern(
-      csp,
-      dof_handler.compute_n_locally_owned_dofs_per_processor(),
-      mpi_communicator,
-      locally_relevant_dofs);
+    SparsityTools::distribute_sparsity_pattern(csp,
+                                               locally_owned_dofs,
+                                               mpi_communicator,
+                                               locally_relevant_dofs);
     system_matrix.reinit(
       mpi_communicator,
       csp,
index 2902bc4a12025c30d5fe69e08c4f4c85f941e100..d53f1b62d982b8d598c5ba1105f7a8eaad6e2ce4 100644 (file)
@@ -152,11 +152,10 @@ namespace Step40
                                dof_handler.n_dofs(),
                                locally_relevant_dofs);
     DoFTools::make_sparsity_pattern(dof_handler, csp, constraints, false);
-    SparsityTools::distribute_sparsity_pattern(
-      csp,
-      dof_handler.compute_n_locally_owned_dofs_per_processor(),
-      mpi_communicator,
-      locally_relevant_dofs);
+    SparsityTools::distribute_sparsity_pattern(csp,
+                                               locally_owned_dofs,
+                                               mpi_communicator,
+                                               locally_relevant_dofs);
     system_matrix.reinit(
       mpi_communicator,
       csp,
index 81d9df230a5b5a26ce31f123c53a31667ac2ed0f..84dc23683ae0b378d61ca2a32c2acd18d0b0cc7e 100644 (file)
@@ -243,11 +243,10 @@ namespace Step27
 
     DynamicSparsityPattern dsp(locally_relevant_dofs);
     DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints, false);
-    SparsityTools::distribute_sparsity_pattern(
-      dsp,
-      dof_handler.compute_n_locally_owned_dofs_per_processor(),
-      mpi_communicator,
-      locally_relevant_dofs);
+    SparsityTools::distribute_sparsity_pattern(dsp,
+                                               locally_owned_dofs,
+                                               mpi_communicator,
+                                               locally_relevant_dofs);
 
     system_matrix.reinit(locally_owned_dofs,
                          locally_owned_dofs,
index fd321964079b8cece33ed9ceefec0af73af6e757..63d417ba9b42a72b6abe01ee3b29565cac2104f6 100644 (file)
@@ -91,11 +91,10 @@ test(const unsigned int poly_degree = 1)
 
   DynamicSparsityPattern dsp(locally_relevant_dofs);
   DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints, false);
-  SparsityTools::distribute_sparsity_pattern(
-    dsp,
-    dof_handler.compute_n_locally_owned_dofs_per_processor(),
-    mpi_communicator,
-    locally_relevant_dofs);
+  SparsityTools::distribute_sparsity_pattern(dsp,
+                                             locally_owned_dofs,
+                                             mpi_communicator,
+                                             locally_relevant_dofs);
 
   mass_matrix.reinit(locally_owned_dofs,
                      locally_owned_dofs,
index 7431f7721fe3282c3ac3bb34a34423849da08d68..e1a61f1a7c0a78384d9c1def5e9cf3e52bdf4f94 100644 (file)
@@ -189,10 +189,8 @@ namespace Step18
     const unsigned int                   n_mpi_processes;
     const unsigned int                   this_mpi_process;
     ConditionalOStream                   pcout;
-    std::vector<types::global_dof_index> local_dofs_per_process;
     IndexSet                             locally_owned_dofs;
     IndexSet                             locally_relevant_dofs;
-    unsigned int                         n_local_cells;
     static const SymmetricTensor<4, dim> stress_strain_tensor;
     int                                  monitored_vertex_first_dof;
   };
@@ -355,10 +353,6 @@ namespace Step18
     dof_handler.distribute_dofs(fe);
     locally_owned_dofs = dof_handler.locally_owned_dofs();
     DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
-    n_local_cells = GridTools::count_cells_with_subdomain_association(
-      triangulation, triangulation.locally_owned_subdomain());
-    local_dofs_per_process =
-      dof_handler.compute_n_locally_owned_dofs_per_processor();
     hanging_node_constraints.clear();
     DoFTools::make_hanging_node_constraints(dof_handler,
                                             hanging_node_constraints);
@@ -369,7 +363,7 @@ namespace Step18
                                     hanging_node_constraints,
                                     /*keep constrained dofs*/ false);
     SparsityTools::distribute_sparsity_pattern(sparsity_pattern,
-                                               local_dofs_per_process,
+                                               locally_owned_dofs,
                                                mpi_communicator,
                                                locally_relevant_dofs);
     system_matrix.reinit(locally_owned_dofs,
index 8364520c441061513753a74f0660c2e81491d86f..0292da33eadeba8d8123b99663e0bd1036b09993 100644 (file)
@@ -205,10 +205,8 @@ namespace Step18
     const unsigned int                   n_mpi_processes;
     const unsigned int                   this_mpi_process;
     ConditionalOStream                   pcout;
-    std::vector<types::global_dof_index> local_dofs_per_process;
     IndexSet                             locally_owned_dofs;
     IndexSet                             locally_relevant_dofs;
-    unsigned int                         n_local_cells;
     static const SymmetricTensor<4, dim> stress_strain_tensor;
     int                                  monitored_vertex_first_dof;
   };
@@ -371,10 +369,6 @@ namespace Step18
     dof_handler.distribute_dofs(fe);
     locally_owned_dofs = dof_handler.locally_owned_dofs();
     DoFTools::extract_locally_relevant_dofs(dof_handler, locally_relevant_dofs);
-    n_local_cells = GridTools::count_cells_with_subdomain_association(
-      triangulation, triangulation.locally_owned_subdomain());
-    local_dofs_per_process =
-      dof_handler.compute_n_locally_owned_dofs_per_processor();
     hanging_node_constraints.clear();
     DoFTools::make_hanging_node_constraints(dof_handler,
                                             hanging_node_constraints);
@@ -385,7 +379,7 @@ namespace Step18
                                     hanging_node_constraints,
                                     /*keep constrained dofs*/ false);
     SparsityTools::distribute_sparsity_pattern(sparsity_pattern,
-                                               local_dofs_per_process,
+                                               locally_owned_dofs,
                                                mpi_communicator,
                                                locally_relevant_dofs);
     system_matrix.reinit(locally_owned_dofs,
index b0b8d0f497bfe7c4784f68ccc733400bf15cb4d7..d28d547902048da36f273e0c7da797c62e153ddd 100644 (file)
@@ -37,8 +37,6 @@ test()
   else
     owned.add_range(7, 10);
 
-  const auto rows_per_cpu = Utilities::MPI::all_gather(comm, owned);
-
   IndexSet ghost_range(owned);
   if (myid == 0)
     {
@@ -86,7 +84,7 @@ test()
   deallog << "Before gather_sparsity_pattern:" << std::endl;
   dsp.print(deallog.get_file_stream());
 
-  SparsityTools::gather_sparsity_pattern(dsp, rows_per_cpu, comm, ghost_range);
+  SparsityTools::gather_sparsity_pattern(dsp, owned, comm, ghost_range);
 
   deallog << "After gather_sparsity_pattern:" << std::endl;
   dsp.print(deallog.get_file_stream());
index f497afb4f82b9c8ac4089d7023afadf3d0cf9d44..97d34702622dc3e71e479758b51b3ccc1423ed40 100644 (file)
@@ -200,11 +200,10 @@ Step4<dim>::setup_system()
 
   DynamicSparsityPattern dsp(dof_handler.n_dofs());
   DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints, false);
-  SparsityTools::distribute_sparsity_pattern(
-    dsp,
-    dof_handler.compute_n_locally_owned_dofs_per_processor(),
-    MPI_COMM_WORLD,
-    locally_relevant_dofs);
+  SparsityTools::distribute_sparsity_pattern(dsp,
+                                             locally_owned_dofs,
+                                             MPI_COMM_WORLD,
+                                             locally_relevant_dofs);
 
   system_matrix.reinit(locally_owned_dofs,
                        locally_owned_dofs,
index ac1161991be713183a5f80300215e26d534b06fe..458391f51fe3e568ae0a0a305c60dfc9d400c138 100644 (file)
@@ -162,11 +162,10 @@ Step4<dim>::setup_system()
 
   DynamicSparsityPattern dsp(dof_handler.n_dofs());
   DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints, false);
-  SparsityTools::distribute_sparsity_pattern(
-    dsp,
-    dof_handler.compute_n_locally_owned_dofs_per_processor(),
-    MPI_COMM_WORLD,
-    locally_relevant_dofs);
+  SparsityTools::distribute_sparsity_pattern(dsp,
+                                             locally_owned_dofs,
+                                             MPI_COMM_WORLD,
+                                             locally_relevant_dofs);
 
   system_matrix.reinit(locally_owned_dofs,
                        locally_owned_dofs,
index 07f00971c4f852ef12065b9a5653d65b8481cdfa..f4d830315968303f21e30f8816551f90cc9f7add 100644 (file)
@@ -169,11 +169,10 @@ namespace LinearAdvectionTest
                                          cell_integral_mask,
                                          flux_integral_mask);
 
-    SparsityTools::distribute_sparsity_pattern(
-      dynamic_sparsity_pattern,
-      dof_handler.compute_n_locally_owned_dofs_per_processor(),
-      MPI_COMM_WORLD,
-      locally_relevant_dofs);
+    SparsityTools::distribute_sparsity_pattern(dynamic_sparsity_pattern,
+                                               locally_owned_dofs,
+                                               MPI_COMM_WORLD,
+                                               locally_relevant_dofs);
 
     system_matrix.reinit(locally_owned_dofs,
                          locally_owned_dofs,
index 04d3d3928a87b200c6dab09877b146214a52f5b6..3c24b38abf0d887a94454edb8bf1a1dc9deaf5a3 100644 (file)
@@ -124,11 +124,10 @@ private:
                                     sparsity_pattern,
                                     constraints,
                                     /*keep constrained dofs*/ false);
-    SparsityTools::distribute_sparsity_pattern(
-      sparsity_pattern,
-      dof_handler.compute_n_locally_owned_dofs_per_processor(),
-      MPI_COMM_WORLD,
-      locally_relevant_dofs);
+    SparsityTools::distribute_sparsity_pattern(sparsity_pattern,
+                                               locally_owned_dofs,
+                                               MPI_COMM_WORLD,
+                                               locally_relevant_dofs);
 
     system_matrix.reinit(locally_owned_dofs,
                          locally_owned_dofs,
index 29a29787b069a4c019df21b03b89aed48acd20b1..65452778a5211958f59f48b98293455e61194ebe 100644 (file)
@@ -217,11 +217,10 @@ Test_Solver_Output::setup_system()
 
   DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints, false);
 
-  SparsityTools::distribute_sparsity_pattern(
-    dsp,
-    dof_handler.compute_n_locally_owned_dofs_per_processor(),
-    mpi_comm,
-    locally_relevant_dofs);
+  SparsityTools::distribute_sparsity_pattern(dsp,
+                                             locally_owned_dofs,
+                                             mpi_comm,
+                                             locally_relevant_dofs);
 
   system_matrix.reinit(locally_owned_dofs, locally_owned_dofs, dsp, mpi_comm);
 }

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.