-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinear_operator_mod.F90
37 lines (33 loc) · 1.55 KB
/
linear_operator_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
!-------------------------------------------------------------------------------
! 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 linear operator
!> @detail Implements an abstract class for a linear operator which
!! defines an interface for the linear operator application y = A.x
module linear_operator_mod
use constants_mod, only : i_def, r_def
use vector_mod, only : abstract_vector_type
implicit none
private
!>@brief Abstract linear operator type to define interfaces for the solver API
type, public, abstract :: abstract_linear_operator_type
private
contains
procedure (apply_interface), deferred :: apply
end type abstract_linear_operator_type
abstract interface
!> Asbtract interface defined for the apply method.
!> param[in] self a linear operator
!> param[in] x a vector the linear operator is applied to
!> param[inout] y a vector, the result.
subroutine apply_interface(self, x, y)
import :: abstract_linear_operator_type
import :: abstract_vector_type
class(abstract_linear_operator_type), intent(in) :: self
class(abstract_vector_type), intent(in) :: x
class(abstract_vector_type), intent(inout) :: y
end subroutine apply_interface
end interface
end module linear_operator_mod