Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
Derived types and interfaces | Functions/Subroutines | Variables
sll_m_linear_solver_cg Module Reference

Description

module for conjugate gradient method in pure form

a linear solver using the conjugate gradient method This is a modification of linear_solver_cg

Maintainer ARA, Katharina Kormann Modified by Benedikt Perse Stability stable

Derived types and interfaces

type  sll_t_linear_solver_cg
 class for the cg linear solver More...
 

Functions/Subroutines

subroutine create_linear_solver_cg (self, linear_operator, pc_left, filename)
 creates a linear solver More...
 
subroutine initialize_linear_solver_cg (self, linear_operator, x_0)
 initializes the linear solver More...
 
subroutine set_guess_linear_solver_cg (self, x_0)
 sets the initial guess More...
 
subroutine check_convergence_linear_solver_cg (self, i_iteration, flag, r_err, arr_err)
 check the convergence of the current linear solver More...
 
subroutine read_from_file_linear_solver_cg (self, filename)
 read from file More...
 
subroutine solve_real_linear_solver_cg (self, rhs, unknown)
 af solves the linear system with real vectors More...
 
subroutine cg_linear_solver (self, x, b, niterx, res)
 cg interface More...
 
subroutine set_verbose_linear_solver_cg (self, verbose)
 sets the verbose for the linear solver object More...
 
subroutine print_info_linear_solver_cg (self)
 destroys a finite element cell More...
 
subroutine free_linear_solver_cg (self)
 destroys the current object More...
 

Variables

integer(kind=i32), parameter sll_solver_bool_false = 0
 code id for False More...
 
integer(kind=i32), parameter sll_solver_maxiter = 1000
 default maximum number of iterations for More...
 
real(kind=f64), parameter sll_solver_tolerance = 1.0d-9
 default tolerance for iterative solvers More...
 

Function/Subroutine Documentation

◆ cg_linear_solver()

subroutine sll_m_linear_solver_cg::cg_linear_solver ( class(sll_t_linear_solver_cg), intent(in)  self,
real(kind=f64), dimension (:), intent(inout)  x,
real(kind=f64), dimension (:), intent(in)  b,
integer(kind=i32), intent(out)  niterx,
real(kind=f64), intent(out)  res 
)
private

cg interface

Parameters
[in,out]selfthe current object
[in]bthe right hand side
[out]uthe solution
[out]niterxnumber of iteration for convergence
[out]resfinal residual error

Definition at line 275 of file sll_m_linear_solver_cg.F90.

Here is the caller graph for this function:

◆ check_convergence_linear_solver_cg()

subroutine sll_m_linear_solver_cg::check_convergence_linear_solver_cg ( class(sll_t_linear_solver_cg), intent(in)  self,
integer(kind=i32), intent(in)  i_iteration,
logical, intent(inout)  flag,
real(kind=f64), intent(in), optional  r_err,
real(kind=f64), dimension(:), intent(in), optional  arr_err 
)
private

check the convergence of the current linear solver

Parameters
[in,out]selfthe current object
[in]i_iterationthe checking iteration
[in]flagthe verbose flag
[in]r_err[optional] the error
[in]arr_err[optional] the array of error

Definition at line 145 of file sll_m_linear_solver_cg.F90.

◆ create_linear_solver_cg()

subroutine sll_m_linear_solver_cg::create_linear_solver_cg ( class(sll_t_linear_solver_cg), intent(inout)  self,
class(sll_t_linear_operator_abstract), intent(in), target  linear_operator,
class(sll_t_linear_solver_abstract), intent(in), optional, target  pc_left,
character(len=*), intent(in), optional  filename 
)
private

creates a linear solver

Parameters
[in,out]selfthe current object
[in]linear_operatora linear operator
[in]filenameparameter filename [optional]

Definition at line 60 of file sll_m_linear_solver_cg.F90.

◆ free_linear_solver_cg()

subroutine sll_m_linear_solver_cg::free_linear_solver_cg ( class(sll_t_linear_solver_cg), intent(inout)  self)
private

destroys the current object

Parameters
[in,out]selfthe current object

Definition at line 397 of file sll_m_linear_solver_cg.F90.

◆ initialize_linear_solver_cg()

subroutine sll_m_linear_solver_cg::initialize_linear_solver_cg ( class(sll_t_linear_solver_cg), intent(inout)  self,
class(sll_t_linear_operator_abstract), intent(in), target  linear_operator,
real(kind=f64), dimension(:), intent(in), optional  x_0 
)
private

initializes the linear solver

Parameters
[in,out]selfthe current object
[in]linear_operatora linear operator
[in]x_0[optional] the init guess, defalut value: 0

Definition at line 97 of file sll_m_linear_solver_cg.F90.

◆ print_info_linear_solver_cg()

subroutine sll_m_linear_solver_cg::print_info_linear_solver_cg ( class(sll_t_linear_solver_cg), intent(in)  self)
private

destroys a finite element cell

Parameters
[in,out]selfthe current object

Definition at line 378 of file sll_m_linear_solver_cg.F90.

◆ read_from_file_linear_solver_cg()

subroutine sll_m_linear_solver_cg::read_from_file_linear_solver_cg ( class(sll_t_linear_solver_cg), intent(inout)  self,
character(len=*), intent(in)  filename 
)
private

read from file

Parameters
[in,out]selfthe current object
[in]filename[optional] name of the output file

Definition at line 174 of file sll_m_linear_solver_cg.F90.

◆ set_guess_linear_solver_cg()

subroutine sll_m_linear_solver_cg::set_guess_linear_solver_cg ( class(sll_t_linear_solver_cg), intent(inout)  self,
real(kind=f64), dimension(:), intent(in)  x_0 
)
private

sets the initial guess

Parameters
[in,out]selfthe current object
[in]x_guessinitial guess

Definition at line 126 of file sll_m_linear_solver_cg.F90.

◆ set_verbose_linear_solver_cg()

subroutine sll_m_linear_solver_cg::set_verbose_linear_solver_cg ( class(sll_t_linear_solver_cg), intent(inout)  self,
logical, intent(in)  verbose 
)
private

sets the verbose for the linear solver object

Parameters
[in,out]selfthe current object
[in]verboseverbose flag

Definition at line 362 of file sll_m_linear_solver_cg.F90.

◆ solve_real_linear_solver_cg()

subroutine sll_m_linear_solver_cg::solve_real_linear_solver_cg ( class(sll_t_linear_solver_cg), intent(inout)  self,
real(kind=f64), dimension(:), intent(in)  rhs,
real(kind=f64), dimension(:), intent(out)  unknown 
)
private

af solves the linear system with real vectors

Parameters
[in,out]selfthe current object
[in]rhsthe right hand side
[in,out]unknownthe solution

Definition at line 228 of file sll_m_linear_solver_cg.F90.

Here is the call graph for this function:

Variable Documentation

◆ sll_solver_bool_false

integer(kind=i32), parameter sll_solver_bool_false = 0
private

code id for False

Definition at line 31 of file sll_m_linear_solver_cg.F90.

◆ sll_solver_maxiter

integer(kind=i32), parameter sll_solver_maxiter = 1000
private

default maximum number of iterations for

Definition at line 32 of file sll_m_linear_solver_cg.F90.

◆ sll_solver_tolerance

real(kind=f64), parameter sll_solver_tolerance = 1.0d-9
private

default tolerance for iterative solvers

Definition at line 33 of file sll_m_linear_solver_cg.F90.

    Report Typos and Errors