Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
sll_m_extraction_operator_12.F90
Go to the documentation of this file.
2 #include "sll_working_precision.h"
3 #include "sll_assert.h"
4 
6 
7 
8  implicit none
9 
11 
12  private
14  sll_int32 :: n_dofs(2)
15  sll_int32 :: n0
16  sll_int32 :: nk
17  sll_real64, allocatable :: conp(:,:)
18  sll_real64 :: tau
19  sll_real64 :: tl(3, 3)
20 
21 
22  contains
23  procedure :: create => create_extraction_operator_12
24  procedure :: free => free_extraction_operator_12
25  procedure :: dot => dot_extraction_operator_12
26  procedure :: print_info => print_info_extraction_operator_12
27 
29 
30 
31 contains
32 
33  subroutine create_extraction_operator_12( self, n_dofs, conp, k, tau )
34  class(sll_t_extraction_operator_12), intent( inout ) :: self
35  sll_int32, intent( in ) :: n_dofs(2)
36  sll_real64, intent( in ) :: conp(:,:)
37  sll_int32, intent( in ) :: k
38  sll_real64, intent( in ) :: tau
39 
40  allocate( self%conp(product(n_dofs), 2) )
41  self%n_dofs = n_dofs
42  self%conp = conp
43  self%tau = tau
44  self%nk = 3!(k+1)*(k+2)/2
45  self%n0 = 2*n_dofs(2)!(k+1)*n_dofs(2)
46 
47  self%tl(:,1) = 1._f64/3._f64
48  self%tl(1,2) = 2._f64/(3._f64*self%tau)
49  self%tl(2,2) = -1._f64/(3._f64*self%tau)
50  self%tl(3,2) = -1._f64/(3._f64*self%tau)
51  self%tl(1,3) = 0._f64
52  self%tl(2,3) = 1._f64/(sqrt(3._f64)*self%tau)
53  self%tl(3,3) = -1._f64/(sqrt(3._f64)*self%tau)
54 
55  self%n_rows = product(self%n_dofs) - self%n0 + self%nk
56  self%n_cols = product(self%n_dofs)
57 
58  self%n_global_rows = self%n_rows
59  self%n_global_cols = self%n_cols
60 
61  end subroutine create_extraction_operator_12
62 
63  subroutine free_extraction_operator_12( self )
64  class(sll_t_extraction_operator_12), intent( inout ) :: self
65 
66  end subroutine free_extraction_operator_12
67 
68 
69  subroutine dot_extraction_operator_12 ( self, x, y )
70  class(sll_t_extraction_operator_12), intent( in ) :: self
71  sll_real64, intent( in ) :: x(:)
72  sll_real64, intent( out ) :: y(:)
73  !local variables
74  sll_int32 :: i, j, ind
75  y=0.0_f64
76 
77  do i = 1, self%nk
78  y(i) = y(i) + &
79  ( (self%conp(1, 1)-self%conp(self%n_dofs(2), 1)) * self%tl(i,2) + &
80  (self%conp(1, 2)-self%conp(self%n_dofs(2), 2)) * self%tl(i,3) )*&
81  x(2)
82  do j = 2, self%n_dofs(2)
83  y(i) = y(i) + &
84  ( (self%conp(j, 1)-self%conp(j-1, 1)) * self%tl(i,2) + &
85  (self%conp(j, 2)-self%conp(j-1, 2)) * self%tl(i,3) )*&
86  x(2+(j-1)*self%n_dofs(1))
87  end do
88  end do
89 
90  ind = self%nk+1
91  do j = 1, self%n_dofs(2)
92  do i = 3, self%n_dofs(1)
93  y(ind) = x(i+(j-1)*self%n_dofs(1))
94  ind = ind+1
95  end do
96  end do
97  sll_assert(ind == self%n_rows+1)
98 
99  end subroutine dot_extraction_operator_12
100 
101 
103  class(sll_t_extraction_operator_12), intent(in) :: self
104 
105  end subroutine print_info_extraction_operator_12
106 
107 
subroutine dot_extraction_operator_12(self, x, y)
subroutine create_extraction_operator_12(self, n_dofs, conp, k, tau)
module for abstract linear operator
    Report Typos and Errors