MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
petscmatrixmodule::petscmatrixtype Type Referenceabstract
Inheritance diagram for petscmatrixmodule::petscmatrixtype:
Inheritance graph
Collaboration diagram for petscmatrixmodule::petscmatrixtype:
Collaboration graph

Public Member Functions

procedure init (this, sparse, mem_path)
procedure destroy (this)
procedure create_vec_mm (this, n, name, mem_path)
procedure create_vec (this, n)
procedure get_value_pos (this, ipos)
procedure get_diag_value (this, irow)
procedure set_diag_value (this, irow, diag_value)
procedure set_value_pos (this, ipos, value)
procedure add_value_pos (this, ipos, value)
procedure add_diag_value (this, irow, value)
procedure zero_entries (this)
 Set all entries in the matrix to zero.
procedure zero_row_offdiag (this, irow)
 Set all off-diagonal entries in the matrix to zero.
procedure get_first_col_pos (this, irow)
procedure get_last_col_pos (this, irow)
procedure get_column (this, ipos)
procedure get_position (this, irow, icol)
 Return position index for (irow,icol) element in the matrix. This index can be used in other routines for direct access.
procedure get_position_diag (this, irow)
procedure get_aij (this, ia, ja, amat)
procedure get_row_offset (this)
procedure multiply (this, vec_x, vec_y)
 Calculates global matrix vector product: y = A * x.
procedure update (this)
 Copies the values from the CSR array into.
procedure get_aij_local (this, ia, ja, amat)
 Get the ia/ja and amat values for the local diagonal block of this matrix. It is a copy.
procedure(init_if), deferred init (this, sparse, mem_path)
procedure(destroy_if), deferred destroy (this)
procedure(create_vec_mm_if), deferred create_vec_mm (this, n, name, mem_path)
procedure(create_vec_if), deferred create_vec (this, n)
procedure(get_value_pos_if), deferred get_value_pos (this, ipos)
procedure(get_diag_value_if), deferred get_diag_value (this, irow)
procedure(set_diag_value_if), deferred set_diag_value (this, irow, diag_value)
procedure(set_value_pos_if), deferred set_value_pos (this, ipos, value)
procedure(add_value_pos_if), deferred add_value_pos (this, ipos, value)
procedure(add_diag_value_if), deferred add_diag_value (this, irow, value)
procedure(zero_entries_if), deferred zero_entries (this)
procedure(zero_row_offdiag_if), deferred zero_row_offdiag (this, irow)
procedure(get_first_col_pos_if), deferred get_first_col_pos (this, irow)
procedure(get_last_col_pos_if), deferred get_last_col_pos (this, irow)
procedure(get_column_if), deferred get_column (this, ipos)
procedure(get_position_if), deferred get_position (this, irow, icol)
procedure(get_position_diag_if), deferred get_position_diag (this, irow)
procedure(get_aij_if), deferred get_aij (this, ia, ja, amat)
procedure(get_row_offset_if), deferred get_row_offset (this)
procedure(multiply_if), deferred multiply (this, vec_x, vec_y)

Public Attributes

type(tmat) mat
 the PETSc matrix object, NOTE: update() should be called before using this, in case the matrix CSR array has changed!!!
integer(i4b) nrow
 number of rows in this portion of the global matrix
integer(i4b) ncol
 number of columns in the matrix
integer(i4b) nnz
 number of nonzeros in the matrix
integer(i4b) nnz_local
 number of nonzeros in the local matrix (the diagonal block tied to this process)
integer(i4b) offset
 global offset for the first row in the matrix
integer(i4b), dimension(:), pointer, contiguous ia_petsc
 IA(CSR) for petsc, contains 0-based index values.
integer(i4b), dimension(:), pointer, contiguous ja_petsc
 JA(CSR) for petsc, contains 0-based index values.
real(dp), dimension(:), pointer, contiguous amat_petsc
 A(CSR) for petsc.
logical(lgp) is_parallel
character(len=lenmempath) memory_path

Private Member Functions

