28DECLARE_TARGET_SIMD_UNIFORM(sim)
51 int cycle[mrk_array_size];
52 real hin[mrk_array_size];
54 real cputime, cputime_last;
62 for(
int i=0; i< mrk_array_size; i++) {
72 for(
int i = 0; i < mrk_array_size; i++) {
91 real rnd[3*mrk_array_size];
95 GPU_MAP_TO_DEVICE(hin[0:mrk_array_size], rnd[0:3*mrk_array_size])
96 while(n_running > 0) {
98 GPU_PARALLEL_LOOP_ALL_LEVELS
99 for(
int i = 0; i < p.
n_mrk; i++) {
105 GPU_PARALLEL_LOOP_ALL_LEVELS
106 for(
int i = 0; i < p.
n_mrk; i++) {
124 GPU_PARALLEL_LOOP_ALL_LEVELS
125 for(
int i = 0; i < p.
n_mrk; i++) {
146 GPU_PARALLEL_LOOP_ALL_LEVELS
147 for(
int i = 0; i < p.
n_mrk; i++) {
151 p.
cputime[i] += cputime - cputime_last;
154 cputime_last = cputime;
173 for(
int i=0; i<p.
n_mrk; i++) {
178 gc_f.id[i] = p.
id[i];
185 gc_i.id[i] = p0.
id[i];
195 GPU_PARALLEL_LOOP_ALL_LEVELS_REDUCTION(n_running)
196 for(
int i = 0; i < p.
n_mrk; i++)
198 if(p_ptr->
running[i] > 0) n_running++;
205 GPU_PARALLEL_LOOP_ALL_LEVELS
206 for(
int i = 0; i < p.
n_mrk; i++) {
Header file for B_field.c.
Header file for E_field.c.
Main header file for ASCOT5.
#define A5_WTIME
Wall time.
void atomic_fo(particle_simd_fo *p, real *h, plasma_data *p_data, neutral_data *n_data, random_data *r_data, asigma_data *asigmadata)
Determine if atomic reactions occur during time-step and change charge.
Header file for atomic.c.
Header file containing physical and mathematical constants.
void simulate_fo_fixed_copy_from_gpu(sim_data *sim, particle_simd_fo *p_ptr)
Copy data from GPU to CPU.
Header file for copytogpu.c.
void diag_update_fo(diag_data *data, B_field_data *Bdata, particle_simd_fo *p_f, particle_simd_fo *p_i)
Collects diagnostics when marker represents a particle.
void diag_update_gc(diag_data *data, B_field_data *Bdata, particle_simd_gc *p_f, particle_simd_gc *p_i)
Collects diagnostics when marker represents a guiding center.
void endcond_check_fo(particle_simd_fo *p_f, particle_simd_fo *p_i, sim_data *sim)
Check end conditions for FO markers.
Header file for endcond.c.
#define math_normc(a1, a2, a3)
Calculate norm of 3D vector from its components a1, a2, a3.
Header file for mccc package.
void mccc_fo_euler(particle_simd_fo *p, real *h, plasma_data *pdata, mccc_data *mdata, real *rnd)
Integrate collisions for one time-step.
int particle_fo_to_gc(particle_simd_fo *p_fo, int j, particle_simd_gc *p_gc, B_field_data *Bdata)
Convert FO struct into a GC struct.
void particle_allocate_fo(particle_simd_fo *p_fo, int nmrk)
Allocates struct representing particle markers.
void particle_offload_fo(particle_simd_fo *p)
Offload particle struct to GPU.
int particle_cycle_fo(particle_queue *q, particle_simd_fo *p, B_field_data *Bdata, int *cycle)
Replace finished FO markers with new ones or dummies.
void particle_copy_fo(particle_simd_fo *p1, int i, particle_simd_fo *p2, int j)
Copy FO struct.
Header file for particle.c.
Methods to evaluate elementary physical quantities.
#define phys_gyrofreq_pnorm(m, q, p, B)
Evaluate gyrofrequency [rad/s] from momentum norm.
Header file for plasma.c.
#define random_normal_simd(data, n, r)
Header file for simulate.c.
real simulate_fo_fixed_inidt(sim_data *sim, particle_simd_fo *p, int i)
Calculates time step value.
void simulate_fo_fixed(particle_queue *pq, sim_data *sim, int mrk_array_size)
Simulates particles using fixed time-step.
Header file for simulate_fo_fixed.c.
void step_fo_vpa_mhd(particle_simd_fo *p, real *h, B_field_data *Bdata, E_field_data *Edata, boozer_data *boozer, mhd_data *mhd)
Integrate a full orbit step with VPA and MHd modes present.
void step_fo_vpa(particle_simd_fo *p, real *h, B_field_data *Bdata, E_field_data *Edata)
Integrate a full orbit step for a struct of particles with VPA.
Header file for step_fo_vpa.c.
Struct representing NSIMD particle markers.
Struct representing NSIMD guiding center markers.
neutral_data neutral_data