Choral
Data Types | Functions/Subroutines | Variables
krylov_mod Module Reference

DERIVED TYPE krylov: for the resolution of linear systems More...

Data Types

interface  clear
 destructor More...
 
interface  krylov
 The type krylov defines the settings of a linear solver. More...
 
interface  print
 print a short description More...
 
interface  solve
 solve More...
 

Functions/Subroutines

subroutine krylov_clear (k)
 Destructor. More...
 
type(krylov) function krylov_create (type, tol, itMax, restart, verb)
  Constructor for the type krylov More...
 
subroutine krylov_print (k)
 Print a short description. More...
 
subroutine solve_start (k)
 Reset krylov parameters before solving. More...
 
subroutine solve_end (k)
 ends up solving More...
 
subroutine krylov_solve_raw (x, k, b, A)
 SOLVE : KRYLOV no preconditioning. More...
 
subroutine krylov_solve_csr (x, k, b, mat)
 SOLVE : KRYLOV no preconditioning. More...
 
subroutine krylov_solve_pc (x, k, b, A, pc)
 SOLVE : KRYLOV with preconditioning. More...
 
subroutine krylov_solve_prec (x, k, b, mat, pc)
 KRYLOV with preconditioning defined with a prec type. More...
 

Variables

real(dp) time_start
 
real(dp) time_end
 

Detailed Description

DERIVED TYPE krylov: for the resolution of linear systems

Choral constants for linear solvers have the form KRY_xxx.

A variable 'kry' with type krylov gathers the settings for a linear solver.
It is constructed e.g. with

kry = krylov(type=kry_cg, tol=1e5-_rp, ...)

A linear problem \( Ax = b \) is solved with

call solve(x, kry, b, ...)

Various calling sequence are available;

see the solve documentation below.

Author
Charles Pierre

Function/Subroutine Documentation

◆ krylov_clear()

subroutine krylov_mod::krylov_clear ( type(krylov), intent(inout)  k)
private

Destructor.

Definition at line 155 of file krylov_mod.f90.

Here is the call graph for this function:

◆ krylov_create()

type(krylov) function krylov_mod::krylov_create ( integer, intent(in), optional  type,
real(rp), intent(in), optional  tol,
integer, intent(in), optional  itMax,
integer, intent(in), optional  restart,
integer, intent(in), optional  verb 
)
private

Constructor for the type krylov

  • OUTPUT:
    • k = krylov
  • INPUT:
  • type = Krylov solver type
  • tol = Tolerance
  • itMax = Max iteration number
  • restart= Restart number (GmRes)
  • verb = Verbosity

These are optional arguments: default values are set in the type krylov definition.

Definition at line 183 of file krylov_mod.f90.

Here is the call graph for this function:

◆ krylov_print()

subroutine krylov_mod::krylov_print ( type(krylov), intent(in)  k)
private

Print a short description.

Definition at line 209 of file krylov_mod.f90.

◆ krylov_solve_csr()

subroutine krylov_mod::krylov_solve_csr ( real(rp), dimension(:), intent(inout)  x,
type(krylov), intent(inout)  k,
real(rp), dimension(:), intent(in)  b,
type(csr), intent(in)  mat 
)
private

SOLVE : KRYLOV no preconditioning.

csr mat format

Definition at line 298 of file krylov_mod.f90.

Here is the call graph for this function:

◆ krylov_solve_pc()

subroutine krylov_mod::krylov_solve_pc ( real(rp), dimension(:), intent(inout)  x,
type(krylov), intent(inout)  k,
real(rp), dimension(:), intent(in)  b,
procedure(rntorn)  A,
procedure(rntorn)  pc 
)
private

SOLVE : KRYLOV with preconditioning.

Definition at line 322 of file krylov_mod.f90.

Here is the call graph for this function:

◆ krylov_solve_prec()

subroutine krylov_mod::krylov_solve_prec ( real(rp), dimension(:), intent(inout)  x,
type(krylov), intent(inout)  k,
real(rp), dimension(:), intent(in)  b,
type(csr), intent(in)  mat,
type(precond), intent(inout)  pc 
)
private

KRYLOV with preconditioning defined with a prec type.

Definition at line 351 of file krylov_mod.f90.

Here is the call graph for this function:

◆ krylov_solve_raw()

subroutine krylov_mod::krylov_solve_raw ( real(rp), dimension(:), intent(inout)  x,
type(krylov), intent(inout)  k,
real(rp), dimension(:), intent(in)  b,
procedure(rntorn)  A 
)
private

SOLVE : KRYLOV no preconditioning.

Definition at line 260 of file krylov_mod.f90.

Here is the call graph for this function:

◆ solve_end()

subroutine krylov_mod::solve_end ( type(krylov), intent(inout)  k)
private

ends up solving

Definition at line 241 of file krylov_mod.f90.

Here is the call graph for this function:

◆ solve_start()

subroutine krylov_mod::solve_start ( type(krylov), intent(inout)  k)
private

Reset krylov parameters before solving.

Definition at line 225 of file krylov_mod.f90.

Here is the call graph for this function:

Variable Documentation

◆ time_end

real(dp) krylov_mod::time_end
private

Definition at line 146 of file krylov_mod.f90.

◆ time_start

real(dp) krylov_mod::time_start
private

Definition at line 146 of file krylov_mod.f90.