21 #include "sll_memory.h"
22 #include "sll_working_precision.h"
107 sll_real64 :: q_im1jm1
109 sll_real64 :: q_ip1jm1
110 sll_real64 :: q_ip2jm1
112 sll_real64 :: q_im1jp1
114 sll_real64 :: q_ip1jp1
115 sll_real64 :: q_ip2jp1
117 sll_real64 :: q_im1jp2
119 sll_real64 :: q_ip1jp2
120 sll_real64 :: q_ip2jp2
149 sll_real64 :: ex_im1j, ey_im1j
150 sll_real64 :: ex_ij, ey_ij
151 sll_real64 :: ex_ip1j, ey_ip1j
152 sll_real64 :: ex_ip2j, ey_ip2j
154 sll_real64 :: ex_im1jm1, ey_im1jm1
155 sll_real64 :: ex_ijm1, ey_ijm1
156 sll_real64 :: ex_ip1jm1, ey_ip1jm1
157 sll_real64 :: ex_ip2jm1, ey_ip2jm1
159 sll_real64 :: ex_im1jp1, ey_im1jp1
160 sll_real64 :: ex_ijp1, ey_ijp1
161 sll_real64 :: ex_ip1jp1, ey_ip1jp1
162 sll_real64 :: ex_ip2jp1, ey_ip2jp1
164 sll_real64 :: ex_im1jp2, ey_im1jp2
165 sll_real64 :: ex_ijp2, ey_ijp2
166 sll_real64 :: ex_ip1jp2, ey_ip1jp2
167 sll_real64 :: ex_ip2jp2, ey_ip2jp2
179 interface operator(+)
181 end interface operator(+)
188 sll_int32 :: num_cells1
189 sll_int32 :: num_cells2
190 sll_int32 :: num_cells_total
194 num_cells1 = mesh_2d%num_cells1
195 num_cells2 = mesh_2d%num_cells2
196 num_cells_total = num_cells1*num_cells2
197 sll_allocate(acc%q_acc(num_cells_total), ierr)
207 if (.not.
associated(mesh_2d))
then
208 print *,
'ERROR: sll_f_new_charge_accumulator_2d(), passed mesh is not ', &
209 'associated. Exiting...'
213 sll_allocate(acc, ierr)
223 res%q_sw = q1%q_sw + q2%q_sw
224 res%q_se = q1%q_se + q2%q_se
225 res%q_nw = q1%q_nw + q2%q_nw
226 res%q_ne = q1%q_ne + q2%q_ne
234 res%q_im1j = q1%q_im1j + q2%q_im1j
235 res%q_ij = q1%q_ij + q2%q_ij
236 res%q_ip1j = q1%q_ip1j + q2%q_ip1j
237 res%q_ip2j = q1%q_ip2j + q2%q_ip2j
239 res%q_im1jm1 = q1%q_im1jm1 + q2%q_im1jm1
240 res%q_ijm1 = q1%q_ijm1 + q2%q_ijm1
241 res%q_ip1jm1 = q1%q_ip1jm1 + q2%q_ip1jm1
242 res%q_ip2jm1 = q1%q_ip2jm1 + q2%q_ip2jm1
244 res%q_im1jp1 = q1%q_im1jp1 + q2%q_im1jp1
245 res%q_ijp1 = q1%q_ijp1 + q2%q_ijp1
246 res%q_ip1jp1 = q1%q_ip1jp1 + q2%q_ip1jp1
247 res%q_ip2jp1 = q1%q_ip2jp1 + q2%q_ip2jp1
249 res%q_im1jp2 = q1%q_im1jp2 + q2%q_im1jp2
250 res%q_ijp2 = q1%q_ijp2 + q2%q_ijp2
251 res%q_ip1jp2 = q1%q_ip1jp2 + q2%q_ip1jp2
252 res%q_ip2jp2 = q1%q_ip2jp2 + q2%q_ip2jp2
258 sll_int32 :: num_cells
260 num_cells = acc%mesh%num_cells1*acc%mesh%num_cells2
263 acc%q_acc(i)%q_sw = 0.0_f64
264 acc%q_acc(i)%q_se = 0.0_f64
265 acc%q_acc(i)%q_nw = 0.0_f64
266 acc%q_acc(i)%q_ne = 0.0_f64
274 if (.not.
associated(acc))
then
275 print *,
'delete_charge_accumulator_2d(): ', &
276 'ERROR, pointer was not associated.'
280 if (
associated(acc%q_acc))
then
281 sll_deallocate(acc%q_acc, ierr)
283 sll_deallocate(acc, ierr)
289 sll_int32 :: num_cells1
290 sll_int32 :: num_cells2
291 sll_int32 :: num_cells_total
295 num_cells1 = mesh_2d%num_cells1
296 num_cells2 = mesh_2d%num_cells2
297 num_cells_total = num_cells1*num_cells2
298 sll_allocate(acc%q_acc(num_cells_total), ierr)
307 if (.not.
associated(mesh_2d))
then
308 print *,
'ERROR: sll_f_new_charge_accumulator_2d(), passed mesh is not ', &
309 'associated. Exiting...'
313 sll_allocate(acc, ierr)
321 sll_int32 :: num_cells
323 num_cells = acc%mesh%num_cells1*acc%mesh%num_cells2
326 acc%q_acc(i)%q_im1j = 0.0_f64; acc%q_acc(i)%q_im1jm1 = 0.0_f64
327 acc%q_acc(i)%q_ij = 0.0_f64; acc%q_acc(i)%q_ijm1 = 0.0_f64
328 acc%q_acc(i)%q_ip1j = 0.0_f64; acc%q_acc(i)%q_ip1jm1 = 0.0_f64
329 acc%q_acc(i)%q_ip2j = 0.0_f64; acc%q_acc(i)%q_ip2jm1 = 0.0_f64
331 acc%q_acc(i)%q_im1jp1 = 0.0_f64; acc%q_acc(i)%q_im1jp2 = 0.0_f64
332 acc%q_acc(i)%q_ijp1 = 0.0_f64; acc%q_acc(i)%q_ijp2 = 0.0_f64
333 acc%q_acc(i)%q_ip1jp1 = 0.0_f64; acc%q_acc(i)%q_ip1jp2 = 0.0_f64
334 acc%q_acc(i)%q_ip2jp1 = 0.0_f64; acc%q_acc(i)%q_ip2jp2 = 0.0_f64
342 if (.not.
associated(acc))
then
343 print *,
'delete_charge_accumulator_2d(): ', &
344 'ERROR, pointer was not associated.'
348 if (
associated(acc%q_acc))
then
349 sll_deallocate(acc%q_acc, ierr)
351 sll_deallocate(acc, ierr)
357 sll_int32 :: num_cells1
358 sll_int32 :: num_cells2
359 sll_int32 :: num_cells_total
362 e_acc%mesh => mesh_2d
363 num_cells1 = mesh_2d%num_cells1
364 num_cells2 = mesh_2d%num_cells2
365 num_cells_total = num_cells1*num_cells2
366 sll_allocate(e_acc%e_acc(num_cells_total), ierr)
376 if (.not.
associated(mesh_2d))
then
377 print *,
'ERROR: sll_f_new_charge_accumulator_2d(), passed mesh is not ', &
378 'associated. Exiting...'
382 sll_allocate(e_acc, ierr)
390 sll_int32 :: num_cells1
391 sll_int32 :: num_cells2
392 sll_int32 :: num_cells_total
395 e_acc%mesh => mesh_2d
396 num_cells1 = mesh_2d%num_cells1
397 num_cells2 = mesh_2d%num_cells2
398 num_cells_total = num_cells1*num_cells2
399 sll_allocate(e_acc%e_acc(num_cells_total), ierr)
409 if (.not.
associated(mesh_2d))
then
410 print *,
'ERROR: sll_f_new_charge_accumulator_2d(), passed mesh is not ', &
411 'associated. Exiting...'
415 sll_allocate(e_acc, ierr)
424 sll_int32 :: num_cells
426 num_cells = e_acc%mesh%num_cells1*e_acc%mesh%num_cells2
428 e_acc%e_acc(i)%Ex_sw = 0.0_f64
429 e_acc%e_acc(i)%Ex_se = 0.0_f64
430 e_acc%e_acc(i)%Ex_nw = 0.0_f64
431 e_acc%e_acc(i)%Ex_ne = 0.0_f64
432 e_acc%e_acc(i)%Ey_sw = 0.0_f64
433 e_acc%e_acc(i)%Ey_se = 0.0_f64
434 e_acc%e_acc(i)%Ey_nw = 0.0_f64
435 e_acc%e_acc(i)%Ey_ne = 0.0_f64
443 sll_int32 :: num_cells
445 num_cells = e_acc%mesh%num_cells1*e_acc%mesh%num_cells2
447 e_acc%e_acc(i)%Ex_im1j = 0.0_f64; e_acc%e_acc(i)%Ey_im1j = 0.0_f64
448 e_acc%e_acc(i)%Ex_ij = 0.0_f64; e_acc%e_acc(i)%Ey_ij = 0.0_f64
449 e_acc%e_acc(i)%Ex_ip1j = 0.0_f64; e_acc%e_acc(i)%Ey_ip1j = 0.0_f64
450 e_acc%e_acc(i)%Ex_ip2j = 0.0_f64; e_acc%e_acc(i)%Ey_ip2j = 0.0_f64
451 e_acc%e_acc(i)%Ex_im1jm1 = 0.0_f64; e_acc%e_acc(i)%Ey_im1jm1 = 0.0_f64
452 e_acc%e_acc(i)%Ex_ijm1 = 0.0_f64; e_acc%e_acc(i)%Ey_ijm1 = 0.0_f64
453 e_acc%e_acc(i)%Ex_ip1jm1 = 0.0_f64; e_acc%e_acc(i)%Ey_ip1jm1 = 0.0_f64
454 e_acc%e_acc(i)%Ex_ip2jm1 = 0.0_f64; e_acc%e_acc(i)%Ey_ip2jm1 = 0.0_f64
455 e_acc%e_acc(i)%Ex_im1jp1 = 0.0_f64; e_acc%e_acc(i)%Ey_im1jp1 = 0.0_f64
456 e_acc%e_acc(i)%Ex_ijp1 = 0.0_f64; e_acc%e_acc(i)%Ey_ijp1 = 0.0_f64
457 e_acc%e_acc(i)%Ex_ip1jp1 = 0.0_f64; e_acc%e_acc(i)%Ey_ip1jp1 = 0.0_f64
458 e_acc%e_acc(i)%Ex_ip2jp1 = 0.0_f64; e_acc%e_acc(i)%Ey_ip2jp1 = 0.0_f64
459 e_acc%e_acc(i)%Ex_im1jp2 = 0.0_f64; e_acc%e_acc(i)%Ey_im1jp2 = 0.0_f64
460 e_acc%e_acc(i)%Ex_ijp2 = 0.0_f64; e_acc%e_acc(i)%Ey_ijp2 = 0.0_f64
461 e_acc%e_acc(i)%Ex_ip1jp2 = 0.0_f64; e_acc%e_acc(i)%Ey_ip1jp2 = 0.0_f64
462 e_acc%e_acc(i)%Ex_ip2jp2 = 0.0_f64; e_acc%e_acc(i)%Ey_ip2jp2 = 0.0_f64
467 sll_int32,
intent(in) :: n_threads, n_cells
473 tab(1)%q%q_acc(i) = tab(1)%q%q_acc(i) + tab(j)%q%q_acc(i)
479 sll_int32,
intent(in) :: n_threads, n_cells
485 tab(1)%q%q_acc(i) = tab(1)%q%q_acc(i) + tab(j)%q%q_acc(i)
Particle deposition routines.
subroutine, public sll_s_sum_accumulators(tab, n_threads, n_cells)
subroutine, public sll_s_reset_field_accumulator_to_zero(E_acc)
type(charge_accumulator_cell_2d_cs) function q_acc_add_cs(q1, q2)
subroutine, public sll_s_sum_accumulators_cs(tab, n_threads, n_cells)
subroutine, public sll_s_reset_field_accumulator_cs_to_zero(E_acc)
type(sll_t_charge_accumulator_2d) function, pointer, public sll_f_new_charge_accumulator_2d(mesh_2d)
subroutine, public sll_s_reset_charge_accumulator_to_zero(acc)
subroutine, public sll_s_charge_accumulator_2d_init(acc, mesh_2d)
subroutine, public sll_s_field_accumulator_2d_init(E_acc, mesh_2d)
type(sll_t_electric_field_accumulator) function, pointer, public sll_f_new_field_accumulator_2d(mesh_2d)
subroutine, public sll_s_charge_accumulator_2d_cs_init(acc, mesh_2d)
type(sll_t_charge_accumulator_cell_2d) function q_acc_add(q1, q2)
type(sll_t_charge_accumulator_2d_cs) function, pointer, public sll_f_new_charge_accumulator_2d_cs(mesh_2d)
subroutine, public sll_s_reset_charge_accumulator_to_zero_cs(acc)
type(sll_t_electric_field_accumulator_cs) function, pointer, public sll_f_new_field_accumulator_cs_2d(mesh_2d)
subroutine delete_charge_accumulator_2d(acc)
subroutine delete_charge_accumulator_2d_cs(acc)
subroutine, public sll_s_field_accumulator_cs_2d_init(E_acc, mesh_2d)
Cartesian mesh basic types.