38 use json_module,
only : json_file
43 type,
public,
abstract ::
pc_t
45 procedure(
pc_init), pass(this),
deferred :: init
47 procedure(
pc_update), pass(this),
deferred :: update
48 procedure(
pc_free), pass(this),
deferred :: free
57 subroutine pc_init(this, coef, bclst, json)
60 class(
pc_t),
intent(inout),
target :: this
61 type(
coef_t),
intent(in),
target :: coef
62 type(
bc_list_t),
intent(inout),
target :: bclst
63 type(json_file),
intent(inout) :: json
76 integer,
intent(in) :: n
77 class(
pc_t),
intent(inout) :: this
78 real(kind=
rp),
dimension(n),
intent(inout) :: z
79 real(kind=
rp),
dimension(n),
intent(inout) :: r
85 class(
pc_t),
intent(inout) :: this
90 class(
pc_t),
intent(inout) :: this
96 module subroutine precon_allocator(pc, type_name)
97 class(pc_t),
allocatable,
intent(inout) :: pc
98 character(len=*),
intent(in) :: type_name
99 end subroutine precon_allocator
102 module subroutine precon_factory(pc, type_name, coef, bclst, json)
103 class(pc_t),
allocatable,
intent(inout),
target :: pc
104 character(len=*),
intent(in) :: type_name
105 type(
coef_t),
intent(in),
target :: coef
106 type(
bc_list_t),
intent(inout),
target :: bclst
107 type(json_file),
intent(inout) :: json
108 end subroutine precon_factory
119 subroutine precon_allocate(obj)
121 class(pc_t),
allocatable,
intent(inout) :: obj
122 end subroutine precon_allocate
127 module subroutine register_precon(type_name, allocator)
128 character(len=*),
intent(in) :: type_name
129 procedure(precon_allocate),
pointer,
intent(in) :: allocator
130 end subroutine register_precon
134 type precon_allocator_entry
135 character(len=20) :: type_name
136 procedure(precon_allocate),
pointer,
nopass :: allocator
137 end type precon_allocator_entry
140 type(precon_allocator_entry),
allocatable :: precon_registry(:)
143 integer :: precon_registry_size = 0
145 public :: precon_allocator, precon_factory, register_precon, precon_allocate
__device__ T solve(const T u, const T y, const T guess, const T nu, const T kappa, const T B)
Abstract interface for initializing a preconditioner from the case file.
Abstract interface for solving .
integer, parameter, public rp
Global precision used in computations.
A list of allocatable `bc_t`. Follows the standard interface of lists.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Defines a canonical Krylov preconditioner.