CentralDiffDerivation Derived Type

type, public, extends(Derivation) :: CentralDiffDerivation

Returns equal to the central difference of the first passed (fluid) variable, optionally multiplied by a constant and product of fluid variables raised to corresponding powers


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

Powers corresponding to each fluid variable - indices in calculate must conform to size of this + 1

real(kind=rk), private :: multConst

Multiplicative constant - default 1

real(kind=rk), private, allocatable, dimension(:) :: leftMult
real(kind=rk), private, allocatable, dimension(:) :: centralMult
real(kind=rk), private, allocatable, dimension(:) :: rightMult

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

  • interface

    private module subroutine initCentralDiffDeriv(this, refGeometry, refPartition, procRank, varPowers, multConst)

    Initialize central difference derivation object

    Arguments

    Type IntentOptional Attributes Name
    class(CentralDiffDerivation), intent(inout) :: this
    type(Geometry), intent(in) :: refGeometry

    Geometry object used to calculate central difference

    type(Partition), intent(in) :: refPartition

    Partition object used to calculate central difference

    integer(kind=ik), intent(in) :: procRank

    Current processor rank

    real(kind=rk), intent(in), optional, dimension(:) :: varPowers

    Optional fluid variable powers

    real(kind=rk), intent(in), optional :: multConst

    Optional multiplicative constant - default 1

procedure, public :: calculate => calculateCentralDiffDeriv

  • interface

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

    Arguments

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

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