Integrate field with leapfrog class scheme.
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(self, U, Dt, t)
!< Integrate field with leapfrog class scheme.
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.
U = self%previous(1) + (self%previous(2)%t(t=t) * (Dt * 2._R_P))
if (self%is_filtered) then
self%filter = (self%previous(1) - (self%previous(2) * 2._R_P) + U) * self%nu * 0.5_R_P
self%previous(2) = self%previous(2) + (self%filter * self%alpha)
U = U + (self%filter * (self%alpha - 1._R_P))
endif
if (self%autoupdate) call self%update_previous(U=U, previous=self%previous)
endsubroutine integrate