From: Martin Kronbichler Date: Mon, 12 Sep 2022 14:38:25 +0000 (+0200) Subject: Adjust test output due to roundoff: Disable output of residual X-Git-Tag: v9.5.0-rc1~970^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14254%2Fhead;p=dealii.git Adjust test output due to roundoff: Disable output of residual --- diff --git a/tests/lac/bicgstab_large.cc b/tests/lac/bicgstab_large.cc index 878b2020ee..e28a21358f 100644 --- a/tests/lac/bicgstab_large.cc +++ b/tests/lac/bicgstab_large.cc @@ -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 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 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; } diff --git a/tests/lac/bicgstab_large.debug.output b/tests/lac/bicgstab_large.debug.output index 6c14184874..5dec688f11 100644 --- a/tests/lac/bicgstab_large.debug.output +++ b/tests/lac/bicgstab_large.debug.output @@ -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