Integrate field with explicit TVD (or SSP) Runge-Kutta scheme.
This method can be used after the integrator is created (i.e. the RK coeficients are initialized).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(tvd_runge_kutta_integrator), | intent(in) | :: | self | Actual RK integrator. |
||
class(euler_1D_caf_nf), | intent(inout) | :: | U | Field to be integrated. |
||
class(euler_1D_caf_nf), | intent(inout) | :: | stage(1:) | Runge-Kutta stages [1:stages]. |
||
real(kind=R_P), | intent(in) | :: | Dt | Time step. |
||
real(kind=R_P), | intent(in) | :: | t | Time. |
subroutine integrate_rk(self, U, stage, Dt, t)
!---------------------------------------------------------------------------------------------------------------------------------
!< Integrate field with explicit TVD (or SSP) Runge-Kutta scheme.
!<
!< @note This method can be used **after** the integrator is created (i.e. the RK coeficients are initialized).
!---------------------------------------------------------------------------------------------------------------------------------
class(tvd_runge_kutta_integrator), intent(IN) :: self !< Actual RK integrator.
class(euler_1D_caf_nf), intent(INOUT) :: U !< Field to be integrated.
class(euler_1D_caf_nf), intent(INOUT) :: stage(1:) !< Runge-Kutta stages [1:stages].
real(R_P), intent(IN) :: Dt !< Time step.
real(R_P), intent(IN) :: t !< Time.
integer(I_P) :: s !< First stages counter.
integer(I_P) :: ss !< Second stages counter.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
! computing stages
do s=1, self%stages
stage(s) = U
do ss=1, s - 1
stage(s)%U = stage(s)%U + stage(ss)%U * (Dt * self%alph(s, ss))
enddo
stage(s) = stage(s)%t()
enddo
! computing new time step
do s=1, self%stages
U%U = U%U + stage(s)%U * (Dt * self%beta(s))
enddo
return
!---------------------------------------------------------------------------------------------------------------------------------
endsubroutine integrate_rk