Stencil Derived Type

type, public, extends(Object) :: Stencil

Stencil object for construction of matrix patterns by mapping row coordinates to sets of column coordinates


Components

Type Visibility Attributes Name Initial
logical, public :: userDefined = .false.

True only if user explicitly sets it to true

type(Stencil1D), private :: xStencil

Stencil in x-direction

type(Stencil1D), private, allocatable :: vStencil

Stencil in v-direction (used as absolute coordinates if mapping from just x-coordinate)

type(Stencil1D), private, allocatable :: hStencil

Stencil in total harmonics (used as absolute coordinates if mapping from just x-coordinate)

logical, private :: xPeriodic

True if the x grid is periodic


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

  • interface

    private pure module function mapCoords(this, gridObj, inputArray) result(output)

    Stencil coordinate mapping routine

    Arguments

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

    Grid used to construct the mapping

    integer(kind=ik), intent(in), dimension(:) :: inputArray

    Input array of coordinates (size 1 - [x], or size 3 [x,h,v])

    Return Value type(IntArray), allocatable, dimension(:)

procedure, public :: init => initStencil

  • interface

    private pure module subroutine initStencil(this, xStencil, vStencil, hStencil, mapToDist, xPeriodic, vStencilFixed)

    Stencil object initialization routine

    Arguments

    Type IntentOptional Attributes Name
    class(Stencil), intent(inout) :: this
    integer(kind=ik), intent(in), optional, dimension(:) :: xStencil

    Stencil in x-direction

    integer(kind=ik), intent(in), optional, dimension(:) :: vStencil

    Stencil in v-direction

    integer(kind=ik), intent(in), optional, dimension(:) :: hStencil

    l harmonic stencil

    logical, intent(in), optional :: mapToDist

    Set to true if stencil maps to harmonic/velocity space

    logical, intent(in), optional :: xPeriodic

    Set to true if x-grid is periodic

    type(IntArray), intent(in), optional, dimension(:) :: vStencilFixed

    Optional fixed vStencil