Integrate field with explicit SSP Runge-Kutta scheme.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrator_runge_kutta_ssp), | intent(inout) | :: | self | Integrator. |
||
class(integrand_object), | intent(inout) | :: | U | Field to be integrated. |
||
real(kind=R_P), | intent(in) | :: | Dt | Time step. |
||
real(kind=R_P), | intent(in) | :: | t | Time. |
||
real(kind=R_P), | intent(out), | optional | :: | new_Dt | New adapted time step. |
subroutine integrate_fast(self, U, Dt, t, new_Dt)
!< Integrate field with explicit SSP Runge-Kutta scheme.
class(integrator_runge_kutta_ssp), intent(inout) :: self !< Integrator.
class(integrand_object), intent(inout) :: U !< Field to be integrated.
real(R_P), intent(in) :: Dt !< Time step.
real(R_P), intent(in) :: t !< Time.
real(R_P), optional, intent(out) :: new_Dt !< New adapted time step.
integer(I_P) :: s !< First stages counter.
integer(I_P) :: ss !< Second stages counter.
! computing stages
self%buffer = U
do s=1, self%stages
self%stage(s) = U
do ss=1, s - 1
call self%buffer%multiply_fast(lhs=self%stage(ss), rhs=Dt * self%alph(s, ss))
call self%stage(s)%add_fast(lhs=self%stage(s), rhs=self%buffer)
enddo
call self%stage(s)%t_fast(t=t + self%gamm(s) * Dt)
enddo
! computing new time step
do s=1, self%stages
call self%buffer%multiply_fast(lhs=self%stage(s), rhs=Dt * self%beta(s))
call U%add_fast(lhs=U, rhs=self%buffer)
enddo
if (present(new_Dt)) new_Dt = Dt
endsubroutine integrate_fast