DiffusionStencilValGenerator Derived Type

type, public, extends(JaggedArrayGenerator) :: DiffusionStencilValGenerator

JaggedArrayGenerator for calculating a diffusion stencil, optionally using a derivation object to calculate the diffusion coefficient at faces. The default diffusion coefficient is unity.


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

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

logical, private :: periodicGrid

True if stencil is calculated on periodic grid

integer(kind=ik), private :: minX

Local minX (obtained from partition data)

integer(kind=ik), private :: maxX

Local maxX

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

Required variable indices for the optional diffusion coefficient derivation

type(CalculationRule), private, allocatable :: diffCoeffDerivRule

Rule for deriving the optional diffusion coefficient

real(kind=rk), private, allocatable, dimension(:) :: diffCoeffBuffer
real(kind=rk), private, allocatable, dimension(:) :: diffCoeffBufferInterp
logical, private :: doNotInterpolateD

Assume the diffusion coefficient is already calculated at cell boundaries. Defaults to false.


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

  • interface

    private module subroutine initDiffusionStencilGen(this, partitionObj, procRank, innerJ, outerJ, linInterp, xPeriodic, diffCoeffDerivRule, xHaloWidth, doNotInterpolateD)

    Diffusion stencil value generator initialization routine

    Arguments

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

    type(CalculationRule), intent(in), optional :: diffCoeffDerivRule

    Rule for deriving the optional diffusion coefficient

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

    Halo width in the x direction. Defaults to 1 and must always be >0

    logical, intent(in), optional :: doNotInterpolateD

    Assume the diffusion coefficient is already calcuated at cell boundaries. Defaults to False.

procedure, public :: calculateInPlace => calcDiffusionStencilGen