constant Derived Type

type, public, extends(piecewise) :: constant

Constant piecewise type. i.e a piecewise function that does not change value


Components

Type Visibility Attributes Name Initial
real(kind=wp), public :: value

The constant value


Type-Bound Procedures

procedure, public :: sample => getValue

Sampling routine

  • public subroutine getValue(this, x, y, value)

    The constant version of sample

    Arguments

    Type IntentOptional Attributes Name
    class(constant), intent(in) :: this
    real(kind=wp), intent(out) :: x

    Output value

    real(kind=wp), intent(out) :: y

    Not used. Kept to keep interface the same for constant, piecewise1D and piecewise2D

    real(kind=wp), intent(in), optional :: value

    Not used. Kept to keep interface the same for constant, piecewise1D and piecewise2D

Source Code

    type, extends(piecewise) :: constant
        !> The constant value
        real(kind=wp) :: value
        contains
            !> Sampling routine
            procedure :: sample => getValue
    end type constant