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

2020-07-30 Thread Alexander Lindsay
I like that a lot. I'll try to spin-up a PR (MR on gitlab?) today. On Tue, Jul 28, 2020 at 6:42 PM Barry Smith wrote: > > Yes, this is a good idea. Simple extension of current code. > > The command line would then be > > -snes_converged_reason ::failed > >add in petscviewer.h > >

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

2020-07-28 Thread Barry Smith
Yes, this is a good idea. Simple extension of current code. The command line would then be -snes_converged_reason ::failed add in petscviewer.h a new PetscViewerFormat PETSC_VIEWER_FAILED, add in viewera.c PetscViewerFormats FAILED. add in SNESReasonView if

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

2020-07-28 Thread Matthew Knepley
On Tue, Jul 28, 2020 at 8:09 PM Alexander Lindsay wrote: > The only slight annoyance with doing this through a PostSolve hook as > opposed to a pluggable ReasonView system is that if a user passed > `-snes_converged_reason` on the command line, we would get redundant > printout from SNESSolve

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

2020-07-28 Thread Alexander Lindsay
The only slight annoyance with doing this through a PostSolve hook as opposed to a pluggable ReasonView system is that if a user passed `-snes_converged_reason` on the command line, we would get redundant printout from SNESSolve and our PostSolve. Although I suppose we could solve this by

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

2020-07-28 Thread Barry Smith
KPSSetPostSolve(), There is no SNESSetPostSolve() but there could/should be. Barry Note inside the SNESSolve there are a bunch of pre and post hooks, don't get the confused with an outside SNESSetPostSolve() > On Jul 28, 2020, at 1:12 PM, Fande Kong wrote: > > One alternative is to

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

2020-07-28 Thread Fande Kong
One alternative is to support a plugable KSP/SNESReasonView system. We then could hook up KSP/SNESReasonView_MOOSE. We could call our views from SNES/KSP"done"Solve as well if such a system is not affordable. What are the final functions we should call, where we guarantee SNES/KSP is already

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

2020-07-28 Thread Barry Smith
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,

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

2020-07-28 Thread Mark Adams
You can also do this with a monitor and get the converged reason to do what you want: https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESMonitorSet.html#SNESMonitorSet On Tue, Jul 28, 2020 at 12:09 PM Mark Adams wrote: > You can add your own convergence test and do anything

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

2020-07-28 Thread Mark Adams
You can add your own convergence test and do anything that you want: https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESSetConvergenceTest.html On Tue, Jul 28, 2020 at 11:44 AM Alexander Lindsay wrote: > To help debug the many emails we get about solves that fail to

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

2020-07-28 Thread Alexander Lindsay
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.