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_fast(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)
call delta%multiply_fast(lhs=self%previous(self%steps), rhs=-self%a(self%steps))
do s=1, self%steps - 1
call self%buffer%multiply_fast(lhs=self%previous(s), rhs=-self%a(s))
call delta%add_fast(lhs=delta, rhs=self%buffer)
enddo
do s=1, self%iterations
self%buffer = U
call self%buffer%t_fast(t=self%t(self%steps) + Dt)
call self%buffer%multiply_fast(lhs=self%buffer, rhs=Dt * self%b)
call U%add_fast(lhs=delta, rhs=self%buffer)
enddo
if (self%autoupdate) call self%update_previous(U=U, previous=self%previous, Dt=Dt, t=t, previous_t=self%t)
endsubroutine integrate_fast