<div class="gmail_quote">On Sat, Nov 12, 2011 at 12:22, behzad baghapour <span dir="ltr"><<a href="mailto:behzad.baghapour@gmail.com">behzad.baghapour@gmail.com</a>></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>No. It'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'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 "while" 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>