Integrate field with BDF class scheme.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrator_back_df), | 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 BDF class scheme.
class(integrator_back_df), 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.
class(integrand_object), allocatable :: delta !< Delta RHS for fixed point iterations.
integer(I_P) :: s !< Steps counter.
allocate(delta, mold=U)
delta = self%previous(self%steps) * (-self%a(self%steps))
do s=1, self%steps - 1
delta = delta + (self%previous(s) * (-self%a(s)))
enddo
do s=1, self%iterations
U = delta + (U%t(t=self%t(self%steps) + Dt) * (Dt * self%b))
enddo
if (self%autoupdate) call self%update_previous(U=U, previous=self%previous, Dt=Dt, t=t, previous_t=self%t)
endsubroutine integrate