dense_interval Subroutine

private subroutine dense_interval(me, available, t0, tf, x0, xf)

Returns the interval of the last accepted step, which is where interpolate can be used. For example, this can be called from the report function to get the previous time and state, so that points in between can be computed.

available is false if there is no dense output available. In this case, the other outputs are not set. This is the case if a step has not been taken yet (e.g., for the first reported point), or if the user has stopped the integration (see interpolate). An error is also raised if the method does not have a dense output, or if it was not enabled when the integrator was initialized.

Note

This is the full internal step taken by the integrator. When integrating backwards, tf < t0. For integrate_to_event_variable_step, at the final reported point (the event), this is the full step that contains the event, so tf will be past the reported event time (the dense output is still valid there).

Type Bound

rk_class

Arguments

Type IntentOptional Attributes Name
class(rk_class), intent(inout) :: me
logical, intent(out) :: available

if dense output is available

real(kind=wp), intent(out), optional :: t0

initial time of the step

real(kind=wp), intent(out), optional :: tf

final time of the step

real(kind=wp), intent(out), optional, dimension(me%n) :: x0

initial state of the step

real(kind=wp), intent(out), optional, dimension(me%n) :: xf

final state of the step


Calls

proc~~dense_interval~~CallsGraph proc~dense_interval rk_class%dense_interval proc~dense_check rk_class%dense_check proc~dense_interval->proc~dense_check proc~raise_exception rk_class%raise_exception proc~dense_check->proc~raise_exception

Source Code

    subroutine dense_interval(me,available,t0,tf,x0,xf)
        class(rk_class),intent(inout) :: me
        logical,intent(out) :: available !! if dense output is available
        real(wp),intent(out),optional :: t0 !! initial time of the step
        real(wp),intent(out),optional :: tf !! final time of the step
        real(wp),dimension(me%n),intent(out),optional :: x0 !! initial state of the step
        real(wp),dimension(me%n),intent(out),optional :: xf !! final state of the step

        available = me%dense_check()
        if (available) available = me%dense_available .and. .not. me%stopped
        if (available) then
            if (present(t0)) t0 = me%dense_t
            if (present(tf)) tf = me%dense_t + me%dense_h
            if (present(x0)) x0 = me%dense_x
            if (present(xf)) xf = me%dense_xf
        end if

    end subroutine dense_interval