pcg_mod Module


Uses

  • module~~pcg_mod~~UsesGraph module~pcg_mod pcg_mod iso_c_binding iso_c_binding module~pcg_mod->iso_c_binding module~precision precision module~pcg_mod->module~precision iso_fortran_env iso_fortran_env module~precision->iso_fortran_env

Used by

  • module~~pcg_mod~~UsedByGraph module~pcg_mod pcg_mod proc~oqp_tdhf_z_vector oqp_tdhf_z_vector proc~oqp_tdhf_z_vector->module~pcg_mod

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: PCG_CONVERGED = -1
integer, public, parameter :: PCG_OK = 0
integer, public, parameter :: PCG_NOT_INITIALIZED = 1
integer, public, parameter :: PCG_BAD_ARGUMENT = 2

Interfaces

interface

  • public subroutine pcg_matvec(y, x, dat)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp) :: y(:)
    real(kind=dp) :: x(:)
    type(c_ptr) :: dat

Derived Types

type, public ::  pcg_t

@brief PCG solver for equation Ax=b

Components

Type Visibility Attributes Name Initial
logical, public :: initialized = .false.
integer(kind=8), public :: errcode = 0
real(kind=dp), public, allocatable :: b(:)
real(kind=dp), public, allocatable :: x(:)
real(kind=dp), public, allocatable :: Ap(:)
real(kind=dp), public, allocatable :: p(:)
real(kind=dp), public, allocatable :: r(:)
real(kind=dp), public, allocatable :: y(:)
real(kind=dp), public :: error = huge(1.0_dp)
real(kind=dp), public :: tol = 0.0_dp
procedure(pcg_matvec), public, nopass, pointer :: precond => null()
procedure(pcg_matvec), public, nopass, pointer :: update => null()
type(c_ptr), public :: dat = c_null_ptr

Type-Bound Procedures

procedure, public :: init => pcg_init
procedure, public :: clean => pcg_clean
procedure, public :: step => pcg_step

Subroutines

public subroutine pcg_optimize(b, update, precond, dat, mxit, x0, tol, err, cgiters)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout) :: b(:)
procedure(pcg_matvec) :: update
procedure(pcg_matvec) :: precond
type(*), intent(in) :: dat
integer, intent(in) :: mxit
real(kind=dp), intent(in), optional :: x0(:)
real(kind=dp), intent(in) :: tol
real(kind=dp), intent(out), optional :: err
real(kind=dp), intent(out), optional :: cgiters