<div dir="ltr">Jed Brown:<div><br></div><div>Thanks for your answer. Some of my state variables must only be accumulated at the end of each Newton iteration. So is SNESLineSearchSetPostCheck only called in that occasion for any non-linear solver?</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Best regards,</div><div class="gmail_extra">Eduardo</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 9, 2014 at 1:31 PM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div>Eduardo <<a href="mailto:erocha.ssa@gmail.com" target="_blank">erocha.ssa@gmail.com</a>> writes:<br>


<br>
> I need to update some state variables in my application at the end of each<br>
> Newton method iteration. Can I do that inside the routine to compute the<br>
> nonlinear function or the routine to compute the Jacobian? Can I assume<br>
> that one (or both) these routines are called only once per Newton iteration?<br>
<br>
</div></div>The function can be called several times during a line search, but you<br>
probably should be updating the state variables there too.  If you<br>
really only want to update after the line search completes (so the<br>
solution could be incompatible with the state variables), you can use<br>
SNESLineSearchSetPostCheck.<br>
</blockquote></div><br></div></div>