]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Adjust test output due to roundoff: Disable output of residual 14254/head
authorMartin Kronbichler <martin.kronbichler@uni-a.de>
Mon, 12 Sep 2022 14:38:25 +0000 (16:38 +0200)
committerMartin Kronbichler <martin.kronbichler@uni-a.de>
Mon, 12 Sep 2022 20:15:58 +0000 (22:15 +0200)
tests/lac/bicgstab_large.cc
tests/lac/bicgstab_large.debug.output

index 878b2020eec02ddba3e51290e4e22dba07868d6a..e28a21358f5e3b7b25ee9a7ab8870dd26b7b72ef 100644 (file)
@@ -31,6 +31,7 @@ main()
 {
   initlog();
   deallog << std::setprecision(4);
+  deallog.depth_file(1);
 
   SparsityPattern sparsity_pattern(4, 4);
   sparsity_pattern.compress();
@@ -46,17 +47,19 @@ main()
 
   Vector<double> solution(4);
 
+  unsigned int n_iter = 0;
   {
     SolverControl    control(100, 1.e-3);
     SolverBicgstab<> bicgstab(control);
     bicgstab.solve(M, solution, rhs, PreconditionIdentity());
+    n_iter = control.last_step();
   }
 
   solution.print(deallog.get_file_stream());
 
   Vector<double> res(4);
   M.residual(res, solution, rhs);
-  deallog << "residual=" << res.l2_norm() << std::endl;
+  deallog << "residual=" << res.l2_norm() << " niter=" << n_iter << std::endl;
 
   // now set up the same problem but with matrix entries scaled by 1e10 and
   // solver tolerance scaled by 1e10. should get the same solution
@@ -69,8 +72,10 @@ main()
     SolverControl    control(100, 1.e7);
     SolverBicgstab<> bicgstab(control);
     bicgstab.solve(M1, solution, rhs, PreconditionIdentity());
+    n_iter = control.last_step();
   }
   solution.print(deallog.get_file_stream());
   M1.residual(res, solution, rhs);
-  deallog << "residual=" << res.l2_norm() << std::endl;
+  deallog << "scaled residual=" << res.l2_norm() / 1e10 << " niter=" << n_iter
+          << std::endl;
 }
index 6c141848748ae3e2028b3925028ff4da9757cd9e..5dec688f11feff72da294988164e0a71afba86fb 100644 (file)
@@ -1,9 +1,5 @@
 
-DEAL:Bicgstab::Starting value 2.000
-DEAL:Bicgstab::Convergence step 4 value 0
-1.000  0.1000 0.09091 0.02381 
-DEAL::residual=0
-DEAL:Bicgstab::Starting value 2.000e+10
-DEAL:Bicgstab::Convergence step 4 value 0.001939
-1.000  0.1000 0.09091 0.02381 
-DEAL::residual=0.001937
+1.000e+00 1.000e-01 9.091e-02 2.381e-02 
+DEAL::residual=1.637e-14 niter=4
+1.000e+00 1.000e-01 9.091e-02 2.381e-02 
+DEAL::scaled residual=1.490e-13 niter=4

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.