From 1b9aed70fd3c76113b031f298c964b7a64a899f6 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Thu, 19 May 2022 22:38:32 +0200 Subject: [PATCH] Make sure to reach numbers small enough to be below numdiff threshold --- tests/matrix_free/solver_cg_interleave.cc | 9 ++- ...interleave.with_p4est=true.mpirun=3.output | 72 +++++++++---------- 2 files changed, 43 insertions(+), 38 deletions(-) diff --git a/tests/matrix_free/solver_cg_interleave.cc b/tests/matrix_free/solver_cg_interleave.cc index 25deedb97c..bce2199da2 100644 --- a/tests/matrix_free/solver_cg_interleave.cc +++ b/tests/matrix_free/solver_cg_interleave.cc @@ -61,7 +61,8 @@ public: , data(matrix_free) {} - ~HelmholtzOperator() + void + print_n_calls_special() { if (n_calls_vmult > 0) deallog << "Number of calls to special vmult: " << n_calls_vmult @@ -217,7 +218,7 @@ test(const unsigned int fe_degree) VectorType rhs, sol; mf_data.initialize_dof_vector(rhs); mf_data.initialize_dof_vector(sol); - rhs = 1.; + rhs = 1. / std::sqrt(rhs.size()); DiagonalMatrix preconditioner; mf_data.initialize_dof_vector(preconditioner.get_vector()); mf.vmult(preconditioner.get_vector(), rhs); @@ -247,6 +248,7 @@ test(const unsigned int fe_degree) SolverCG solver(control); solver.solve(matrix, sol, rhs, preconditioner); deallog << "Norm of the solution: " << sol.l2_norm() << std::endl; + matrix.print_n_calls_special(); } // Step 3: solve with CG solver for a matrix that does support but a @@ -261,6 +263,7 @@ test(const unsigned int fe_degree) SolverCG solver(control); solver.solve(matrix, sol, rhs, simple_diagonal); deallog << "Norm of the solution: " << sol.l2_norm() << std::endl; + matrix.print_n_calls_special(); } // Step 4: solve with CG solver for a matrix that does support the @@ -276,6 +279,7 @@ test(const unsigned int fe_degree) SolverCG solver(control); solver.solve(matrix, sol, rhs, diagonal_subrange); deallog << "Norm of the solution: " << sol.l2_norm() << std::endl; + matrix.print_n_calls_special(); } } @@ -287,6 +291,7 @@ main(int argc, char **argv) Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); mpi_initlog(); + deallog << std::setprecision(8); test<2, double>(3); test<3, double>(4); diff --git a/tests/matrix_free/solver_cg_interleave.with_p4est=true.mpirun=3.output b/tests/matrix_free/solver_cg_interleave.with_p4est=true.mpirun=3.output index 0f4a8155ff..f98bb860a3 100644 --- a/tests/matrix_free/solver_cg_interleave.with_p4est=true.mpirun=3.output +++ b/tests/matrix_free/solver_cg_interleave.with_p4est=true.mpirun=3.output @@ -1,55 +1,55 @@ DEAL::CG solver without interleaving support -DEAL:cg::Starting value 49.0000 -DEAL:cg::Convergence step 51 value 0.429721 -DEAL::Norm of the solution: 11776.3 +DEAL:cg::Starting value 1.0000000 +DEAL:cg::Convergence step 51 value 0.0087698196 +DEAL::Norm of the solution: 240.33305 DEAL::CG solver with interleaving support -DEAL:cg::Starting value 49.0000 -DEAL:cg::Convergence step 51 value 0.429721 -DEAL::Norm of the solution: 11776.3 +DEAL:cg::Starting value 1.0000000 +DEAL:cg::Convergence step 51 value 0.0087698196 +DEAL::Norm of the solution: 240.33305 DEAL::Number of calls to special vmult: 51 DEAL::CG solver with matrix with interleaving support but no preconditioner -DEAL:cg::Starting value 49.0000 -DEAL:cg::Convergence step 51 value 0.429721 -DEAL::Norm of the solution: 11776.3 +DEAL:cg::Starting value 1.0000000 +DEAL:cg::Convergence step 51 value 0.0087698196 +DEAL::Norm of the solution: 240.33305 DEAL::CG solver with interleaving support and preconditioner working on subrange -DEAL:cg::Starting value 49.0000 -DEAL:cg::Convergence step 51 value 0.429721 -DEAL::Norm of the solution: 11776.3 +DEAL:cg::Starting value 1.0000000 +DEAL:cg::Convergence step 51 value 0.0087698196 +DEAL::Norm of the solution: 240.33305 DEAL::Number of calls to special vmult: 51 DEAL::CG solver without interleaving support -DEAL:cg::Starting value 189.571 -DEAL:cg::Convergence step 61 value 1.71195 -DEAL::Norm of the solution: 684335. +DEAL:cg::Starting value 1.0000000 +DEAL:cg::Convergence step 61 value 0.0090310678 +DEAL::Norm of the solution: 3609.9220 DEAL::CG solver with interleaving support -DEAL:cg::Starting value 189.571 -DEAL:cg::Convergence step 61 value 1.71195 -DEAL::Norm of the solution: 684335. +DEAL:cg::Starting value 1.0000000 +DEAL:cg::Convergence step 61 value 0.0090310675 +DEAL::Norm of the solution: 3609.9220 DEAL::Number of calls to special vmult: 61 DEAL::CG solver with matrix with interleaving support but no preconditioner -DEAL:cg::Starting value 189.571 -DEAL:cg::Convergence step 61 value 1.71195 -DEAL::Norm of the solution: 684335. +DEAL:cg::Starting value 1.0000000 +DEAL:cg::Convergence step 61 value 0.0090310678 +DEAL::Norm of the solution: 3609.9220 DEAL::CG solver with interleaving support and preconditioner working on subrange -DEAL:cg::Starting value 189.571 -DEAL:cg::Convergence step 61 value 1.71195 -DEAL::Norm of the solution: 684335. +DEAL:cg::Starting value 1.0000000 +DEAL:cg::Convergence step 61 value 0.0090310574 +DEAL::Norm of the solution: 3609.9220 DEAL::Number of calls to special vmult: 61 DEAL::CG solver without interleaving support -DEAL:cg::Starting value 125.000 -DEAL:cg::Convergence step 39 value 1.10898 -DEAL::Norm of the solution: 196549. +DEAL:cg::Starting value 1.0000000 +DEAL:cg::Convergence step 39 value 0.0088718752 +DEAL::Norm of the solution: 1572.3941 DEAL::CG solver with interleaving support -DEAL:cg::Starting value 125.000 -DEAL:cg::Convergence step 39 value 1.10898 -DEAL::Norm of the solution: 196549. +DEAL:cg::Starting value 1.0000000 +DEAL:cg::Convergence step 39 value 0.0088718752 +DEAL::Norm of the solution: 1572.3941 DEAL::Number of calls to special vmult: 39 DEAL::CG solver with matrix with interleaving support but no preconditioner -DEAL:cg::Starting value 125.000 -DEAL:cg::Convergence step 39 value 1.10898 -DEAL::Norm of the solution: 196549. +DEAL:cg::Starting value 1.0000000 +DEAL:cg::Convergence step 39 value 0.0088718752 +DEAL::Norm of the solution: 1572.3941 DEAL::CG solver with interleaving support and preconditioner working on subrange -DEAL:cg::Starting value 125.000 -DEAL:cg::Convergence step 39 value 1.10898 -DEAL::Norm of the solution: 196549. +DEAL:cg::Starting value 1.0000000 +DEAL:cg::Convergence step 39 value 0.0088718752 +DEAL::Norm of the solution: 1572.3941 DEAL::Number of calls to special vmult: 39 -- 2.39.5