Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
sll_m_time_propagator_pic_vm_1d2v_ecsim2o.F90
Go to the documentation of this file.
1 
6  !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
7 #include "sll_assert.h"
8 #include "sll_memory.h"
9 #include "sll_working_precision.h"
10 
11  use sll_m_collective, only: &
14 
15  use sll_m_time_propagator_base, only: &
17 
20 
21  use sll_m_particle_group_base, only: &
23 
24  use sll_m_low_level_bsplines, only: &
25  sll_s_uniform_bsplines_eval_basis
26 
29 
30  use mpi, only: &
31  mpi_sum
32 
33  use sll_m_linear_operator_ecsim_eb, only : &
35 
36  use sll_m_linear_operator_ecsim_ev, only : &
38 
39  use sll_m_linear_solver_mgmres, only : &
41 
42  use sll_m_spline_fem_utilities, only : &
44 
45  implicit none
46 
47  public :: &
49 
50  private
51  !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
52 
55  class(sll_c_particle_mesh_coupling_1d), pointer :: kernel_smoother_0
56  class(sll_c_particle_mesh_coupling_1d), pointer :: kernel_smoother_1
57  class(sll_t_particle_array), pointer :: particle_group
58  sll_int32 :: spline_degree
59  sll_real64 :: lx
60  sll_real64 :: x_min
61  sll_real64 :: domain(2)
62  sll_real64 :: delta_x
63  sll_int32 :: n_dofs
64 
65  sll_real64 :: cell_integrals_0(4)
66  sll_real64 :: cell_integrals_1(3)
67 
68 
69  sll_real64, pointer :: efield_dofs(:,:)
70  sll_real64, allocatable :: efield_dofs_local(:)
71  sll_real64, pointer :: bfield_dofs(:)
72  sll_real64, allocatable :: j_dofs(:,:)
73  sll_real64, allocatable :: j_dofs_local(:,:)
74  sll_real64, allocatable :: rho_dofs(:)
75  sll_real64, allocatable :: rho_dofs_local(:)
76 
77 
78  sll_real64, allocatable :: mass_line_0(:)
79  sll_real64, allocatable :: mass_line_1(:)
80 
81  sll_real64, allocatable :: m1(:,:),m2(:,:),m4(:,:)
82  sll_real64, allocatable :: m1_local(:,:),m2_local(:,:),m4_local(:,:)
83  type(sll_t_linear_operator_ecsim_eb) :: linear_operator_eb
84  type(sll_t_linear_solver_mgmres) :: linear_solver_eb
85  type(sll_t_linear_operator_ecsim_ev) :: linear_operator_ev
86  type(sll_t_linear_solver_mgmres) :: linear_solver_ev
87 
88 contains
89  procedure :: advect_x => advect_x_pic_vm_1d2v_ecsim2o
90  procedure :: advect_ev => advect_ev_pic_vm_1d2v_ecsim2o
91  procedure :: advect_eb => advect_eb_pic_vm_1d2v_ecsim2o
92  procedure :: lie_splitting => lie_splitting_pic_vm_1d2v_ecsim2o
93  procedure :: lie_splitting_back => lie_splitting_back_pic_vm_1d2v_ecsim2o
94  procedure :: strang_splitting => strang_splitting_pic_vm_1d2v_ecsim2o
95 
96  procedure :: init => initialize_pic_vm_1d2v_ecsim2o
97  procedure :: free => delete_pic_vm_1d2v_ecsim2o
98 
100 
101 contains
102 
104 subroutine strang_splitting_pic_vm_1d2v_ecsim2o(self,dt, number_steps)
105  class(sll_t_time_propagator_pic_vm_1d2v_ecsim2o), intent(inout) :: self
106  sll_real64, intent(in) :: dt
107  sll_int32, intent(in) :: number_steps
108  ! local variable
109  sll_int32 :: i_step
110 
111  do i_step = 1, number_steps
112  call self%advect_x(dt*0.5_f64)
113  call self%advect_eb(dt*0.5_f64)
114  call self%advect_ev(dt)
115  call self%advect_eb(dt*0.5_f64)
116  call self%advect_x(dt*0.5_f64)
117  end do
118 
119 
120 
122 
124 subroutine lie_splitting_pic_vm_1d2v_ecsim2o(self,dt, number_steps)
125  class(sll_t_time_propagator_pic_vm_1d2v_ecsim2o), intent(inout) :: self
126  sll_real64, intent(in) :: dt
127  sll_int32, intent(in) :: number_steps
128  ! local variable
129  sll_int32 :: i_step
130 
131  do i_step = 1, number_steps
132  call self%advect_x(dt)
133  call self%advect_eb(dt)
134  call self%advect_ev(dt)
135 
136  end do
137 
139 
141 subroutine lie_splitting_back_pic_vm_1d2v_ecsim2o(self,dt, number_steps)
142  class(sll_t_time_propagator_pic_vm_1d2v_ecsim2o), intent(inout) :: self
143  sll_real64, intent(in) :: dt
144  sll_int32, intent(in) :: number_steps
145  ! local variable
146  sll_int32 :: i_step
147 
148  do i_step = 1, number_steps
149  call self%advect_ev(dt)
150  call self%advect_eb(dt)
151  call self%advect_x(dt)
152  end do
153 
155 
156 !---------------------------------------------------------------------------!
157 subroutine advect_x_pic_vm_1d2v_ecsim2o ( self, dt )
158  class(sll_t_time_propagator_pic_vm_1d2v_ecsim2o), intent(inout) :: self
159  sll_real64, intent(in) :: dt
160  ! local variables
161  sll_int32 :: i_part, i_sp
162  sll_real64 :: xi(3), vi(3)
163 
164  do i_sp = 1,self%particle_group%n_species
165  do i_part=1,self%particle_group%group(i_sp)%n_particles
166  ! Read out particle position and velocity
167  xi = self%particle_group%group(i_sp)%get_x(i_part)
168  vi = self%particle_group%group(i_sp)%get_v(i_part)
169 
170  xi(1) = xi(1) + dt * vi(1)
171  xi(1) = modulo(xi(1), self%Lx)
172  call self%particle_group%group(i_sp)%set_x ( i_part, xi )
173  end do
174  end do
175 
176 end subroutine advect_x_pic_vm_1d2v_ecsim2o
177 
178 !---------------------------------------------------------------------------!
179 subroutine advect_eb_pic_vm_1d2v_ecsim2o ( self, dt )
180  class(sll_t_time_propagator_pic_vm_1d2v_ecsim2o), intent(inout) :: self
181  sll_real64, intent(in) :: dt
182  sll_real64 :: rhs(2*self%n_dofs)
183  sll_real64 :: scratch(2*self%n_dofs)
184  self%linear_operator_eb%dt=dt
185  self%linear_operator_eb%dx=self%delta_x
186  rhs=0.0_f64
187 
188  call righthandside_eb( self, dt, rhs)
189  call self%linear_solver_eb%set_guess([self%efield_dofs(:,2),self%bfield_dofs])
190  call self%linear_solver_eb%solve(rhs, scratch)
191 
192  self%efield_dofs(:,2)=scratch(1:self%n_dofs)
193  self%bfield_dofs= scratch(self%n_dofs+1:2*self%n_dofs)
194 end subroutine advect_eb_pic_vm_1d2v_ecsim2o
195 
196 
197 
198 !---------------------------------------------------------------------------!
199 subroutine advect_ev_pic_vm_1d2v_ecsim2o ( self, dt )
200  class(sll_t_time_propagator_pic_vm_1d2v_ecsim2o), intent(inout) :: self
201  sll_real64, intent(in) :: dt
202  ! local variables
203  sll_int32 :: i_part, i_sp
204  sll_real64 :: vi(3),v_new(3), xi(3), wi
205  sll_real64 :: qm, beta
206  sll_real64 :: mu
207  sll_real64 :: efield(2), bfield
208  sll_real64 :: scratch(2*self%n_dofs)
209  sll_real64 :: rhs(2*self%n_dofs)
210 
211  self%linear_operator_ev%dt=dt
212  self%linear_operator_ev%dx=self%delta_x
213  ! Set to zero
214  self%j_dofs_local = 0.0_f64
215  self%j_dofs = 0.0_f64
216  self%rho_dofs_local = 0.0_f64
217  self%rho_dofs = 0.0_f64
218  self%m1=0.0_f64
219  self%m2=0.0_f64
220  self%m4=0.0_f64
221  self%m1_local=0.0_f64
222  self%m2_local=0.0_f64
223  self%m4_local=0.0_f64
224  rhs=0.0_f64
225  scratch=0.0_f64
226  bfield=0.0_f64
227  efield=0.0_f64
228 
229  ! First particle loop
230  do i_sp = 1, self%particle_group%n_species
231  qm = self%particle_group%group(i_sp)%species%q_over_m();
232  beta=qm*dt* 0.5_f64;
233  do i_part = 1,self%particle_group%group(i_sp)%n_particles
234  ! Read out particle position and velocity
235  vi = self%particle_group%group(i_sp)%get_v(i_part)
236  xi = self%particle_group%group(i_sp)%get_x(i_part)
237 
238  ! Get charge for accumulation of j
239  wi = self%particle_group%group(i_sp)%get_charge(i_part)
240  call self%kernel_smoother_1%evaluate &
241  (xi(1), self%bfield_dofs, bfield)
242  mu=(1+(beta*bfield)**2.0_f64)
243 
244  ! Accumulate jx
245  call self%kernel_smoother_1%add_charge( xi(1), wi*(vi(1)+vi(2)*beta* bfield)/mu, self%j_dofs_local(:,1) )
246 
247  ! Accumulate jy
248  call self%kernel_smoother_0%add_charge( xi(1), wi*(vi(2)-vi(1)*beta* bfield)/mu, self%j_dofs_local(:,2) )
249 
250  !Compute particle-mass matrices m1,m2,m4
251  call self%kernel_smoother_1%add_particle_mass( xi(1), (beta*wi)/mu,self%m1_local)
252 
253  call add_particle_mass_mixed_spline_1d(self, self%kernel_smoother_0, self%spline_degree, self%spline_degree-1, xi(1), -(beta**2.0_f64*wi*bfield)/mu,self%m2_local)
254 
255  call self%kernel_smoother_0%add_particle_mass( xi(1), (beta*wi)/mu,self%m4_local)
256 
257  end do
258  end do
259 
260  ! MPI to sum up contributions from each processor
261  call sll_o_collective_allreduce( sll_v_world_collective, self%j_dofs_local(:,1), &
262  self%kernel_smoother_1%n_dofs, mpi_sum, self%j_dofs(:,1) )
263  call sll_o_collective_allreduce( sll_v_world_collective, self%j_dofs_local(:,2), &
264  self%kernel_smoother_1%n_dofs, mpi_sum, self%j_dofs(:,2) )
265  call sll_o_collective_allreduce( sll_v_world_collective, self%m1_local, &
266  self%kernel_smoother_1%n_dofs*self%spline_degree, mpi_sum, self%m1 )
267  call sll_o_collective_allreduce( sll_v_world_collective, self%m2_local, &
268  self%kernel_smoother_0%n_dofs*2*self%spline_degree, mpi_sum, self%m2 )
269  call sll_o_collective_allreduce( sll_v_world_collective, self%m4_local, &
270  self%kernel_smoother_0%n_dofs* (self%spline_degree+1), mpi_sum, self%m4 )
271 
272  ! maxwell equations solved for fields at next timestep
273  call righthandside_ev( self, dt, rhs)
274  call self%linear_solver_ev%set_guess([self%efield_dofs(:,1),self%efield_dofs(:,2)])
275  call self%linear_solver_ev%solve(rhs, scratch)
276 
277 
278  self%efield_dofs(:,1)=0.5_f64*(scratch(1:self%n_dofs)+self%efield_dofs(:,1))
279  self%efield_dofs(:,2)=0.5_f64*(scratch(self%n_dofs+1:2*self%n_dofs)+self%efield_dofs(:,2))
280  bfield=0.0_f64
281  efield=0.0_f64
282  ! Second particle loop for v update
283  do i_sp = 1, self%particle_group%n_species
284  qm = self%particle_group%group(i_sp)%species%q_over_m();
285  beta=qm*dt* 0.5_f64;
286  do i_part = 1,self%particle_group%group(i_sp)%n_particles
287  ! Read out particle position and velocity
288  vi = self%particle_group%group(i_sp)%get_v(i_part)
289  xi = self%particle_group%group(i_sp)%get_x(i_part)
290  ! evaluate fields at particle position
291  call self%kernel_smoother_1%evaluate &
292  (xi(1), self%bfield_dofs, bfield)
293  mu=1+(beta*bfield)**2.0_f64
294  call self%kernel_smoother_1%evaluate &
295  (xi(1), self%efield_dofs(:,1), efield(1))
296  call self%kernel_smoother_0%evaluate &
297  (xi(1), self%efield_dofs(:,2), efield(2))
298 
299  !calculate v**(n+1/2)
300  v_new(1)=(vi(1)+beta*efield(1)+beta*bfield*(vi(2)+beta*efield(2)))/mu
301  v_new(2)=(vi(2)+beta*efield(2)-beta*bfield*(vi(1)+beta*efield(1)))/mu
302 
303 
304  v_new(1)=2.0_f64*v_new(1)-vi(1)
305  v_new(2)=2.0_f64*v_new(2)-vi(2)
306 
307  call self%particle_group%group(i_sp)%set_v(i_part, v_new)
308  end do
309  end do
310 
311  ! update fields
312  self%efield_dofs(:,1)= scratch(1:self%n_dofs)
313  self%efield_dofs(:,2)= scratch(self%n_dofs+1:2*self%n_dofs)
314 
315 
316 end subroutine advect_ev_pic_vm_1d2v_ecsim2o
317 
318 
320 subroutine add_particle_mass_mixed_spline_1d(self, kernel_smoother, degree1, degree2, position, marker_charge, particle_mass)
321  class(sll_t_time_propagator_pic_vm_1d2v_ecsim2o), intent(inout) :: self
322  class(sll_c_particle_mesh_coupling_1d), intent( in ) :: kernel_smoother
323  sll_int32, intent( in ) :: degree1
324  sll_int32, intent( in ) :: degree2
325  sll_real64, intent( in ) :: position(self%kernel_smoother_1%dim)
326  sll_real64, intent( in ) :: marker_charge
327  sll_real64, intent( inout ) :: particle_mass(:,:)
328  !local variables
329  sll_int32 :: i1, column
330  sll_int32 :: index1d, index
331  sll_real64 :: xi(1)
332  sll_real64 :: spline_val1(degree1+1)
333  sll_real64 :: spline_val2(degree2+1)
334 
335  sll_assert( size(particle_mass,1) == degree1+degree2+1 )
336  sll_assert( size(particle_mass,2) == kernel_smoother%n_dofs )
337 
338  xi(1) = (position(1) - self%x_min)/self%delta_x
339  index = ceiling(xi(1))
340  xi(1) = xi(1) - real(index-1, f64)
341  index = index - degree1
342 
343 
344  call sll_s_uniform_bsplines_eval_basis(degree1, xi(1), spline_val1)
345  call sll_s_uniform_bsplines_eval_basis(degree2, xi(1), spline_val2)
346 
347  do i1 = 1, degree1+1
348  index1d = modulo(index+i1-2,kernel_smoother%n_cells)+1 !index-degree1:index
349  do column = 1, degree2+1
350  particle_mass(column+degree1+1-i1, index1d) = particle_mass(column+degree1+1-i1, index1d)+ &
351  marker_charge * spline_val1(i1) * spline_val2(column)
352  end do
353  end do
354 
356 
358 subroutine righthandside_eb (self,dt,rhs)
359  class(sll_t_time_propagator_pic_vm_1d2v_ecsim2o), intent(inout) :: self
360  sll_real64, intent(in) :: dt
361  sll_real64, intent(out):: rhs(2*self%n_dofs)
362  ! local variables
363  sll_int32 :: row, column
364  sll_real64 :: scratch(self%n_dofs+1) ! scratch data
365  ! set to zero
366  scratch=0.0_f64
367  do row=1, self%n_dofs
368  ! multiply field-dofs with diagonal entries of mass and particle-mass matrix and substract current
369  rhs(row)= self%mass_line_0(1)*self%efield_dofs(row,2)
370  scratch(row)=self%mass_line_1(1)*self%bfield_dofs(row)
371  do column = 2, self%spline_degree
372  scratch(row)=scratch(row)+&
373  self%mass_line_1(column) * &
374  (self%bfield_dofs(modulo(row+column-2,self%n_dofs)+1) +&
375  self%bfield_dofs(modulo(row-column,self%n_dofs)+1))
376  end do
377  do column = 2, self%spline_degree+1
378  rhs(row) = rhs(row) +&
379  self%mass_line_0(column) * &
380  (self%efield_dofs(modulo(row+column-2,self%n_dofs)+1,2) +&
381  self%efield_dofs(modulo(row-column,self%n_dofs)+1,2))
382  end do
383 
384  end do
385  scratch(self%n_dofs+1)=scratch(1)
386  do row=1, self%n_dofs
387  ! update efield with curl of bfield
388  rhs(row)= rhs(row)+&
389  0.5_f64*dt/self%delta_x*(scratch(row)-scratch(row+1))
390  ! update bfield with curl of efield
391  rhs(self%n_dofs+row)=self%bfield_dofs(row)-&
392  0.5_f64*dt/self%delta_x*(self%efield_dofs(row,2)-self%efield_dofs(modulo(row-2,self%n_dofs)+1,2))
393 
394  end do
395 end subroutine righthandside_eb
396 
397 
398 
400 subroutine righthandside_ev (self,dt,rhs)
401  class(sll_t_time_propagator_pic_vm_1d2v_ecsim2o), intent(inout) :: self
402  sll_real64, intent(in) :: dt
403  sll_real64, intent(out):: rhs(2*self%n_dofs)
404  ! local variables
405  sll_int32 :: row, column
406 
407  do row=1, self%n_dofs
408  ! multiply field-dofs with diagonal entries of mass and particle-mass matrix and substract current
409  rhs(row) = (self%mass_line_1(1)-0.5_f64*dt*self%m1(1,row))*self%efield_dofs(row,1)-dt*self%j_dofs(row,1)
410  rhs(self%n_dofs+row)= (self%mass_line_0(1)-0.5_f64*dt*self%m4(1,row))*self%efield_dofs(row,2)-dt*self%j_dofs(row,2)
411 
412  do column = 2, self%spline_degree
413  rhs(row) = rhs(row) +&
414  self%mass_line_1(column) * &
415  (self%efield_dofs(modulo(row+column-2,self%n_dofs)+1,1) +&
416  self%efield_dofs(modulo(row-column,self%n_dofs)+1,1))-&
417  0.5_f64*dt*self%m1(column,row) * &
418  self%efield_dofs(modulo(row+column-2,self%n_dofs)+1,1)-&
419  0.5_f64*dt*self%m1(column,modulo(row-column,self%n_dofs)+1) * &
420  self%efield_dofs(modulo(row-column,self%n_dofs)+1,1)
421 
422  end do
423  do column = 2, self%spline_degree+1
424  rhs(self%n_dofs+row) = rhs(self%n_dofs+row) +&
425  self%mass_line_0(column) * &
426  (self%efield_dofs(modulo(row+column-2,self%n_dofs)+1,2) +&
427  self%efield_dofs(modulo(row-column,self%n_dofs)+1,2))-&
428  0.5_f64*dt*self%m4(column,row)*&
429  self%efield_dofs(modulo(row+column-2,self%n_dofs)+1,2)-&
430  0.5_f64*dt*self%m4(column,modulo(row-column,self%n_dofs)+1)*&
431  self%efield_dofs(modulo(row-column,self%n_dofs)+1,2)
432  end do
433  ! multiply efields with entries of m2 and m3
434  do column = 1, 2*self%spline_degree
435  rhs(row) = rhs(row) + &
436  0.5_f64*dt*self%m2(7-column,modulo(column-4+row-1,self%n_dofs)+1) *&
437  self%efield_dofs(modulo(row+column-self%spline_degree-2,self%n_dofs)+1,2)
438  rhs(row+self%n_dofs) = rhs(row+self%n_dofs) - &
439  0.5_f64*dt*self%m2(column,row) *&
440  self%efield_dofs(modulo(row+column-self%spline_degree-1,self%n_dofs)+1,1)
441  end do
442  end do
443 
444 
445 
446 end subroutine righthandside_ev
447 
448 
449 !---------------------------------------------------------------------------!
452  self, &
453  kernel_smoother_0, &
454  kernel_smoother_1, &
455  particle_group, &
456  efield_dofs, &
457  bfield_dofs, &
458  x_min, &
459  Lx, &
460  solver_tolerance )
461  class(sll_t_time_propagator_pic_vm_1d2v_ecsim2o), intent(out) :: self
462  class(sll_c_particle_mesh_coupling_1d), target, intent(in) :: kernel_smoother_0
463  class(sll_c_particle_mesh_coupling_1d), target, intent(in) :: kernel_smoother_1
464  class(sll_t_particle_array), target, intent(in) :: particle_group
465  sll_real64, target, intent(in) :: efield_dofs(:,:)
466  sll_real64, target, intent(in) :: bfield_dofs(:)
467  sll_real64, intent(in) :: x_min
468  sll_real64, intent(in) :: lx
469  sll_real64, intent(in), optional :: solver_tolerance
470  !local variable
471  sll_int32 :: ierr
472 
473 
474  self%kernel_smoother_0 => kernel_smoother_0
475  self%kernel_smoother_1 => kernel_smoother_1
476  self%particle_group => particle_group
477  self%efield_dofs => efield_dofs
478  self%bfield_dofs => bfield_dofs
479 
480  ! Check that n_dofs is the same for both kernel smoothers.
481  sll_assert( self%kernel_smoother_0%n_dofs == self%kernel_smoother_1%n_dofs )
482  sll_allocate(self%j_dofs(self%kernel_smoother_0%n_dofs,2), ierr)
483  sll_allocate(self%j_dofs_local(self%kernel_smoother_0%n_dofs,2), ierr)
484 
485  self%spline_degree = self%kernel_smoother_0%spline_degree
486  self%x_min = x_min
487  self%Lx = lx
488  self%domain=[x_min,x_min+lx]
489  self%delta_x = self%Lx/real(self%kernel_smoother_1%n_dofs,f64)
490  self%n_dofs=self%kernel_smoother_1%n_dofs
491 
492  self%cell_integrals_1 = [0.5_f64, 2.0_f64, 0.5_f64]
493  self%cell_integrals_1 = self%cell_integrals_1 / 3.0_f64
494 
495  self%cell_integrals_0 = [1.0_f64,11.0_f64,11.0_f64,1.0_f64]
496  self%cell_integrals_0 = self%cell_integrals_0 / 24.0_f64
497 
498 
499  allocate( self%mass_line_0( self%spline_degree +1) )
500  allocate( self%mass_line_1( self%spline_degree ) )
501  call sll_s_spline_fem_mass_line ( self%spline_degree, self%mass_line_0 )
502  call sll_s_spline_fem_mass_line ( self%spline_degree-1, self%mass_line_1 )
503 
504  ! Scale with dx
505  self%mass_line_0 = self%mass_line_0 * self%delta_x
506  self%mass_line_1 = self%mass_line_1 * self%delta_x
507 
508 
509  sll_allocate(self%rho_dofs(self%kernel_smoother_0%n_dofs), ierr)
510  sll_allocate(self%rho_dofs_local(self%kernel_smoother_0%n_dofs), ierr)
511  sll_allocate(self%efield_dofs_local(self%kernel_smoother_1%n_dofs), ierr)
512 
513  allocate(self%m1(self%spline_degree,self%kernel_smoother_1%n_dofs))
514  allocate(self%m2(2*self%spline_degree,self%kernel_smoother_0%n_dofs))
515  allocate(self%m4(self%spline_degree+1,self%kernel_smoother_0%n_dofs))
516  allocate(self%m1_local(self%spline_degree,self%kernel_smoother_1%n_dofs))
517  allocate(self%m2_local(2*self%spline_degree,self%kernel_smoother_0%n_dofs))
518  allocate(self%m4_local(self%spline_degree+1,self%kernel_smoother_0%n_dofs))
519 
520  call self%linear_operator_eb%create(self%n_dofs, self%spline_degree, &
521  self%mass_line_0,self%mass_line_1)
522  call self%linear_operator_ev%create(self%n_dofs, self%spline_degree, &
523  self%mass_line_0,self%mass_line_1, self%m1, self%m2, self%m4)
524 
525  call self%linear_solver_eb%create(self%linear_operator_eb)
526  call self%linear_solver_ev%create(self%linear_operator_ev)
527 
528  if (present(solver_tolerance)) then
529  self%linear_solver_eb%rtol= solver_tolerance
530  self%linear_solver_eb%atol= solver_tolerance
531  self%linear_solver_ev%rtol= solver_tolerance
532  self%linear_solver_ev%atol= solver_tolerance
533  else
534  self%linear_solver_eb%rtol= 1e-14_f64
535  self%linear_solver_eb%atol= 1e-14_f64
536  self%linear_solver_ev%rtol= 1e-14_f64
537  self%linear_solver_ev%atol= 1e-14_f64
538  end if
539  !self%linear_solver_eb%verbose=.true.
540  !self%linear_solver_ev%verbose=.true.
541 end subroutine initialize_pic_vm_1d2v_ecsim2o
542 
543 !---------------------------------------------------------------------------!
546  class(sll_t_time_propagator_pic_vm_1d2v_ecsim2o), intent( inout ) :: self
547 
548  deallocate(self%j_dofs)
549  deallocate(self%j_dofs_local)
550  deallocate(self%m1)
551  deallocate(self%m2)
552  deallocate(self%m4)
553  deallocate(self%m1_local)
554  deallocate(self%m2_local)
555  deallocate(self%m4_local)
556  self%kernel_smoother_0 => null()
557  self%kernel_smoother_1 => null()
558  self%particle_group => null()
559  self%efield_dofs => null()
560  self%bfield_dofs => null()
561 
562  call self%linear_operator_eb%free()
563  call self%linear_solver_eb%free()
564  call self%linear_operator_ev%free()
565  call self%linear_solver_ev%free()
566 
567 end subroutine delete_pic_vm_1d2v_ecsim2o
568 
569 
570 
571 
572 
Combines values from all processes and distributes the result back to all processes.
Parallelizing facility.
type(sll_t_collective_t), pointer, public sll_v_world_collective
Control of subset assignment. Processes with the same color are in the same new communicator.
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 for a sequential gmres
Low level arbitrary degree splines.
Base class for kernel smoothers for accumulation and field evaluation in PIC.
Utilites for Maxwell solver's with spline finite elements.
subroutine, public sll_s_spline_fem_mass_line(degree, mass_line)
Computes the mass line for a mass matrix with degree splines.
Base class for Hamiltonian splittings.
Particle pusher based on Lapentas splitting in Ecsim for 1d2v Vlasov-Poisson.
subroutine righthandside_ev(self, dt, rhs)
calculation of the righthandside of the system of maxwellequations
subroutine initialize_pic_vm_1d2v_ecsim2o(self, kernel_smoother_0, kernel_smoother_1, particle_group, efield_dofs, bfield_dofs, x_min, Lx, solver_tolerance)
Constructor.
subroutine lie_splitting_back_pic_vm_1d2v_ecsim2o(self, dt, number_steps)
Lie splitting.
subroutine strang_splitting_pic_vm_1d2v_ecsim2o(self, dt, number_steps)
Finalization.
subroutine lie_splitting_pic_vm_1d2v_ecsim2o(self, dt, number_steps)
Lie splitting.
subroutine righthandside_eb(self, dt, rhs)
calculation of the righthandside of the system of maxwellequations
subroutine add_particle_mass_mixed_spline_1d(self, kernel_smoother, degree1, degree2, position, marker_charge, particle_mass)
Add charge of one particle for splines of different degrees.
    Report Typos and Errors