Integrate field with explicit low storage Runge-Kutta scheme, fast mode.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrator_runge_kutta_ls), | 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 low storage Runge-Kutta scheme, fast mode.
class(integrator_runge_kutta_ls), 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), intent(out), optional :: new_Dt !< New adapted time step.
integer(I_P) :: s !< First stages counter.
! computing stages
self%stage(1) = U
call self%stage(2)%multiply_fast(lhs=U, rhs=0._R_P)
do s=1, self%stages
self%buffer = self%stage(1)
call self%buffer%t_fast(t=t + self%C(s) * Dt)
call self%buffer%multiply_fast(lhs=self%buffer, rhs=Dt)
call self%stage(2)%multiply_fast(lhs=self%stage(2), rhs=self%A(s))
call self%stage(2)%add_fast(lhs=self%stage(2), rhs=self%buffer)
call self%buffer%multiply_fast(lhs=self%stage(2), rhs=self%B(s))
call self%stage(1)%add_fast(lhs=self%stage(1), rhs=self%buffer)
enddo
U = self%stage(1)
if (present(new_Dt)) new_Dt = Dt
endsubroutine integrate_fast