diffusion_stencil_gen_class Module

Stencil generator for diffusion in x direction


Used by


Interfaces

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.

interface


Derived Types

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
procedure, public :: makeDefined => makeDefinedObject
procedure, public :: makeUndefined => makeUndefinedObject
procedure, public :: calculate
procedure, public :: init => initDiffusionStencilGen
procedure, public :: calculateInPlace => calcDiffusionStencilGen