Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
sll_m_extraction_operator_transposed_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
27 
29 
30 
31 contains
32 
33  subroutine create_extraction_operator_transposed_12( self, n_dofs, conp, k, tau )
34  class(sll_t_extraction_operator_transposed_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)
56  self%n_cols = product(self%n_dofs) - self%n0 + self%nk
57 
58  self%n_global_rows = self%n_rows
59  self%n_global_cols = self%n_cols
60 
62 
64  class(sll_t_extraction_operator_transposed_12), intent( inout ) :: self
65 
67 
68 
69  subroutine dot_extraction_operator_transposed_12 ( self, x, y )
70  class(sll_t_extraction_operator_transposed_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(2) = y(2) + &
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(i)
82  end do
83  do j = 2, self%n_dofs(2)
84  do i = 1, self%nk
85  y(2+(j-1)*self%n_dofs(1)) = y(2+(j-1)*self%n_dofs(1)) + &
86  ( (self%conp(j, 1)-self%conp(j-1, 1)) * self%tl(i,2) + &
87  (self%conp(j, 2)-self%conp(j-1, 2)) * self%tl(i,3) )*&
88  x(i)
89  end do
90  end do
91 
92  ind = self%nk+1
93  do j = 1, self%n_dofs(2)
94  do i = 3, self%n_dofs(1)
95  y(i+(j-1)*self%n_dofs(1)) = x(ind)
96  ind = ind+1
97  end do
98  end do
99  sll_assert(ind == self%n_cols+1)
100 
102 
103 
105  class(sll_t_extraction_operator_transposed_12), intent(in) :: self
106 
108 
109 
subroutine create_extraction_operator_transposed_12(self, n_dofs, conp, k, tau)
module for abstract linear operator
    Report Typos and Errors