]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make sure to reach numbers small enough to be below numdiff threshold 13760/head
authorMartin Kronbichler <martin.kronbichler@uni-a.de>
Thu, 19 May 2022 20:38:32 +0000 (22:38 +0200)
committerMartin Kronbichler <martin.kronbichler@uni-a.de>
Thu, 19 May 2022 20:38:32 +0000 (22:38 +0200)
tests/matrix_free/solver_cg_interleave.cc
tests/matrix_free/solver_cg_interleave.with_p4est=true.mpirun=3.output

index 25deedb97cf656d10683862add23d1dd58b244e4..bce2199da23a2205839c2f3f662efebdfcda461e 100644 (file)
@@ -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<VectorType> 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<VectorType>           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<VectorType>           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<VectorType>   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);
index 0f4a8155ffbe905644437a2808bd883b1cbeb407..f98bb860a320b2ed66dfc8f52346c41496e4fbf3 100644 (file)
@@ -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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.