procedure, private pm_get_position (this, irow, icol)
 Return position index for (irow,icol) element in the matrix. This index can be used in other routines for direct access.

Private Attributes

integer(i4b), dimension(:), pointer, private, contiguous ia_local
 IA(CSR) for local block, contains 1-based index values.
integer(i4b), dimension(:), pointer, private, contiguous ja_local
 JA(CSR) for local block, contains 1-based index values.
real(dp), dimension(:), pointer, private, contiguous amat_local
 A(CSR) for local block.

Detailed Description

Definition at line 14 of file PetscMatrix.F90.

Member Function/Subroutine Documentation

◆ add_diag_value() [1/2]

procedure(add_diag_value_if), deferred matrixbasemodule::matrixbasetype::add_diag_value ( class(matrixbasetype) this,
integer(i4b) irow,
real(dp) value )
pure virtualinherited

Definition at line 23 of file MatrixBase.f90.

◆ add_diag_value() [2/2]

procedure petscmatrixmodule::petscmatrixtype::add_diag_value ( class(petscmatrixtype) this,
integer(i4b) irow,
real(dp) value )

Definition at line 40 of file PetscMatrix.F90.

◆ add_value_pos() [1/2]

procedure(add_value_pos_if), deferred matrixbasemodule::matrixbasetype::add_value_pos ( class(matrixbasetype) this,
integer(i4b) ipos,
real(dp) value )
pure virtualinherited

Definition at line 22 of file MatrixBase.f90.

◆ add_value_pos() [2/2]

procedure petscmatrixmodule::petscmatrixtype::add_value_pos ( class(petscmatrixtype) this,
integer(i4b) ipos,
real(dp) value )

Definition at line 39 of file PetscMatrix.F90.

◆ create_vec() [1/2]

procedure(create_vec_if), deferred matrixbasemodule::matrixbasetype::create_vec ( class(matrixbasetype) this,
integer(i4b) n )
pure virtualinherited

Definition at line 15 of file MatrixBase.f90.

◆ create_vec() [2/2]

procedure petscmatrixmodule::petscmatrixtype::create_vec ( class(petscmatrixtype) this,
integer(i4b) n )
Parameters
nthe nr. of elements in the vector
Returns
the vector object to return

Definition at line 34 of file PetscMatrix.F90.

◆ create_vec_mm() [1/2]

procedure(create_vec_mm_if), deferred matrixbasemodule::matrixbasetype::create_vec_mm ( class(matrixbasetype) this,
integer(i4b) n,
character(len=*) name,
character(len=*) mem_path )
pure virtualinherited

Definition at line 14 of file MatrixBase.f90.

◆ create_vec_mm() [2/2]

procedure petscmatrixmodule::petscmatrixtype::create_vec_mm ( class(petscmatrixtype) this,
integer(i4b) n,
character(len=*) name,
character(len=*) mem_path )
Parameters
nthe nr. of elements in the vector
namethe variable name (for access through memory manager)
mem_pathmemory path for storing the underlying memory items
Returns
the vector object to return

Definition at line 33 of file PetscMatrix.F90.

◆ destroy() [1/2]

procedure(destroy_if), deferred matrixbasemodule::matrixbasetype::destroy ( class(matrixbasetype) this)
pure virtualinherited

Definition at line 13 of file MatrixBase.f90.

◆ destroy() [2/2]

procedure petscmatrixmodule::petscmatrixtype::destroy ( class(petscmatrixtype) this)

Definition at line 32 of file PetscMatrix.F90.

◆ get_aij() [1/2]

procedure(get_aij_if), deferred matrixbasemodule::matrixbasetype::get_aij ( class(matrixbasetype) this,
integer(i4b), dimension(:), pointer, contiguous ia,
integer(i4b), dimension(:), pointer, contiguous ja,
real(dp), dimension(:), pointer, contiguous amat )
pure virtualinherited

Definition at line 33 of file MatrixBase.f90.

◆ get_aij() [2/2]

procedure petscmatrixmodule::petscmatrixtype::get_aij ( class(petscmatrixtype) this,
integer(i4b), dimension(:), pointer, contiguous ia,
integer(i4b), dimension(:), pointer, contiguous ja,
real(dp), dimension(:), pointer, contiguous amat )

