GenIntPolyFunDeriv Derived Type

type, public, extends(Derivation) :: GenIntPolyFunDeriv

Derivation taking in multiple variables and calculating multConst*fun(sum coef_i prod vars^powers) where prod vars^powers is shorthand for a product of multiple variables raised to corresponding powers. Basically behaves like a multiplicative derivation where the inner derivation is a massive sum of simple derivation outputs with integer powers. Implemented to allow AMJUEL rate fit derivations efficiently


Components

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

True only if user explicitly sets it to true

type(IntArray), private, allocatable, dimension(:) :: polyPowers

Variable powers for each monomial

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

Polynomial coefficients for each monomial

real(kind=rk), private :: multConst

Constant coefficient - default 1

integer(kind=ik), private, allocatable, dimension(:) :: maxPowers

Maximum powers to be precalculated for each passed variable

character(len=:), private, allocatable :: funcName

Intrinsic function name optionally applied to polynomial


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 => initGenIntPolyFunDeriv

  • interface

    private module subroutine initGenIntPolyFunDeriv(this, polyPowers, polyCoeffs, maxPowers, funcName, multConst)

    Initialize generalized integer powered polynomial function derivation object

    Arguments

    Type IntentOptional Attributes Name
    class(GenIntPolyFunDeriv), intent(inout) :: this
    type(IntArray), intent(in), dimension(:) :: polyPowers
    real(kind=rk), intent(in), dimension(:) :: polyCoeffs
    integer(kind=ik), intent(in), dimension(:) :: maxPowers
    character(len=*), intent(in), optional :: funcName
    real(kind=rk), intent(in), optional :: multConst

procedure, public :: calculate => calculateGenIntPolyFun

  • interface

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

    Arguments

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

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