Neko 1.99.9
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
preconditioner_template.f90
Go to the documentation of this file.
1
3 use num_types, only : rp
4 use precon, only : pc_t, precon_allocate, register_precon
5 use coefs, only : coef_t
6 use bc_list, only : bc_list_t
7 use json_module, only : json_file
8 implicit none
9 private
10
12 contains
13 procedure :: init => preconditioner_template_init
15 procedure :: update => preconditioner_template_update
16 procedure :: free => preconditioner_template_free
18
20
21contains
22
23 subroutine preconditioner_template_init(this, coef, bclst, json)
24 class(preconditioner_template_t), intent(inout), target :: this
25 type(coef_t), intent(in), target :: coef
26 type(bc_list_t), intent(inout), target :: bclst
27 type(json_file), intent(inout) :: json
28 ! TODO: Set up the preconditioner from the SEM coefficients, the boundary
29 ! conditions of the system and the preconditioner's case-file dictionary.
30 end subroutine preconditioner_template_init
31
32 subroutine preconditioner_template_solve(this, z, r, n)
33 class(preconditioner_template_t), intent(inout) :: this
34 integer, intent(in) :: n
35 real(kind=rp), intent(inout) :: z(n), r(n)
36 ! TODO: Replace the identity operation with M z = r.
37 z = r
39
41 class(preconditioner_template_t), intent(inout) :: this
42 ! TODO: Update state after a change in geometry or operator coefficients.
44
46 class(preconditioner_template_t), intent(inout) :: this
47 ! TODO: Release any resources held by the preconditioner.
48 end subroutine preconditioner_template_free
49
51 procedure(precon_allocate), pointer :: allocator
53 call register_precon('preconditioner_template', allocator)
55
57 class(pc_t), allocatable, intent(inout) :: obj
58 allocate(preconditioner_template_t :: obj)
__device__ T solve(const T u, const T y, const T guess, const T nu, const T kappa, const T B)
Allocate a preconditioner.
Definition precon.f90:120
Defines a list of bc_t.
Definition bc_list.f90:34
Coefficients.
Definition coef.f90:34
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:14
Krylov preconditioner.
Definition precon.f90:34
Template for a user-defined Krylov preconditioner.
subroutine preconditioner_template_free(this)
subroutine preconditioner_template_update(this)
subroutine preconditioner_template_solve(this, z, r, n)
subroutine preconditioner_template_allocate(obj)
subroutine preconditioner_template_init(this, coef, bclst, json)
subroutine, public preconditioner_template_register_types()
A list of allocatable `bc_t`. Follows the standard interface of lists.
Definition bc_list.f90:49
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Definition coef.f90:136
Defines a canonical Krylov preconditioner.
Definition precon.f90:44