Integrate integrand field by (s-1)-th order formula.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrator_runge_kutta_lssp), | 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. |
subroutine integrate_order_s_1_fast(self, U, Dt, t)
!< Integrate integrand field by (s-1)-th order formula.
class(integrator_runge_kutta_lssp), 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.
integer(I_P) :: s !< First stages counter.
! computing stages
self%stage(1) = U
do s=2, self%stages
self%buffer = self%stage(s-1)
call self%buffer%t_fast(t=t)
call self%buffer%multiply_fast(lhs=self%buffer, rhs=Dt * 0.5_R_P)
call self%stage(s)%add_fast(lhs=self%stage(s-1), rhs=self%buffer)
enddo
self%buffer = self%stage(self%stages)
call self%buffer%t_fast(t=t)
call self%buffer%multiply_fast(lhs=self%buffer, rhs=Dt * 0.5_R_P)
call self%stage(self%stages)%add_fast(lhs=self%stage(self%stages), rhs=self%buffer)
! computing new time step
call U%multiply_fast(lhs=U, rhs=0._R_P)
do s=1, self%stages
call self%buffer%multiply_fast(lhs=self%stage(s), rhs=self%alpha(s))
call U%add_fast(lhs=U, rhs=self%buffer)
enddo
endsubroutine integrate_order_s_1_fast