Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
sll_m_linear_solver_abstract.F90
Go to the documentation of this file.
1 
10 
12  !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
13 #include "sll_working_precision.h"
14 
17 
18  use sll_m_linear_operator_block, only: &
20 
21  implicit none
22 
23  public :: &
25 
26  private
27  ! ..................................................
30  type, abstract :: sll_t_linear_solver_abstract
31  sll_int32 :: n_rows = 0
32  sll_int32 :: n_cols = 0
33 
34  sll_int32 :: n_global_rows = 0
35  sll_int32 :: n_global_cols = 0
36 
37  sll_int32 :: n_total_rows = 0
38  sll_int32 :: n_total_cols = 0
39 
40  logical :: is_allocated = .false.
41  logical :: verbose = .false.
42 
43  contains
44 
45  generic :: solve => solve_real
46 
47  procedure :: initialize_abstract => initialize_linear_solver_abstract
48  procedure :: set_verbose_abstract => set_verbose_linear_solver_abstract
49 
50  procedure(sll_p_read_from_file_linear_solver_abstract), deferred :: read_from_file
51  procedure(sll_p_set_verbose_linear_solver_abstract) , deferred :: set_verbose
52  procedure(sll_p_solve_real_linear_solver_abstract) , deferred :: solve_real
53  procedure(sll_p_print_info_linear_solver_abstract) , deferred :: print_info
54  procedure(sll_p_free_linear_solver_abstract) , deferred :: free
56  ! ..................................................
57 
58  ! ..................................................
59  abstract interface
60  subroutine sll_p_solve_real_linear_solver_abstract(self, rhs, unknown)
63 
64  class(sll_t_linear_solver_abstract), intent(inout) :: self
65  sll_real64, dimension(:) , intent(in ) :: rhs
66  sll_real64, dimension(:) , intent( out) :: unknown
68  end interface
69  ! ..................................................
70 
71  ! ..................................................
72  abstract interface
73  subroutine sll_p_set_verbose_linear_solver_abstract(self, verbose)
76 
77  class(sll_t_linear_solver_abstract), intent(inout) :: self
78  logical , intent(in) :: verbose
80  end interface
81  ! ..................................................
82 
83  ! ..................................................
84  abstract interface
88 
89  class(sll_t_linear_solver_abstract), intent(inout) :: self
90  character(len=*) , intent(in) :: filename
92  end interface
93  ! ..................................................
94 
95  ! ..................................................
96  abstract interface
99 
100  class(sll_t_linear_solver_abstract), intent(in) :: self
102  end interface
103  ! ..................................................
104 
105 
106  ! ..................................................
107  abstract interface
110  class(sll_t_linear_solver_abstract), intent(inout) :: self
111  end subroutine sll_p_free_linear_solver_abstract
112  end interface
113  ! ..................................................
114 
115 
116 contains
117 
118  ! ........................................................
123  subroutine initialize_linear_solver_abstract(self, linear_operator)
124  implicit none
125  class(sll_t_linear_solver_abstract) , intent(inout) :: self
126  class(sll_t_linear_operator_abstract), target, intent(in) :: linear_operator
127 
128  self % n_rows = linear_operator % n_rows
129  self % n_cols = linear_operator % n_cols
130 
131  self % n_global_rows = linear_operator % n_global_rows
132  self % n_global_cols = linear_operator % n_global_cols
133 
134  select type (linear_operator)
135  class is (sll_t_linear_operator_block)
136  self % n_total_rows = self % n_global_rows
137  self % n_total_cols = self % n_global_cols
138  class default
139  self % n_total_rows = self % n_global_rows * linear_operator % n_block_rows
140  self % n_total_cols = self % n_global_cols * linear_operator % n_block_cols
141  end select
142 
143  end subroutine initialize_linear_solver_abstract
144  ! ........................................................
145 
146  ! ............................................
151  subroutine set_verbose_linear_solver_abstract(self, verbose)
152  implicit none
153  class(sll_t_linear_solver_abstract), intent(inout) :: self
154  logical , intent(in) :: verbose
155 
156  ! ...
157  self % verbose = verbose
158  ! ...
159 
161  ! ..................................................
162 
module for abstract linear operator
module for a block linear operator
module for abstract linear solver
subroutine initialize_linear_solver_abstract(self, linear_operator)
initialize linear solver from linear operator
subroutine set_verbose_linear_solver_abstract(self, verbose)
sets the verbose for the linear solver object
Module to select the kind parameter.
    Report Typos and Errors