# KSP Tolerances

jarunan at ascomp.ch jarunan at ascomp.ch
Mon Dec 14 08:36:24 CST 2009

```Dear Petsc Team,

There is something not clear for me about divergence tolerance.
Firstly, my computation diverges with the reason of dtol (-4), which
was set by default (10000). When I increased dtol to 1.0e+8, it became
converged. However, the relative residual where it was diverged is
less than the default dtol. I would like to know, how it is exactly
calculated.

----------I describe my problem more in detail here.-------------------
As I set the tolerances for the solver as below, my problem diverges
with converged reason -4 (from divergence tolerance)

call KSPSetTolerances(ksp,1.0e-06,1.0e-20,
PETSC_DEFAULT_DOUBLE_PRECISION,10000,ierr)

I monitor the residual. it printed the information below and quit the
computation.(I delete the true residual norm and Ax/Ae. Please tell me
if you need them.)

0 KSP preconditioned resid norm 5.139790011051e+02

With -ksp_view, it shows that default value of dtol is 10000. I
increased dtol to 1.0e+8, then the solver solved the problem. With
-ksp_monitor_true_residual, the first 5 iterations read:

0 KSP preconditioned resid norm 5.139790011051e+02
1 KSP preconditioned resid norm 1.840751662590e+01
2 KSP preconditioned resid norm 3.653339750400e+00
3 KSP preconditioned resid norm 2.538794826933e+00
4 KSP preconditioned resid norm 2.299844715275e-01

Here, from iteration 0 to iteration 1,the relative residual is
0.03580, much less than 1.0e+4 the default dtol value. So, why was it
diverged at the first time?
----------------------------------------------------------------------------

Regards,
Jarunan

--
Jarunan Panyasantisuk
Development Engineer
ASCOMP GmbH, Technoparkstr. 1
CH-8005 Zurich, Switzerland
Phone : +41 44 445 4072
Fax   : +41 44 445 4075
E-mail: jarunan at ascomp.ch
www.ascomp.ch
```