26DECLARE_TARGET_SIMD_UNIFORM(sim)
29#define DUMMY_TIMESTEP_VAL 1.0
68 real cputime, cputime_last;
76 for(
int i=0; i<
NSIMD; i++) {
92 for(
int i = 0; i <
NSIMD; i++) {
95 hin[i] = hin_default[i];
110 while(n_running > 0) {
114 for(
int i = 0; i <
NSIMD; i++) {
122 for(
int i = 0; i <
NSIMD; i++) {
143 for(
int i = 0; i <
NSIMD; i++) {
159 rfof_resonance_check_and_kick_gc(
164 for(
int i = 0; i <
NSIMD; i++) {
165 if(p.running[i] && hout_rfof[i] < 0){
168 hnext_recom[i] = hout_rfof[i];
171 }
else if(p.running[i]) {
173 hin[i] = hin_default[i];
184 for(
int i = 0; i <
NSIMD; i++) {
185 if(hnext_recom[i] < 0) {
189 hin[i] = -hnext_recom[i];
192 if(hnext_recom[i] < 0) {
197 p.time[i] += ( 1.0 - 2.0 * ( sim->
reverse_time > 0 ) ) * hin[i];
198 p.mileage[i] += hin[i];
199 p.cputime[i] += cputime - cputime_last;
203 cputime_last = cputime;
216 for(
int i = 0; i <
NSIMD; i++) {
221 rfof_clear_history(&rfof_mrk, i);
232 rfof_tear_down(&rfof_mrk);
261 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)
Contains the functions to be called from the simulation loop when using ICRH.
Header file for simulate.c.
#define DUMMY_TIMESTEP_VAL
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(particle_simd_gc *p, real *h, B_field_data *Bdata, E_field_data *Edata, int aldforce)
Integrate a guiding center step for a struct of markers with RK4.
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, int aldforce)
Integrate a guiding center step with RK4 with MHD modes present.
Header file for step_gc_rk4.c.
Struct representing NSIMD guiding center markers.
Reusable struct for storing marker specific data during the simulation loop.