27DECLARE_TARGET_SIMD_UNIFORM(sim)
51 int* cycle = (
int*) malloc(mrk_array_size*
sizeof(
int));
55 real cputime, cputime_last;
63 for(
int i = 0; i < mrk_array_size; i++) {
73 for(
int i = 0; i < mrk_array_size; i++) {
91 real* rnd = (
real*) malloc(3*mrk_array_size*
sizeof(
real));
92 GPU_MAP_TO_DEVICE(hin[0:mrk_array_size], rnd[0:3*mrk_array_size])
93 while(n_running > 0) {
95 GPU_PARALLEL_LOOP_ALL_LEVELS
96 for(
int i = 0; i < p.
n_mrk; i++) {
102 GPU_PARALLEL_LOOP_ALL_LEVELS
103 for(
int i = 0; i < p.
n_mrk; i++) {
121 GPU_PARALLEL_LOOP_ALL_LEVELS
122 for(
int i = 0; i < p.
n_mrk; i++) {
143 GPU_PARALLEL_LOOP_ALL_LEVELS
144 for(
int i = 0; i < p.
n_mrk; i++) {
148 p.
cputime[i] += cputime - cputime_last;
151 cputime_last = cputime;
170 for(
int i=0; i<p.
n_mrk; i++) {
175 gc_f.id[i] = p.
id[i];
182 gc_i.id[i] = p0.
id[i];
192 GPU_PARALLEL_LOOP_ALL_LEVELS_REDUCTION(n_running)
193 for(
int i = 0; i < p.
n_mrk; i++)
195 if(p.
running[i] > 0) n_running++;
202 GPU_PARALLEL_LOOP_ALL_LEVELS
203 for(
int i = 0; i < p.
n_mrk; i++) {
212 GPU_MAP_FROM_DEVICE(sim[0:1])
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 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.
void particle_onload_fo(particle_simd_fo *p)
Onload particle struct from the GPU.
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