# Stopping criteria

Matthew Knepley knepley at gmail.com
Wed Jan 14 14:05:19 CST 2009

```On Wed, Jan 14, 2009 at 1:54 PM, Nguyen, Hung V ERDC-ITL-MS <
Hung.V.Nguyen at usace.army.mil> wrote:

>
> Hello All,
>
> I tried to solve an ill-conditioned system using cg with Jacobi
> preconditioned. The KSP solver was stopping due to diverged reason within a
> few iterations. Is there a way to keep KSP solver running until max_it?

There is no way to continue CG here because it gets a zero divisor, and
interprets
this as an indefinite matrix. You can try GMRES, however I would first check
your
matrix using -pc_type lu -ksp_type preonly to make sure its not singular.

Matt

>
> Thanks,
>
> -hung
>
> jacobi
> -ksp_rtol 1.0e-15 -ksp_max_it 50000 -ksp_monitor -ksp_converged_reason
>  0 KSP Residual norm 1.379074550666e+04
>  1 KSP Residual norm 7.252034661743e+03
>  2 KSP Residual norm 7.302184771313e+03
>  3 KSP Residual norm 1.162244351275e+04
>  4 KSP Residual norm 7.912531765659e+03
>  5 KSP Residual norm 4.094706251487e+03
>  6 KSP Residual norm 5.486131070301e+03
>  7 KSP Residual norm 6.367904529202e+03
>  8 KSP Residual norm 6.312767173219e+03
> Linear solve did not converge due to DIVERGED_INDEFINITE_MAT iterations 9
> Time in PETSc solver: 0.452695 seconds
> The number of iteration       = 9
> The solution residual error = 6.312767e+03
>
>

--
What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments