From 258dd8fad32075c38ce1cead5563e25dd7c173d4 Mon Sep 17 00:00:00 2001 From: Marco Feder Date: Thu, 23 May 2024 22:02:03 +0000 Subject: [PATCH] Update tests --- .../distributed_poisson_sanity_check_01.cc | 7 +- .../distributed_poisson_sanity_check_02.cc | 13 +- test/polydeal/exact_solutions_distributed.cc | 10 +- ...lly_distributed_poisson_sanity_check_01.cc | 12 +- ...lly_distributed_poisson_sanity_check_02.cc | 12 +- test/polydeal/sparsity_distributed_tria.cc | 3 +- ...h_mpi=true.with_p4est=true.mpirun=3.output | 120 ++++++++++++++++-- 7 files changed, 133 insertions(+), 44 deletions(-) diff --git a/test/polydeal/distributed_poisson_sanity_check_01.cc b/test/polydeal/distributed_poisson_sanity_check_01.cc index ae5a0f0f..6afcdf04 100644 --- a/test/polydeal/distributed_poisson_sanity_check_01.cc +++ b/test/polydeal/distributed_poisson_sanity_check_01.cc @@ -315,12 +315,11 @@ main(int argc, char *argv[]) ah.distribute_agglomerated_dofs( fe_dg); // setup_ghost_polytopes has been called here - DynamicSparsityPattern dsp; + TrilinosWrappers::SparsityPattern dsp; ah.create_agglomeration_sparsity_pattern(dsp); + dsp.compress(); - const IndexSet &locally_owned_dofs = ah.agglo_dh.locally_owned_dofs(); - - system_matrix.reinit(locally_owned_dofs, locally_owned_dofs, dsp, comm); + system_matrix.reinit(dsp); std::ofstream out("sparsity_agglomeration_from_rank_" + std::to_string(Utilities::MPI::this_mpi_process(comm)) + diff --git a/test/polydeal/distributed_poisson_sanity_check_02.cc b/test/polydeal/distributed_poisson_sanity_check_02.cc index d2f62abe..749a854d 100644 --- a/test/polydeal/distributed_poisson_sanity_check_02.cc +++ b/test/polydeal/distributed_poisson_sanity_check_02.cc @@ -169,16 +169,11 @@ main(int argc, char *argv[]) ah.distribute_agglomerated_dofs( fe_dg); // setup_ghost_polytopes has been called here - DynamicSparsityPattern sparsity_pattern; - ah.create_agglomeration_sparsity_pattern(sparsity_pattern); - - const IndexSet &locally_owned_dofs = ah.agglo_dh.locally_owned_dofs(); - - system_matrix.reinit(locally_owned_dofs, - locally_owned_dofs, - sparsity_pattern, - comm); + TrilinosWrappers::SparsityPattern dsp; + ah.create_agglomeration_sparsity_pattern(dsp); + dsp.compress(); + system_matrix.reinit(dsp); std::ofstream out("sparsity_agglomeration_from_rank_" + std::to_string(Utilities::MPI::this_mpi_process(comm)) + ".svg"); diff --git a/test/polydeal/exact_solutions_distributed.cc b/test/polydeal/exact_solutions_distributed.cc index ece09a82..9d241d54 100644 --- a/test/polydeal/exact_solutions_distributed.cc +++ b/test/polydeal/exact_solutions_distributed.cc @@ -213,17 +213,15 @@ do_test() ah.distribute_agglomerated_dofs(fe_dg); - DynamicSparsityPattern sparsity_pattern; - ah.create_agglomeration_sparsity_pattern(sparsity_pattern); + TrilinosWrappers::SparsityPattern dsp; + ah.create_agglomeration_sparsity_pattern(dsp); + dsp.compress(); + system_matrix.reinit(dsp); const IndexSet &locally_owned_dofs = ah.agglo_dh.locally_owned_dofs(); const IndexSet locally_relevant_dofs = DoFTools::extract_locally_relevant_dofs(ah.agglo_dh); - system_matrix.reinit(locally_owned_dofs, - locally_owned_dofs, - sparsity_pattern, - comm); system_rhs.reinit(locally_owned_dofs, comm); std::unique_ptr> rhs_function; diff --git a/test/polydeal/fully_distributed_poisson_sanity_check_01.cc b/test/polydeal/fully_distributed_poisson_sanity_check_01.cc index 06cbb68b..b49967b3 100644 --- a/test/polydeal/fully_distributed_poisson_sanity_check_01.cc +++ b/test/polydeal/fully_distributed_poisson_sanity_check_01.cc @@ -200,15 +200,11 @@ main(int argc, char *argv[]) ah.distribute_agglomerated_dofs( fe_dg); // setup_ghost_polytopes has been called here - DynamicSparsityPattern sparsity_pattern; - ah.create_agglomeration_sparsity_pattern(sparsity_pattern); + TrilinosWrappers::SparsityPattern dsp; + ah.create_agglomeration_sparsity_pattern(dsp); + dsp.compress(); - const IndexSet &locally_owned_dofs = ah.agglo_dh.locally_owned_dofs(); - - system_matrix.reinit(locally_owned_dofs, - locally_owned_dofs, - sparsity_pattern, - comm); + system_matrix.reinit(dsp); std::ofstream out("sparsity_agglomeration_from_rank_" + std::to_string(Utilities::MPI::this_mpi_process(comm)) + diff --git a/test/polydeal/fully_distributed_poisson_sanity_check_02.cc b/test/polydeal/fully_distributed_poisson_sanity_check_02.cc index dc7e5f18..7f4ab944 100644 --- a/test/polydeal/fully_distributed_poisson_sanity_check_02.cc +++ b/test/polydeal/fully_distributed_poisson_sanity_check_02.cc @@ -187,15 +187,11 @@ main(int argc, char *argv[]) ah.distribute_agglomerated_dofs( fe_dg); // setup_ghost_polytopes has been called here - DynamicSparsityPattern sparsity_pattern; - ah.create_agglomeration_sparsity_pattern(sparsity_pattern); + TrilinosWrappers::SparsityPattern dsp; + ah.create_agglomeration_sparsity_pattern(dsp); + dsp.compress(); - const IndexSet &locally_owned_dofs = ah.agglo_dh.locally_owned_dofs(); - - system_matrix.reinit(locally_owned_dofs, - locally_owned_dofs, - sparsity_pattern, - comm); + system_matrix.reinit(dsp); std::ofstream out("sparsity_agglomeration_from_rank_" + std::to_string(Utilities::MPI::this_mpi_process(comm)) + diff --git a/test/polydeal/sparsity_distributed_tria.cc b/test/polydeal/sparsity_distributed_tria.cc index f9a4932f..6558aef6 100644 --- a/test/polydeal/sparsity_distributed_tria.cc +++ b/test/polydeal/sparsity_distributed_tria.cc @@ -157,8 +157,9 @@ main(int argc, char *argv[]) QGauss<1>(face_quadrature_degree)); ah.distribute_agglomerated_dofs(fe_dg); - DynamicSparsityPattern sparsity_pattern; + TrilinosWrappers::SparsityPattern sparsity_pattern; ah.create_agglomeration_sparsity_pattern(sparsity_pattern); + sparsity_pattern.compress(); // Print (the locally owned part of) the sparsity pattern to the given stream, // using the format (line,col), only from rank 0 diff --git a/test/polydeal/sparsity_distributed_tria.with_mpi=true.with_p4est=true.mpirun=3.output b/test/polydeal/sparsity_distributed_tria.with_mpi=true.with_p4est=true.mpirun=3.output index e5b18d88..b553d860 100644 --- a/test/polydeal/sparsity_distributed_tria.with_mpi=true.with_p4est=true.mpirun=3.output +++ b/test/polydeal/sparsity_distributed_tria.with_mpi=true.with_p4est=true.mpirun=3.output @@ -1,9 +1,113 @@ Running with 3 MPI ranks. -[0,0,1,2,3,4,5,6,7,8,9,10,11] -[1,0,1,2,3,4,5,6,7,8,9,10,11] -[2,0,1,2,3,4,5,6,7,8,9,10,11] -[3,0,1,2,3,4,5,6,7,8,9,10,11] -[4,0,1,2,3,4,5,6,7,12,13,14,15,16,17,18,19] -[5,0,1,2,3,4,5,6,7,12,13,14,15,16,17,18,19] -[6,0,1,2,3,4,5,6,7,12,13,14,15,16,17,18,19] -[7,0,1,2,3,4,5,6,7,12,13,14,15,16,17,18,19] +(0,0) +(0,1) +(0,2) +(0,3) +(0,4) +(0,5) +(0,6) +(0,7) +(0,8) +(0,9) +(0,10) +(0,11) +(1,0) +(1,1) +(1,2) +(1,3) +(1,4) +(1,5) +(1,6) +(1,7) +(1,8) +(1,9) +(1,10) +(1,11) +(2,0) +(2,1) +(2,2) +(2,3) +(2,4) +(2,5) +(2,6) +(2,7) +(2,8) +(2,9) +(2,10) +(2,11) +(3,0) +(3,1) +(3,2) +(3,3) +(3,4) +(3,5) +(3,6) +(3,7) +(3,8) +(3,9) +(3,10) +(3,11) +(4,0) +(4,1) +(4,2) +(4,3) +(4,4) +(4,5) +(4,6) +(4,7) +(4,12) +(4,13) +(4,14) +(4,15) +(4,16) +(4,17) +(4,18) +(4,19) +(5,0) +(5,1) +(5,2) +(5,3) +(5,4) +(5,5) +(5,6) +(5,7) +(5,12) +(5,13) +(5,14) +(5,15) +(5,16) +(5,17) +(5,18) +(5,19) +(6,0) +(6,1) +(6,2) +(6,3) +(6,4) +(6,5) +(6,6) +(6,7) +(6,12) +(6,13) +(6,14) +(6,15) +(6,16) +(6,17) +(6,18) +(6,19) +(7,0) +(7,1) +(7,2) +(7,3) +(7,4) +(7,5) +(7,6) +(7,7) +(7,12) +(7,13) +(7,14) +(7,15) +(7,16) +(7,17) +(7,18) +(7,19)