v_space_class Module

Houses object responsible for moment-taking and velocity space interpolation


Used by


Interfaces

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)

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)

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

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

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

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)

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)

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

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)

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)

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


Derived Types

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
procedure, public :: makeDefined => makeDefinedObject
procedure, public :: makeUndefined => makeUndefinedObject
procedure, public :: getVCellWidths
procedure, public :: getVGrid
procedure, public :: getNumH
procedure, public :: getNumV
procedure, public :: getVLinInterp
procedure, public :: calculateMoment
procedure, public :: getNearestPoints
procedure, public :: getContainingVCell
procedure, public :: getShkarofskyIMat
procedure, public :: getShkarofskyJMat
procedure, public :: init => initVSpace