[petsc-users] Stop KSP if diverging

Edoardo alinovi edoardo.alinovi at gmail.com
Wed May 29 02:06:33 CDT 2019


Dear PETSc friends,

Hope you are doing all well.

I have a quick question for you that I am not able to solve by my self.
Time to time, while testing new code features, it happens that KSP diverges
but it does not stop automatically and the iterations continue even after
getting a NaN.

In the KSP setup I use the following instruction to set the divergence
stopping criteria (div = 10000):

call KSPSetTolerances(myksp,  rel_tol,  abs_tol, div,  itmax,  ierr)

But is does not help. Looking into the documentation I have found also:

KSPConvergedDefault
<https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPConvergedDefault.html#KSPConvergedDefault>(KSP
<https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSP.html#KSP>
ksp,PetscInt <https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscInt.html#PetscInt>
n,PetscReal <https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscReal.html#PetscReal>
rnorm,KSPConvergedReason
<https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPConvergedReason.html#KSPConvergedReason>
*reason,void *ctx)

Which I am not calling in the code. Is this maybe the reason of my problem?
If yes how can I use KSPConvergedDefault
<https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPConvergedDefault.html#KSPConvergedDefault>
in
FORTRAN?

Thanks,

Edo

------

Edoardo Alinovi, Ph.D.

DICCA, Scuola Politecnica,
Universita' degli Studi di Genova,
1, via Montallegro,
16145 Genova, Italy

Email: edoardo.alinovi at dicca.unige.it
Tel: +39 010 353 2540
Website: https://www.edoardoalinovi.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190529/d3fae2fa/attachment-0001.html>


More information about the petsc-users mailing list