-
-
Notifications
You must be signed in to change notification settings - Fork 61
Description
Is your feature request related to a problem? Please describe.
At least for nonlinear problems coming from PDEs discretized with finite element methods it is typically more efficient to evaluate Jacobians and residuals together instead of separately, as there is a huge chunk of redundant computation going on.
Describe the solution you’d like
I think the fix should be rather straight forward. We can add some fjac to NonlinearFunction which defaults to evaluating f and jac in order. Then the algorithms in this package can simply call fjac instead of jac and f separately when they evaluate both -- as in most cases the algorithm wants either both or just the residual since we typically do not evaluate just the jac and keep the residual.
Describe alternatives you’ve considered
I am done reimplementing Newton by hand.
Additional context
N/A.