[petsc-users] Simultaneously compute Residual+Jacobian in SNES
Derek Gaston
friedmud at gmail.com
Mon Dec 12 11:40:16 CST 2016
On Mon, Dec 12, 2016 at 11:43 AM Jed Brown <jed at jedbrown.org> wrote:
> 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.
>
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.
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.
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.
I can see that.
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.
But anyway - the gains seem pretty small and not worth it. I'm pretty
convinced this idea is foolhardy ;-)
Derek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20161212/5449f06c/attachment.html>
More information about the petsc-users
mailing list