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 <[email protected]> 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 <[email protected] 
> <mailto:[email protected]>> wrote:
> Adolfo Rodriguez <[email protected] <mailto:[email protected]>> 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?

Reply via email to