20 #include "sll_memory.h"
21 #include "sll_working_precision.h"
22 #include "sll_accumulators.h"
45 sll_real64,
dimension(:, :),
intent(out) :: rho
54 ncx = charge%mesh%num_cells1
55 ncy = charge%mesh%num_cells2
56 deltax = charge%mesh%delta_eta1
57 deltay = charge%mesh%delta_eta2
58 factor = 1.0_f64/(deltax*deltay)
65 rho(i, j) = sll_get_charge_acc_value(charge, i, j, q_sw) + &
66 sll_get_charge_acc_value(charge, i - 1, j, q_se) + &
67 sll_get_charge_acc_value(charge, i - 1, j - 1, q_ne) + &
68 sll_get_charge_acc_value(charge, i, j - 1, q_nw)
69 rho(i, j) = rho(i, j)*factor
74 rho(1, j) = sll_get_charge_acc_value(charge, 1, j, q_sw) + &
75 sll_get_charge_acc_value(charge, 1, j - 1, q_nw) + &
76 sll_get_charge_acc_value(charge, ncx, j, q_se) + &
77 sll_get_charge_acc_value(charge, ncx, j - 1, q_ne)
78 rho(1, j) = rho(1, j)*factor
79 rho(ncx + 1, j) = rho(1, j)
83 rho(i, 1) = sll_get_charge_acc_value(charge, i - 1, 1, q_se) + &
84 sll_get_charge_acc_value(charge, i, 1, q_sw) + &
85 sll_get_charge_acc_value(charge, i - 1, ncy, q_ne) + &
86 sll_get_charge_acc_value(charge, i, ncy, q_nw)
87 rho(i, 1) = rho(i, 1)*factor
88 rho(i, ncy + 1) = rho(i, 1)
91 rho(1, 1) = sll_get_charge_acc_value(charge, 1, 1, q_sw) + &
92 sll_get_charge_acc_value(charge, 1, ncy, q_nw) + &
93 sll_get_charge_acc_value(charge, ncx, 1, q_se) + &
94 sll_get_charge_acc_value(charge, ncx, ncy, q_ne)
95 rho(1, 1) = rho(1, 1)*factor
96 rho(1, ncy + 1) = rho(1, 1)
97 rho(ncx + 1, 1) = rho(1, 1)
98 rho(ncx + 1, ncy + 1) = rho(1, 1)
112 sll_real64,
dimension(:, :),
intent(out) :: rho
113 sll_int32 :: i, im1, im2, ip1
114 sll_int32 :: j, jm1, jm2, jp1
121 ncx = charge%mesh%num_cells1
122 ncy = charge%mesh%num_cells2
123 deltax = charge%mesh%delta_eta1
124 deltay = charge%mesh%delta_eta2
125 factor = 1.0_f64/(deltax*deltay)
156 rho(i, j) = charge%q_acc(im1 + (jm1 - 1)*ncx)%q_ip1jp1 + &
157 charge%q_acc(i + (jm1 - 1)*ncx)%q_ijp1 + &
158 charge%q_acc(i + (j - 1)*ncx)%q_ij + &
159 charge%q_acc(im1 + (j - 1)*ncx)%q_ip1j + &
160 charge%q_acc(im2 + (jm2 - 1)*ncx)%q_ip2jp2 + &
161 charge%q_acc(im1 + (jm2 - 1)*ncx)%q_ip1jp2 + &
162 charge%q_acc(i + (jm2 - 1)*ncx)%q_ijp2 + &
163 charge%q_acc(ip1 + (jm2 - 1)*ncx)%q_im1jp2 + &
164 charge%q_acc(ip1 + (jm1 - 1)*ncx)%q_im1jp1 + &
165 charge%q_acc(ip1 + (j - 1)*ncx)%q_im1j + &
166 charge%q_acc(ip1 + (jp1 - 1)*ncx)%q_im1jm1 + &
167 charge%q_acc(i + (jp1 - 1)*ncx)%q_ijm1 + &
168 charge%q_acc(im1 + (jp1 - 1)*ncx)%q_ip1jm1 + &
169 charge%q_acc(im2 + (jp1 - 1)*ncx)%q_ip2jm1 + &
170 charge%q_acc(im2 + (j - 1)*ncx)%q_ip2j + &
171 charge%q_acc(im2 + (jm1 - 1)*ncx)%q_ip2jp1
172 rho(i, j) = rho(i, j)*factor
173 rho(i, ncy + 1) = rho(i, 1)
175 rho(ncx + 1, j) = rho(1, j)
177 rho(ncx + 1, ncy + 1) = rho(1, 1)
190 sll_real64,
dimension(:, :),
intent(in) :: e1, e2
193 sll_int32 :: ncx, ncy
195 ncx = e_accumulator%mesh%num_cells1
196 ncy = e_accumulator%mesh%num_cells2
199 e_accumulator%e_acc(i + (j - 1)*ncx)%Ex_sw = e1(i, j)
200 e_accumulator%e_acc(i + (j - 1)*ncx)%Ex_se = e1(i + 1, j)
201 e_accumulator%e_acc(i + (j - 1)*ncx)%Ex_nw = e1(i, j + 1)
202 e_accumulator%e_acc(i + (j - 1)*ncx)%Ex_ne = e1(i + 1, j + 1)
204 e_accumulator%e_acc(i + (j - 1)*ncx)%Ey_sw = e2(i, j)
205 e_accumulator%e_acc(i + (j - 1)*ncx)%Ey_se = e2(i + 1, j)
206 e_accumulator%e_acc(i + (j - 1)*ncx)%Ey_nw = e2(i, j + 1)
207 e_accumulator%e_acc(i + (j - 1)*ncx)%Ey_ne = e2(i + 1, j + 1)
215 sll_real64,
dimension(:, :),
intent(in) :: e1, e2
217 sll_int32 :: i, j, im1, ip2, jm1, jp2
218 sll_int32 :: ncx, ncy
220 ncx = e_accumulator%mesh%num_cells1
221 ncy = e_accumulator%mesh%num_cells2
240 e_accumulator%e_acc(i + (j - 1)*ncx)%Ex_im1j = e1(im1, j)
241 e_accumulator%e_acc(i + (j - 1)*ncx)%Ex_ij = e1(i, j)
242 e_accumulator%e_acc(i + (j - 1)*ncx)%Ex_ip1j = e1(i + 1, j)
243 e_accumulator%e_acc(i + (j - 1)*ncx)%Ex_ip2j = e1(ip2, j)
245 e_accumulator%e_acc(i + (j - 1)*ncx)%Ex_im1jm1 = e1(im1, jm1)
246 e_accumulator%e_acc(i + (j - 1)*ncx)%Ex_ijm1 = e1(i, jm1)
247 e_accumulator%e_acc(i + (j - 1)*ncx)%Ex_ip1jm1 = e1(i + 1, jm1)
248 e_accumulator%e_acc(i + (j - 1)*ncx)%Ex_ip2jm1 = e1(ip2, jm1)
250 e_accumulator%e_acc(i + (j - 1)*ncx)%Ex_im1jp1 = e1(im1, j + 1)
251 e_accumulator%e_acc(i + (j - 1)*ncx)%Ex_ijp1 = e1(i, j + 1)
252 e_accumulator%e_acc(i + (j - 1)*ncx)%Ex_ip1jp1 = e1(i + 1, j + 1)
253 e_accumulator%e_acc(i + (j - 1)*ncx)%Ex_ip2jp1 = e1(ip2, j + 1)
255 e_accumulator%e_acc(i + (j - 1)*ncx)%Ex_im1jp2 = e1(im1, jp2)
256 e_accumulator%e_acc(i + (j - 1)*ncx)%Ex_ijp2 = e1(i, jp2)
257 e_accumulator%e_acc(i + (j - 1)*ncx)%Ex_ip1jp2 = e1(i + 1, jp2)
258 e_accumulator%e_acc(i + (j - 1)*ncx)%Ex_ip2jp2 = e1(ip2, jp2)
261 e_accumulator%e_acc(i + (j - 1)*ncx)%Ey_im1j = e2(im1, j)
262 e_accumulator%e_acc(i + (j - 1)*ncx)%Ey_ij = e2(i, j)
263 e_accumulator%e_acc(i + (j - 1)*ncx)%Ey_ip1j = e2(i + 1, j)
264 e_accumulator%e_acc(i + (j - 1)*ncx)%Ey_ip2j = e2(ip2, j)
266 e_accumulator%e_acc(i + (j - 1)*ncx)%Ey_im1jm1 = e2(im1, jm1)
267 e_accumulator%e_acc(i + (j - 1)*ncx)%Ey_ijm1 = e2(i, jm1)
268 e_accumulator%e_acc(i + (j - 1)*ncx)%Ey_ip1jm1 = e2(i + 1, jm1)
269 e_accumulator%e_acc(i + (j - 1)*ncx)%Ey_ip2jm1 = e2(ip2, jm1)
271 e_accumulator%e_acc(i + (j - 1)*ncx)%Ey_im1jp1 = e2(im1, j + 1)
272 e_accumulator%e_acc(i + (j - 1)*ncx)%Ey_ijp1 = e2(i, j + 1)
273 e_accumulator%e_acc(i + (j - 1)*ncx)%Ey_ip1jp1 = e2(i + 1, j + 1)
274 e_accumulator%e_acc(i + (j - 1)*ncx)%Ey_ip2jp1 = e2(ip2, j + 1)
276 e_accumulator%e_acc(i + (j - 1)*ncx)%Ey_im1jp2 = e2(im1, jp2)
277 e_accumulator%e_acc(i + (j - 1)*ncx)%Ey_ijp2 = e2(i, jp2)
278 e_accumulator%e_acc(i + (j - 1)*ncx)%Ey_ip1jp2 = e2(i + 1, jp2)
279 e_accumulator%e_acc(i + (j - 1)*ncx)%Ey_ip2jp2 = e2(ip2, jp2)
Particle deposition routines.
subroutine, public sll_s_accumulate_field_cs(E1, E2, E_accumulator)
subroutine, public sll_s_accumulate_field(E1, E2, E_accumulator)
subroutine, public sll_s_convert_charge_to_rho_2d_per_per(charge, rho)
subroutine, public sll_s_convert_charge_to_rho_2d_per_per_cs(charge, rho)