89 GPU_PARALLEL_LOOP_ALL_LEVELS
90 for(
int i = 0; i < p_f->
n_mrk; i++) {
93 int i_r = floor((p_f->
r[i] - dist->
min_r)
100 int i_phi = floor((phi - dist->
min_phi)
103 int i_z = floor((p_f->
z[i] - dist->
min_z)
106 int i_pr = floor((p_f->
p_r[i] - dist->
min_pr)
112 int i_pz = floor((p_f->
p_z[i] - dist->
min_pz)
121 if(i_r >= 0 && i_r <= dist->n_r - 1 &&
122 i_phi >= 0 && i_phi <= dist->n_phi - 1 &&
123 i_z >= 0 && i_z <= dist->n_z - 1 &&
124 i_pr >= 0 && i_pr <= dist->n_pr - 1 &&
125 i_pphi >= 0 && i_pphi <= dist->n_pphi - 1 &&
126 i_pz >= 0 && i_pz <= dist->n_pz - 1 &&
127 i_time >= 0 && i_time <= dist->n_time - 1 &&
128 i_q >= 0 && i_q <= dist->n_q - 1 ) {
131 i_r, i_phi, i_z, i_pr, i_pphi, i_pz,
169 for(
int i = 0; i <
NSIMD; i++) {
170 if(p_f->running[i]) {
174 p_f->B_r[i], p_f->B_r_dr[i], p_f->B_r_dphi[i], p_f->B_r_dz[i],
175 p_f->B_phi[i], p_f->B_phi_dr[i], p_f->B_phi_dphi[i],
177 p_f->B_z[i], p_f->B_z_dr[i], p_f->B_z_dphi[i], p_f->B_z_dz[i]};
179 p_f->phi[i], p_f->ppar[i],
180 p_f->mu[i], p_f->zeta[i],
183 i_r[i] = floor((p_f->r[i] - dist->
min_r)
190 i_phi[i] = floor((phi[i] - dist->
min_phi)
193 i_z[i] = floor((p_f->z[i] - dist->
min_z)
196 i_pr[i] = floor((pr - dist->
min_pr)
199 i_pphi[i] = floor((pphi - dist->
min_pphi)
202 i_pz[i] = floor((pz - dist->
min_pz)
205 i_time[i] = floor((p_f->time[i] - dist->
min_time)
211 if(i_r[i] >= 0 && i_r[i] <= dist->
n_r - 1 &&
212 i_phi[i] >= 0 && i_phi[i] <= dist->
n_phi - 1 &&
213 i_z[i] >= 0 && i_z[i] <= dist->
n_z - 1 &&
214 i_pr[i] >= 0 && i_pr[i] <= dist->
n_pr - 1 &&
215 i_pphi[i] >= 0 && i_pphi[i] <= dist->
n_pphi - 1 &&
216 i_pz[i] >= 0 && i_pz[i] <= dist->
n_pz - 1 &&
217 i_time[i] >= 0 && i_time[i] <= dist->
n_time - 1 &&
218 i_q[i] >= 0 && i_q[i] <= dist->
n_q - 1 ) {
220 weight[i] = p_f->weight[i] * (p_f->time[i] - p_i->time[i]);
228 for(
int i = 0; i <
NSIMD; i++) {
229 if(p_f->running[i] && ok[i]) {
231 i_r[i], i_phi[i], i_z[i], i_pr[i], i_pphi[i], i_pz[i],
void dist_6D_update_fo(dist_6D_data *dist, particle_simd_fo *p_f, particle_simd_fo *p_i)
Update the histogram from full-orbit particles.
void dist_6D_update_gc(dist_6D_data *dist, particle_simd_gc *p_f, particle_simd_gc *p_i)
Update the histogram from guiding-center particles.
size_t dist_6D_index(int i_r, int i_phi, int i_z, int i_pr, int i_pphi, int i_pz, int i_time, int i_q, size_t step_7, size_t step_6, size_t step_5, size_t step_4, size_t step_3, size_t step_2, size_t step_1)
Internal function calculating the index in the histogram array.
Struct representing NSIMD particle markers.
Struct representing NSIMD guiding center markers.