On Sat, Nov 12, 2011 at 4:20 PM, behzad baghapour <span dir="ltr">&lt;<a href="mailto:behzad.baghapour@gmail.com">behzad.baghapour@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
The state of my problem is set and saved in elements and faces. So I should pass and update them for residual and Jacobian calculations in each Newton step. It is better for me to use them since the element and face connectivities required in residual and jacobian matrix are saved there. How would be my best choice then???<br>
</blockquote><div><br></div><div>I cannot understand what information you are talking about, so I can&#39;t make any recommendation. If you can</div><div>clearly state, preferably with equations, what you are storing, we might be able to help.</div>
<div><br></div><div>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="gmail_quote">On Sat, Nov 12, 2011 at 6:04 PM, Jed Brown <span dir="ltr">&lt;<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">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><div class="gmail_quote">On Sat, Nov 12, 2011 at 02:08, 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">
I should pass a user-defined context, containing element and face local data obtained from PDE solution, to RHS and Jacobian evaluation of SNES process. Here I need to update my context each Newton Iteration. I may pass my context into a monitor function set by SNESMonitorSet. In the monitor function, I cast into my context and update my field (elements and faces) for next evaluations in RHS and Jacobian routines in Newton process. </blockquote>


</div><br></div><div>Are you updating external forcing information? The state vector is passed in to the residual and Jacobian routines, you should just use it.</div></blockquote></div></blockquote></div>-- <br>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<br>