Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fdrmrc committed May 24, 2024
1 parent 3efd706 commit 258dd8f
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 44 deletions.
7 changes: 3 additions & 4 deletions test/polydeal/distributed_poisson_sanity_check_01.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)) +
Expand Down
13 changes: 4 additions & 9 deletions test/polydeal/distributed_poisson_sanity_check_02.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
10 changes: 4 additions & 6 deletions test/polydeal/exact_solutions_distributed.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<const RightHandSide<dim>> rhs_function;
Expand Down
12 changes: 4 additions & 8 deletions test/polydeal/fully_distributed_poisson_sanity_check_01.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)) +
Expand Down
12 changes: 4 additions & 8 deletions test/polydeal/fully_distributed_poisson_sanity_check_02.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)) +
Expand Down
3 changes: 2 additions & 1 deletion test/polydeal/sparsity_distributed_tria.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 258dd8f

Please sign in to comment.