This is a solver for systems in the form
The method is 'Jacobian-Free' in the sense that the user only need supply a function that evaluates
I hope that you will find that the code is simply written, and that it can be bolted on to any existing code that evaluates (a potentially complicated)
The JFNK solver and GMRES codes are available in both MATLAB/Fortran90 versions, and are easily integrated with codes developed in other languages: if your code doesn't already, edit it a little so that it loads a state
The MATLAB version of this code will run under the free alternative Octave.
Developed as part of www.openpipeflow.org
FURTHER DETAILS ON THE METHOD: See below or at https://doi.org/10.48550/arXiv.1908.06730
CITATION: https://doi.org/10.48550/arXiv.1908.06730 or https://doi.org/10.1016/j.softx.2017.05.003
AUTHOR: Ashley P. Willis, Applied Mathematics, School of Mathematical and Physical Sciences, University of Sheffield. https://www.sheffield.ac.uk/mps/research/fluid-dynamics
THANKS: Rich Kerswell, Predrag Cvitanovi'c (chaosbook.org), John Gibson (channelflow.org), Marc Avila and many others for their generous support in many forms. Developed under EPSRC grants EP/K03636X/1, EP/P000959/1.
With git:
$ git clone https://github.com/apwillis1/JFNK-Hookstep.git
Manually:
- click on 'MATLAB' or 'Fortran90' above,
- click on a code file,
- click on 'Raw',
- Ctrl+S, or use browser option 'Save page as...'
Tutorial and Adapting the code for your own use.
The codes implement the 'Jacobian-free Newton-Krylov (JFNK) method' for solving
This is a powerful method that can solve for
To find the roots
The Jacobian matrix is usually difficult to evaluate. However, the problem
Iterations of the GMRES algorithm for the problem
Note that provided that each step of the Newton method,
To improve the domain of convergence of the Newton method, it is commonplace to limit the size of the step taken. One approach is simply to take a 'damped' step in the direction of the solution to
In the hookstep approach, we minimise subject to the condition that the magnitude of the Newton step is limited,
The hookstep can be calculated with little extra work to the GMRES method, provided that the size of Krylov-subspace, m, is chosen sufficiently large to solve to the desired accuracy within m GMRES iterations.
For a given
The GMRES implementations can be supplied with a preconditioner routine (see GMRES subroutine), but is unlikely to be necessary when the method is combined with time integration.
Extended overview https://doi.org/10.48550/arXiv.1908.06730 . See section 4 for a Tutorial and Adapting the code for your own use
Further details on the method at channelflow.org.