psfun_d_krylov Derived Type

type, public :: psfun_d_krylov


Inherits

type~~psfun_d_krylov~~InheritsGraph type~psfun_d_krylov psfun_d_krylov amg_dprec_type amg_dprec_type type~psfun_d_krylov->amg_dprec_type prec

Contents


Components

TypeVisibility AttributesNameInitial
integer(kind=psb_ipk_), public :: irst =10

Size for subspace restarting (inner method)

integer(kind=psb_ipk_), public :: istopc =1

Stopping criterion (inner method)

integer(kind=psb_ipk_), public :: itmax =200

Maximum number of iterations (inner method)

integer(kind=psb_ipk_), public :: itrace =0

Trace for the solution (inner method)

character(len=20), public :: kmethd ='CG'

Method for the solution of the linear system

character(len=20), public :: kname ='ARNOLDI'

Name of the Krylov method

type(amg_dprec_type), public :: prec

Preconditioner for the inner solution method

real(kind=psb_dpk_), public :: tau =dzero

Shift for shift-and-invert methods


Type-Bound Procedures

procedure, public, pass(meth) :: apply => psfun_d_parallel_apply

  • public subroutine psfun_d_parallel_apply(meth, fun, a, desc_a, y, x, eps, info, itmax, itrace, istop, iter, err, res)

    This is the generic function for applying every implemented Krylov method. The general iteration parameters (like the number of iteration, the stop criterion to be used, and the verbosity of the trace) can be passed directly to this routine. All the constitutive parameters of the actual method, and the information relative to the function are instead contained in the meth and fun objects. The Descriptor object `desc_a' contains the properties of the parallel environment.

    Arguments

    Type IntentOptional AttributesName
    class(psfun_d_krylov), intent(inout) :: meth

    Krylov method object

    type(psfun_d_serial), intent(inout) :: fun

    Function object

    type(psb_dspmat_type), intent(in) :: a

    Distribute sparse matrix

    type(psb_desc_type), intent(in) :: desc_a

    Descriptor for the sparse matrix

    type(psb_d_vect_type), intent(inout) :: y

    Output vector

    type(psb_d_vect_type), intent(inout) :: x

    Input vector

    real(kind=psb_dpk_), intent(in) :: eps

    Requested tolerance

    integer(kind=psb_ipk_), intent(out) :: info

    Output flag

    integer(kind=psb_ipk_), intent(in), optional :: itmax

    Maximum number of iteration

    integer(kind=psb_ipk_), intent(in), optional :: itrace

    Trace for logoutput

    integer(kind=psb_ipk_), intent(in), optional :: istop

    Stop criterion

    integer(kind=psb_ipk_), intent(out), optional :: iter

    Number of iteration

    real(kind=psb_dpk_), intent(out), optional :: err

    Last estimate error

    real(kind=psb_dpk_), intent(out), optional allocatable:: res(:)

    Vector of the residuals

procedure, public, pass(meth) :: plot => psfun_d_plot_info

  • public subroutine psfun_d_plot_info(meth, fun, iter, res, info)

    This function plots the convergence history of the Krylov method

    Arguments

    Type IntentOptional AttributesName
    class(psfun_d_krylov), intent(inout) :: meth

    Krylov method

    type(psfun_d_serial), intent(inout) :: fun

    Function object

    integer(kind=psb_ipk_), intent(in) :: iter

    Number of iteration

    real(kind=psb_dpk_), intent(in), dimension(:):: res

    Residual vector

    integer(kind=psb_ipk_), intent(out) :: info

    Result of the Gnuplot call

procedure, public, pass(meth) :: precbuild => psfun_d_prec_build

  • public subroutine psfun_d_prec_build(meth, a, desc_a, info)

    This function builds the AMG4PSBLAS preconditioner for the inner solve in a Rational Krylov method

    Arguments

    Type IntentOptional AttributesName
    class(psfun_d_krylov), intent(inout) :: meth

    Krylov method

    type(psb_dspmat_type), intent(inout) :: a

    Sparse matrix

    type(psb_desc_type), intent(inout) :: desc_a

    Descriptor for the sparse matrix

    integer(kind=psb_ipk_) :: info

    Result of the init call

procedure, public, pass(meth) :: precinit => psfun_d_prec_init

  • public subroutine psfun_d_prec_init(meth, ctxt, ptype, info)

    This function performs the init of the preconditioner for the inner solve in the rational Krylov method

    Arguments

    Type IntentOptional AttributesName
    class(psfun_d_krylov), intent(inout) :: meth

    Krylov method

    type(psb_ctxt_type), intent(in) :: ctxt

    Parallel context

    character(len=20), intent(in) :: ptype

    PSBLAS/AMG4PSBLAS preconditioner

    integer(kind=psb_ipk_) :: info

    Result of the init call

generic, public :: set => setstring, setinteger

  • private subroutine psfun_d_setstring(meth, what, val, info)

    Set function for setting options defined by a string

    Arguments

    Type IntentOptional AttributesName
    class(psfun_d_krylov), intent(inout) :: meth
    character(len=*), intent(in) :: what
    character(len=*), intent(in) :: val
    integer(kind=psb_ipk_), intent(out) :: info
  • private subroutine psfun_d_setinteger(meth, what, val, info)

    Set function for setting options defined by an integer

    Arguments

    Type IntentOptional AttributesName
    class(psfun_d_krylov), intent(inout) :: meth

    Krylov method object

    character(len=*), intent(in) :: what

    String of option to set

    integer(kind=psb_ipk_), intent(in) :: val

    Value of the integer

    integer(kind=psb_ipk_), intent(out) :: info

    Output flag

procedure, public, pass(meth) :: setinteger => psfun_d_setinteger

  • private subroutine psfun_d_setinteger(meth, what, val, info)

    Set function for setting options defined by an integer

    Arguments

    Type IntentOptional AttributesName
    class(psfun_d_krylov), intent(inout) :: meth

    Krylov method object

    character(len=*), intent(in) :: what

    String of option to set

    integer(kind=psb_ipk_), intent(in) :: val

    Value of the integer

    integer(kind=psb_ipk_), intent(out) :: info

    Output flag

procedure, public, pass(meth) :: setstring => psfun_d_setstring

  • private subroutine psfun_d_setstring(meth, what, val, info)

    Set function for setting options defined by a string

    Arguments

    Type IntentOptional AttributesName
    class(psfun_d_krylov), intent(inout) :: meth
    character(len=*), intent(in) :: what
    character(len=*), intent(in) :: val
    integer(kind=psb_ipk_), intent(out) :: info