-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreconditioner_mod.F90
42 lines (34 loc) · 1.56 KB
/
preconditioner_mod.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
!-------------------------------------------------------------------------------
! Copyright (c) 2017, Met Office, on behalf of HMSO and Queen's Printer
! For further details please refer to the file LICENCE.original which you
! should have received as part of this distribution.
!-------------------------------------------------------------------------------
!> @brief Abstract base type for preconditioner
!>
!> @detail Implements an abstract class for a preconditioner which
!> defines an interface for the preconditioner application y = P^{-1}.x
module preconditioner_mod
use vector_mod, only : abstract_vector_type
implicit none
private
!>@brief Abstract preconditioner type for the solver API
type, public, abstract :: abstract_preconditioner_type
private
contains
procedure (apply_interface), deferred :: apply
end type abstract_preconditioner_type
abstract interface
!> abstract interface defined for the apply procedure of a preconditioner
!! y = P.x
!> @param[in] self, a preconditioner
!> @param[inout] x a vector that the preconditioner is applied to.
!> @param[inout] y a vector, the result.
subroutine apply_interface(self, x, y)
import :: abstract_vector_type
import :: abstract_preconditioner_type
class(abstract_preconditioner_type), intent(in) :: self
class(abstract_vector_type), intent(inout) :: x
class(abstract_vector_type), intent(inout) :: y
end subroutine apply_interface
end interface
end module preconditioner_mod