Simple stage value prediction for implicit RK #260
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The JFNK solver for diagonally-implicit Runge-Kutta used to use the previous stage value as the initial guess for nonlinear iterations:
$u^(i)_0$ = $u^{(i-1)}$ where superscripts in parentheses indicate stage values.
I modified the implicit solver to use a better stage value prediction:
$u^(i)_0 = c_i \Delta t \ RHS(u^n)$ $c_i \Delta t$ .
That is, I store the slope at the previous time step and use linear extrapolation to the "stage time",
The same test took 14h to run before making this change and 11h after adding the better stage value prediction. For the cost of adding a residual evaluation and storing the slope$RHS(u^n)$ , the JFNK solver needs to perform fewer iterations.
I propose making this a hard-coded change because it is unlikely to ever degrade performance, and only impacts a very small part of the code. If I add better stage value prediction in the future, I will code this more carefully. Section 2.18 of the Kennedy & Carpenter review on DIRK methods describes this SVP alongside many other more complex ones.
Draft while I clean up the changes...