[petsc-users] Number of Iteration of KSP and relative tolerance

Ivano Barletta ibarletta at inogs.it
Thu Sep 1 04:01:45 CDT 2016


Thanks for the replies

Adding these two lines before calling KSPSolve did
the job

      CALL KSPSetInitialGuessNonzero(ksp, PETSC_TRUE, ierr)
      CALL KSPSetNormType(ksp, KSP_NORM_UNPRECONDITIONED, ierr)

Regards
Ivano

2016-08-31 19:51 GMT+02:00 Barry Smith <bsmith at mcs.anl.gov>:

>
>   From the KSP view
>
> using PRECONDITIONED norm type for convergence test
>
> it is using the ratio of the preconditioned residual norms for the
> convergence test, not the true residual norms.
> If you want to use the true residual norm use -ksp_pc_side right   See
> also KSPSetNormType() and KSPSetPCSide()
>
>    Barry
>
>
> > On Aug 31, 2016, at 10:32 AM, Ivano Barletta <ibarletta at inogs.it> wrote:
> >
> > Dear Petsc Users
> >
> > I'm using Petsc to solve an elliptic equation
> >
> > The code can be run in parallel but I'm running
> > some tests in sequential by the moment
> >
> > When I look at the output, what it looks odd to
> > me is that the relative tolerance that I set is
> > not fulfilled.
> > I've set -ksp_rtol 1e-8 in my runtime options
> > but the solver stops when the ratio
> > || r || / || b || is still 9e-8, then almost
> > one order of magnitude greater of the rtol
> > that I set (as you can see in the txt in attachment).
> >
> > My question is, isn't the solver supposed to
> > make other few iterations to reach the relative tolerance?
> >
> > Thanks in advance for replies and suggestions
> > Kind Regards
> > Ivano
> >
> > P.S. my runtime options are these:
> > -ksp_monitor_true_residual -ksp_type cg -ksp_converged_reason -ksp_view
> -ksp_rtol 1e-8
> >
> > <ksp_out.txt>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160901/ee902ff5/attachment.html>


More information about the petsc-users mailing list