22DECLARE_TARGET_SIMD_UNIFORM(sim)
26#define MAGNETIC_FIELD_LINE_INISTEP 1.0e-2
27#define DUMMY_STEP_VAL 100.0
60 real cputime, cputime_last;
68 for(i=0; i<
NSIMD; i++) {
78 for(i = 0; i <
NSIMD; i++) {
98 while(n_running > 0) {
102 for(i = 0; i <
NSIMD; i++) {
116 for(i = 0; i <
NSIMD; i++) {
132 for(i = 0; i <
NSIMD; i++) {
139 if(p.running[i] && hout[i] < 0){
151 for(i = 0; i <
NSIMD; i++) {
158 if(dphi > 1 && dphi > drho) {
159 hnext[i] = -hin[i]/dphi;
161 else if(drho > 1 && drho > dphi) {
162 hnext[i] = -hin[i]/drho;
181 p.mileage[i] += hin[i] /
CONST_C;
183 if(hnext[i] > hout[i]) {
194 p.cputime[i] += cputime - cputime_last;
198 cputime_last = cputime;
211 for(i = 0; i <
NSIMD; i++) {
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.
#define CONST_C
Speed of light [m/s]
void diag_update_ml(diag_data *data, particle_simd_ml *p_f, particle_simd_ml *p_i)
Collects diagnostics when marker represents a magnetic field line.
void endcond_check_ml(particle_simd_ml *p_f, particle_simd_ml *p_i, sim_data *sim)
Check end conditions for ML markers.
Header file for endcond.c.
void particle_copy_ml(particle_simd_ml *p1, int i, particle_simd_ml *p2, int j)
Copy ML struct.
int particle_cycle_ml(particle_queue *q, particle_simd_ml *p, B_field_data *Bdata, int *cycle)
Replace finished ML markers with new ones or dummies.
Header file for particle.c.
Header file for simulate.c.
real simulate_ml_adaptive_inidt(sim_data *sim, particle_simd_ml *p, int i)
Calculates initial time step value.
void simulate_ml_adaptive(particle_queue *pq, sim_data *sim)
Simulates magnetic field-lines using adaptive time-step.
#define MAGNETIC_FIELD_LINE_INISTEP
Header file for simulate_ml_adaptive.c.
void step_ml_cashkarp_mhd(particle_simd_ml *p, real *h, real *hnext, real tol, B_field_data *Bdata, boozer_data *boozerdata, mhd_data *mhddata)
Integrate a magnetic field line step for a struct of markers.
void step_ml_cashkarp(particle_simd_ml *p, real *h, real *hnext, real tol, B_field_data *Bdata)
Integrate a magnetic field line step for a struct of markers.
Header file for step_ml_cashkarp.c.
Struct representing NSIMD field line markers.