<p>The function is always evaluated before the jacobian, but sometimes the function is evaluated at several places before a jacobian is needed (e.g. in a line search). You can cache any information you want in the user context during function evaluation and use it to speed up jacobian evaluation.</p>
<p><blockquote type="cite">On Feb 9, 2011 9:22 PM, "Pearl Flath" <<a href="mailto:pflath@ices.utexas.edu">pflath@ices.utexas.edu</a>> wrote:<br><br>Dear All,<br>I'd like to use the SNES nonlinear solvers. For my problem, evaluation of the Jacobian and the right hand side function involves some identical steps. I'd prefer not to repeat those, and instead have the Jacobian and function calculation share some computations. Is there a way to do this? Does SNES consistently evaluate one of them first, and thus I could have the other one re-use that information? Or is there a way to tell SNES to call a general update at each step before evaluating the Jacobian and function?<br>
<br>Many thanks.<br>
</blockquote></p>