<div dir="ltr"><div dir="ltr">On Sun, Dec 12, 2021 at 7:48 PM <a href="mailto:celestechevali@gmail.com">celestechevali@gmail.com</a> <<a href="mailto:celestechevali@gmail.com">celestechevali@gmail.com</a>> wrote:<br></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">Thank you so much for your reply !<div><br></div><div>In fact I didn't know how to set tolerances, so I proceeded without specifying the tolerances, hoping that this could lead to the implementation of default values...</div><div><br></div><div>I just added <i>SNESSetFromOptions(snes); </i>However, it doesn't make any difference... But it's true that the "tol" values are somehow set to zero... </div></div></blockquote><div><br></div><div>1) If you call <i>SNESSetFromOptions(), you can set the tolerances using</i></div><div> </div><div> -snes_rtol 1e-8</div><div><br></div><div>or similar.</div><div><br></div><div> 2) These are not the default values, so you are definitely changing them. I suspect you are calling SNESetTolerances(). Do not call it unless you want to set them.</div><div><br></div><div>3) Give -snes_converged_reason, so we can see why the iteration stopped.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div><br></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"><div><i><b>atol = 0.000000, rtol = 0.000000, stol = 0.000000, maxit = 50, maxf = 10000 <br> <br> 0 SNES Function norm 7.604910424038e+02</b></i></div><div> <br></div><div>Is it possible that it has something to do with my makefile ?</div><div><br></div><div>Since I didn't figure out the PETSc makefile format (which seems to be different from standard C makefile format), I named my source code as <b>ex1.c</b> to make use of the default settings for PETSc example programs...</div><div><br></div><div>And in my makefile I wrote :</div><div><br></div><div><b>include ${PETSC_DIR}/lib/petsc/conf/variables<br>include ${PETSC_DIR}/lib/petsc/conf/test<br><br>ex1: ex1.o</b><br></div><div><b><br></b></div><div>Is it possible the "tol" values are set to 0 by the default setting used for example programs ?</div><div><br></div><div>Thank you so much for your help.</div><div><br></div><div>PS: I just tried the same code with less degrees of freedom and this time it worked... But for a large system it didn't...</div><div><br></div><div><i>atol = 0.000000, rtol = 0.000000, stol = 0.000000, maxit = 50, maxf = 10000 <br> <br> 0 SNES Function norm 1.164809703659e+00 <br> 1 SNES Function norm 1.311388740736e-01 <br> 2 SNES Function norm 7.232579319557e-02 <br> 3 SNES Function norm 4.984271911548e-02 <br> 4 SNES Function norm 3.224387373805e-02 <br> 5 SNES Function norm 6.898280568053e-03 <br> 6 SNES Function norm 6.297558001575e-03 <br> 7 SNES Function norm 5.358028396052e-03 <br> 8 SNES Function norm 4.591005105466e-03 <br> 9 SNES Function norm 4.063981130201e-03 <br> 10 SNES Function norm 3.715929394609e-03 <br> 11 SNES Function norm 3.428330101253e-03 <br> 12 SNES Function norm 3.177113603032e-03 <br> 13 SNES Function norm 2.958574186594e-03 <br> 14 SNES Function norm 2.769227811865e-03 <br> 15 SNES Function norm 2.605947870584e-03 <br> 16 SNES Function norm 2.465934405221e-03 <br> 17 SNES Function norm 2.346761136962e-03 <br> 18 SNES Function norm 2.246362261451e-03 <br> 19 SNES Function norm 2.163102452591e-03 <br> 20 SNES Function norm 2.095849101382e-03 <br> 21 SNES Function norm 2.043740325461e-03 <br> 22 SNES Function norm 2.005106316761e-03 <br> 23 SNES Function norm 1.975748994170e-03 <br> 24 SNES Function norm 1.949413335428e-03 <br> 25 SNES Function norm 1.920795414593e-03 <br> 26 SNES Function norm 1.886883259141e-03 <br> 27 SNES Function norm 1.846374653045e-03 <br> 28 SNES Function norm 1.799050087038e-03 <br> 29 SNES Function norm 1.745284156916e-03 <br> 30 SNES Function norm 1.685885151987e-03 <br> 31 SNES Function norm 1.621850994665e-03 <br> 32 SNES Function norm 1.554258940064e-03 <br> 33 SNES Function norm 1.484213253375e-03 <br> 34 SNES Function norm 1.412768267404e-03 <br> 35 SNES Function norm 1.340893218332e-03 <br> 36 SNES Function norm 1.269412489589e-03 <br> 37 SNES Function norm 1.199029202116e-03 <br> 38 SNES Function norm 1.130300263372e-03 <br> 39 SNES Function norm 1.063694395854e-03 <br> 40 SNES Function norm 9.995826338243e-04 <br> 41 SNES Function norm 9.383610129089e-04 <br> 42 SNES Function norm 8.807543352645e-04 <br> 43 SNES Function norm 8.288695938590e-04 <br> 44 SNES Function norm 7.898873173876e-04 <br> 45 SNES Function norm 7.752509690373e-04 <br> 46 SNES Function norm 7.625724154377e-04 <br> 47 SNES Function norm 7.503152403370e-04 <br> 48 SNES Function norm 7.364744378378e-04 <br> 49 SNES Function norm 7.202926541551e-04 <br> 50 SNES Function norm 7.015245603442e-04 </i><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>> 于2021年12月13日周一 01:11写道:<br></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">The three "tol" values should be finite. It sounds like you set them to 0.<div>Don't do that and use the defaults to start.</div><div>The behavior with zero tolerances is not defined.</div><div>You can use -snes_monitor to print out the iterations.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Dec 12, 2021 at 6:22 PM <a href="mailto:celestechevali@gmail.com" target="_blank">celestechevali@gmail.com</a> <<a href="mailto:celestechevali@gmail.com" target="_blank">celestechevali@gmail.com</a>> wrote:<br></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">Hello,<div><br></div><div>I encountered a strange problem concerning the convergence of SNES.</div><div><br></div><div>In my recent test runs I found that SNES always stops at iteration 0...</div><div><br></div><div>At first I thought there may be an error with the tolerance setting, so I output the tolerances :</div><div><br></div><div><i>atol = 0.000000, rtol = 0.000000, stol = 0.000000, maxit = 50, maxf = 10000 <br> <br>Norm of error 760.491 Iterations 0</i><br></div><div><br></div><div>Which are exactly the default values that I always used. However, for the same tolerance settings, the SNES solver converges successfully if I decrease the number of degrees of freedom in my system... </div><div><br></div><div>I wish to know if anyone has experienced the same type of problems or has an idea about what could possibly cause the problem...</div><div><br></div><div>Thank you so much in advance. </div><div><br></div><div>I appreciate any advice that you provide.</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>