OK. I try to following this procedure.<br>Thanks a lot.<br><br><br><br><div class="gmail_quote">On Sat, Nov 12, 2011 at 9:57 PM, Jed Brown <span dir="ltr">&lt;<a href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="gmail_quote"><div class="im">On Sat, Nov 12, 2011 at 12:22, behzad baghapour <span dir="ltr">&lt;<a href="mailto:behzad.baghapour@gmail.com" target="_blank">behzad.baghapour@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So, after a line-search update in newton iteration, I should in some way pass the updated values into my objects (elements) so that the FormJacobian and FormFunctions use these objects for the next newton iteration. </blockquote>

<div><br></div></div><div>No. It&#39;s very simple. Put work arrays in a context and set that context for both FormFunction() and FormJacobian().</div><div><br></div><div>In FormFunction(): do NOT assume that anything useful is in the work array. You can&#39;t possibly put something semantically meaningful, so treat them as uninitialized memory. THIS function puts the useful stuff into the work arrays. You can do it at the start of the function or you can do it &quot;while&quot; computing the residual.</div>

<div><br></div><div>In FormJacobian(): use the values that were placed in the work arrays by FormFunction().</div><div><br></div></div>
</blockquote></div><br>