Multi-step TVD ODE solver class.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | neq |
number of equations |
|||
integer, | public | :: | order |
order of the method |
|||
integer, | public | :: | fevals | = | 0 |
number of function evaluations |
|
integer, | public | :: | istate | = | 0 |
flag indicating the state of the integration: 1 first call for a problem, 2 subsequent call for a problem. |
|
character(len=:), | public, | allocatable | :: | msg |
error message |
Error method.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tvdode), | intent(inout) | :: | self |
object |
||
character(len=*), | intent(in) | :: | msg |
message |
This subroutine implements a 5-step, 3rd order TVD multi-step method described in ICASE 97-65 (Shu, 1997). In theory, this method should have an efficiency 1.5 times higher than the RK method of the same order. However, in practice they appear to be almost identical. The routine was built to work similarly to LSODE.
Note
There is a 2nd order multi-step method, but the corresponding CFL value is half that of the 2nd order RK method. Thus, there is no reason to implement it.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mstvd), | intent(inout) | :: | self |
object |
||
real(kind=rk), | intent(inout) | :: | u(:) |
vector(neq) with the variables to integrate |
||
real(kind=rk), | intent(inout) | :: | t |
time; on return it will be the current value of (close to tout) |
||
real(kind=rk), | intent(in) | :: | tout |
time where next output is desired |
||
real(kind=rk), | intent(in) | :: | dt |
time step |
type, extends(tvdode) :: mstvd !! Multi-step TVD ODE solver class. real(rk), allocatable, private :: uold(:, :) real(rk), allocatable, private :: udotold(:, :) contains procedure, pass(self) :: integrate => mstvd_integrate end type mstvd