Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pf_imk_t), | intent(inout) | :: | this | Inputs |
||
type(pf_pfasst_t), | intent(inout), | target | :: | pf | PFASST structure |
|
real(kind=pfdp), | intent(in) | :: | t0 | Time at beginning of time step |
||
real(kind=pfdp), | intent(in) | :: | dt | time step size |
subroutine mkrk_step(this, pf, t0, dt)
use pf_mod_timer
use pf_mod_hooks
!> Inputs
class(pf_imk_t), intent(inout) :: this
type(pf_pfasst_t), intent(inout),target :: pf !! PFASST structure
real(pfdp), intent(in ) :: t0 !! Time at beginning of time step
real(pfdp), intent(in ) :: dt !! time step size
!> Local variables
class(pf_level_t), pointer :: lev !! points to current level
integer :: m !! Loop variables
real(pfdp) :: t !! Time at nodes
lev => pf%levels(1)
t = t0 + dt
do m = 1, 5
call lev%Q(m)%setval(0.0_pfdp)
end do
call call_hooks(pf, 1, PF_PRE_SWEEP)
call lev%Q(1)%copy(lev%q0, flags=1)
call this%f_eval(lev%Q(1), t, lev%index, this%A(1))
call this%dexpinv(this%A(1), lev%Q(1), lev%F(1,1))
call lev%Q(2)%axpy(0.5_pfdp*dt, lev%F(1,1))
call this%propagate(lev%q0, lev%Q(2))
call this%f_eval(lev%Q(2), t, lev%index, this%A(2))
call this%dexpinv(this%A(2), lev%Q(2), lev%F(2,1))
call lev%Q(3)%axpy(0.5_pfdp*dt, lev%F(2,1))
call this%propagate(lev%q0, lev%Q(3))
call this%f_eval(lev%Q(3), t, lev%index, this%A(3))
call this%dexpinv(this%A(3), lev%Q(3), lev%F(3,1))
call lev%Q(4)%axpy(dt, lev%F(3,1))
call this%propagate(lev%q0, lev%Q(4))
call this%f_eval(lev%Q(4), t, lev%index, this%A(4))
call this%dexpinv(this%A(4), lev%Q(4), lev%F(4,1))
call lev%Q(5)%axpy(dt/6.0_pfdp, lev%F(1,1))
call lev%Q(5)%axpy(dt/6.0_pfdp, lev%F(4,1))
call lev%Q(5)%axpy(dt/3.0_pfdp, lev%F(2,1))
call lev%Q(5)%axpy(dt/3.0_pfdp, lev%F(3,1))
call this%propagate(lev%q0, lev%Q(5))
call pf_residual(pf, lev, dt)
call lev%qend%copy(lev%Q(lev%nnodes), 1)
call call_hooks(pf, 1, PF_POST_SWEEP)
end subroutine mkrk_step