13 #include "sll_working_precision.h"
35 sll_int32 :: n_maxiter = 2000
36 logical :: null_space = .false.
38 sll_real64 :: atol = 1.0d-9
40 sll_real64,
dimension(:),
allocatable :: x_0
65 sll_real64,
dimension(:),
intent(in) :: x_0
77 sll_int32,
intent(in) :: i_iteration
78 logical,
intent(inout) :: flag
79 sll_real64,
optional,
intent(in) :: r_err
80 sll_real64,
dimension(:),
optional,
intent(in) :: arr_err
94 sll_real64,
dimension(:),
intent(in) :: unknown
95 sll_real64,
dimension(:),
intent(in) :: rhs
96 sll_real64,
intent(inout) :: r_err
99 sll_real64,
dimension(:),
allocatable :: residu
108 call self % ptr_linear_operator % dot(unknown, residu)
109 residu = rhs - residu
111 r_err = maxval(abs(residu))
132 if (self % null_space)
then
139 if (.not.
allocated(self % p_linear_operator))
then
145 select type (p_linear_operator => self % p_linear_operator)
148 call p_linear_operator % create(linear_operator=linear_operator)
155 self % ptr_linear_operator => self % p_linear_operator
159 self % ptr_linear_operator => linear_operator
175 sll_real64,
intent(in) :: atol
196 select type (p_linear_operator => self % p_linear_operator)
198 call p_linear_operator % free()
200 if (
allocated(self % p_linear_operator))
then
201 deallocate(self % p_linear_operator)
206 self % ptr_linear_operator => null()
module for abstract linear operator
module for a penalized linear operator
module for abstract linear solver
module for abstract iterative linear solvers
subroutine free_abstract_linear_solver_iter_abstract(self)
abstract free for an iterative solver
subroutine set_tolerance_linear_solver_iter_abstract(self, atol)
set absolute tolerance
subroutine compute_residual_error_linear_solver_iter_abstract(self, unknown, rhs, r_err)
computes the residual error for an iterative solver
subroutine set_linop_linear_solver_iter_abstract(self, linear_operator)
sets a linear operator for an iterative solver
Module to select the kind parameter.
class for abstract linear operator
class for a linear operator_penalized
class for abstract linear solver
class for abstract iterative linear solver