Neko  0.9.99
A portable framework for high-order spectral element flow simulations
krylov Module Reference

Implements the base abstract type for Krylov solvers plus helper types.

Data Types

type  ksp_monitor_t
 Type for storing initial and final residuals in a Krylov solver. More...
 
type  ksp_t
 Base abstract type for a canonical Krylov method, solving \( Ax = f \). More...
 
interface  ksp_method
 Abstract interface for a Krylov method's solve routine. More...
 
interface  ksp_method_coupled
 Abstract interface for a Krylov method's coupled solve routine. More...
 
interface  ksp_t_free
 Abstract interface for deallocating a Krylov method. More...
 

Functions/Subroutines

subroutine krylov_init (this, max_iter, rel_tol, abs_tol, M, monitor)
 Factory for Krylov solvers. Both creates and initializes the object. More...
 
subroutine krylov_free (this)
 Deallocate a Krylov solver. More...
 
subroutine krylov_set_pc (this, M)
 Setup a Krylov solver's preconditioner. More...
 
subroutine krylov_monitor_start (this, name)
 Monitor start. More...
 
subroutine krylov_monitor_stop (this)
 Monitor stop. More...
 
subroutine krylov_monitor_iter (this, iter, rnorm)
 Monitor iteration. More...
 

Variables

integer, parameter, public ksp_max_iter = 1e3
 Maximum number of iters. More...
 
real(kind=rp), parameter, public ksp_abs_tol = 1d-9
 Absolut tolerance. More...
 
real(kind=rp), parameter, public ksp_rel_tol = 1d-9
 Relative tolerance. More...
 

Function/Subroutine Documentation

◆ krylov_free()

subroutine krylov::krylov_free ( class(ksp_t), intent(inout)  this)
private
Todo:
add calls to destroy precon. if necessary

Definition at line 261 of file krylov.f90.

◆ krylov_init()

subroutine krylov::krylov_init ( class(ksp_t), intent(inout), target  this,
integer, intent(in)  max_iter,
real(kind=rp), intent(in), optional  rel_tol,
real(kind=rp), intent(in), optional  abs_tol,
class(pc_t), intent(in), optional, target  M,
logical, intent(in), optional  monitor 
)
private
Parameters
objectThe object to be allocated.
nSize of the vectors the solver operates on.
type_nameThe name of the solver type.
max_iterThe maximum number of iterations
abstolThe absolute tolerance, optional.
MThe preconditioner, optional.
monitorEnable/disable monitoring, optional. Destroy an iterative Krylov type_name Constructor for the base type.
max_iterMaximum number of iterations.
rel_tolRelative tolarance for converence.
rel_tolAbsolute tolarance for converence.
MThe preconditioner.

Definition at line 215 of file krylov.f90.

◆ krylov_monitor_iter()

subroutine krylov::krylov_monitor_iter ( class(ksp_t), intent(in)  this,
integer, intent(in)  iter,
real(kind=rp), intent(in)  rnorm 
)
private

Definition at line 318 of file krylov.f90.

◆ krylov_monitor_start()

subroutine krylov::krylov_monitor_start ( class(ksp_t), intent(in)  this,
character(len=*)  name 
)
private

Definition at line 288 of file krylov.f90.

◆ krylov_monitor_stop()

subroutine krylov::krylov_monitor_stop ( class(ksp_t), intent(in)  this)
private

Definition at line 306 of file krylov.f90.

◆ krylov_set_pc()

subroutine krylov::krylov_set_pc ( class(ksp_t), intent(inout)  this,
class(pc_t), intent(in), target  M 
)
private
Parameters
MThe preconditioner.

Definition at line 270 of file krylov.f90.

Variable Documentation

◆ ksp_abs_tol

real(kind=rp), parameter, public krylov::ksp_abs_tol = 1d-9

Definition at line 52 of file krylov.f90.

◆ ksp_max_iter

integer, parameter, public krylov::ksp_max_iter = 1e3

Definition at line 51 of file krylov.f90.

◆ ksp_rel_tol

real(kind=rp), parameter, public krylov::ksp_rel_tol = 1d-9

Definition at line 53 of file krylov.f90.