From 41866b4f5eae8d03728ca59c9c45ef3f9f214f1a Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Sun, 22 Mar 2020 12:45:10 +0100 Subject: [PATCH] Update tests to new distribute_sparsity_pattern --- tests/dofs/dof_tools_22a.cc | 9 ++++--- tests/dofs/sparsity_pattern_06.cc | 2 +- tests/dofs/sparsity_pattern_07.cc | 2 +- tests/fe/fe_nedelec_singularity_01.cc | 9 ++++--- tests/fe/fe_nedelec_singularity_02.cc | 9 ++++--- tests/gla/block_mat_02.cc | 2 +- tests/gla/block_mat_03.cc | 9 ++++--- tests/gla/mat_03.cc | 9 ++++--- tests/lac/linear_operator_12.cc | 10 ++++---- tests/lac/linear_operator_12a.cc | 10 ++++---- tests/mpi/distribute_flux_sparsity_pattern.cc | 9 ++++--- tests/mpi/distribute_sp_01.cc | 3 ++- tests/mpi/distribute_sp_02.cc | 24 +++++++------------ tests/mpi/hp_step-4.cc | 9 ++++--- tests/mpi/hp_step-40.cc | 9 ++++--- tests/mpi/hp_step-40_variable_01.cc | 9 ++++--- tests/mpi/interpolate_to_different_mesh_02.cc | 9 ++++--- tests/mpi/periodicity_01.cc | 9 ++++--- tests/mpi/petsc_step-27.cc | 9 ++++--- tests/mpi/step-40.cc | 9 ++++--- tests/mpi/step-40_cuthill_mckee.cc | 9 ++++--- tests/mpi/step-40_cuthill_mckee_MPI-subset.cc | 9 ++++--- tests/mpi/step-40_direct_solver.cc | 9 ++++--- tests/mpi/trilinos_step-27.cc | 9 ++++--- .../parallel_sparse_matrix_01.cc | 9 ++++--- tests/physics/step-18-rotation_matrix.cc | 8 +------ tests/physics/step-18.cc | 8 +------ tests/sparsity/dynamic_sparsity_pattern_19.cc | 4 +--- tests/trilinos/direct_solver_2.cc | 9 ++++--- tests/trilinos/direct_solver_3.cc | 9 ++++--- tests/trilinos/elide_zeros.cc | 9 ++++--- tests/trilinos/renumbering_01.cc | 9 ++++--- tests/trilinos/solver_control_06.cc | 9 ++++--- 33 files changed, 116 insertions(+), 164 deletions(-) diff --git a/tests/dofs/dof_tools_22a.cc b/tests/dofs/dof_tools_22a.cc index d092899b82..0daf8bb62b 100644 --- a/tests/dofs/dof_tools_22a.cc +++ b/tests/dofs/dof_tools_22a.cc @@ -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); diff --git a/tests/dofs/sparsity_pattern_06.cc b/tests/dofs/sparsity_pattern_06.cc index be9c5c158f..90eeb0b28f 100644 --- a/tests/dofs/sparsity_pattern_06.cc +++ b/tests/dofs/sparsity_pattern_06.cc @@ -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()); diff --git a/tests/dofs/sparsity_pattern_07.cc b/tests/dofs/sparsity_pattern_07.cc index 2b7634beec..53041479ba 100644 --- a/tests/dofs/sparsity_pattern_07.cc +++ b/tests/dofs/sparsity_pattern_07.cc @@ -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()); diff --git a/tests/fe/fe_nedelec_singularity_01.cc b/tests/fe/fe_nedelec_singularity_01.cc index ab7ba689be..52f3b4428f 100644 --- a/tests/fe/fe_nedelec_singularity_01.cc +++ b/tests/fe/fe_nedelec_singularity_01.cc @@ -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, diff --git a/tests/fe/fe_nedelec_singularity_02.cc b/tests/fe/fe_nedelec_singularity_02.cc index 064617f4aa..3987aebf31 100644 --- a/tests/fe/fe_nedelec_singularity_02.cc +++ b/tests/fe/fe_nedelec_singularity_02.cc @@ -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, diff --git a/tests/gla/block_mat_02.cc b/tests/gla/block_mat_02.cc index 1d5eb2945a..ed427db14a 100644 --- a/tests/gla/block_mat_02.cc +++ b/tests/gla/block_mat_02.cc @@ -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); diff --git a/tests/gla/block_mat_03.cc b/tests/gla/block_mat_03.cc index 7bfe73dd90..c30fb59b4b 100644 --- a/tests/gla/block_mat_03.cc +++ b/tests/gla/block_mat_03.cc @@ -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); diff --git a/tests/gla/mat_03.cc b/tests/gla/mat_03.cc index b28d4bd6fc..6cf1ab0bd6 100644 --- a/tests/gla/mat_03.cc +++ b/tests/gla/mat_03.cc @@ -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); diff --git a/tests/lac/linear_operator_12.cc b/tests/lac/linear_operator_12.cc index 929b6bace3..b95f1e6a21 100644 --- a/tests/lac/linear_operator_12.cc +++ b/tests/lac/linear_operator_12.cc @@ -198,14 +198,12 @@ Step4::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, diff --git a/tests/lac/linear_operator_12a.cc b/tests/lac/linear_operator_12a.cc index 29174b6b3f..a4f3d161ed 100644 --- a/tests/lac/linear_operator_12a.cc +++ b/tests/lac/linear_operator_12a.cc @@ -199,14 +199,12 @@ Step4::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, diff --git a/tests/mpi/distribute_flux_sparsity_pattern.cc b/tests/mpi/distribute_flux_sparsity_pattern.cc index fc192ccb9d..8d81e63581 100644 --- a/tests/mpi/distribute_flux_sparsity_pattern.cc +++ b/tests/mpi/distribute_flux_sparsity_pattern.cc @@ -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, diff --git a/tests/mpi/distribute_sp_01.cc b/tests/mpi/distribute_sp_01.cc index 1961922eff..6dadf2606a 100644 --- a/tests/mpi/distribute_sp_01.cc +++ b/tests/mpi/distribute_sp_01.cc @@ -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 #include diff --git a/tests/mpi/distribute_sp_02.cc b/tests/mpi/distribute_sp_02.cc index 1d7d14fc37..f5179851e9 100644 --- a/tests/mpi/distribute_sp_02.cc +++ b/tests/mpi/distribute_sp_02.cc @@ -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 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 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); diff --git a/tests/mpi/hp_step-4.cc b/tests/mpi/hp_step-4.cc index b20eaa77dc..19ceaa8507 100644 --- a/tests/mpi/hp_step-4.cc +++ b/tests/mpi/hp_step-4.cc @@ -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, diff --git a/tests/mpi/hp_step-40.cc b/tests/mpi/hp_step-40.cc index b691a79ac0..47df172800 100644 --- a/tests/mpi/hp_step-40.cc +++ b/tests/mpi/hp_step-40.cc @@ -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, diff --git a/tests/mpi/hp_step-40_variable_01.cc b/tests/mpi/hp_step-40_variable_01.cc index ed20a2cabf..ccdef1e3ee 100644 --- a/tests/mpi/hp_step-40_variable_01.cc +++ b/tests/mpi/hp_step-40_variable_01.cc @@ -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, diff --git a/tests/mpi/interpolate_to_different_mesh_02.cc b/tests/mpi/interpolate_to_different_mesh_02.cc index 54f4c677d5..21977fe851 100644 --- a/tests/mpi/interpolate_to_different_mesh_02.cc +++ b/tests/mpi/interpolate_to_different_mesh_02.cc @@ -150,11 +150,10 @@ SeventhProblem::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, diff --git a/tests/mpi/periodicity_01.cc b/tests/mpi/periodicity_01.cc index ab2c8b2fa9..be0454f167 100644 --- a/tests/mpi/periodicity_01.cc +++ b/tests/mpi/periodicity_01.cc @@ -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, diff --git a/tests/mpi/petsc_step-27.cc b/tests/mpi/petsc_step-27.cc index 0cbecbdd81..cf875044af 100644 --- a/tests/mpi/petsc_step-27.cc +++ b/tests/mpi/petsc_step-27.cc @@ -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, diff --git a/tests/mpi/step-40.cc b/tests/mpi/step-40.cc index 1d247ad6d8..200f282aba 100644 --- a/tests/mpi/step-40.cc +++ b/tests/mpi/step-40.cc @@ -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, diff --git a/tests/mpi/step-40_cuthill_mckee.cc b/tests/mpi/step-40_cuthill_mckee.cc index 9f6ab9da90..c3cb0e2812 100644 --- a/tests/mpi/step-40_cuthill_mckee.cc +++ b/tests/mpi/step-40_cuthill_mckee.cc @@ -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, diff --git a/tests/mpi/step-40_cuthill_mckee_MPI-subset.cc b/tests/mpi/step-40_cuthill_mckee_MPI-subset.cc index 17268ab6e0..f4bb8844e5 100644 --- a/tests/mpi/step-40_cuthill_mckee_MPI-subset.cc +++ b/tests/mpi/step-40_cuthill_mckee_MPI-subset.cc @@ -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, diff --git a/tests/mpi/step-40_direct_solver.cc b/tests/mpi/step-40_direct_solver.cc index 2902bc4a12..d53f1b62d9 100644 --- a/tests/mpi/step-40_direct_solver.cc +++ b/tests/mpi/step-40_direct_solver.cc @@ -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, diff --git a/tests/mpi/trilinos_step-27.cc b/tests/mpi/trilinos_step-27.cc index 81d9df230a..84dc23683a 100644 --- a/tests/mpi/trilinos_step-27.cc +++ b/tests/mpi/trilinos_step-27.cc @@ -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, diff --git a/tests/petsc_complex/parallel_sparse_matrix_01.cc b/tests/petsc_complex/parallel_sparse_matrix_01.cc index fd32196407..63d417ba9b 100644 --- a/tests/petsc_complex/parallel_sparse_matrix_01.cc +++ b/tests/petsc_complex/parallel_sparse_matrix_01.cc @@ -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, diff --git a/tests/physics/step-18-rotation_matrix.cc b/tests/physics/step-18-rotation_matrix.cc index 7431f7721f..e1a61f1a7c 100644 --- a/tests/physics/step-18-rotation_matrix.cc +++ b/tests/physics/step-18-rotation_matrix.cc @@ -189,10 +189,8 @@ namespace Step18 const unsigned int n_mpi_processes; const unsigned int this_mpi_process; ConditionalOStream pcout; - std::vector 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, diff --git a/tests/physics/step-18.cc b/tests/physics/step-18.cc index 8364520c44..0292da33ea 100644 --- a/tests/physics/step-18.cc +++ b/tests/physics/step-18.cc @@ -205,10 +205,8 @@ namespace Step18 const unsigned int n_mpi_processes; const unsigned int this_mpi_process; ConditionalOStream pcout; - std::vector 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, diff --git a/tests/sparsity/dynamic_sparsity_pattern_19.cc b/tests/sparsity/dynamic_sparsity_pattern_19.cc index b0b8d0f497..d28d547902 100644 --- a/tests/sparsity/dynamic_sparsity_pattern_19.cc +++ b/tests/sparsity/dynamic_sparsity_pattern_19.cc @@ -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()); diff --git a/tests/trilinos/direct_solver_2.cc b/tests/trilinos/direct_solver_2.cc index f497afb4f8..97d3470262 100644 --- a/tests/trilinos/direct_solver_2.cc +++ b/tests/trilinos/direct_solver_2.cc @@ -200,11 +200,10 @@ Step4::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, diff --git a/tests/trilinos/direct_solver_3.cc b/tests/trilinos/direct_solver_3.cc index ac1161991b..458391f51f 100644 --- a/tests/trilinos/direct_solver_3.cc +++ b/tests/trilinos/direct_solver_3.cc @@ -162,11 +162,10 @@ Step4::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, diff --git a/tests/trilinos/elide_zeros.cc b/tests/trilinos/elide_zeros.cc index 07f00971c4..f4d8303159 100644 --- a/tests/trilinos/elide_zeros.cc +++ b/tests/trilinos/elide_zeros.cc @@ -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, diff --git a/tests/trilinos/renumbering_01.cc b/tests/trilinos/renumbering_01.cc index 04d3d3928a..3c24b38abf 100644 --- a/tests/trilinos/renumbering_01.cc +++ b/tests/trilinos/renumbering_01.cc @@ -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, diff --git a/tests/trilinos/solver_control_06.cc b/tests/trilinos/solver_control_06.cc index 29a29787b0..65452778a5 100644 --- a/tests/trilinos/solver_control_06.cc +++ b/tests/trilinos/solver_control_06.cc @@ -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); } -- 2.39.5