fb_diff_stencil_gen_class Module

Stencil generator for fixed forward or backwards differencing


Used by


Interfaces

interface

  • private module subroutine initFBValGen(this, partitionObj, procRank, innerJ, outerJ, xPeriodic, backwardsDiff, staggeredGridMode)

    Forward/backward differentiation stencil value generator initialization routine

    Arguments

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

    logical, intent(in), optional :: xPeriodic

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

    logical, intent(in), optional :: backwardsDiff

    If true the difference is backwards. Defaults to .false.

    logical, intent(in), optional :: staggeredGridMode

    If true will zero out the rightmost contribution to backwards differencing or remove last row for forward differencing

interface

  • private module subroutine calcFBVals(this, varCont, res, mbData, hostModel)

    Calculate forward/backwards diff stencil values in place (does not depend on varCont)

    Arguments

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

Derived Types

type, public, extends(JaggedArrayGenerator) ::  FBDiffStencilValGenerator

JaggedArrayGenerator for calculating forward or backwards difference stencils. These are two-point stencils of the form [-Jout(i)Jin(i),Jout(i)Jin(i+1)], or [-Jout(i)Jin(i-1),Jout(i)Jin(i)], depending on whether the difference is forward or backwards. Jout and Jin should be defined on the x grid, and should act like the (inverse) Jacobian/Hodge star operator.

Components

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

True only if user explicitly sets it to true

logical, private :: backwardsDiff

If true the difference is backwards. Defaults to .false.

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

Inner/column jacobian/hodge star (left jacobian if forward diff and vice versa)

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

Outer/row inverse jacobian/hodge star

logical, private :: periodicGrid

True if stencil is calculated on periodic grid

logical, private :: staggeredGridMode

If true will zero out the rightmost contribution to backwards differencing or remove last row for forward differencing - defaults to false

integer(kind=ik), private :: minX

Local minX (obtained from partition data)

integer(kind=ik), private :: maxX

Local maxX

Type-Bound Procedures

procedure, public :: isDefined => isDefinedObject
procedure, public :: makeDefined => makeDefinedObject
procedure, public :: makeUndefined => makeUndefinedObject
procedure, public :: calculate
procedure, public :: init => initFBValGen
procedure, public :: calculateInPlace => calcFBVals