[petsc-users] Test convergence with non linear preconditioners

Barry Smith bsmith at petsc.dev
Wed Aug 5 15:41:51 CDT 2020


   Adolfo,

     You can also just change the tolerances for the inner solve using the options data base and the prefix for the inner solve. 

     When you run with -snes_view it will show the prefix for each of the (nested) solvers. You can also run with -help to get all the possible options for the inner solvers.

     In this case I think the prefix is npc so you can set tolerances with -npc_snes_rtol <rtol> -npc_ksp_rtol <rtol> etc.  From the program you can use SNESGetNPC() and then call SNESSetXXX() to set options, for the linear solver (if there is one) call SNESGetKSP() on the npc and then set options on that KSP.


   Barry


> On Aug 5, 2020, at 3:30 PM, Adolfo Rodriguez <adantra at gmail.com> wrote:
> 
> Jed, 
> 
> I tred your suggestion 
> 
>   SNESGetNPC(snes, &inner);
>   SNESSetConvergenceTest(inner, YourFunc, ...); 
> 
> and it is working as expected. I had not pieced together the fact that "inner" is a "snes" object as well.
> 
> Thanks!
> 
>  
> 
>  <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>	Virus-free. www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link> <x-msg://85/#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> On Wed, Aug 5, 2020 at 3:11 PM Jed Brown <jed at jedbrown.org <mailto:jed at jedbrown.org>> wrote:
> Adolfo Rodriguez <adantra at gmail.com <mailto:adantra at gmail.com>> writes:
> 
> > Actually I can set the non-linear pc. My problem relates to the convergence
> > test. I have not found a way to set the tolerances for the inner problem,
> > are they hard coded?
> 
> I suggested code to set a custom convergence test.  Nothing is hard-coded.  What have you done?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200805/12dd9faa/attachment.html>


More information about the petsc-users mailing list