Indexing Derived Type

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

  • 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 :: getProcDoF

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

procedure, public :: findIndex

  • 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)

procedure, public :: getNumX

  • 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)

procedure, public :: getNumV

  • 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)

procedure, public :: getNumH

  • 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)

procedure, public :: getAllIndicesOfVar

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

procedure, public :: findDistIndex

  • 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)

procedure, public :: findLocalXIndex

  • 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)

procedure, public :: mapToGlobalIndices

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

procedure, public :: init => initIndexing

  • 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