Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
sll_m_linear_operator_curl_3d.F90
Go to the documentation of this file.
2 #include "sll_working_precision.h"
3 
5 
6  use sll_m_spline_fem_utilities, only : &
11 
12  use sll_m_linear_operator_block, only : &
14 
15  implicit none
16 
18 
19  private
21  type(sll_t_linear_operator_block), pointer :: mass1
22  type(sll_t_linear_operator_block), pointer :: mass2
23  sll_int32 :: n_dofs(3)
24  sll_real64 :: delta_x(3)
25  sll_real64 :: epsilon = 1._f64
26  sll_int32 :: n_total
27 
28  contains
29  procedure :: create => create_linear_operator_curl_3d
30  procedure :: free => free_curl_3d
31  procedure :: dot => dot_curl_3d
32  procedure :: print_info => print_info_curl_3d
33 
35 
36 
37 contains
38 
39  subroutine create_linear_operator_curl_3d( self, mass1, mass2, n_dofs, delta_x )
40  class(sll_t_linear_operator_curl_3d), intent( inout ) :: self
41  type(sll_t_linear_operator_block), target :: mass1
42  type(sll_t_linear_operator_block), target :: mass2
43  sll_int32 :: n_dofs(3)
44  sll_real64 :: delta_x(3)
45 
46  self%mass1 => mass1
47  self%mass2 => mass2
48 
49  self%n_total = product(n_dofs)
50  self%n_dofs = n_dofs
51  self%delta_x = delta_x
52 
53  self%n_rows = 3*self%n_total
54  self%n_cols = 3*self%n_total
55 
56  self%n_global_rows = self%n_rows
57  self%n_global_cols = self%n_cols
58 
59  end subroutine create_linear_operator_curl_3d
60 
61  subroutine free_curl_3d( self )
62  class(sll_t_linear_operator_curl_3d), intent( inout ) :: self
63 
64  self%mass1=> null()
65  self%mass2=> null()
66 
67  end subroutine free_curl_3d
68 
69 
70  subroutine dot_curl_3d ( self, x, y )
71  class(sll_t_linear_operator_curl_3d), intent( in ) :: self
72  sll_real64, intent( in ) :: x(:)
73  sll_real64, intent( out ) :: y(:)
74  !local variables
75  sll_real64 :: scratch1(3*self%n_total), scratch2(3*self%n_total)
76 
77  ! Compute C x
78  call sll_s_multiply_c( self%n_dofs, self%delta_x, x, scratch1 )
79 
80  ! Compute M2 C x
81  call self%mass2%dot( scratch1, scratch2 )
82 
83  ! Compute C^T M2 C x
84  call sll_s_multiply_ct( self%n_dofs, self%delta_x, scratch2, y )
85 !!$
86  ! Compute M1 x
87  call self%mass1%dot( x, scratch1 )
88 
89  ! Compute G^T M1 x
90  call sll_s_multiply_gt( self%n_dofs, self%delta_x, scratch1, scratch2(1:self%n_total) )
91 
92  ! Compute G G^T M1 x
93  call sll_s_multiply_g( self%n_dofs, self%delta_x, scratch2(1:self%n_total), scratch1 )
94 
95  ! Compute M1 G G^T M_1 x
96  call self%mass1%dot( scratch1, scratch2 )
97 
98  ! y = (C^T M2 C + epsilon M1 G G^T M_1) x
99  y = y + self%epsilon*scratch2
100 
101  end subroutine dot_curl_3d
102 
103 
104  subroutine print_info_curl_3d( self )
105  class(sll_t_linear_operator_curl_3d), intent(in) :: self
106 
107  end subroutine print_info_curl_3d
108 
109 
module for abstract linear operator
module for a block linear operator
subroutine create_linear_operator_curl_3d(self, mass1, mass2, n_dofs, delta_x)
Utilites for Maxwell solver's with spline finite elements.
subroutine, public sll_s_multiply_g(n_dofs, delta_x, field_in, field_out)
Multiply by dicrete gradient matrix (3d version)
subroutine, public sll_s_multiply_c(n_dofs, delta_x, field_in, field_out)
Multiply by discrete curl matrix.
subroutine, public sll_s_multiply_ct(n_dofs, delta_x, field_in, field_out)
Multiply by transpose of discrete curl matrix.
subroutine, public sll_s_multiply_gt(n_dofs, delta_x, field_in, field_out)
Multiply by transpose of dicrete gradient matrix (3d version)
    Report Typos and Errors