Integrate field with leapfrog class scheme, fast mode.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrator_leapfrog), | 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_fast(self, U, Dt, t)
!< Integrate field with leapfrog class scheme, fast mode.
class(integrator_leapfrog), 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.
self%buffer = self%previous(2)
call self%buffer%t_fast(t=t)
call self%buffer%multiply_fast(lhs=self%buffer, rhs=Dt * 2._R_P)
call U%add_fast(lhs=self%previous(1), rhs=self%buffer)
if (self%is_filtered) then
call self%buffer%multiply_fast(lhs=self%previous(2), rhs=2._R_P)
call self%buffer%subtract_fast(lhs=self%previous(1), rhs=self%buffer)
call self%buffer%add_fast(lhs=self%buffer, rhs=U)
call self%filter%multiply_fast(lhs=self%buffer, rhs=self%nu * 0.5_R_P)
call self%buffer%multiply_fast(lhs=self%filter, rhs=self%alpha)
call self%previous(2)%add_fast(lhs=self%previous(2), rhs=self%buffer)
call self%buffer%multiply_fast(lhs=self%filter, rhs=self%alpha - 1._R_P)
call U%add_fast(lhs=U, rhs=self%buffer)
endif
if (self%autoupdate) call self%update_previous(U=U, previous=self%previous)
endsubroutine integrate_fast