From: Vladimir Yushutin Date: Mon, 20 May 2024 16:21:20 +0000 (-0400) Subject: Tests fixed X-Git-Tag: v9.6.0-rc1~254^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F17033%2Fhead;p=dealii.git Tests fixed --- diff --git a/tests/lac/linear_operator_12.cc b/tests/lac/linear_operator_12.cc index 4baf77c06b..675bfd2919 100644 --- a/tests/lac/linear_operator_12.cc +++ b/tests/lac/linear_operator_12.cc @@ -197,7 +197,7 @@ Step4::setup_system() const IndexSet locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_handler); - DynamicSparsityPattern dsp(dof_handler.n_dofs()); + DynamicSparsityPattern dsp(locally_relevant_dofs); DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints, false); SparsityTools::distribute_sparsity_pattern(dsp, locally_owned_dofs, diff --git a/tests/lac/linear_operator_12a.cc b/tests/lac/linear_operator_12a.cc index 9ce563d1ae..1e80b6298a 100644 --- a/tests/lac/linear_operator_12a.cc +++ b/tests/lac/linear_operator_12a.cc @@ -198,7 +198,7 @@ Step4::setup_system() const IndexSet locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(dof_handler); - DynamicSparsityPattern dsp(dof_handler.n_dofs()); + DynamicSparsityPattern dsp(locally_relevant_dofs); DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints, false); SparsityTools::distribute_sparsity_pattern(dsp, locally_owned_dofs, diff --git a/tests/particles/particle_interpolation_01.cc b/tests/particles/particle_interpolation_01.cc index 7960c4c9e5..e904c35ec1 100644 --- a/tests/particles/particle_interpolation_01.cc +++ b/tests/particles/particle_interpolation_01.cc @@ -88,15 +88,6 @@ test() << "Space FE: " << space_fe.get_name() << std::endl << "Space dofs: " << space_dh.n_dofs() << std::endl; - DynamicSparsityPattern dsp(particle_handler.n_global_particles() * n_comps, - space_dh.n_dofs()); - - AffineConstraints constraints; - - // Build the interpolation sparsity - Particles::Utilities::create_interpolation_sparsity_pattern( - space_dh, particle_handler, dsp, constraints, space_mask); - const auto n_local_particles_dofs = particle_handler.n_locally_owned_particles() * n_comps; @@ -116,6 +107,16 @@ test() auto global_particles_index_set = Utilities::MPI::all_gather(MPI_COMM_WORLD, n_local_particles_dofs); + DynamicSparsityPattern dsp(particle_handler.n_global_particles() * n_comps, + space_dh.n_dofs(), + local_particle_index_set); + + AffineConstraints constraints; + + // Build the interpolation sparsity + Particles::Utilities::create_interpolation_sparsity_pattern( + space_dh, particle_handler, dsp, constraints, space_mask); + SparsityTools::distribute_sparsity_pattern(dsp, global_particles_index_set, MPI_COMM_WORLD, diff --git a/tests/particles/particle_interpolation_02.cc b/tests/particles/particle_interpolation_02.cc index 5ceecf786f..c39682da2e 100644 --- a/tests/particles/particle_interpolation_02.cc +++ b/tests/particles/particle_interpolation_02.cc @@ -92,15 +92,6 @@ test() << "Space FE: " << space_fe.get_name() << std::endl << "Space dofs: " << space_dh.n_dofs() << std::endl; - DynamicSparsityPattern dsp(particle_handler.n_global_particles() * n_comps, - space_dh.n_dofs()); - - AffineConstraints constraints; - - // Build the interpolation sparsity - Particles::Utilities::create_interpolation_sparsity_pattern( - space_dh, particle_handler, dsp, constraints, space_mask); - const auto n_local_particles_dofs = particle_handler.n_locally_owned_particles() * n_comps; @@ -120,6 +111,16 @@ test() auto global_particles_index_set = Utilities::MPI::all_gather(MPI_COMM_WORLD, n_local_particles_dofs); + DynamicSparsityPattern dsp(particle_handler.n_global_particles() * n_comps, + space_dh.n_dofs(), + local_particle_index_set); + + AffineConstraints constraints; + + // Build the interpolation sparsity + Particles::Utilities::create_interpolation_sparsity_pattern( + space_dh, particle_handler, dsp, constraints, space_mask); + SparsityTools::distribute_sparsity_pattern(dsp, global_particles_index_set, MPI_COMM_WORLD, diff --git a/tests/particles/particle_interpolation_03.cc b/tests/particles/particle_interpolation_03.cc index 86011bcdd7..8de18e4825 100644 --- a/tests/particles/particle_interpolation_03.cc +++ b/tests/particles/particle_interpolation_03.cc @@ -91,15 +91,6 @@ test() << "Space FE: " << space_fe.get_name() << std::endl << "Space dofs: " << space_dh.n_dofs() << std::endl; - DynamicSparsityPattern dsp(particle_handler.n_global_particles() * n_comps, - space_dh.n_dofs()); - - AffineConstraints constraints; - - // Build the interpolation sparsity - Particles::Utilities::create_interpolation_sparsity_pattern( - space_dh, particle_handler, dsp, constraints, space_mask); - const auto n_local_particles_dofs = particle_handler.n_locally_owned_particles() * n_comps; @@ -119,6 +110,16 @@ test() auto global_particles_index_set = Utilities::MPI::all_gather(MPI_COMM_WORLD, n_local_particles_dofs); + DynamicSparsityPattern dsp(particle_handler.n_global_particles() * n_comps, + space_dh.n_dofs(), + local_particle_index_set); + + AffineConstraints constraints; + + // Build the interpolation sparsity + Particles::Utilities::create_interpolation_sparsity_pattern( + space_dh, particle_handler, dsp, constraints, space_mask); + SparsityTools::distribute_sparsity_pattern(dsp, global_particles_index_set, MPI_COMM_WORLD, diff --git a/tests/particles/particle_interpolation_04.cc b/tests/particles/particle_interpolation_04.cc index ffd5b72856..653a1ca3f0 100644 --- a/tests/particles/particle_interpolation_04.cc +++ b/tests/particles/particle_interpolation_04.cc @@ -86,15 +86,6 @@ test() << "Space FE: " << space_fe.get_name() << std::endl << "Space dofs: " << space_dh.n_dofs() << std::endl; - DynamicSparsityPattern dsp(particle_handler.n_global_particles() * n_comps, - space_dh.n_dofs()); - - AffineConstraints constraints; - - // Build the interpolation sparsity - Particles::Utilities::create_interpolation_sparsity_pattern( - space_dh, particle_handler, dsp, constraints, space_mask); - const auto n_local_particles_dofs = particle_handler.n_locally_owned_particles() * n_comps; @@ -114,6 +105,16 @@ test() auto global_particles_index_set = Utilities::MPI::all_gather(MPI_COMM_WORLD, n_local_particles_dofs); + DynamicSparsityPattern dsp(particle_handler.n_global_particles() * n_comps, + space_dh.n_dofs(), + local_particle_index_set); + + AffineConstraints constraints; + + // Build the interpolation sparsity + Particles::Utilities::create_interpolation_sparsity_pattern( + space_dh, particle_handler, dsp, constraints, space_mask); + SparsityTools::distribute_sparsity_pattern(dsp, global_particles_index_set, MPI_COMM_WORLD, diff --git a/tests/particles/particle_interpolation_05.cc b/tests/particles/particle_interpolation_05.cc index 1f2739446a..536d9a5b9a 100644 --- a/tests/particles/particle_interpolation_05.cc +++ b/tests/particles/particle_interpolation_05.cc @@ -88,15 +88,6 @@ test() << "Space FE: " << space_fe.get_name() << std::endl << "Space dofs: " << space_dh.n_dofs() << std::endl; - DynamicSparsityPattern dsp(particle_handler.n_global_particles() * n_comps, - space_dh.n_dofs()); - - AffineConstraints constraints; - - // Build the interpolation sparsity - Particles::Utilities::create_interpolation_sparsity_pattern( - space_dh, particle_handler, dsp, constraints, space_mask); - const auto n_local_particles_dofs = particle_handler.n_locally_owned_particles() * n_comps; @@ -116,6 +107,16 @@ test() auto global_particles_index_set = Utilities::MPI::all_gather(MPI_COMM_WORLD, n_local_particles_dofs); + DynamicSparsityPattern dsp(particle_handler.n_global_particles() * n_comps, + space_dh.n_dofs(), + local_particle_index_set); + + AffineConstraints constraints; + + // Build the interpolation sparsity + Particles::Utilities::create_interpolation_sparsity_pattern( + space_dh, particle_handler, dsp, constraints, space_mask); + SparsityTools::distribute_sparsity_pattern(dsp, global_particles_index_set, MPI_COMM_WORLD, diff --git a/tests/trilinos/direct_solver_2.cc b/tests/trilinos/direct_solver_2.cc index 14991ddded..1f3ca1f35e 100644 --- a/tests/trilinos/direct_solver_2.cc +++ b/tests/trilinos/direct_solver_2.cc @@ -196,7 +196,7 @@ Step4::setup_system() DoFTools::extract_locally_relevant_dofs(dof_handler); - DynamicSparsityPattern dsp(dof_handler.n_dofs()); + DynamicSparsityPattern dsp(locally_relevant_dofs); DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints, false); SparsityTools::distribute_sparsity_pattern(dsp, locally_owned_dofs, diff --git a/tests/trilinos/direct_solver_3.cc b/tests/trilinos/direct_solver_3.cc index 89190ed693..92770bf1f6 100644 --- a/tests/trilinos/direct_solver_3.cc +++ b/tests/trilinos/direct_solver_3.cc @@ -160,7 +160,7 @@ Step4::setup_system() DoFTools::extract_locally_relevant_dofs(dof_handler); - DynamicSparsityPattern dsp(dof_handler.n_dofs()); + DynamicSparsityPattern dsp(locally_relevant_dofs); DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints, false); SparsityTools::distribute_sparsity_pattern(dsp, locally_owned_dofs, diff --git a/tests/trilinos_tpetra/direct_solver_01.cc b/tests/trilinos_tpetra/direct_solver_01.cc index 3c778f7475..04bf70831f 100644 --- a/tests/trilinos_tpetra/direct_solver_01.cc +++ b/tests/trilinos_tpetra/direct_solver_01.cc @@ -197,7 +197,7 @@ Step4::setup_system() DoFTools::extract_locally_relevant_dofs(dof_handler); - DynamicSparsityPattern dsp(dof_handler.n_dofs()); + DynamicSparsityPattern dsp(locally_relevant_dofs); DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints, false); SparsityTools::distribute_sparsity_pattern(dsp, locally_owned_dofs, diff --git a/tests/trilinos_tpetra/direct_solver_02.cc b/tests/trilinos_tpetra/direct_solver_02.cc index 3c0c4f53f3..5e01f25679 100644 --- a/tests/trilinos_tpetra/direct_solver_02.cc +++ b/tests/trilinos_tpetra/direct_solver_02.cc @@ -195,7 +195,7 @@ Step4::setup_system() DoFTools::extract_locally_relevant_dofs(dof_handler); - DynamicSparsityPattern dsp(dof_handler.n_dofs()); + DynamicSparsityPattern dsp(locally_relevant_dofs); DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints, false); SparsityTools::distribute_sparsity_pattern(dsp, locally_owned_dofs,