Definition at line 48 of file PetscMatrix.F90.

◆ get_aij_local()

procedure petscmatrixmodule::petscmatrixtype::get_aij_local ( class(petscmatrixtype) this,
integer(i4b), dimension(:), pointer, contiguous ia,
integer(i4b), dimension(:), pointer, contiguous ja,
real(dp), dimension(:), pointer, contiguous amat )

Definition at line 55 of file PetscMatrix.F90.

◆ get_column() [1/2]

procedure(get_column_if), deferred matrixbasemodule::matrixbasetype::get_column ( class(matrixbasetype) this,
integer(i4b) ipos )
pure virtualinherited

Definition at line 29 of file MatrixBase.f90.

◆ get_column() [2/2]

procedure petscmatrixmodule::petscmatrixtype::get_column ( class(petscmatrixtype) this,
integer(i4b) ipos )

Definition at line 45 of file PetscMatrix.F90.

◆ get_diag_value() [1/2]

procedure(get_diag_value_if), deferred matrixbasemodule::matrixbasetype::get_diag_value ( class(matrixbasetype) this,
integer(i4b) irow )
pure virtualinherited

Definition at line 18 of file MatrixBase.f90.

◆ get_diag_value() [2/2]

procedure petscmatrixmodule::petscmatrixtype::get_diag_value ( class(petscmatrixtype) this,
integer(i4b) irow )

Definition at line 36 of file PetscMatrix.F90.

◆ get_first_col_pos() [1/2]

procedure(get_first_col_pos_if), deferred matrixbasemodule::matrixbasetype::get_first_col_pos ( class(matrixbasetype) this,
integer(i4b) irow )
pure virtualinherited

Definition at line 27 of file MatrixBase.f90.

◆ get_first_col_pos() [2/2]

procedure petscmatrixmodule::petscmatrixtype::get_first_col_pos ( class(petscmatrixtype) this,
integer(i4b) irow )

Definition at line 43 of file PetscMatrix.F90.

◆ get_last_col_pos() [1/2]

procedure(get_last_col_pos_if), deferred matrixbasemodule::matrixbasetype::get_last_col_pos ( class(matrixbasetype) this,
integer(i4b) irow )
pure virtualinherited

Definition at line 28 of file MatrixBase.f90.

◆ get_last_col_pos() [2/2]

procedure petscmatrixmodule::petscmatrixtype::get_last_col_pos ( class(petscmatrixtype) this,
integer(i4b) irow )

Definition at line 44 of file PetscMatrix.F90.

◆ get_position() [1/2]

procedure(get_position_if), deferred matrixbasemodule::matrixbasetype::get_position ( class(matrixbasetype) this,
integer(i4b) irow,
integer(i4b) icol )
pure virtualinherited

Definition at line 30 of file MatrixBase.f90.

◆ get_position() [2/2]

procedure petscmatrixmodule::petscmatrixtype::get_position ( class(petscmatrixtype) this,
integer(i4b) irow,
integer(i4b) icol )

Definition at line 46 of file PetscMatrix.F90.

◆ get_position_diag() [1/2]

procedure(get_position_diag_if), deferred matrixbasemodule::matrixbasetype::get_position_diag ( class(matrixbasetype) this,
integer(i4b) irow )
pure virtualinherited

Definition at line 31 of file MatrixBase.f90.

◆ get_position_diag() [2/2]

procedure petscmatrixmodule::petscmatrixtype::get_position_diag ( class(petscmatrixtype) this,
integer(i4b) irow )

Definition at line 47 of file PetscMatrix.F90.

◆ get_row_offset() [1/2]

procedure(get_row_offset_if), deferred matrixbasemodule::matrixbasetype::get_row_offset ( class(matrixbasetype) this)
pure virtualinherited

Definition at line 34 of file MatrixBase.f90.

◆ get_row_offset() [2/2]

procedure petscmatrixmodule::petscmatrixtype::get_row_offset ( class(petscmatrixtype) this)

