4 #include "sll_memory.h"
5 #include "sll_working_precision.h"
28 character(len=64) :: name
46 sll_int32 :: n_particles
47 sll_int32 :: n_total_particles
48 sll_int32 :: n_weights
86 procedure(
empty ),
deferred :: free
102 sll_int32 :: n_species
113 sll_int32 ,
intent( in ) :: i
124 sll_int32 ,
intent( in ) :: i
135 sll_int32 ,
intent( in ) :: i
136 sll_int32,
optional ,
intent( in ) :: i_weight
157 sll_int32 ,
intent( in ) :: i
168 sll_int32 ,
intent( in ) :: i
169 sll_real64 :: r(self%n_weights)
179 sll_int32 ,
intent( in ) :: i
180 sll_real64 ,
intent( in ) :: x(3)
190 sll_int32 ,
intent( in ) :: i
191 sll_real64 ,
intent( in ) :: x
201 sll_real64 ,
intent( in ) :: x
211 sll_int32 ,
intent( in ) :: i
212 sll_real64 ,
intent( in ) :: x(self%n_weights)
245 sll_real64,
intent ( in ) :: species_charge
246 sll_real64,
intent ( in ) :: species_mass
249 self%q = species_charge
250 self%m = species_mass
263 sll_int32,
intent ( in ) :: i
274 sll_int32,
intent ( in ) :: i
285 sll_int32,
intent ( in ) :: i
296 sll_int32,
intent ( in ) :: i
307 sll_int32,
intent ( in ) :: i
319 sll_int32,
intent ( in ) :: i
320 sll_int32,
intent ( out) :: box
328 sll_int32,
intent ( in ) :: i
329 sll_int32,
intent ( out) :: box(:)
338 sll_int32,
intent ( in ) :: i
339 sll_int32,
intent ( out) :: box
351 sll_int32,
intent ( in ) :: chunk(1:2)
352 sll_real64,
pointer,
intent( out ) :: x(:,:)
356 do i=chunk(1),chunk(2)
357 x(:,i-chunk(1)+1) = self%get_x( i )
365 sll_int32,
intent ( in ) :: chunk(1:2)
366 sll_real64,
pointer,
intent( out ) :: v(:,:)
370 do i=chunk(1),chunk(2)
371 v(:,i-chunk(1)+1) = self%get_v( i )
379 sll_int32,
intent ( in ) :: chunk(1:2)
380 sll_real64,
pointer,
intent( out ) :: weights(:,:)
384 do i=chunk(1),chunk(2)
385 weights(:,i-chunk(1)+1) = self%get_weights( i )
393 sll_int32,
intent ( in ) :: chunk(1:2)
394 sll_int32,
pointer,
intent( out ) :: box(:)
398 do i=chunk(1),chunk(2)
399 box(i-chunk(1)+1) = self%get_box( i )
407 sll_int32,
intent ( in ) :: chunk(1:2)
408 sll_int32,
pointer,
intent( out ) :: boxnd(:,:)
412 do i=chunk(1),chunk(2)
413 boxnd(:,i-chunk(1)+1) = self%get_boxnd( i )
421 sll_int32,
intent ( in ) :: chunk(1:2)
422 sll_int32,
pointer,
intent( out ) :: patch(:)
426 do i=chunk(1),chunk(2)
427 patch(i-chunk(1)+1) = self%get_patch( i )
435 character(len=*),
intent(in) :: filename
440 subroutine read( self, filename )
442 character(len=*),
intent(in) :: filename
452 sll_int32,
intent( in ) :: num_pts(2)
453 sll_int32,
intent( in ) :: ind1d
454 sll_int32 :: ind2d(2)
456 ind2d(2) = ( ind1d/num_pts(1) )
457 ind2d(1) = ind1d - ind2d(2)*num_pts(1)
458 ind2d(2) = ind2d(2)+1
464 sll_int32,
intent( in ) :: num_pts(2)
465 sll_int32,
intent( in ) :: ind2d(2)
469 ind1d = ind2d(1)+ (ind2d(2)-1) * num_pts(1)
476 sll_int32,
intent( in ) :: num_pts(3)
477 sll_int32,
intent( in ) :: ind1d
478 sll_int32 :: ind3d(3)
482 ind3d(3) = ( ind1d/(num_pts(1)*num_pts(2)) )
483 ind = ind1d - ind3d(3)*(num_pts(1)*num_pts(2))
484 ind3d(3) = ind3d(3) +1
485 ind3d(2) = ( ind/num_pts(1) )
486 ind3d(1) = ind - ind3d(2)*num_pts(1)
487 ind3d(2) = ind3d(2)+1
493 sll_int32,
intent( in ) :: num_pts(3)
494 sll_int32,
intent( in ) :: ind3d(3)
498 ind1d = ind3d(1) + (ind3d(2)-1) * num_pts(1) + (ind3d(3)-1)* num_pts(1)*num_pts(2)
subroutine set_boxnd(self, i, box)
Set the number of the box from nd index (by default nothing is done)
subroutine chget_x(self, chunk, x)
subroutine set_patch(self, i, box)
Set the number of the patch (by default nothing is done)
subroutine read(self, filename)
Dummy read function ( can be overwritten to read for restart )
pure integer(kind=i32) function get_box(self, i)
pure integer(kind=i32) function, dimension(2), public sll_f_index_1dto2d(num_pts, ind1d)
Helper function to compute the 2d index for a tensor product grid from the 1d index.
subroutine print(self, filename)
Dummy print function ( can be overwritten to print for debugging )
pure real(kind=f64) function, dimension(3) get_xpatch(self, i)
Get the coordinate in the patch-local system. Default: get_x.
pure real(kind=f64) function, dimension(3) get_xbox(self, i)
pure integer(kind=i32) function, dimension(3) get_boxnd(self, i)
subroutine chget_box(self, chunk, box)
subroutine initialize_species(self, species_charge, species_mass)
pure integer(kind=i32) function, public sll_f_index_3dto1d(num_pts, ind3d)
Helper function to compute the 1d index for a tensor product grid from the 2d index.
subroutine chget_v(self, chunk, v)
pure real(kind=f64) function q_over_m(self)
pure integer(kind=i32) function get_patch(self, i)
Get the number of the patch (per default we only have one patch and therefore always return a 1)
subroutine chget_boxnd(self, chunk, boxnd)
subroutine set_box(self, i, box)
Set the number of the box (by default nothing is done)
subroutine chget_weights(self, chunk, weights)
pure integer(kind=i32) function, dimension(3), public sll_f_index_1dto3d(num_pts, ind1d)
Helper function to compute the 2d index for a tensor product grid from the 1d index.
pure integer(kind=i32) function, public sll_f_index_2dto1d(num_pts, ind2d)
Helper function to compute the 1d index for a tensor product grid from the 2d index.
subroutine chget_patch(self, chunk, patch)
Module to select the kind parameter.