[petsc-users] Only print converged reason when not converged

Barry Smith bsmith at petsc.dev
Tue Jul 28 13:01:24 CDT 2020


  Alex,
 
    The actual printing is done with SNESReasonView() and KSPReasonView() I would suggest copying those files to Moose with a name change and removing all the code you don't want. Then you can call your versions immediately after SNESSolve() and KSPSolve().

   Barry


> On Jul 28, 2020, at 10:43 AM, Alexander Lindsay <alexlindsay239 at gmail.com> wrote:
> 
> 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 ?
> 
> Alex



More information about the petsc-users mailing list