OK. I try to following this procedure. Thanks a lot.
On Sat, Nov 12, 2011 at 9:57 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote: > On Sat, Nov 12, 2011 at 12:22, behzad baghapour < > behzad.baghapour at gmail.com> wrote: > >> 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. > > > No. It's very simple. Put work arrays in a context and set that context > for both FormFunction() and FormJacobian(). > > 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. > > In FormJacobian(): use the values that were placed in the work arrays by > FormFunction(). > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111112/a8447e69/attachment.htm>
