petsc_preallocation_data_class Module

Houses data container class used in PETSc matrix preallocation


Used by


Interfaces

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

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

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

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)

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)

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)

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

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

interface

interface

  • private module subroutine deallocatePattern(this)

    Deallocates the COO matrix pattern

    Arguments

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

Derived Types

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
procedure, public :: makeDefined => makeDefinedObject
procedure, public :: makeUndefined => makeUndefinedObject
procedure, public :: addRowDataToPattern
procedure, public :: assembleData
procedure, public :: isAssembled
procedure, public :: getNumNonzerosDiag
procedure, public :: getNumNonzerosOffDiag
procedure, public :: getLocalNumDoFs
procedure, public :: getTotalNumDoFs
procedure, public :: getLocalDoFOffset
procedure, public :: deallocatePattern
procedure, public :: init => initPetscPreallocationData