ddv_stencil_gen_class Module

Stencil generator for d/dv type terms


Used by


Interfaces

interface

  • private module subroutine initDDVValGen(this, partitionObj, vspaceObj, procRank, activeXCoords, fixedC, fixedInterp, mbC, mbInterp, cfAtZero)

    d/dv stencil value generator initialization routine

    Arguments

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

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

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

    Fixed vel interpolation values (size numV). Defaults to values from VSpace.

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

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

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

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

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

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

interface

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

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

    Arguments

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

JaggedArrayGenerator for calculating d/dv type stencils for single harmonics. Automatically includes spatial dependence. Has options for custom velocity grid interpolation of the distribution function and definition of the velocity cell boundary flux in the form C*f where f is the distribution function and C is a custom value. The interpolation weights and C are 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(:) :: bufferC

Buffer for velocity cell boundary flux jacobian (with or without spatial dependence). Defaults to 1.

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

Buffer for velocity cell boundary flux jacobian (with or without spatial dependence). Defaults to interpolation values from vSpace.

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

Optional modelbound value for C (single harmonic dist)

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

Optional modelbound value for interpolation weight (single harmonic dist)

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

Extrapolation of Cf 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

Type-Bound Procedures

procedure, public :: isDefined => isDefinedObject
procedure, public :: makeDefined => makeDefinedObject
procedure, public :: makeUndefined => makeUndefinedObject
procedure, public :: calculate
procedure, public :: init => initDDVValGen
procedure, public :: calculateInPlace => calcDDVVals