<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, Sep 12, 2018 at 1:25 AM Josh L <<a href="mailto:ysjosh.lo@gmail.com">ysjosh.lo@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div><br></div>The following is the output. Thanks.</div></div></blockquote><div><br></div><div>I do not know what you residual looks like, but it entirely possible that your Jacobian is not</div><div>accurate enough to drive the residual below 5e-13. You could just try -snes_atol 1e-12</div><div>unless you really think you need to be more accurate. Also have you non-dimensionalized</div><div>your problem?</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div><div> 0 SNES Function norm 3.775139483936e-07 </div><div> Line search: Using full step: fnorm 3.775139483936e-07 gnorm 1.043499007769e-11</div><div> 1 SNES Function norm 1.043499007769e-11 </div><div> Line search: Using full step: fnorm 1.043499007769e-11 gnorm 5.302082026305e-12</div><div> 2 SNES Function norm 5.302082026305e-12 </div><div> Line search: Using full step: fnorm 5.302082026305e-12 gnorm 3.136358665117e-12</div><div> 3 SNES Function norm 3.136358665117e-12 </div><div> Line search: Using full step: fnorm 3.136358665117e-12 gnorm 2.170819065257e-12</div><div> 4 SNES Function norm 2.170819065257e-12 </div><div> Line search: Using full step: fnorm 2.170819065257e-12 gnorm 1.475760790713e-12</div><div> 5 SNES Function norm 1.475760790713e-12 </div><div> Line search: Using full step: fnorm 1.475760790713e-12 gnorm 1.130642522675e-12</div><div> 6 SNES Function norm 1.130642522675e-12 </div><div> Line search: Using full step: fnorm 1.130642522675e-12 gnorm 8.647827205825e-13</div><div> 7 SNES Function norm 8.647827205825e-13 </div><div> Line search: Using full step: fnorm 8.647827205825e-13 gnorm 7.403983354386e-13</div><div> 8 SNES Function norm 7.403983354386e-13 </div><div> Line search: Using full step: fnorm 7.403983354386e-13 gnorm 6.291615062788e-13</div><div> 9 SNES Function norm 6.291615062788e-13 </div><div> Line search: Using full step: fnorm 6.291615062788e-13 gnorm 5.682820624094e-13</div><div> 10 SNES Function norm 5.682820624094e-13 </div><div> Line search: Using full step: fnorm 5.682820624094e-13 gnorm 5.300267435005e-13</div><div> 11 SNES Function norm 5.300267435005e-13 </div><div> Line search: Using full step: fnorm 5.300267435005e-13 gnorm 5.096339188439e-13</div><div> 12 SNES Function norm 5.096339188439e-13 </div><div> Line search: Using full step: fnorm 5.096339188439e-13 gnorm 4.970340343183e-13</div><div> 13 SNES Function norm 4.970340343183e-13 </div><div> Line search: Using full step: fnorm 4.970340343183e-13 gnorm 4.916509482510e-13</div><div> 14 SNES Function norm 4.916509482510e-13 </div><div> Line search: Using full step: fnorm 4.916509482510e-13 gnorm 4.875840608086e-13</div><div> 15 SNES Function norm 4.875840608086e-13 </div><div> Line search: Using full step: fnorm 4.875840608086e-13 gnorm 4.859609948396e-13</div><div> 16 SNES Function norm 4.859609948396e-13 </div><div> Line search: Using full step: fnorm 4.859609948396e-13 gnorm 4.846457390135e-13</div><div> 17 SNES Function norm 4.846457390135e-13 </div><div> Line search: Using full step: fnorm 4.846457390135e-13 gnorm 4.840667643605e-13</div><div> 18 SNES Function norm 4.840667643605e-13 </div><div> Line search: Using full step: fnorm 4.840667643605e-13 gnorm 4.837878467904e-13</div><div> 19 SNES Function norm 4.837878467904e-13 </div><div> Line search: Using full step: fnorm 4.837878467904e-13 gnorm 4.835385298533e-13</div><div> 20 SNES Function norm 4.835385298533e-13 </div><div> Line search: Using full step: fnorm 4.835385298533e-13 gnorm 4.833767981145e-13</div><div> 21 SNES Function norm 4.833767981145e-13 </div><div> Line search: Aborted due to ynorm < stol*xnorm (6.489173391862e-15 < 2.387840730261e-06) and inadequate full step.</div><div>Nonlinear smu_ solve did not converge due to DIVERGED_LINE_SEARCH iterations 21</div><div><br></div><div><br></div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-09-11 23:37 GMT-05:00 Smith, Barry F. <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Do you start with initial conditions of 0 <= u_i <= 1 ?<br>
<br>
Run with -snes_monitor -snes_converged_reason -ksp_monitor_true_residual -info -snes_linesearch_monitor and send all the output<br>
<span class="m_-3494537184464711022HOEnZb"><font color="#888888"><br>
Barry<br>
</font></span><div class="m_-3494537184464711022HOEnZb"><div class="m_-3494537184464711022h5"><br>
<br>
> On Sep 11, 2018, at 11:33 PM, Josh L <<a href="mailto:ysjosh.lo@gmail.com" target="_blank">ysjosh.lo@gmail.com</a>> wrote:<br>
> <br>
> Hi,<br>
> <br>
> I am using SNES to solve an nonlinear equation f(u), and I know all the u_i should be 0 and 1.<br>
> <br>
> First, I use SNES without constraint, and it converges.<br>
> <br>
> But, If I set <br>
> SNESSetType(snes,SNESVINEWTONRSLS,ierr)<br>
> SNESVISetVariableBounds(snes,xl,xu,ierr)<br>
> <br>
> where xl and xu is vector, and xl_i=0 and xu_i=1<br>
> <br>
> then SNES fails to converge, because linesearch fails(snes reason = -6), and the norm of residual is not reducing(the norm of incremental solution is reducing)<br>
> <br>
> The reason to add constraint is that I want to implement some irreversibility.<br>
> <br>
> <br>
> Thanks,<br>
> Josh <br>
> <br>
<br>
</div></div></blockquote></div><br></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="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>