PETScPreallocationData Derived Type

type, public, extends(Object) :: PETScPreallocationData

Object used to properly preallocate PETSc matrices


Components

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

True only if user explicitly sets it to true

type(COOSparsityPattern), private, allocatable :: totalCOOPattern

Total (across matrix terms) sparsity pattern

integer(kind=ik), private :: localDoFOffset

Local process offset of degrees of freedom

integer(kind=ik), private :: localNumDoFs

Local number of degrees of freedom

integer(kind=ik), private :: totalNumDoFs

Total number of degrees of freedom

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

Number of nonzeros in each matrix row

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

Number of nonzeros in each row belonging to the local diagonal block

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

Number of nonzeros in each row not in the local diagonal block

logical, private :: assembled

True if preallocation data is assembled and ready for processing by PETScController routines


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

  • interface

    private pure module subroutine addRowDataToPattern(this, rowData)

    Add sparse row data structure to total sparsity pattern

    Arguments

    Type IntentOptional Attributes Name
    class(PETScPreallocationData), intent(inout) :: this
    type(SparseRowData), intent(in) :: rowData

procedure, public :: assembleData

  • interface

    private pure module subroutine assembleData(this)

    Assemble preallocation data

    Arguments

    Type IntentOptional Attributes Name
    class(PETScPreallocationData), intent(inout) :: this

procedure, public :: isAssembled

  • interface

    private pure module function isAssembled(this) result(assembled)

    Return assembly status of preallocation data

    Arguments

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

    Return Value logical

procedure, public :: getNumNonzerosDiag

  • interface

    private pure module function getNumNonzerosDiag(this) result(numNZDiag)

    Return number of nonzeros in the diagonal part of each row

    Arguments

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

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

procedure, public :: getNumNonzerosOffDiag

  • interface

    private pure module function getNumNonzerosOffDiag(this) result(numNZODiag)

    Return number of nonzeros in the off-diagonal part of each row

    Arguments

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

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

procedure, public :: getLocalNumDoFs

  • interface

    private pure module function getLocalNumDoFs(this) result(locNumDoFs)

    Return local number of DoFs in unknown vector

    Arguments

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

    Return Value integer(kind=ik)

procedure, public :: getTotalNumDoFs

  • interface

    private pure module function getTotalNumDoFs(this) result(totalNumDoFs)

    Return total number of DoFs in unknown vector

    Arguments

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

    Return Value integer(kind=ik)

procedure, public :: getLocalDoFOffset

  • interface

    private pure module function getLocalDoFOffset(this) result(offset)

    Return offset of the start of this processors local vector in the global vector

    Arguments

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

    Return Value integer(kind=ik)

procedure, public :: deallocatePattern

  • interface

    private module subroutine deallocatePattern(this)

    Deallocates the COO matrix pattern

    Arguments

    Type IntentOptional Attributes Name
    class(PETScPreallocationData), intent(inout) :: this

procedure, public :: init => initPetscPreallocationData

  • interface

    private pure module subroutine initPetscPreallocationData(this, indexingObj, procRank)

    Petsc preallocation data object initialization routine

    Arguments

    Type IntentOptional Attributes Name
    class(PETScPreallocationData), intent(inout) :: this
    type(Indexing), intent(in) :: indexingObj

    Indexing object to retrieve DoF data from

    integer(kind=ik), intent(in) :: procRank

    Current process rank