[petsc-users] Very small right hand side and KSP_DIVERGED_DTOL
Barry Smith
bsmith at mcs.anl.gov
Fri Mar 24 19:52:04 CDT 2017
> On Mar 24, 2017, at 8:56 AM, alexandre this <alexandre.this at gmail.com> wrote:
>
> Dear all,
>
> I'm in the configuration where I need to solve a linear system Ax = b where b is very small although not equal to zero.
>
> It appears that, in this configuration, the initial residual of the first iteration of the solver is completely out of reach and the KSP_DIVERGED_DTOL is raised.
>
> In particular, when using the "-ksp_monitor_true_residual flag", I get the following :
> 0 KSP preconditioned resid norm 2.907111674781e+00 true resid norm 1.955854211540e+02 ||r(i)||/||b|| 1.765818923254e+09
Yeah this is a glitch in the divergence checking. A bad initial guess with a nearly zero right hand side can trigger this. There is special code in KSPConvergedDefault() when the right hand side is identical to zero
if (!snorm) {
ierr = PetscInfo(ksp,"Special case, user has provided nonzero initial guess and zero RHS\n");CHKERRQ(ierr);
snorm = rnorm;
}
but not for "small" right hand side.
You can use something like -ksp_divtol 1.e30 ( or bigger) to turn off the divtol test.
Do any PETSc users or developers know a more systematic way to handle this issue with small right hand side and bad initial guess?
Barry
>
> What is the best course of action in this case ?
>
> Best,
> Alexandre
>
>
> --
> Alexandre This
>
> Doctorant CIFRE (Philips Healthcare - INRIA) : Fusion Image / Modèles Numériques pour la quantification de la sévérité de la régurgitation mitrale
>
> Master 2 Recherche Mathématiques, Vision, Apprentissage - ENS Cachan
> Ingénieur spécialisation Santé&Technologie - ECE Paris
> Bachelor of Science : Informatics - Aalborg University, Danemark
>
> tel : 06.32.57.12.44
More information about the petsc-users
mailing list