From 877ca85c1816cfc86276a89e5dbe61c0e94afe29 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Tue, 11 Sep 2001 12:52:56 +0000 Subject: [PATCH] Orthogonal residual as a stopping criterion git-svn-id: https://svn.dealii.org/trunk@4957 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/solver_bicgstab.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/deal.II/lac/include/lac/solver_bicgstab.h b/deal.II/lac/include/lac/solver_bicgstab.h index 1ea6e919c5..28d562df23 100644 --- a/deal.II/lac/include/lac/solver_bicgstab.h +++ b/deal.II/lac/include/lac/solver_bicgstab.h @@ -37,9 +37,13 @@ * The Bicgstab-method has two additional parameters: the first is a * boolean, deciding whether to compute the actual residual in each * step (@p{true}) or to use the length of the computed orthogonal - * residual (@{false}, not implemented yet). Remark, that computing - * the residual causes a third matrix-vector-multiplication, though no - * additional preconditioning, in each step. + * residual (@{false}). Remark, that computing the residual causes a + * third matrix-vector-multiplication, though no additional + * preconditioning, in each step. The reason for doing this is, that + * the size of the orthogonalized residual computed during the + * iteration may be larger by orders of magnitude than the true + * residual. This is due to numerical instabilities related to badly + * conditioned matrices. * * The second parameter is the size of a breakdown criterion. It is * difficult to find a general good criterion, so if things do not @@ -325,7 +329,11 @@ SolverBicgstab::iterate(const MATRIX& A, Vx->add(alpha, y, omega, z); r.equ(1., s, -omega, t); - res = criterion(A, *Vx, *Vb); + if (additional_data.exact_residual) + res = criterion(A, *Vx, *Vb); + else + res = r.l2_norm(); + state = control().check(++step, res); print_vectors(step, *Vx, r, y); } -- 2.39.5