additive_derivation_class Module

Houses composite derivation class where multiple derivation results get added


Used by


Interfaces

interface

  • private module function calculateAdditive(this, inputArray, indices) result(output)

    Arguments

    Type IntentOptional Attributes Name
    class(AdditiveDerivation), 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 initAdditiveDeriv(this, numDerivs, expectedNumIndices, resultPower, linearCoefficients)

    Initialize additive derivation object, allocating the expected number of derivation objects

    Arguments

    Type IntentOptional Attributes Name
    class(AdditiveDerivation), intent(inout) :: this
    integer(kind=ik), intent(in) :: numDerivs
    integer(kind=ik), intent(in) :: expectedNumIndices
    real(kind=rk), intent(in), optional :: resultPower
    real(kind=rk), intent(in), optional, dimension(:) :: linearCoefficients

interface

  • private module subroutine addDerivation(this, deriv, activeIndices)

    Adds derivation to additive derivation object

    Arguments

    Type IntentOptional Attributes Name
    class(AdditiveDerivation), intent(inout) :: this
    class(Derivation), intent(in) :: deriv
    integer(kind=ik), intent(in), dimension(:) :: activeIndices

    Entries of indices object passed to calculateAdditive to be passed to added derivation


Derived Types

type, public, extends(Derivation) ::  AdditiveDerivation

Composite derivation class containing a number of calculation rules applied additively. All derivations must return same length array

Components

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

True only if user explicitly sets it to true

type(DerivationContainer), private, allocatable, dimension(:) :: derivs

Derivation whose results to be added

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

Subset of indices vector passed to each derivation

integer(kind=ik), private :: numAddedDerivations

Counter for keeping track of added derivations

integer(kind=ik), private :: expectedNumIndices

Expected size of indices array - for errorChecking

real(kind=rk), private :: resultPower

Optional power to which the result is raised = default 1

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

Additive linear combination coefficients associated with each derivation. Defaults to ones.

Type-Bound Procedures

procedure, public :: isDefined => isDefinedObject
procedure, public :: makeDefined => makeDefinedObject
procedure, public :: makeUndefined => makeUndefinedObject
procedure, public :: init => initAdditiveDeriv
procedure, public :: addDerivation
procedure, public :: calculate => calculateAdditive