PolyFunDeriv Derived Type

type, public, extends(Derivation) :: PolyFunDeriv

Derivation taking in a single variable v and returning c0 + sum(c_ivp_i), where p are powers and c polynomial coefficents, Can optionally take as many conforming variables as there are coefficients and return c0 + sum(c_iv_i**p_i)


Components

Type Visibility Attributes Name Initial
logical, public :: userDefined = .false.

True only if user explicitly sets it to true

real(kind=rk), private, allocatable, dimension(:) :: polyPowers

Polynomial powers

real(kind=rk), private, allocatable, dimension(:) :: polyCoeffs

Polynomial coefficients

real(kind=rk), private :: constCoeff

Constant coefficient - default 0


Type-Bound Procedures

procedure, public :: isDefined => isDefinedObject

  • interface

    private pure module function isDefinedObject(this) result(defined)

    Getter for userDefined

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(in) :: this

    Return Value logical

procedure, public :: makeDefined => makeDefinedObject

  • interface

    private pure module subroutine makeDefinedObject(this)

    Set userDefined to .true.

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(inout) :: this

procedure, public :: makeUndefined => makeUndefinedObject

  • interface

    private pure module subroutine makeUndefinedObject(this)

    Set userDefined to .false.

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(inout) :: this

procedure, public :: init => initPolyFunDeriv

  • interface

    private module subroutine initPolyFunDeriv(this, polyPowers, polyCoeffs, constCoeff)

    Initialize polynomial function derivation object

    Arguments

    Type IntentOptional Attributes Name
    class(PolyFunDeriv), intent(inout) :: this
    real(kind=rk), intent(in), dimension(:) :: polyPowers
    real(kind=rk), intent(in), dimension(:) :: polyCoeffs
    real(kind=rk), intent(in), optional :: constCoeff

procedure, public :: calculate => calculatePolyFun

  • interface

    private module function calculatePolyFun(this, inputArray, indices) result(output)

    Arguments

    Type IntentOptional Attributes Name
    class(PolyFunDeriv), intent(inout) :: this
    type(RealArray), intent(in), dimension(:) :: inputArray
    integer(kind=ik), intent(in), dimension(:) :: indices

    Return Value real(kind=rk), allocatable, dimension(:)