[petsc-users] Help with KSPSetConvergenceTest

Edoardo alinovi edoardo.alinovi at gmail.com
Tue May 9 03:40:18 CDT 2023


Mega! This is gonna be useful for many people :)


Il Mar 9 Mag 2023, 00:54 Barry Smith <bsmith at petsc.dev> ha scritto:

>
>   See https://gitlab.com/petsc/petsc/-/merge_requests/6436 with commit
> barry/2023-05-08/add-ksp-min-its
>
>
>
> On May 7, 2023, at 2:22 PM, Edoardo alinovi <edoardo.alinovi at gmail.com>
> wrote:
>
> Hello Barry,
>
> Mega! Thank you Berry much for providing me with a working example! I
> ended up in writing this:
>
>
>
>
>
> *        call KSPConvergedDefault(ksp, n, rnorm, flag,
> PETSC_NULL_FUNCTION, ierr)        if (n<flubioSolvers%itmin) then
>   flag = 0        endif        ierr = 0*
>
> and it looks working but I'll take advantage of your suggestion ;)  Is
> KSPConvergedDefaultDestroy mandatory?
>
> I know it's easy code, but maybe you might have a think to add this
> control and expose it as the max number of iterations in KSP. I can tell
> you it is very much used, I found myself many times in need to tell the
> solver to iterate regardless of the tolerances criteria. It happens for
> example in the RANS equation, especially omega. Sometimes they tend to
> stall and you do want to tighten the tolerances for a bunch of iters, or
> you might not know if they do while iterating!
>
> Cheers
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230509/55e0fec9/attachment-0001.html>


More information about the petsc-users mailing list