Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
sll_m_preconditioner_jacobi.F90
Go to the documentation of this file.
1 
8 
10  !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
11 #include "sll_assert.h"
12 #include "sll_memory.h"
13 #include "sll_working_precision.h"
14 
15  use sll_m_linear_operator_abstract, only : &
17 
18  use sll_m_linear_solver_abstract, only : &
20 
21  implicit none
22 
23  public :: &
25 
26  private
27  !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28 
30  sll_real64, allocatable :: diag(:)
31 
32  contains
33 
34  procedure :: create => create_3d_trafo
35  procedure :: free => free_3d_trafo
36  procedure :: solve_real => solve_3d_trafo
37  procedure :: set_verbose
38  procedure :: print_info
39  procedure :: read_from_file
40 
42 
43 contains
44 
45 
46  subroutine create_3d_trafo( self, linop)
47  class(sll_t_preconditioner_jacobi), intent( inout ) :: self
48  class(sll_t_linear_operator_abstract) :: linop
49  !local variables
50  sll_int32 :: i
51  sll_real64, allocatable :: scratch1(:), scratch2(:)
52 
53  allocate( self%diag(1:linop%n_rows) )
54  allocate( scratch1(1:linop%n_rows) )
55  allocate( scratch2(1:linop%n_rows) )
56 
57  do i = 1, linop%n_rows
58  scratch1 = 0._f64
59  scratch1(i) = 1._f64
60  call linop%dot( scratch1, scratch2 )
61  self%diag(i) = scratch2(i)
62  end do
63 
64  end subroutine create_3d_trafo
65 
66  subroutine solve_3d_trafo(self, rhs, unknown)
67  class(sll_t_preconditioner_jacobi), intent( inout ) :: self
68  sll_real64, intent(in ) :: rhs(:)
69  sll_real64, intent( out) :: unknown(:)
70 
71  unknown = rhs/self%diag
72 
73  end subroutine solve_3d_trafo
74 
75  subroutine set_verbose(self, verbose)
76  class(sll_t_preconditioner_jacobi), intent( inout ) :: self
77  logical, intent( in ) :: verbose
78 
79  self%verbose = verbose
80  end subroutine set_verbose
81 
82  subroutine print_info(self)
83  class(sll_t_preconditioner_jacobi), intent( in ) :: self
84 
85  end subroutine print_info
86 
87  subroutine read_from_file(self, filename)
88  class(sll_t_preconditioner_jacobi), intent( inout ) :: self
89  character(len=*), intent( in ) :: filename
90 
91  end subroutine read_from_file
92 
93 
94  subroutine free_3d_trafo( self )
95  class(sll_t_preconditioner_jacobi), intent(inout) :: self
96 
97  end subroutine free_3d_trafo
98 
99 
module for abstract linear operator
module for abstract linear solver
Module interface to solve Maxwell's equations.
subroutine read_from_file(self, filename)
subroutine solve_3d_trafo(self, rhs, unknown)
    Report Typos and Errors