D2DV2Derivation Derived Type

type, public, extends(Derivation) :: D2DV2Derivation

Calculates v_o*d(v_i df/dv)/dv, where v_o and v_i are velocity vectors, and f is a distribution. Can return either a distribution or a single harmonic. Assumes that df/dv at v->inf is 0.


Components

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

True only if user explicitly sets it to true

integer(kind=ik), private :: numH

Total number of harmonics

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

Local copy of velocity grid widths for easier calculations

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

Local copy of v_n+1 - v_n

type(RealArray), private, allocatable, dimension(:) :: outerV

Outer velocity vector corresponding to cell centres for each included harmonic. Defaults to ones.

type(RealArray), private, allocatable, dimension(:) :: innerV

Inner velocity vector corresponding to right cell boundaries for each included harmonic. Defaults to ones.

type(RealArray), private, allocatable, dimension(:) :: vidfdvAtZero

Extrapolation of v_idf/dv at zero in the form A1f(v1)+A2*f(v2) where A's correspond to included harmonics (default = 0)

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

Harmonics included in the output (either all or just the targeted harmonics). Defaults to all.


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

  • interface

    private module subroutine initD2DV2Derivation(this, vSpaceObj, outerV, innerV, vidfdvAtZero, targetH)

    Initialize second order velocity derivative derivation

    Arguments

    Type IntentOptional Attributes Name
    class(D2DV2Derivation), intent(inout) :: this
    type(VSpace), intent(in) :: vSpaceObj
    type(RealArray), intent(in), optional, dimension(:) :: outerV

    Outer velocity vector corresponding to cell centres for each included harmonic. Defaults to ones.

    type(RealArray), intent(in), optional, dimension(:) :: innerV

    Inner velocity vector corresponding to right cell boundaries for each included harmonic. Defaults to ones.

    type(RealArray), intent(in), optional, dimension(:) :: vidfdvAtZero

    Extrapolation of v_idf/dv at zero in the form A1f(v1)+A2*f(v2) where A's correspond to included harmonics (default = 0)

    integer(kind=ik), intent(in), optional :: targetH

    Harmonic to take derivative of. If not present will return full distribution.

procedure, public :: calculate => calculateD2DV2

  • interface

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

    Arguments

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

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