<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=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 7, 2020, at 11:19 AM, 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="">Great, that works. What would be the way to change the ilu level, I need to use ilu(1). I would assume that I can accomplish that by means of:<div class=""><br class=""><div class="">-<span style="font-family: "Courier New", Courier, monospace, arial, sans-serif; font-size: 14px; white-space: pre-wrap;" class="">npc_fas_coarse_pc_type ilu</span></div><div class="">-<span style="font-family: "Courier New", Courier, monospace, arial, sans-serif; font-size: 14px; white-space: pre-wrap;" class="">npc_fas_coarse_pc_ilu_levels 1</span>  <br class=""></div><div class=""><br class=""></div><div class="">I noticed that the first line actually works, but I am not sure about the second one.</div></div></div></div></blockquote><div><br class=""></div>  The number of levels should be noted in the -snes_view output.  </div><div><br class=""></div><div>  You can run with -help -<span class="" style="font-family: "Courier New", Courier, monospace, arial, sans-serif; font-size: 14px; white-space: pre-wrap;">npc_fas_coarse_pc_type ilu </span>| grep <span class="" style="font-family: "Courier New", Courier, monospace, arial, sans-serif; font-size: 14px; white-space: pre-wrap;">npc_fas_coarse_pc </span>see what the exact names of the options are if you are unsure</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Adolfo</div><div id="m_-242385451441738719DAB4FAD8-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" style="color:#4453ea" target="_blank" class="">www.avast.com</a>
                </td>
        </tr>
</tbody></table><a href="x-msg://13/#m_-242385451441738719_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1" class=""></a></div></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 6, 2020 at 9:23 PM Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank" class="">knepley@gmail.com</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 dir="ltr" class=""><div dir="ltr" class="">On Thu, Aug 6, 2020 at 10:08 PM Adolfo Rodriguez <<a href="mailto:adantra@gmail.com" target="_blank" class="">adantra@gmail.com</a>> wrote:<br class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class="">Considering the output produced by snes_view (attachment), would be possible to change the linear solver tolerances and the preconditioning level or type?</div></blockquote><div class=""><br class=""></div><div class="">Yes. The options prefix is shown for each subsolver. For example, you can change the linear solver type for the coarse level of FAS using</div><div class=""><br class=""></div><div class="">  -<span style="font-family: "Courier New", Courier, monospace, arial, sans-serif; font-size: 14px; white-space: pre-wrap;" class="">npc_fas_coarse_ksp_type bigcg</span></div><div class=""><br class=""></div><div class="">Notice that you are using 1 level of FAS, so its the same as just Newton.</div><div class=""><br class=""></div><div class="">  Thanks,</div><div class=""><br class=""></div><div class="">     Matt</div><div 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 dir="ltr" class=""><div class="">Adolfo</div></div><div id="gmail-m_-242385451441738719gmail-m_5425691679335133860gmail-m_9065914518290907664DAB4FAD8-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 href="x-msg://13/#m_-242385451441738719_m_5425691679335133860_m_9065914518290907664_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 8:31 PM Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank" 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 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 class=""><br class=""><blockquote type="cite" class=""><div class="">On Aug 5, 2020, at 8:10 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="">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="gmail-m_-242385451441738719gmail-m_5425691679335133860gmail-m_9065914518290907664gmail-m_-9058999065386376045DAB4FAD8-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:41 PM Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank" 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 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_-242385451441738719gmail-m_5425691679335133860gmail-m_9065914518290907664gmail-m_-9058999065386376045gmail-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></div></blockquote></div>
</blockquote></div><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div><div class=""><br class=""></div><div class=""><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a><br class=""></div></div></div></div></div></div></div></div>
</blockquote></div>
</div></blockquote></div><br class=""></body></html>