<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div> Turtles on top of turtles on top of turtles. <div class=""><br class=""></div><div class=""> It is probably easiest for you to look at the actual code to see how it handles things</div><div class=""><br class=""></div><div class=""> 1) the SNESFAS uses SNES for each of the levels, for each of these level SNES you can control the convergence criteria (either from the command lineor with appropriate prefix (highly recommended) or with function calls (not recommended)); and even provide your own convergence functions run with -snes_view to see the various solvers and their prefixes). </div><div class=""><br class=""></div><div class=""> 2) at the finest level of SNESFAS it does call </div><div class=""><br class=""></div><div class=""><div class=""> /* Test for convergence */</div><div class=""> if (isFine) {</div><div class=""> ierr = (*snes->ops->converged)(snes,snes->iter,0.0,0.0,snes->norm,&snes->reason,snes->cnvP);CHKERRQ(ierr);</div><div class=""> if (snes->reason) break;</div><div class=""> }</div><div class=""><br class=""></div><div class="">src/snes/impls/fas/fas.c line 881 so at least in theory you can provide your own convergence test function.</div><div class=""><br class=""></div><div class=""> It was certainly our intention that users can control all the convergence knobs for arbitrary imbedded nonlinear solvers including FAS but, of course, there may be bugs so let us know what doesn't work.</div><div class=""><br class=""></div><div class=""> Generally the model for FAS is to run a single (or small number of) iteration(s) on the level solves and so not directly use convergence tolerances like rtol to control the number of iterations on a level but you should be able to set any criteria you want.</div><div class=""><br class=""></div><div class=""> You should be able to run with -snes_view and change some of the criteria on the command line and see the changes presented in the -snes_view output, plus see differences in convergence behavior.</div><div class=""><br class=""></div><div class=""> </div><div class=""><br class=""></div><div class=""> Barry</div><div class=""><br class=""></div><div class=""><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 5, 2020, at 8:10 PM, Adolfo Rodriguez <<a href="mailto:adantra@gmail.com" class="">adantra@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">It looks like I cannot really change the test function or anything else for this particular SNES solver (I am using SNESFas). Basically, I am trying to use the ideas exposed in the paper on Composing scalable solvers but it seems that SNESFas does not allow to change the function for testing convergence, or anything else. Is this correct?<div class=""><br class=""></div><div class="">Adolfo</div></div><div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" class=""><br class="">
<table style="border-top:1px solid #d3d4de" class="">
<tbody class=""><tr class="">
<td style="width:55px;padding-top:13px" class=""><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon" target="_blank" class=""><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;" class=""></a></td>
<td style="width:470px;padding-top:12px;color:#41424e;font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px" class="">Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link" target="_blank" style="color:#4453ea" class="">www.avast.com</a>
</td>
</tr>
</tbody></table><a href="x-msg://98/#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1" class=""></a></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Aug 5, 2020 at 3:41 PM Barry Smith <<a href="mailto:bsmith@petsc.dev" class="">bsmith@petsc.dev</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;" class=""><div class=""><br class=""></div> Adolfo,<div class=""><br class=""></div><div class=""> You can also just change the tolerances for the inner solve using the options data base and the prefix for the inner solve. </div><div class=""><br class=""></div><div class=""> 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.</div><div class=""><br class=""></div><div class=""> 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.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""> Barry</div><div class=""><br class=""></div><div class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Aug 5, 2020, at 3:30 PM, Adolfo Rodriguez <<a href="mailto:adantra@gmail.com" target="_blank" class="">adantra@gmail.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class="">Jed, <div class=""><br class=""></div><div class="">I tred your suggestion </div><div class=""><br class=""></div><div class=""> SNESGetNPC(snes, &inner);<br class=""> SNESSetConvergenceTest(inner, YourFunc, ...); </div><div class=""><br class=""></div><div class="">and it is working as expected. I had not pieced together the fact that "inner" is a "snes" object as well.</div><div class=""><br class=""></div><div class="">Thanks!</div><div class=""><br class=""></div><div class=""> <br class=""></div></div><div id="gmail-m_1008765421119631962DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" class=""><br class="">
<table style="border-top:1px solid rgb(211,212,222)" class="">
<tbody class=""><tr class="">
<td style="width:55px;padding-top:13px" class=""><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon" target="_blank" class=""><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;" class=""></a></td>
<td style="width:470px;padding-top:12px;color:rgb(65,66,78);font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px" class="">Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link" style="color:rgb(68,83,234)" target="_blank" class="">www.avast.com</a>
</td>
</tr>
</tbody></table><a width="1" height="1" class=""></a></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Aug 5, 2020 at 3:11 PM Jed Brown <<a href="mailto:jed@jedbrown.org" target="_blank" class="">jed@jedbrown.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Adolfo Rodriguez <<a href="mailto:adantra@gmail.com" target="_blank" class="">adantra@gmail.com</a>> writes:<br class="">
<br class="">
> Actually I can set the non-linear pc. My problem relates to the convergence<br class="">
> test. I have not found a way to set the tolerances for the inner problem,<br class="">
> are they hard coded?<br class="">
<br class="">
I suggested code to set a custom convergence test. Nothing is hard-coded. What have you done?<br class="">
</blockquote></div>
</div></blockquote></div><br class=""></div></div></blockquote></div>
</div></blockquote></div><br class=""></div></body></html>