<div dir="ltr"><div dir="ltr"><div>Dear PETSc friends,<br></div><div><br></div><div>Hope you are doing all well.</div><div><br></div><div>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. </div><div><br></div><div>In the KSP setup I use the following instruction to set the divergence stopping criteria (div = 10000):</div><div><br></div><div>call KSPSetTolerances(myksp,  rel_tol,  abs_tol, div,  itmax,  ierr)<br></div><div><br></div><div>But is does not help. Looking into the documentation I have found also:</div><div><pre style="color:rgb(0,0,0)"><a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPConvergedDefault.html#KSPConvergedDefault">KSPConvergedDefault</a>(<a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSP.html#KSP">KSP</a> ksp,<a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</a> n,<a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscReal.html#PetscReal">PetscReal</a> rnorm,<a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPConvergedReason.html#KSPConvergedReason">KSPConvergedReason</a> *reason,void *ctx)</pre></div><div>Which I am not calling in the code. Is this maybe the reason of my problem? If yes how can I use <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/KSP/KSPConvergedDefault.html#KSPConvergedDefault">KSPConvergedDefault</a> in FORTRAN? </div><div><br></div><div>Thanks,</div><div><br></div><div>Edo</div><div><br></div><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr">------<div><br></div><div>Edoardo Alinovi, Ph.D.</div><div><br></div><div>DICCA, Scuola Politecnica,<br>Universita' degli Studi di Genova,<br>1, via Montallegro,<br>16145 Genova, Italy<br></div><div><br></div><div>Email: <a href="mailto:edoardo.alinovi@dicca.unige.it" target="_blank">edoardo.alinovi@dicca.unige.it</a></div><div>Tel: +39 010 353 2540<br></div><div>Website: <a href="https://www.edoardoalinovi.com/" style="color:rgb(17,85,204)" target="_blank">https://www.edoardoalinovi.com/</a><br></div><div><br></div><div><br></div></div></div></div></div></div></div></div>