8 #include "sll_assert.h"
9 #include "sll_memory.h"
10 #include "sll_working_precision.h"
29 sll_real64,
allocatable :: particle_array(:,:)
30 sll_real64 :: common_weight = 1.0_f64
63 deallocate(self%particle_array)
77 sll_int32 ,
intent( in ) :: n_particles
78 sll_int32 ,
intent( in ) :: n_total_particles
79 sll_real64 ,
intent( in ) :: charge
80 sll_real64 ,
intent( in ) :: mass
81 sll_int32 ,
intent( in ) :: n_weights
85 self%n_particles = n_particles
86 self%n_total_particles = n_total_particles
88 sll_allocate(self%particle_array(4+n_weights, self%n_particles), ierr)
90 allocate(self%species, stat=ierr)
91 sll_assert( ierr == 0)
92 call self%species%init( charge, mass)
94 self%n_weights = n_weights
109 sll_int32 ,
intent( in ) :: n_particles
110 sll_int32 ,
intent( in ) :: n_total_particles
111 sll_real64 ,
intent( in ) :: charge
112 sll_real64 ,
intent( in ) :: mass
113 sll_int32 ,
intent(in) :: n_weights
119 select type( particle_group )
121 call particle_group%init(n_particles, n_total_particles, charge, mass, n_weights)
137 sll_int32 ,
intent( in ) :: n_particles
138 sll_int32 ,
intent( in ) :: n_total_particles
139 sll_real64 ,
intent( in ) :: charge
140 sll_real64 ,
intent( in ) :: mass
141 sll_int32 ,
intent(in) :: n_weights
147 select type( particle_group )
149 call particle_group%init(n_particles, n_total_particles, charge, mass, n_weights)
158 sll_int32 ,
intent( in ) :: i
162 r(1:2) = self%particle_array(1:2, i)
170 sll_int32 ,
intent( in ) :: i
174 r(1:2) = self%particle_array(3:4, i)
183 sll_int32 ,
intent( in ) :: i
184 sll_int32,
optional ,
intent( in ) :: i_weight
190 if(
present(i_weight)) i_wi = i_weight
191 r = self%species%q * self%particle_array(4+i_wi, i) * self%common_weight
200 sll_int32 ,
intent( in ) :: i
201 sll_int32,
optional ,
intent( in ) :: i_weight
207 if(
present(i_weight)) i_wi = i_weight
208 r = self%species%m * self%particle_array(4+i_wi, i) * self%common_weight
217 sll_int32 ,
intent( in ) :: i
218 sll_real64 :: r(self%n_weights)
220 r = self%particle_array(5:4+self%n_weights, i)
230 r = self%common_weight
238 sll_int32 ,
intent( in ) :: i
239 sll_real64 ,
intent( in) :: x(3)
241 self%particle_array(1:2, i) = x(1:2)
249 sll_int32 ,
intent( in ) :: i
250 sll_real64 ,
intent( in) :: x(3)
252 self%particle_array(3:4, i) = x(1:2)
260 sll_int32 ,
intent( in ) :: i
261 sll_real64 ,
intent( in) :: x(self%n_weights)
263 self%particle_array(5:4+self%n_weights, i) = x
271 sll_real64 ,
intent( in) :: x
273 self%common_weight = x
282 character(len=*),
intent(in) :: filename
285 open(newunit=file_id,file=filename)
286 write(file_id,*) self%particle_array
Simple particle group group for 2d2v.
subroutine print_particle_group_2d2v(self, filename)
Print particle array to file.
subroutine, public sll_s_new_particle_group_2d2v_ptr(particle_group, n_particles, n_total_particles, charge, mass, n_weights)
Constructor for abstract type.
pure real(kind=f64) function, dimension(3) get_v_2d2v(self, i)
Get velocities of particle i.
subroutine initialize_particle_group_2d2v(self, n_particles, n_total_particles, charge, mass, n_weights)
Initialize particle group.
pure real(kind=f64) function get_common_weight_2d2v(self)
Set the common weight.
subroutine set_v_2d2v(self, i, x)
Set velocities of particle i.
subroutine set_common_weight_2d2v(self, x)
Set the common weight.
pure real(kind=f64) function get_mass_2d2v(self, i, i_weight)
Get mass of particle i ( m * particle_weight)
subroutine delete_particle_group_2d2v(self)
print particle array to file
subroutine set_weights_2d2v(self, i, x)
Set weights of particle i.
pure real(kind=f64) function get_charge_2d2v(self, i, i_weight)
Get charge of particle i ( q * particle_weight)
pure real(kind=f64) function, dimension(3) get_x_2d2v(self, i)
Get positions of particle i.
subroutine set_x_2d2v(self, i, x)
Set positions of particle i.
subroutine, public sll_s_new_particle_group_2d2v(particle_group, n_particles, n_total_particles, charge, mass, n_weights)
Constructor for abstract type.
pure real(kind=f64) function, dimension(self%n_weights) get_weights_2d2v(self, i)
Get weights of particle i.
Simple version of a PIC particle group in 2d2v.