Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
sll_m_poisson_2d_base.F90
Go to the documentation of this file.
1 
7 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8 #include "sll_working_precision.h"
9 
10  implicit none
11 
12  public :: &
15 
16  private
17 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
18 
20  type, abstract :: sll_c_poisson_2d_base
21 
22  contains
23 
25  procedure(signature_compute_phi_from_rho_2d), deferred, pass(poisson) :: &
26  compute_phi_from_rho
27 
29  procedure(signature_compute_e_from_rho_2d), deferred, pass(poisson) :: &
30  compute_e_from_rho
31 
33  procedure(signature_norm_squared), deferred :: &
34  l2norm_squared
36  procedure(signature_update_dofs_function), deferred :: &
37  compute_rhs_from_function
38 
39  procedure(signature_empty), deferred :: &
40  free
41 
42  end type sll_c_poisson_2d_base
43 
44  abstract interface
45 
48  sll_real64 :: sll_i_function_of_position
49  sll_real64, intent(in) :: x(:)
50  end function sll_i_function_of_position
51  end interface
52 
53 #ifndef DOXYGEN_SHOULD_SKIP_THIS
54 
55  abstract interface
56 
57  ! solves -\Delta phi = rho in 2d
58 
59  subroutine signature_compute_phi_from_rho_2d(poisson, phi, rho)
60 
63 
64  class(sll_c_poisson_2d_base) :: poisson
65  sll_real64, dimension(:, :), intent(in) :: rho
66  sll_real64, dimension(:, :), intent(out) :: phi
67 
68  end subroutine signature_compute_phi_from_rho_2d
69 
70  end interface
71 
72  abstract interface
73  ! solves E = -\nabla Phi with -\Delta phi = rho in 2d
74  subroutine signature_compute_e_from_rho_2d(poisson, E1, E2, rho)
75 
78 
79  class(sll_c_poisson_2d_base) :: poisson
80  sll_real64, dimension(:, :), intent(in) :: rho
81  sll_real64, dimension(:, :), intent(out) :: e1
82  sll_real64, dimension(:, :), intent(out) :: e2
83 
84  end subroutine signature_compute_e_from_rho_2d
85  end interface
86 
87  !---------------------------------------------------------------------------!
88  abstract interface
89  function signature_norm_squared(poisson, coefs_dofs) result(r)
92  class(sll_c_poisson_2d_base), intent(in) :: poisson
93  sll_real64, intent(in) :: coefs_dofs(:, :)
94  sll_real64 :: r
95  end function signature_norm_squared
96  end interface
97 
98  !---------------------------------------------------------------------------!
99  abstract interface
100  subroutine signature_update_dofs_function(poisson, func, coefs_dofs)
102  import sll_c_poisson_2d_base
104  class(sll_c_poisson_2d_base) :: poisson
105  procedure(sll_i_function_of_position) :: func
106  sll_real64, intent(out) :: coefs_dofs(:)
107  end subroutine signature_update_dofs_function
108  end interface
109 
110  abstract interface
111 
112  ! Destructor
113 
114  subroutine signature_empty(poisson)
115  import sll_c_poisson_2d_base
116  class(sll_c_poisson_2d_base) :: poisson
117 
118  end subroutine signature_empty
119 
120  end interface
121 
122 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
123 
124 end module sll_m_poisson_2d_base
Module interface to solve Poisson equation in 2D.
Module to select the kind parameter.
    Report Typos and Errors