5. Low-storage forms
The Butcher form of an
| Form | Schemes | Registers | The update, at the end of stage k |
|---|---|---|---|
FORM_SHU_OSHER_2R | euler, ssp-22, ssp-33 | 2 | |
FORM_WILLIAMSON_2N | lsrk-33, lsrk-54 | 2 | |
FORM_KETCHESON_2R | ssp-104 | 2 | Ketcheson's recipe: Euler steps of |
In these forms the stage state is q itself, advanced in place at every end_stage. The caller asks which array holds the stage state with stage_state_is_q(k):
call st%begin_step(bx, q)
do k=1, st%stages()
call st%begin_stage(k, bx, dt, q)
if (st%stage_state_is_q(k)) then ! the low-storage forms keep the stage state in q itself
u => q
else ! the Butcher form keeps it in a register
u => st%stage_state()
endif
r => st%rhs_register()
call fill_ghosts(u)
call residual(u, r, dx)
call st%end_stage(k, bx, dt, q) ! the low-storage forms advance q here
enddo
call st%finish_step(bx, dt, q) ! the Butcher form advances q hereRunning it
$ low_storage
scheme low-storage form registers (Butcher, low-storage) max |q_butcher - q_low-storage|
ssp-33 shu-osher-2r 4 2 1.67E-15
lsrk-54 williamson-2n 6 2 9.99E-16
ssp-104 ketcheson-2r 11 2 4.66E-15Each scheme gives the same solution in both forms, to round-off (the forms add the same terms in a different order), with a third of the registers or less.
Which form, then?
On a GPU, take the low-storage form when the scheme has one: less memory and fewer field passes per step (Performance). Keep the Butcher form when you need the step residual dq (chapter 10), which only it can compute, or a scheme that has no other form (ssp-54, rk4).
Next: 6. Splittings.