Skip to content

Interface for combined residual and Jacobian evaluations #743

@termi-official

Description

@termi-official

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions