25DECLARE_TARGET_SIMD_UNIFORM(sim)
50 real cputime, cputime_last;
56 for(
int i=0; i<
NSIMD; i++) {
66 for(
int i = 0; i <
NSIMD; i++) {
82 while(n_running > 0) {
86 for(
int i = 0; i <
NSIMD; i++) {
94 for(
int i = 0; i <
NSIMD; i++) {
113 for(
int i = 0; i <
NSIMD; i++) {
133 for(
int i = 0; i <
NSIMD; i++) {
135 p.time[i] += ( 1.0 - 2.0 * ( sim->
reverse_time > 0 ) ) * hin[i];
136 p.mileage[i] += hin[i];
137 p.cputime[i] += cputime - cputime_last;
140 cputime_last = cputime;
153 for(
int i = 0; i <
NSIMD; i++) {
190 p->mu[i], p->ppar[i], Bnorm);
Header file for B_field.c.
Header file for E_field.c.
Main header file for ASCOT5.
#define NSIMD
Number of particles simulated simultaneously in a particle group operations.
#define A5_WTIME
Wall time.
Header file containing physical and mathematical constants.
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_gc(particle_simd_gc *p_f, particle_simd_gc *p_i, sim_data *sim)
Check end conditions for GC 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_gc_euler(particle_simd_gc *p, real *h, B_field_data *Bdata, plasma_data *pdata, mccc_data *mdata, real *rnd)
Integrate collisions for one time-step.
void particle_copy_gc(particle_simd_gc *p1, int i, particle_simd_gc *p2, int j)
Copy GC struct.
int particle_cycle_gc(particle_queue *q, particle_simd_gc *p, B_field_data *Bdata, int *cycle)
Replace finished GC markers with new ones or dummies.
Header file for particle.c.
Methods to evaluate elementary physical quantities.
#define phys_gyrofreq_ppar(m, q, mu, ppar, B)
Evaluate gyrofrequency [rad/s] from parallel momentum and magnetic moment.
Header file for plasma.c.
#define random_normal_simd(data, n, r)
Header file for simulate.c.
void simulate_gc_fixed(particle_queue *pq, sim_data *sim)
Simulates guiding centers using fixed time-step.
real simulate_gc_fixed_inidt(sim_data *sim, particle_simd_gc *p, int i)
Calculates time step value.
Header file for simulate_gc_fixed.c.
void step_gc_rk4_mhd(particle_simd_gc *p, real *h, B_field_data *Bdata, E_field_data *Edata, boozer_data *boozer, mhd_data *mhd)
Integrate a guiding center step with RK4 with MHD modes present.
void step_gc_rk4(particle_simd_gc *p, real *h, B_field_data *Bdata, E_field_data *Edata)
Integrate a guiding center step for a struct of markers with RK4.
Header file for step_gc_rk4.c.
Struct representing NSIMD guiding center markers.