<div dir="ltr">You can also do this with a monitor and get the converged reason to do what you want:<div><br></div><div><a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESMonitorSet.html#SNESMonitorSet">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESMonitorSet.html#SNESMonitorSet</a><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 28, 2020 at 12:09 PM Mark Adams <<a href="mailto:mfadams@lbl.gov">mfadams@lbl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">You can add your own convergence test and do anything that you want:<div><br></div><div><a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESSetConvergenceTest.html" target="_blank">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESSetConvergenceTest.html</a><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 28, 2020 at 11:44 AM Alexander Lindsay <<a href="mailto:alexlindsay239@gmail.com" target="_blank">alexlindsay239@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>To help debug the many emails we get about solves that fail to converge, in MOOSE we recently appended `-snes_converged_reason -ksp_converged_reason` for every call to `SNESSolve`. Of course, now we have users complaining about the new text printed to their screens that they didn't have before. Some of them have made a reasonable request to only print the convergence reason when the solve has actually failed to converge. Is there some way we can only print the reason if we've diverged, e.g. if reason < 0 ?</div><div><br></div><div>Alex<br></div></div>
</blockquote></div>
</blockquote></div>