33submodule(
krylov) krylov_fctry
57 character(len=20) :: KSP_KNOWN_TYPES(9) = [character(len=20) :: &
78 module subroutine krylov_solver_factory(object, n, type_name, &
79 max_iter, abstol, m, monitor)
80 class(ksp_t),
allocatable,
intent(inout) :: object
81 integer,
intent(in),
value :: n
82 character(len=*),
intent(in) :: type_name
83 integer,
intent(in) :: max_iter
84 real(kind=
rp),
optional :: abstol
85 class(pc_t),
optional,
intent(in),
target :: M
86 logical,
optional,
intent(in) :: monitor
87 character(len=:),
allocatable :: type_string
89 if (
allocated(object))
then
90 call krylov_solver_destroy(object)
94 if (trim(type_name) .eq.
'cg')
then
100 allocate(
cg_t::object)
102 else if (trim(type_name) .eq.
'coupledcg')
then
105 call neko_error(
'Coupled CG only supported for CPU')
107 else if (trim(type_name) .eq.
'pipecg')
then
112 call neko_error(
'PipeCG not supported for OpenCL')
118 else if (trim(type_name) .eq.
'fusedcg')
then
121 call neko_error(
'FusedCG not supported for OpenCL')
125 call neko_error(
'FusedCG only supported for CUDA/HIP')
127 else if (trim(type_name) .eq.
'fusedcoupledcg')
then
130 call neko_error(
'Coupled FusedCG not supported for OpenCL')
134 call neko_error(
'Coupled FusedCG only supported for CUDA/HIP')
136 else if (trim(type_name) .eq.
'cacg')
then
138 else if (trim(type_name) .eq.
'gmres')
then
146 else if (trim(type_name) .eq.
'cheby')
then
152 else if (trim(type_name) .eq.
'bicgstab')
then
156 new_line(
'A') //
"- ", .true.)
157 call neko_error(
"Unknown Krylov solver type: " &
158 // trim(type_name) //
". Known types are: " &
166 select type (obj => object)
168 call obj%init(n, max_iter, m = m, abs_tol = abstol,&
171 call obj%init(n, max_iter, m = m, abs_tol = abstol,&
174 call obj%init(n, max_iter, m = m, abs_tol = abstol,&
177 call obj%init(n, max_iter, m = m, abs_tol = abstol,&
180 call obj%init(n, max_iter, m = m, abs_tol = abstol,&
183 call obj%init(n, max_iter, m = m, abs_tol = abstol,&
186 call obj%init(n, max_iter, m = m, abs_tol = abstol,&
189 call obj%init(n, max_iter, m = m, abs_tol = abstol,&
192 call obj%init(n, max_iter, m = m, abs_tol = abstol,&
195 call obj%init(n, max_iter, m = m, abs_tol = abstol,&
198 call obj%init(n, max_iter, m = m, abs_tol = abstol,&
201 call obj%init(n, max_iter, m = m, abs_tol = abstol,&
204 call obj%init(n, max_iter, m = m, abs_tol = abstol,&
207 call obj%init(n, max_iter, m = m, abs_tol = abstol,&
210 call obj%init(n, max_iter, m = m, abs_tol = abstol,&
213 call obj%init(n, max_iter, m = m, abs_tol = abstol,&
217 end subroutine krylov_solver_factory
220 module subroutine krylov_solver_destroy(object)
221 class(ksp_t),
allocatable,
intent(inout) :: object
223 end subroutine krylov_solver_destroy
225end submodule krylov_fctry
Defines various Bi-Conjugate Gradient Stabilized methods.
Defines a communication avoiding Conjugate Gradient method.
Defines a coupled Conjugate Gradient methods.
Defines various Conjugate Gradient methods for accelerators.
Defines various Conjugate Gradient methods.
Defines various Conjugate Gradient methods.
Chebyshev preconditioner.
Chebyshev preconditioner.
Defines a fused Conjugate Gradient method for accelerators.
Defines a fused Conjugate Gradient method for accelerators.
Defines various GMRES methods.
Defines various GMRES methods.
Defines various GMRES methods.
Implements the base abstract type for Krylov solvers plus helper types.
integer, parameter neko_bcknd_sx
integer, parameter neko_bcknd_device
integer, parameter neko_bcknd_opencl
integer, parameter, public rp
Global precision used in computations.
Defines a pipelined Conjugate Gradient methods.
Defines a pipelined Conjugate Gradient methods SX-Aurora backend.
Defines a pipelined Conjugate Gradient methods.
character(:) function, allocatable, public concat_string_array(array, sep, prepend)
Concatenate an array of strings into one string with array items separated by spaces.
Standard preconditioned Bi-Conjugate Gradient Stabilized method.
S-step communication avoiding preconditioned conjugate gradient method.
Standard preconditioned conjugate gradient method.
Coupled preconditioned conjugate gradient method.
Device based preconditioned conjugate gradient method.
Standard preconditioned conjugate gradient method (SX version)
Defines a Chebyshev preconditioner.
Defines a Chebyshev preconditioner.
Fused preconditioned conjugate gradient method.
Fused preconditioned conjugate gradient method.
Standard preconditioned generalized minimal residual method.
Standard preconditioned generalized minimal residual method.
Standard preconditioned generalized minimal residual method (SX version)
Pipelined preconditioned conjugate gradient method.
Pipelined preconditioned conjugate gradient method.
Pipelined preconditioned conjugate gradient method for SX-Aurora.
Defines a canonical Krylov preconditioner.