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_11.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_11( self, n_dofs, conp, k, tau )
34  class(sll_t_extraction_operator_transposed_11), 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%n_dofs(2) + 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_11), intent( inout ) :: self
65 
67 
68 
69  subroutine dot_extraction_operator_transposed_11 ( self, x, y )
70  class(sll_t_extraction_operator_transposed_11), 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 j = 1, self%n_dofs(2)
78  do i = 1, self%nk
79  y(1+(j-1)*self%n_dofs(1)) = y(1+(j-1)*self%n_dofs(1)) + &
80  ( self%conp(j, 1) * self%tl(i,2) + &
81  self%conp(j, 2) * self%tl(i,3) )*&
82  x(i)
83  end do
84  end do
85 
86  ind = self%nk+1
87  do j = 1, self%n_dofs(2)
88  do i = 2, self%n_dofs(1)
89  y(i+(j-1)*self%n_dofs(1)) = x(ind)
90  ind = ind+1
91  end do
92  end do
93  sll_assert(ind == self%n_cols+1)
94 
96 
97 
99  class(sll_t_extraction_operator_transposed_11), intent(in) :: self
100 
102 
103 
subroutine create_extraction_operator_transposed_11(self, n_dofs, conp, k, tau)
module for abstract linear operator
    Report Typos and Errors