Definition at line 49 of file PetscMatrix.F90.

◆ get_value_pos() [1/2]

procedure(get_value_pos_if), deferred matrixbasemodule::matrixbasetype::get_value_pos ( class(matrixbasetype) this,
integer(i4b) ipos )
pure virtualinherited

Definition at line 17 of file MatrixBase.f90.

◆ get_value_pos() [2/2]

procedure petscmatrixmodule::petscmatrixtype::get_value_pos ( class(petscmatrixtype) this,
integer(i4b) ipos )

Definition at line 35 of file PetscMatrix.F90.

◆ init() [1/2]

procedure(init_if), deferred matrixbasemodule::matrixbasetype::init ( class(matrixbasetype) this,
type(sparsematrix) sparse,
character(len=*) mem_path )
pure virtualinherited

Definition at line 12 of file MatrixBase.f90.

◆ init() [2/2]

procedure petscmatrixmodule::petscmatrixtype::init ( class(petscmatrixtype) this,
type(sparsematrix) sparse,
character(len=*) mem_path )

Definition at line 31 of file PetscMatrix.F90.

◆ multiply() [1/2]

procedure(multiply_if), deferred matrixbasemodule::matrixbasetype::multiply ( class(matrixbasetype) this,
class(vectorbasetype), pointer vec_x,
class(vectorbasetype), pointer vec_y )
pure virtualinherited

Definition at line 36 of file MatrixBase.f90.

◆ multiply() [2/2]

procedure petscmatrixmodule::petscmatrixtype::multiply ( class(petscmatrixtype) this,
class(vectorbasetype), pointer vec_x,
class(vectorbasetype), pointer vec_y )

Definition at line 51 of file PetscMatrix.F90.

◆ pm_get_position()

procedure, private petscmatrixmodule::petscmatrixtype::pm_get_position ( class(petscmatrixtype) this,
integer(i4b) irow,
integer(i4b) icol )
private

Definition at line 58 of file PetscMatrix.F90.

◆ set_diag_value() [1/2]

procedure(set_diag_value_if), deferred matrixbasemodule::matrixbasetype::set_diag_value ( class(matrixbasetype) this,
integer(i4b) irow,
real(dp) diag_value )
pure virtualinherited

Definition at line 20 of file MatrixBase.f90.

◆ set_diag_value() [2/2]

procedure petscmatrixmodule::petscmatrixtype::set_diag_value ( class(petscmatrixtype) this,
integer(i4b) irow,
real(dp) diag_value )

Definition at line 37 of file PetscMatrix.F90.

◆ set_value_pos() [1/2]

procedure(set_value_pos_if), deferred matrixbasemodule::matrixbasetype::set_value_pos ( class(matrixbasetype) this,
integer(i4b) ipos,
real(dp) value )
pure virtualinherited

Definition at line 21 of file MatrixBase.f90.

◆ set_value_pos() [2/2]

procedure petscmatrixmodule::petscmatrixtype::set_value_pos ( class(petscmatrixtype) this,
integer(i4b) ipos,
real(dp) value )

Definition at line 38 of file PetscMatrix.F90.

◆ update()

procedure petscmatrixmodule::petscmatrixtype::update ( class(petscmatrixtype) this)

Definition at line 54 of file PetscMatrix.F90.

◆ zero_entries() [1/2]

procedure(zero_entries_if), deferred matrixbasemodule::matrixbasetype::zero_entries ( class(matrixbasetype) this)
pure virtualinherited

Definition at line 24 of file MatrixBase.f90.

◆ zero_entries() [2/2]

procedure petscmatrixmodule::petscmatrixtype::zero_entries ( class(petscmatrixtype) this)

Definition at line 41 of file PetscMatrix.F90.

◆ zero_row_offdiag() [1/2]

procedure(zero_row_offdiag_if), deferred matrixbasemodule::matrixbasetype::zero_row_offdiag ( class(matrixbasetype) this,
integer(i4b) irow )
pure virtualinherited

Definition at line 25 of file MatrixBase.f90.

