Example with custom Newton solver and line search

I am looking for an example which implements its own non-linear solver (doesn’t really matter which one). I am interested in seeing a line search implementation. I couldn’t find such an example.

I have implemented one in cashocs. Here is the full code: cashocs/cashocs/nonlinear_solvers/newton_solver.py at main · sblauth/cashocs · GitHub

Disclaimer: I am the author of cashocs.

The line search is the affine covariant version considered in Newton Methods for Nonlinear Problems: Affine Invariance and Adaptive Algorithms | SpringerLink
In general I can highly recommend this book for an analysis of damped Newton methods and the line searches, as a simple Armijo-type line search will, in general, be problematic for Newton’s method.

2 Likes

@dokken also has an example at Custom Newton solvers — FEniCSx tutorial