gen_int_polynomial_fun_derivation_class Module

Houses derivation taking in multiple variables and performing a generalized integer powered polynomial calculation



Interfaces

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(:)

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

Derived Types

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
procedure, public :: makeDefined => makeDefinedObject
procedure, public :: makeUndefined => makeUndefinedObject
procedure, public :: init => initGenIntPolyFunDeriv
procedure, public :: calculate => calculateGenIntPolyFun