◆ zero_row_offdiag() [2/2]

procedure petscmatrixmodule::petscmatrixtype::zero_row_offdiag ( class(petscmatrixtype) this,
integer(i4b) irow )

Definition at line 42 of file PetscMatrix.F90.

Member Data Documentation

◆ amat_local

real(dp), dimension(:), pointer, private, contiguous petscmatrixmodule::petscmatrixtype::amat_local
private

Definition at line 24 of file PetscMatrix.F90.

24 real(DP), dimension(:), pointer, contiguous, private :: amat_local !< A(CSR) for local block

◆ amat_petsc

real(dp), dimension(:), pointer, contiguous petscmatrixmodule::petscmatrixtype::amat_petsc

Definition at line 27 of file PetscMatrix.F90.

27 real(DP), dimension(:), pointer, contiguous :: amat_petsc !< A(CSR) for petsc

◆ ia_local

integer(i4b), dimension(:), pointer, private, contiguous petscmatrixmodule::petscmatrixtype::ia_local
private

Definition at line 22 of file PetscMatrix.F90.

22 integer(I4B), dimension(:), pointer, contiguous, private :: ia_local !< IA(CSR) for local block, contains 1-based index values

◆ ia_petsc

integer(i4b), dimension(:), pointer, contiguous petscmatrixmodule::petscmatrixtype::ia_petsc

Definition at line 25 of file PetscMatrix.F90.

25 integer(I4B), dimension(:), pointer, contiguous :: ia_petsc !< IA(CSR) for petsc, contains 0-based index values

◆ is_parallel

logical(lgp) petscmatrixmodule::petscmatrixtype::is_parallel

Definition at line 28 of file PetscMatrix.F90.

28 logical(LGP) :: is_parallel

◆ ja_local

integer(i4b), dimension(:), pointer, private, contiguous petscmatrixmodule::petscmatrixtype::ja_local
private

Definition at line 23 of file PetscMatrix.F90.

23 integer(I4B), dimension(:), pointer, contiguous, private :: ja_local !< JA(CSR) for local block, contains 1-based index values

◆ ja_petsc

integer(i4b), dimension(:), pointer, contiguous petscmatrixmodule::petscmatrixtype::ja_petsc

Definition at line 26 of file PetscMatrix.F90.

26 integer(I4B), dimension(:), pointer, contiguous :: ja_petsc !< JA(CSR) for petsc, contains 0-based index values

◆ mat

type(tmat) petscmatrixmodule::petscmatrixtype::mat

Definition at line 15 of file PetscMatrix.F90.

15 mat :: mat !< the PETSc matrix object, NOTE: update() should be called before using this,

◆ memory_path

character(len=lenmempath) matrixbasemodule::matrixbasetype::memory_path
inherited

Definition at line 10 of file MatrixBase.f90.

10 character(len=LENMEMPATH) :: memory_path

◆ ncol

integer(i4b) petscmatrixmodule::petscmatrixtype::ncol

Definition at line 18 of file PetscMatrix.F90.

18 integer(I4B) :: ncol !< number of columns in the matrix

◆ nnz

integer(i4b) petscmatrixmodule::petscmatrixtype::nnz

Definition at line 19 of file PetscMatrix.F90.

19 integer(I4B) :: nnz !< number of nonzeros in the matrix

◆ nnz_local

integer(i4b) petscmatrixmodule::petscmatrixtype::nnz_local

Definition at line 20 of file PetscMatrix.F90.

20 integer(I4B) :: nnz_local !< number of nonzeros in the local matrix (the diagonal block tied to this process)

◆ nrow

integer(i4b) petscmatrixmodule::petscmatrixtype::nrow

Definition at line 17 of file PetscMatrix.F90.

17 integer(I4B) :: nrow !< number of rows in this portion of the global matrix

◆ offset

integer(i4b) petscmatrixmodule::petscmatrixtype::offset

Definition at line 21 of file PetscMatrix.F90.

21 integer(I4B) :: offset !< global offset for the first row in the matrix

The documentation for this type was generated from the following file: