<div dir="ltr"><div dir="ltr">The following is the converging one(without setting SNESVI and variable bounds)<div><br></div><div><div> 0 SNES Function norm 3.775139279770e-07</div><div> Line search: Using full step: fnorm 3.775139279770e-07 gnorm 1.911103519935e-12</div><div> 1 SNES Function norm 1.911103519935e-12</div><div>Nonlinear smu_ solve converged due to CONVERGED_SNORM_RELATIVE iterations 1</div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-09-12 0:25 GMT-05:00 Josh L <span dir="ltr"><<a href="mailto:ysjosh.lo@gmail.com" target="_blank">ysjosh.lo@gmail.com</a>></span>:<br><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><br></div><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"><span class="">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></span><div><div class="h5"><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_-4746255064048674130HOEnZb"><font color="#888888"><br>
Barry<br>
</font></span><div class="m_-4746255064048674130HOEnZb"><div class="m_-4746255064048674130h5"><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,SNESVINEWTONR<wbr>SLS,ierr)<br>
> SNESVISetVariableBounds(snes,x<wbr>l,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></div></div><br></div>
</blockquote></div><br></div>