59 real(kind=
rp) :: res_start
61 real(kind=
rp) :: res_final
66 class(
pc_t),
pointer :: m => null()
67 real(kind=
rp) :: rel_tol
68 real(kind=
rp) :: abs_tol
70 class(
pc_t),
allocatable :: m_ident
95 function ksp_method(this, Ax, x, f, n, coef, blst, gs_h, niter)
result(ksp_results)
105 class(
ksp_t),
intent(inout) :: this
106 class(
ax_t),
intent(inout) :: ax
107 type(
field_t),
intent(inout) :: x
108 integer,
intent(in) :: n
109 real(kind=
rp),
dimension(n),
intent(inout) :: f
110 type(
coef_t),
intent(inout) :: coef
112 type(
gs_t),
intent(inout) :: gs_h
113 integer,
optional,
intent(in) :: niter
122 class(
ksp_t),
intent(inout) :: this
134 class(
ksp_t),
target,
intent(inout) :: this
135 integer,
intent(in) :: max_iter
136 real(kind=
rp),
optional,
intent(in) :: rel_tol
137 real(kind=
rp),
optional,
intent(in) :: abs_tol
138 class(
pc_t),
optional,
target,
intent(in) :: m
142 if (
present(rel_tol))
then
143 this%rel_tol = rel_tol
148 if (
present(abs_tol))
then
149 this%abs_tol = abs_tol
154 this%max_iter = max_iter
159 if (.not.
associated(this%M))
then
163 allocate(
ident_t::this%M_ident)
165 this%M => this%M_ident
173 class(
ksp_t),
intent(inout) :: this
182 class(
ksp_t),
intent(inout) :: this
183 class(
pc_t),
target,
intent(in) :: M
185 if (
associated(this%M))
then
186 select type(pc => this%M)
190 call neko_error(
'Preconditioner already defined')
Abstract interface for a Krylov method's solve routine.
Abstract interface for deallocating a Krylov method.
Defines a Matrix-vector product.
Defines a boundary condition.
Identity Krylov preconditioner for accelerators.
Krylov preconditioner (identity)
Implements the base abstract type for Krylov solvers plus helper types.
real(kind=rp), parameter, public ksp_rel_tol
Relative tolerance.
real(kind=rp), parameter, public ksp_abs_tol
Absolut tolerance.
subroutine krylov_free(this)
Deallocate a Krylov solver.
integer, parameter, public ksp_max_iter
Maximum number of iters.
subroutine krylov_set_pc(this, M)
Setup a Krylov solver's preconditioner.
subroutine krylov_init(this, max_iter, rel_tol, abs_tol, M)
Constructor for the base type.
integer, parameter neko_bcknd_device
integer, parameter, public c_rp
integer, parameter, public rp
Global precision used in computations.
subroutine neko_warning(warning_msg)
Base type for a matrix-vector product providing .
A list of boundary conditions.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Defines a canonical Krylov preconditioner for accelerators.
Defines a canonical Krylov preconditioner.
Type for storing initial and final residuals in a Krylov solver.
Base abstract type for a canonical Krylov method, solving .
Defines a canonical Krylov preconditioner.