VSpace Derived Type

type, public, extends(Object) :: VSpace

Object responsible for taking velocity moments of distributions and other velocity grid manipulation


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

Copy of velocity grid

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

Velocity grid cell widths

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

Linear interpolation coefficient for cell faces in velocity space

integer(kind=ik), public :: numV

Number of velocity cells

integer(kind=ik), public :: numH

Number of harmonics


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 :: getVCellWidths

  • interface

    private pure module function getVCellWidths(this) result(dv)

    Getter for vWidths

    Arguments

    Type IntentOptional Attributes Name
    class(VSpace), intent(in) :: this

    Return Value real(kind=rk), allocatable, dimension(:)

procedure, public :: getVGrid

  • interface

    private pure module function getVGrid(this) result(v)

    Getter for vGrid

    Arguments

    Type IntentOptional Attributes Name
    class(VSpace), intent(in) :: this

    Return Value real(kind=rk), allocatable, dimension(:)

procedure, public :: getNumH

  • interface

    private pure module function getNumH(this) result(numH)

    Return total number of resolved harmonic on grid

    Arguments

    Type IntentOptional Attributes Name
    class(VSpace), intent(in) :: this

    Return Value integer(kind=ik)

procedure, public :: getNumV

  • interface

    private pure module function getNumV(this) result(numV)

    Return number of v points on grid

    Arguments

    Type IntentOptional Attributes Name
    class(VSpace), intent(in) :: this

    Return Value integer(kind=ik)

procedure, public :: getVLinInterp

  • interface

    private pure module function getVLinInterp(this) result(linInterp)

    Getter for linInterp

    Arguments

    Type IntentOptional Attributes Name
    class(VSpace), intent(in) :: this

    Return Value real(kind=rk), allocatable, dimension(:)

procedure, public :: calculateMoment

  • interface

    private pure module function calculateMoment(this, f, h, mOrder, g, gDependsOnX) result(res)

    Calculate moment of the h-th harmonic of passed local distribution function f, optionally multiplied by g(v). If gDependsOnX is .true. assumes that g is given as a strided array with stride numV, and it is used to allocate the result - this allows g to not have a halo while f does. The moment is of order mOrder.

    Arguments

    Type IntentOptional Attributes Name
    class(VSpace), intent(in) :: this
    real(kind=rk), intent(in), dimension(:) :: f
    integer(kind=ik), intent(in) :: h
    integer(kind=ik), intent(in) :: mOrder
    real(kind=rk), intent(in), optional, dimension(:) :: g
    logical, intent(in), optional :: gDependsOnX

    Return Value real(kind=rk), allocatable, dimension(:)

procedure, public :: getNearestPoints

  • interface

    private pure module function getNearestPoints(this, v) result(pair)

    Return two nearest points for given velocity value v. If the first point is 0, the velocity is below the lowest velocity in the grid, and if the second point is 0 the velocity is above the greatest v in the grid.

    Arguments

    Type IntentOptional Attributes Name
    class(VSpace), intent(in) :: this
    real(kind=rk), intent(in) :: v

    Return Value integer(kind=ik), dimension(2)

procedure, public :: getContainingVCell

  • interface

    private pure module function getContainingVCell(this, v) result(ind)

    Return index of cell which containes the given velocity value v. If the returned index is 0, the point is outside of the grid.

    Arguments

    Type IntentOptional Attributes Name
    class(VSpace), intent(in) :: this
    real(kind=rk), intent(in) :: v

    Return Value integer(kind=ik)

procedure, public :: getShkarofskyIMat

  • interface

    private pure module function getShkarofskyIMat(this, index) result(res)

    Return sparse row data format for the lower triangular Shkarofsky I_index integral.

    Arguments

    Type IntentOptional Attributes Name
    class(VSpace), intent(in) :: this
    integer(kind=ik), intent(in) :: index

    Return Value type(SparseRowData)

procedure, public :: getShkarofskyJMat

  • interface

    private pure module function getShkarofskyJMat(this, index) result(res)

    Return sparse row data format for the upper triangular Shkarofsky J_index integral.

    Arguments

    Type IntentOptional Attributes Name
    class(VSpace), intent(in) :: this
    integer(kind=ik), intent(in) :: index

    Return Value type(SparseRowData)

procedure, public :: init => initVSpace

  • interface

    private pure module subroutine initVSpace(this, gridObj)

    VSpace initialization routine

    Arguments

    Type IntentOptional Attributes Name
    class(VSpace), intent(inout) :: this
    type(Grid), intent(in) :: gridObj

    Grid object used to initialize VSpace