<div dir="ltr">On Mon, Dec 12, 2016 at 11:43 AM Jed Brown <<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_msg">I still don't understand your many field case. The geometric overhead is amortized and the Jacobian contribution typically grows quadratically in the number of fields, so I would expect it to increase the Jacobian:residual cost ratio, not reduce it.</div></blockquote><div><br></div><div>It depends on how things are coupled... but I do agree that with many fields the Jacobian tends to get even more expensive to produce.</div><div><br></div><div>However, the point is just about reusing an expensive computation: the field values on every element.  Regardless of how expensive the Jacobian/Residual are to compute... cutting the time in half for computing the values of many fields could be worthwhile.</div><div><br></div><div>But I suppose your point is that if you are blindly computing Jacobians with residuals... then you're going to waste a few Jacobians (at least one every timestep for instance).  If that Jacobian is incredibly expensive to produce then it's wiped out any gains made in not recomputing variable values.</div><div><br></div><div>I can see that.</div><div><br></div><div>How about this: what if SNES only called this optional R+J interface when it knew _for sure_ it needed both?  For instance... for the first linear solve.</div><div><br></div><div>But anyway - the gains seem pretty small and not worth it.  I'm pretty convinced this idea is foolhardy ;-)</div><div><br></div><div>Derek</div></div></div>