<div dir="ltr"><span style="font-size:small;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Barry,</span><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">0 represents fully damaged and 1 is intact. if I unload it, the crack shouldn't heal(solution goes back to 1), so I set the constraint as  </div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">    0 <= u^{i+1} <= u^{i}</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">    i is either load step or time step. </div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"> </div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">Matt,</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">Yes, that is what I am going to do next. a linear penalty gives a quadratic distribution instead of the exponential distribution given by quadratic penalty term. </div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">Thanks,</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">Josh</div><br class="gmail-Apple-interchange-newline"><br></div><div class="gmail_extra"><br><div class="gmail_quote">2018-09-12 16:23 GMT-05:00 Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@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 class="gmail_quote"><span class=""><div dir="ltr">On Wed, Sep 12, 2018 at 5:16 PM Smith, Barry F. <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
   The function norm given by the -snes_monitor is the function norm for the DVI problem (which depends on where the solution is constrained) while FormFunction() norm you compute is for the original unconstrained problem.<br>
<br>
    I am still not sure why you solve this as a DVI. If you solve it without the constraints do you get the "wrong" answer?<br></blockquote><div><br></div></span><div>If this is a variational crack problem, you can solve it unconstrained if you use a quadratic penalty term. However,</div><div>that induces spurious long range communication between crack tips. If you bound the phase field between 0 and 1,</div><div>you can use a linear penalty which has physical behavior.</div><div><br></div><div>   Matt</div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
    Barry<br>
<br>
<br>
> On Sep 12, 2018, at 3:32 PM, Josh L <<a href="mailto:ysjosh.lo@gmail.com" target="_blank">ysjosh.lo@gmail.com</a>> wrote:<br>
> <br>
> Hi,<br>
> <br>
> my solution is mostly very close to 1. only  for a very small area where solution goes from 0 to 1(a smeared crack). <br>
> <br>
> I set -snes_atol 1e-7 and it is converging.<br>
> <br>
> I've noticed the following:<br>
> <br>
> There is a difference between the function norm.<br>
> <br>
> I calculate the function norm in FormFunction, so every time it is called it gives the function norm<br>
> , and the result is different from the function norm given by -snes_monitor if i set <br>
>      <br>
>      SNESSetType(snes,<wbr>SNESVINEWTONRSLS,ierr)<br>
>      SNESVISetVariableBounds(snes,<wbr>xl,xu,ierr)<br>
> <br>
> The function norm calculated in FromFunction is NOT reducing, however, the function norm given by -snes_monitor is reducing<br>
> They are the same if I just use regular SNES without setting variable bounds.<br>
> <br>
> <br>
> Thanks,<br>
> Josh<br>
> <br>
> 2018-09-12 12:02 GMT-05:00 Smith, Barry F. <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>>:<br>
> <br>
>      You have too tight a convergence tolerance for your problem.  You can't expect to get more than 1.e-12 as the minimum residual norm or even less. <br>
> <br>
>       How close is your solution to 1 and -1?<br>
> <br>
>       If you really need much higher convergence you can try ./configure --with-precision=__float128 <br>
> <br>
> <br>
>       Barry<br>
> <br>
> > On Sep 11, 2018, at 11:53 PM, Josh L <<a href="mailto:ysjosh.lo@gmail.com" target="_blank">ysjosh.lo@gmail.com</a>> wrote:<br>
> > <br>
> > Yes, I initialize all u_i to 1.0<br>
> > <br>
> >  <br>
> > <br>
> > 2018-09-11 23:37 GMT-05:00 Smith, Barry F. <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>>:<br>
> > <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>
> > <br>
> >   Barry<br>
> > <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,<wbr>SNESVINEWTONRSLS,ierr)<br>
> > >      SNESVISetVariableBounds(snes,<wbr>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>
> > <br>
> <br>
> <br>
<br>
</blockquote></div></div></div><br clear="all"><span class=""><div><br></div>-- <br><div dir="ltr" class="m_4651065387418088263gmail_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/~<wbr>knepley/</a><br></div></div></div></div></div></div></div></span></div>
</blockquote></div><br></div>