mkrk_step Subroutine

public subroutine mkrk_step(this, pf, t0, dt)

Uses

  • proc~~mkrk_step~~UsesGraph proc~mkrk_step mkrk_step module~pf_mod_hooks pf_mod_hooks proc~mkrk_step->module~pf_mod_hooks module~pf_mod_timer pf_mod_timer proc~mkrk_step->module~pf_mod_timer module~pf_mod_dtype pf_mod_dtype module~pf_mod_hooks->module~pf_mod_dtype module~pf_mod_timer->module~pf_mod_dtype iso_c_binding iso_c_binding module~pf_mod_dtype->iso_c_binding

Arguments

Type IntentOptional AttributesName
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


Calls

proc~~mkrk_step~~CallsGraph proc~mkrk_step mkrk_step proc~call_hooks call_hooks proc~mkrk_step->proc~call_hooks proc~pf_residual pf_residual proc~mkrk_step->proc~pf_residual proc~start_timer start_timer proc~call_hooks->proc~start_timer proc~end_timer end_timer proc~call_hooks->proc~end_timer proc~pf_residual->proc~start_timer proc~pf_residual->proc~end_timer

Called by

proc~~mkrk_step~~CalledByGraph proc~mkrk_step mkrk_step proc~imk_sweep imk_sweep proc~imk_sweep->proc~mkrk_step

Contents

Source Code


Source Code

  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