VDiffStencilGen Derived Type

type, public, extends(JaggedArrayGenerator) :: VDiffStencilGen

JaggedArrayGenerator for calculating d(Ad/dv)/dv type stencils. Formally a d/dv term where the flux is A*df/dv where df/dv at cell edge n+1/2 is (f_{n+1}-f_{n})/(v_{n+1}-v_{n}). A is assumed to be defined on right velocity cell boundaries. Assumes that the velocity stencil is [-1,0,1]


Components

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

True only if user explicitly sets it to true

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

List of local x coordinates for which this stencil generator creates values

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

Buffer for diffusion coefficient (with or without spatial dependence). Defaults to 1.

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

Optional modelbound value for A (single harmonic dist)

real(kind=rk), private, dimension(2) :: adfAtZero

Extrapolation of Adf/dv at zero in the form A1f(v1)+A2*f(v2) where all A's are fixed (default = 0)

integer(kind=ik), private :: numV

Local copy of vGrid size

integer(kind=ik), private :: locNumX

Local x grid size

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

Copy of v grid widths

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

v_{n+1}-v_{n} used to calculate cell edge derivatives


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 :: calculate

  • interface

    private module function calculate(this, varCont, mbData, hostModel) result(res)

    Use in place version of stencil calculation to return values

    Arguments

    Type IntentOptional Attributes Name
    class(JaggedArrayGenerator), intent(inout) :: this
    type(VariableContainer), intent(in) :: varCont
    class(ModelboundData), intent(in), optional :: mbData
    class(ModelSurrogate), intent(in), optional :: hostModel

    Return Value type(RealArray), allocatable, dimension(:)

procedure, public :: init => initVDiffValGen

  • interface

    private module subroutine initVDiffValGen(this, partitionObj, vspaceObj, procRank, activeXCoords, fixedA, mbA, adfAtZero)

    d(Ad/dv)/dv stencil value generator initialization routine

    Arguments

    Type IntentOptional Attributes Name
    class(VDiffStencilGen), intent(inout) :: this
    type(Partition), intent(in) :: partitionObj

    Partition object used to determine local number of rows

    type(VSpace), intent(in) :: vspaceObj

    VSpace object used to get interpolation object

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

    Current processor rank

    integer(kind=ik), intent(in), dimension(:) :: activeXCoords

    List of active global x coords

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

    Fixed A values (size numV). Defaults to ones.

    character(len=*), intent(in), optional :: mbA

    Optional modelbound value for A (single harmonic variable). Overrides fixed values.

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

    Optional extrapolation of Adf/dv at zero in the form A1f(v1)+A2*f(v2) where all A's are fixed. Defaults to 0.

procedure, public :: calculateInPlace => calcVDiffVals

  • interface

    private module subroutine calcVDiffVals(this, varCont, res, mbData, hostModel)

    Calculate d(Ad/dv)/dv stencil values in place (does not depend on varCont)

    Arguments

    Type IntentOptional Attributes Name
    class(VDiffStencilGen), intent(inout) :: this
    type(VariableContainer), intent(in) :: varCont
    type(RealArray), intent(inout), allocatable, dimension(:) :: res
    class(ModelboundData), intent(in), optional :: mbData
    class(ModelSurrogate), intent(in), optional :: hostModel