dougshidong / PHiLiP

Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
Other
45 stars 36 forks source link

Simple stage value prediction for implicit RK #260

Open cpethrick opened 2 months ago

cpethrick commented 2 months ago

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)$ That is, I store the slope at the previous time step and use linear extrapolation to the "stage time", $c_i \Delta t$.

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...