UWCDiffStencilValGenerator Derived Type

type, public, extends(JaggedArrayGenerator) :: UWCDiffStencilValGenerator

JaggedArrayGenerator for calculating an upwinding or central difference stencil based on interpolation to cell faces. Optionally interpolates a variable with given index in variable container. Interpolation variable required in upwinding mode.


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

Outer/row inverse jacobian/hodge star

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

linear interpolation coefficients to right cell faces

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

linear interpolation coefficients to right cell faces, taking into account potential upwinding

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

Inner/column jacobian/hodge star (right cell faces)

logical, private :: periodicGrid

True if stencil is calculated on periodic grid

integer(kind=ik), private :: upwindingMode

0 - no upwinding, 1 - upwinding with stencil containing the flux jacobian, 2- upwinding with stencil not including flux jacobian

integer(kind=ik), private :: minX

Local minX (obtained from partition data)

integer(kind=ik), private :: maxX

Local maxX

integer(kind=ik), private, allocatable :: interpVarIndex

Variable to optionally interpolate as part of stencil

real(kind=rk), private, allocatable, dimension(:) :: interpVarBuffer
logical, private :: staggeredGridMode

Remove last row if true


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

  • interface

    private module subroutine initUWCDiffStencil(this, partitionObj, procRank, innerJ, outerJ, linInterp, xPeriodic, interpVarIndex, upwindingMode, staggeredGridMode)

    Central/upwind differentiation stencil value generator initialization routine

    Arguments

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

    Partition object used to determine local number of rows

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

    Current processor rank

    real(kind=rk), intent(in), dimension(:) :: innerJ

    Inner/column jacobian/hodge star (should conform to x-grid)

    real(kind=rk), intent(in), dimension(:) :: outerJ

    Outer/row inverse jacobian/hodge star (should conform to x-grid)

    real(kind=rk), intent(in), dimension(:) :: linInterp

    Linear interpolation coefficients to right cell faces (should be size(xGrid)+1)

    logical, intent(in), optional :: xPeriodic

    Used to determine if outer processors should have their stencils trimmed. Defaults to .false.

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

    Optional interpolated variable index

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

    0 - no upwinding, 1 - upwinding with stencil containing the flux jacobian, 2- upwinding with stencil not including flux jacobian. Defaults to 0.

    logical, intent(in), optional :: staggeredGridMode

    Removes last row if true

procedure, public :: calculateInPlace => calcUWCDiffVals

  • interface

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

    Calculate central/upwind diff stencil values in place

    Arguments

    Type IntentOptional Attributes Name
    class(UWCDiffStencilValGenerator), 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