Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
sll_m_maxwell_1d_ps.F90
Go to the documentation of this file.
1 
6 
8 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9 #include "sll_memory.h"
10 #include "sll_working_precision.h"
11 
12  use sll_m_constants, only: &
13  sll_p_pi, &
15 
16  use sll_m_fft, only: &
17  sll_t_fft, &
23 
26 
27  use sll_m_maxwell_1d_base, only: &
30 
31  implicit none
32 
33  public :: &
35 
36  private
37  !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
40 
41  ! Fourier plans
42  type(sll_t_fft) :: plan_fw
43  type(sll_t_fft) :: plan_bw
44 
45  ! Eigenvalues
46  sll_real64, allocatable :: eig_d(:)
47  sll_real64, allocatable :: eig_interp1(:)
48  sll_real64, allocatable :: eig_interp1_inverse(:)
49  sll_real64, allocatable :: eig_interp1t_inverse(:)
50  sll_real64, allocatable :: eig_poisson(:)
51  sll_real64, allocatable :: eig_schur_curl_part(:) ! Schur complement in curl part computation
52 
53  sll_real64, allocatable :: eig_mixed(:)
54 
55  ! Scratch arrays
56  sll_real64, allocatable :: work(:)
57  sll_real64, allocatable :: wsave(:)
58 
59  !
60  sll_real64 :: domain(2)
61 
62 
63  contains
64  procedure :: &
65  compute_e_b => sll_s_compute_e_b_1d
66  procedure :: &
67  compute_e_from_b => compute_field_from_field_1d_ps
68  procedure :: &
69  compute_b_from_e => compute_field_from_field_1d_ps
70  procedure :: &
71  compute_curl_part => compute_curl_part_1d_ps
72  procedure :: &
73  compute_e_from_rho => compute_e_from_rho_1d_ps
74  procedure :: &
75  compute_rho_from_e => compute_rho_from_e_1d_ps
76  procedure :: &
77  compute_e_from_j => compute_e_from_j_1d_ps
78  procedure :: &
80  procedure :: &
81  l2norm_squared => l2norm_squared_1d_ps
82  procedure :: &
83  inner_product => inner_product_1d_ps
84  procedure :: &
86  procedure :: transform_dofs => transform_dofs_1d_ps
87  procedure :: multiply_mass => multiply_mass_1d_ps
88  procedure :: invert_mass => invert_mass_1d_ps
89  procedure :: multiply_g
90  procedure :: multiply_gt
91  procedure :: free => free_1d_ps
92  procedure :: &
93  init => init_1d_ps
94 
95  procedure :: grad_proj0
96  procedure :: proj1_grad
97 
98  procedure :: compute_phi_from_rho => compute_phi_from_rho_1d_ps
99  procedure :: compute_phi_from_j => compute_phi_from_j_1d_ps
100 
101 
102  end type sll_t_maxwell_1d_ps
103 
104 contains
105 
106  subroutine sll_s_compute_e_b_1d( self, delta_t, efield_dofs, bfield_dofs )
107  class(sll_t_maxwell_1d_ps) :: self
108  sll_real64, intent( in ) :: delta_t
109  sll_real64, intent( inout ) :: efield_dofs(:)
110  sll_real64, intent( inout ) :: bfield_dofs(:)
111 
112  end subroutine sll_s_compute_e_b_1d
113 
114  subroutine grad_proj0( self, in, out )
115  class(sll_t_maxwell_1d_ps), intent(inout) :: self
116  sll_real64, intent(in) :: in(:)
117  sll_real64, intent(out) :: out(:)
118 
119  self%wsave = in / sqrt(real(self%n_cells,f64))
120  call sll_s_fft_exec_r2r_1d( self%plan_fw, self%wsave, self%work )
121 
122 
123 
124  call complex_product_real( self%n_cells, self%eig_d, self%work, out )
125  end subroutine grad_proj0
126 
127  subroutine proj1_grad( self, in, out )
128  class(sll_t_maxwell_1d_ps), intent(inout) :: self
129  sll_real64, intent(in) :: in(:)
130  sll_real64, intent(out) :: out(:)
131 
132  self%wsave = in / sqrt(real(self%n_cells,f64))
133  call sll_s_fft_exec_r2r_1d( self%plan_fw, self%wsave, self%work )
134 
135  call complex_product_real( self%n_cells, self%eig_d, self%work, self%wsave )
136  call complex_product_real( self%n_cells, self%eig_interp1_inverse, self%wsave, out )
137 
138  end subroutine proj1_grad
139 
140 
141  subroutine init_1d_ps( self, domain, n_dofs )
142  class(sll_t_maxwell_1d_ps), intent(out) :: self
143  sll_real64, intent(in) :: domain(2) ! xmin, xmax
144  sll_int32, intent(in) :: n_dofs ! number of degrees of freedom (here number of cells and grid points)
145  ! local variables
146  sll_int :: ierr, k
147  sll_real64 :: cos_mode, sin_mode, factor, modulus, ni
148 
149  self%s_deg_0 = -1
150 
151  self%n_dofs0 = n_dofs
152  self%n_dofs1 = n_dofs
153  self%n_cells = n_dofs
154  ni = 1.0_f64/real(n_dofs,f64)
155  self%domain = domain
156  self%Lx = domain(2)-domain(1)
157  self%delta_x = self%Lx * ni
158  !print*, 'dx',self%delta_x
159  ! Initialise FFT
160  sll_allocate(self%work(n_dofs),ierr)
161  sll_allocate(self%wsave(n_dofs),ierr)
162  call sll_s_fft_init_r2r_1d( self%plan_fw, self%n_cells, self%work, self%wsave, sll_p_fft_forward, normalized=.false. )
163  call sll_s_fft_init_r2r_1d( self%plan_bw, self%n_cells, self%work, self%work, sll_p_fft_backward, normalized=.false. )
164 
165  ! Eigenvalues
166  sll_allocate( self%eig_d(n_dofs) , ierr )
167  sll_allocate( self%eig_interp1(n_dofs) , ierr )
168  sll_allocate( self%eig_interp1_inverse(n_dofs) , ierr )
169  sll_allocate( self%eig_interp1t_inverse(n_dofs) , ierr )
170  sll_allocate( self%eig_poisson(n_dofs) , ierr )
171  sll_allocate( self%eig_schur_curl_part(n_dofs) , ierr )
172  sll_allocate( self%eig_mixed(n_dofs), ierr )
173 
174 
175  ! Set the eigenvalues
176  self%eig_d(1) = 0.0_f64
177  self%eig_interp1(1) = 1.0_f64!self%Lx/n_dofs
178  self%eig_interp1_inverse(1) = 1.0_f64!n_dofs/self%Lx
179  self%eig_mixed(1) = 1.0_f64
180 
181  do k=1, (n_dofs+1)/2 - 1
182  cos_mode = cos(sll_p_twopi*ni*real(k, f64))
183  sin_mode = sin(sll_p_twopi*ni*real(k, f64))
184  factor = sll_p_twopi/self%Lx*real(k,f64)
185  modulus = (cos_mode-1.0_f64)**2 + sin_mode**2
186  ! real part first derivative
187  self%eig_d(k+1) = 0.0_f64
188  ! imaginary part first derivative
189  self%eig_d(n_dofs-k+1) = factor
190 
191  factor = factor * self%Lx*ni
192 
193  ! real part for interpolation 1
194  self%eig_interp1(k+1) = sin_mode/factor
195  self%eig_interp1(n_dofs-k+1) = (cos_mode-1.0_f64)/factor
196 
197  self%eig_mixed(k+1) = sin_mode/factor
198 
199  self%eig_interp1_inverse(k+1) = sin_mode/modulus * factor
200  self%eig_interp1_inverse(n_dofs-k+1) = (1.0_f64-cos_mode)/modulus * factor
201 
202  self%eig_mixed(n_dofs-k+1) = 0.0_f64
203  end do
204 
205  if ( modulo(n_dofs,2) == 0 ) then
206  self%eig_d(n_dofs/2 + 1) = 0.0_f64
207  self%eig_interp1(n_dofs/2+1) = 0.0_f64
208 
209  self%eig_interp1_inverse(n_dofs/2+1) = 0.0_f64
210 
211  self%eig_interp1t_inverse(1:n_dofs/2+1) = self%eig_interp1_inverse(1:n_dofs/2+1)
212  self%eig_interp1t_inverse(n_dofs/2+2:n_dofs) = -self%eig_interp1_inverse(n_dofs/2+2:n_dofs)
213  self%eig_poisson(n_dofs/2 + 1) = 0.0_f64
214 
215  self%eig_mixed(n_dofs/2 + 1) = 0.0_f64
216  else
217  self%eig_interp1t_inverse(1:n_dofs/2+1) = self%eig_interp1_inverse(1:n_dofs/2+1)
218  self%eig_interp1t_inverse(n_dofs/2+2:n_dofs) = -self%eig_interp1_inverse(n_dofs/2+2:n_dofs)
219  end if
220 
221  self%eig_poisson(1) = 0.0_f64
222 
223  do k=1,(n_dofs+1)/2 - 1
224  self%eig_poisson(k+1) = self%eig_interp1_inverse(n_dofs-k+1) / self%eig_d(n_dofs-k+1)
225  self%eig_poisson(n_dofs-k+1) = -self%eig_interp1_inverse(k+1) / self%eig_d(n_dofs-k+1)
226  end do
227 
228  end subroutine init_1d_ps
229 
230 
231  subroutine set_eig_schur_curl_part( self, delta_t )
232  class( sll_t_maxwell_1d_ps ), intent( inout ) :: self
233  sll_real64, intent( in ) :: delta_t
234 
235  sll_int32 :: k, n_dofs
236  sll_real64 :: factor
237 
238  n_dofs = self%n_cells
239  factor = 0.25_f64 * delta_t**2
240 
241  self%eig_schur_curl_part = 0.0_f64
242  self%eig_schur_curl_part(1) = 1.0_f64
243  do k=1, (n_dofs+1)/2 - 1
244  self%eig_schur_curl_part(k+1) = 1.0_f64/(1.0_f64 + factor * self%eig_d(n_dofs-k+1)**2)
245  !self%eig_schur_curl_part(n_dofs-k+1) = 0.0_f64
246  end do
247 
248  end subroutine set_eig_schur_curl_part
249 
250  subroutine free_1d_ps( self )
251  class(sll_t_maxwell_1d_ps) :: self
252 
253  end subroutine free_1d_ps
254 
255  function inner_product_1d_ps( self, coefs1_dofs, coefs2_dofs, degree, degree2 ) result (r)
256  class(sll_t_maxwell_1d_ps) :: self
257  sll_real64 :: coefs1_dofs(:)
258  sll_real64 :: coefs2_dofs(:)
259  sll_int32 :: degree
260  sll_int32, optional :: degree2
261  sll_real64 :: r
262 
263  if (present(degree2) ) then
264  if (degree .ne. degree2 ) then
265  call complex_product_real( self%n_cells, self%eig_mixed, coefs1_dofs, self%wsave )
266  r = self%wsave(1) * coefs2_dofs(1) * self%delta_x
267  r = r + sum(self%wsave(2:self%n_cells) * coefs2_dofs(2:self%n_cells) ) * self%delta_x * 2.0_f64
268  else
269  r = coefs1_dofs(1) * coefs2_dofs(1) * self%delta_x
270  r = r + sum(coefs1_dofs(2:self%n_cells) * coefs2_dofs(2:self%n_cells) ) * self%delta_x * 2.0_f64
271  end if
272  else
273  r = coefs1_dofs(1) * coefs2_dofs(1) * self%delta_x
274  r = r + sum(coefs1_dofs(2:self%n_cells) * coefs2_dofs(2:self%n_cells) ) * self%delta_x * 2.0_f64
275  end if
276 
277  end function inner_product_1d_ps
278 
279  function l2norm_squared_1d_ps(self, coefs_dofs, degree) result (r)
280  class(sll_t_maxwell_1d_ps) :: self
281  sll_real64 :: coefs_dofs(:)
282  sll_int32 :: degree
283  sll_real64 :: r
284 
285  r = coefs_dofs(1) * coefs_dofs(1) * self%delta_x
286  r = r + sum(coefs_dofs(2:self%n_cells) * coefs_dofs(2:self%n_cells) ) * self%delta_x * 2.0_f64
287 
288  end function l2norm_squared_1d_ps
289 
291  subroutine compute_e_from_j_1d_ps(self, current, component, E)
292  class(sll_t_maxwell_1d_ps) :: self
293  sll_real64,dimension(:),intent(in) :: current
294  sll_int32, intent(in) :: component
295  sll_real64,dimension(:),intent(inout) :: e
296 
297 
298  if ( component == 1 ) then
299  self%wsave = current
300  call sll_s_fft_exec_r2r_1d ( self%plan_fw, self%wsave, self%work )
301  e = e - self%work / sqrt(real(self%n_cells,f64))
302  elseif ( component == 2) then
303  self%wsave = current
304  call sll_s_fft_exec_r2r_1d ( self%plan_fw, self%wsave, self%work )
305  call complex_product_real( self%n_cells, self%eig_interp1_inverse, self%work, self%wsave )
306  e = e - self%wsave / sqrt(real(self%n_cells,f64))
307  else
308  print*, 'Component ', component, 'not implemented in compute_E_from_j_1d_ps.'
309  end if
310 
311 
312 
313  end subroutine compute_e_from_j_1d_ps
314 
315 
316  subroutine compute_field_from_field_1d_ps(self, delta_t, field_in, field_out)
317  class(sll_t_maxwell_1d_ps) :: self
318  sll_real64, intent(in) :: delta_t
319  sll_real64, intent(in) :: field_in(:)
320  sll_real64, intent(inout) :: field_out(:)
321 
322  call complex_product_real ( self%n_cells, self%eig_d, field_in, self%work )
323  field_out = field_out - delta_t * self%work
324 
325  end subroutine compute_field_from_field_1d_ps
326 
327  subroutine compute_curl_part_1d_ps( self, delta_t, efield, bfield, betar )
328  class(sll_t_maxwell_1d_ps) :: self
329  sll_real64, intent(in) :: delta_t
330  sll_real64, intent(inout) :: efield(:)
331  sll_real64, intent(inout) :: bfield(:)
332  sll_real64, optional :: betar
333  !local variables
334  sll_real64 :: factor
335  sll_real64 :: dth
336 
337  if( present(betar) ) then
338  factor = betar
339  else
340  factor = 1._f64
341  end if
342 
343  dth = 0.5_f64 * delta_t
344 
345  call set_eig_schur_curl_part( self, delta_t )
346 
347  self%wsave = bfield
348  call self%compute_b_from_e ( dth, efield, self%wsave )
349  call self%compute_e_from_b ( dth, bfield*factor, efield )
350 
351  call self%compute_b_from_e ( dth, efield, self%wsave )
352 
353  call complex_product_real ( self%n_cells, self%eig_schur_curl_part, self%wsave, bfield )
354  call self%compute_e_from_b( dth, bfield*factor, efield )
355 
356  end subroutine compute_curl_part_1d_ps
357 
358 
359  subroutine transform_dofs_1d_ps(self, in, out, degree)
360  class(sll_t_maxwell_1d_ps), intent(inout) :: self
361  sll_int32, intent(in) :: degree ! this is 0 for 0 form and 1 for 1 form
362  sll_real64, intent(in) :: in(:) ! spline coefficients of projection
363  sll_real64, intent(out) :: out(:) ! spline coefficients of projection
364  ! local variables
365 
366  if ( degree == 0 ) then
367  ! Backward FFT
368  self%wsave = in
369  call sll_s_fft_exec_r2r_1d( self%plan_bw, self%wsave, out )
370  ! normalize
371  out = out / sqrt(real(self%n_cells, f64)) * self%delta_x
372  elseif ( degree == 1 ) then
373  call complex_product_real( self%n_cells, self%eig_interp1t_inverse, in, self%wsave )
374  ! Backward FFT
375  call sll_s_fft_exec_r2r_1d( self%plan_bw, self%wsave, out )
376  ! normalize
377  out = out / sqrt(real(self%n_cells, f64)) * self%delta_x
378  elseif ( degree == 2 ) then
379  !self%work = in
380  call complex_product_real( self%n_cells, self%eig_interp1t_inverse, in, self%work )
381  call complex_product_real( self%n_cells, self%eig_mixed, self%work, self%wsave )
382  call sll_s_fft_exec_r2r_1d( self%plan_bw, self%wsave, out )
383  ! normalize
384  out = out / sqrt(real(self%n_cells, f64)) * self%delta_x
385  elseif ( degree == 3 ) then
386  call complex_product_real( self%n_cells, self%eig_interp1t_inverse, in, self%work )
387  call complex_product_real( self%n_cells, self%eig_mixed, self%work, self%wsave )
388  call sll_s_fft_exec_r2r_1d( self%plan_bw, self%wsave, out )
389  ! normalize
390  out = out / sqrt(real(self%n_cells, f64)) * self%delta_x
391  else
392  print*, 'Component', degree, 'not defined in maxwell_1d_ps.'
393  end if
394 
395  end subroutine transform_dofs_1d_ps
396 
397 
398  subroutine compute_e_from_rho_1d_ps(self, field_in, field_out )
399  class(sll_t_maxwell_1d_ps) :: self
400  sll_real64, intent(in) :: field_in(:) !rho
401  sll_real64, intent(out) :: field_out(:) !E
402 
403  ! Fourier transform rho
404  self%wsave = field_in/sqrt(real(self%n_cells,f64))
405  call sll_s_fft_exec_r2r_1d ( self%plan_fw, self%wsave, self%work )
406  ! Invert the Interpolation
407  call complex_product_real( self%n_cells, self%eig_poisson, self%work, field_out )
408 
409  end subroutine compute_e_from_rho_1d_ps
410 
411  subroutine compute_rho_from_e_1d_ps(self, field_in, field_out )
412  class(sll_t_maxwell_1d_ps) :: self
413  sll_real64, intent(in) :: field_in(:) !rho
414  sll_real64, intent(out) :: field_out(:) !E
415 
416  call complex_product_real( self%n_cells, self%eig_d, field_in, self%wsave )
417  call complex_product_real( self%n_cells, self%eig_interp1, self%wsave, self%work )
418  call sll_s_fft_exec_r2r_1d( self%plan_bw, self%work, field_out )
419  field_out = field_out / sqrt(real(self%n_cells,f64))
420 
421  end subroutine compute_rho_from_e_1d_ps
422 
423  ! Helper function
424  subroutine complex_product_real(n_dofs, eigvals, in, out)
425  sll_int32, intent(in) :: n_dofs
426  sll_real64, intent(in) :: eigvals(:) ! eigenvalues of circulant matrix
427  sll_real64, intent(in) :: in(:)
428  sll_real64, intent(out) :: out(:)
429  ! local variables
430  sll_int32 :: k
431  sll_real64 :: re, im
432 
433 
434  out(1) = in(1) * eigvals(1)
435  do k=2, (n_dofs+1)/2
436  re = in(k) * eigvals(k) - &
437  in(n_dofs-k+2) * eigvals(n_dofs-k+2)
438  im = in(k) * eigvals(n_dofs-k+2) + &
439  in(n_dofs-k+2) * eigvals(k)
440  out(k) = re
441  out(n_dofs-k+2) = im
442  end do
443  if ( modulo(n_dofs,2) == 0 ) then
444  out(n_dofs/2+1) = in(n_dofs/2+1)*eigvals(n_dofs/2+1)
445  end if
446 
447  end subroutine complex_product_real
448 
449 
450  subroutine multiply_mass_1d_ps( self, in, out, degree)
451  class(sll_t_maxwell_1d_ps), intent(inout) :: self
452  sll_real64, intent(in) :: in(:)
453  sll_real64, intent(out) :: out(:)
454  sll_int32, intent(in) :: degree
455 
456  out = in * self%delta_x!self%Lx
457 
458  end subroutine multiply_mass_1d_ps
459 
460  subroutine invert_mass_1d_ps(self, in, out, degree)
461  class(sll_t_maxwell_1d_ps), intent(inout) :: self
462  sll_int32, intent(in) :: degree
463  sll_real64, intent(in) :: in(:) ! spline coefficients of projection
464  sll_real64, intent(out) :: out(:) ! spline coefficients of projection
465 
466  out = in / self%delta_x !self%Lx
467 
468  end subroutine invert_mass_1d_ps
469 
470  subroutine multiply_g( self, in, out)
471  class(sll_t_maxwell_1d_ps), intent(in) :: self
472  sll_real64, intent(in) :: in(:)
473  sll_real64, intent(out) :: out(:)
474 
475  call complex_product_real( self%n_cells, self%eig_d, in, out )
476 
477  end subroutine multiply_g
478 
479 
480  subroutine multiply_gt( self, in, out)
481  class(sll_t_maxwell_1d_ps), intent(in) :: self
482  sll_real64, intent(in) :: in(:)
483  sll_real64, intent(out) :: out(:)
484 
485  call complex_product_real( self%n_cells, self%eig_d, in, out )
486  out = - out
487 
488  end subroutine multiply_gt
489 
492  subroutine compute_rhs_from_function(self, func, degree, coefs_dofs)
493  class(sll_t_maxwell_1d_ps) :: self
494  procedure(sll_i_function_1d_real64) :: func
495  sll_int32, intent(in) :: degree
496  sll_real64, intent(out) :: coefs_dofs(:) ! Finite Element right-hand-side
497 
498  ! local variables
499  sll_int32 :: k
500  sll_real64 :: x
501 
502  do k=1, self%n_cells
503  x = self%domain(1) + self%delta_x * real(k-1, f64)
504  coefs_dofs(k) = func( x )
505  end do
506 
507 
508  end subroutine compute_rhs_from_function
509 
511  subroutine l2projection(self, func, degree, coefs_dofs)
512  class(sll_t_maxwell_1d_ps) :: self
513  procedure(sll_i_function_1d_real64) :: func
514  sll_int32, intent(in) :: degree
515  sll_real64, intent(out) :: coefs_dofs(:) ! spline coefficients of projection
516 
517 
518  call self%compute_rhs_from_function( func, degree, self%wsave )
519 
520  call sll_s_fft_exec_r2r_1d ( self%plan_fw, self%wsave, coefs_dofs )
521  coefs_dofs = coefs_dofs/sqrt(real(self%n_cells,f64))
522 
523  end subroutine l2projection
524 
525 
527  subroutine compute_phi_from_rho_1d_ps( self, in, phi, efield )
528  class(sll_t_maxwell_1d_ps) :: self
529  sll_real64, intent(in) :: in(:)
530  sll_real64, intent(out) :: phi(:)
531  sll_real64, intent(out) :: efield(:)
532 
533  ! Compute phi by inverting the mass matrix
534  call self%invert_mass( in, phi, self%s_deg_0 )
535 
536  ! Compute the degrees of freedom of the electric field as -G phi
537  call complex_product_real( self%n_cells, self%eig_d, phi, efield )
538  efield = -efield
539 
540  end subroutine compute_phi_from_rho_1d_ps
541 
542 
544  subroutine compute_phi_from_j_1d_ps( self, in, phi, efield )
545  class(sll_t_maxwell_1d_ps) :: self
546  sll_real64, intent(in) :: in(:)
547  sll_real64, intent(out) :: phi(:)
548  sll_real64, intent(out) :: efield(:)
549 
550  ! Compute divergence of the current (G^T current) (assuming a 1v model)
551  self%wsave = in
552  call complex_product_real( self%n_cells, self%eig_d, self%wsave, self%work )
553 
554  ! Compute phi by inverting the mass matrix
555  call self%invert_mass( self%work, self%wsave, self%s_deg_0 )
556  phi = phi + self%wsave
557 
558  ! Compute the degrees of freedom of the electric field as -G phi
559  call complex_product_real( self%n_cells, self%eig_d, phi, efield )
560  efield = -efield
561 
562  end subroutine compute_phi_from_j_1d_ps
563 
564 end module sll_m_maxwell_1d_ps
Fortran module where set some physical and mathematical constants.
real(kind=f64), parameter, public sll_p_pi
real(kind=f64), parameter, public sll_p_twopi
FFT interface for FFTW.
subroutine, public sll_s_fft_free(plan)
Delete a plan.
integer, parameter, public sll_p_fft_forward
Flag to specify forward FFT (negative sign) [value -1].
subroutine, public sll_s_fft_init_r2r_1d(plan, nx, array_in, array_out, direction, normalized, aligned, optimization)
Create new 1d real to real plan.
integer, parameter, public sll_p_fft_backward
Flag to specify backward FFT (positive sign) [value 1].
subroutine, public sll_s_fft_exec_r2r_1d(plan, array_in, array_out)
Compute fast Fourier transform in real to real mode.
real(kind=f64) function, dimension(2, 1:npoints), public sll_f_gauss_legendre_points_and_weights(npoints, a, b)
Returns a 2d array of size (2,npoints) containing gauss-legendre points and weights in the interval [...
Module interface to solve Maxwell's equations in 1D.
Solve Maxwell's equations in 1D based on a pseudospectral solver.
subroutine multiply_gt(self, in, out)
subroutine complex_product_real(n_dofs, eigvals, in, out)
real(kind=f64) function inner_product_1d_ps(self, coefs1_dofs, coefs2_dofs, degree, degree2)
subroutine compute_rhs_from_function(self, func, degree, coefs_dofs)
Compute the FEM right-hand-side for a given function f and periodic splines of given degree Its compo...
subroutine l2projection(self, func, degree, coefs_dofs)
Compute the L2 projection of a given function f on periodic splines of given degree.
real(kind=f64) function l2norm_squared_1d_ps(self, coefs_dofs, degree)
subroutine set_eig_schur_curl_part(self, delta_t)
subroutine proj1_grad(self, in, out)
subroutine invert_mass_1d_ps(self, in, out, degree)
subroutine init_1d_ps(self, domain, n_dofs)
subroutine grad_proj0(self, in, out)
subroutine compute_phi_from_j_1d_ps(self, in, phi, efield)
For model with adiabatic electrons.
subroutine compute_rho_from_e_1d_ps(self, field_in, field_out)
subroutine sll_s_compute_e_b_1d(self, delta_t, efield_dofs, bfield_dofs)
subroutine compute_curl_part_1d_ps(self, delta_t, efield, bfield, betar)
subroutine free_1d_ps(self)
subroutine compute_phi_from_rho_1d_ps(self, in, phi, efield)
For model with adiabatic electrons.
subroutine multiply_g(self, in, out)
subroutine compute_e_from_j_1d_ps(self, current, component, E)
Compute E_i from j_i integrated over the time interval using weak Ampere formulation
subroutine transform_dofs_1d_ps(self, in, out, degree)
subroutine compute_field_from_field_1d_ps(self, delta_t, field_in, field_out)
subroutine multiply_mass_1d_ps(self, in, out, degree)
subroutine compute_e_from_rho_1d_ps(self, field_in, field_out)
Type for FFT plan in SeLaLib.
Maxwell solver class with pseudospectral method.
    Report Typos and Errors