indexing_class Module

Houses Indexing object responsible for handling the indexing of the global variable vector


Used by


Interfaces

interface

  • private pure module function getProcDoF(this) result(procDoF)

    Getter for procDoFs

    Arguments

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

    Return Value integer(kind=ik), allocatable, dimension(:)

interface

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

    Getter for numH

    Arguments

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

    Return Value integer(kind=ik)

interface

  • private pure module function getNumX(this) result(numX)

    Getter for numX

    Arguments

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

    Return Value integer(kind=ik)

interface

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

    Getter for numV

    Arguments

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

    Return Value integer(kind=ik)

interface

  • private pure module function findIndex(this, name, xInd, hInd, vInd, local) result(ind)

    Return index of degree of freedom associated with variable with given name and with coordinates given by xInd,hInd,vInd If local is true return index in the local implicit vector

    Arguments

    Type IntentOptional Attributes Name
    class(Indexing), intent(in) :: this
    character(len=*), intent(in) :: name
    integer(kind=ik), intent(in) :: xInd
    integer(kind=ik), intent(in), optional :: hInd
    integer(kind=ik), intent(in), optional :: vInd
    logical, intent(in), optional :: local

    Return Value integer(kind=ik)

interface

  • private pure module function findDistIndex(this, xInd, hInd, vInd, allH, locXInd) result(ind)

    Return linear index of distribution corresponding to xInd,hInd,vInd - if allH is true return indexing assuming all harmonics are indexed locally. If present locXInd is used to identify the processor

    Arguments

    Type IntentOptional Attributes Name
    class(Indexing), intent(in) :: this
    integer(kind=ik), intent(in) :: xInd
    integer(kind=ik), intent(in) :: hInd
    integer(kind=ik), intent(in) :: vInd
    logical, intent(in) :: allH
    integer(kind=ik), intent(in), optional :: locXInd

    Return Value integer(kind=ik)

interface

  • private pure module function findLocalXIndex(this, xInd, locXInd) result(ind)

    Return local non-distribution variable index corresponding to xInd,if present, locXInd is used to identify the processor

    Arguments

    Type IntentOptional Attributes Name
    class(Indexing), intent(in) :: this
    integer(kind=ik), intent(in) :: xInd
    integer(kind=ik), intent(in), optional :: locXInd

    Return Value integer(kind=ik)

interface

  • private pure module function mapToGlobalIndices(this, name, inputIndices) result(ind)

    Returns list of global indices associated with all possible combinations of inputIndices (IntArray of size 1 or 3) and given variable name

    Arguments

    Type IntentOptional Attributes Name
    class(Indexing), intent(in) :: this
    character(len=*), intent(in) :: name
    type(IntArray), intent(in), dimension(:) :: inputIndices

    Return Value integer(kind=ik), allocatable, dimension(:)

interface

  • private pure module function getAllIndicesOfVar(this, varInd, procRank) result(ind)

    Returns all local indices corresponding to variable with a given index on given processor

    Arguments

    Type IntentOptional Attributes Name
    class(Indexing), intent(in) :: this
    integer(kind=ik), intent(in) :: varInd
    integer(kind=ik), intent(in) :: procRank

    Return Value integer(kind=ik), allocatable, dimension(:)

interface

  • private pure module subroutine initIndexing(this, part, gridData, varList, xHaloWidth)

    Indexing object initialization routine

    Arguments

    Type IntentOptional Attributes Name
    class(Indexing), intent(inout) :: this
    type(Partition), intent(in) :: part

    Partition component of initialized Indexing object

    type(Grid), intent(in) :: gridData

    Grid object used to initialize Indexing

    type(VariableList), intent(in) :: varList

    Implicit variable list

    integer(kind=ik), intent(in), optional :: xHaloWidth

    Width of halo in x-direction - if passed will assume the x-grid is periodic


Derived Types

type, public, extends(Object) ::  Indexing

Indexing object containing local and global indexing rules

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

Number of degrees of freedom for each processor

integer(kind=ik), private, allocatable, dimension(:,:) :: varOffset

For indices (i,k) gives offset of variable k in local spatial chunk of processor i

integer(kind=ik), private, allocatable, dimension(:) :: xDoFs

Degrees of freedom in the x-direction for each processor

integer(kind=ik), private :: numV

Number of velocity cells in grid

integer(kind=ik), private :: numX

Total number of spatial cells in grid

integer(kind=ik), private :: numH

Total numbe of harmonics in grid

type(Partition), private :: part

Associated partition object

type(VariableList), private :: varList

Associated implicit variable list

integer(kind=ik), private :: xHaloWidth

Halo width in x-direction - only used for periodic indexing

logical, private :: periodicIndexing

Used to make sure that local indexing is correct in periodic case

Type-Bound Procedures

procedure, public :: isDefined => isDefinedObject
procedure, public :: makeDefined => makeDefinedObject
procedure, public :: makeUndefined => makeUndefinedObject
procedure, public :: getProcDoF
procedure, public :: findIndex
procedure, public :: getNumX
procedure, public :: getNumV
procedure, public :: getNumH
procedure, public :: getAllIndicesOfVar
procedure, public :: findDistIndex
procedure, public :: findLocalXIndex
procedure, public :: mapToGlobalIndices
procedure, public :: init => initIndexing