ASCOT5
Loading...
Searching...
No Matches
endcond.c
Go to the documentation of this file.
1
53#include <math.h>
54#include "endcond.h"
55#include "particle.h"
56#include "simulate.h"
57#include "physlib.h"
58#include "consts.h"
59#include "math.h"
60#include "plasma.h"
61
74 sim_data* sim) {
75
76 /* Note which end conditions are set as active.
77 Only these ones are checked */
78 int active_tlim = sim->endcond_active & endcond_tlim;
79 int active_wall = sim->endcond_active & endcond_wall;
80 int active_emin = sim->endcond_active & endcond_emin;
81 int active_therm = sim->endcond_active & endcond_therm;
82 int active_rhomax = sim->endcond_active & endcond_rhomax;
83 int active_rhomin = sim->endcond_active & endcond_rhomin;
84 int active_polmax = sim->endcond_active & endcond_polmax;
85 int active_tormax = sim->endcond_active & endcond_tormax;
86 int active_cpumax = sim->endcond_active & endcond_cpumax;
87 int active_neutr = sim->endcond_active & endcond_neutr;
88 int active_ioniz = sim->endcond_active & endcond_ioniz;
89
90 GPU_PARALLEL_LOOP_ALL_LEVELS
91 for(int i = 0; i < p_f->n_mrk; i++) {
92 if(p_f->running[i]) {
93
94 /* Update bounces if pitch changed sign */
95 if( (p_i->p_r[i]*p_i->B_r[i] + p_i->p_phi[i]*p_i->B_phi[i]
96 + p_i->p_z[i]*p_i->B_z[i])
97 * (p_f->p_r[i]*p_f->B_r[i] + p_f->p_phi[i]*p_f->B_phi[i]
98 + p_f->p_z[i]*p_f->B_z[i]) < 0 ) {
99 if(p_f->bounces[i] > 0) {
100 /* Half bounce */
101 p_f->bounces[i] *= -1;
102 }
103 else if(p_f->bounces[i] < 0) {
104 /* Bounce complete */
105 p_f->bounces[i] *= -1;
106 p_f->bounces[i] += 1;
107 }
108 else {
109 /* Initial bounce */
110 p_f->bounces[i] += 1;
111 }
112 }
113
114 /* Check if the marker time exceeds simulation time */
115 if(active_tlim) {
116 if(!sim->reverse_time && p_f->time[i] > sim->endcond_lim_simtime) {
117 p_f->endcond[i] |= endcond_tlim;
118 p_f->running[i] = 0;
119 }
120 if(sim->reverse_time && p_f->time[i] < sim->endcond_lim_simtime) {
121 p_f->endcond[i] |= endcond_tlim;
122 p_f->running[i] = 0;
123 }
124 if(p_f->mileage[i] > sim->endcond_max_mileage) {
125 p_f->endcond[i] |= endcond_tlim;
126 p_f->running[i] = 0;
127 }
128 }
129
130 /* Check, using the wall collision module, whether marker hit wall
131 * during this time-step. Store the wall element ID if it did. */
132 if(active_wall) {
133 real w_coll = 0;
134 int tile = wall_hit_wall(
135 p_i->r[i], p_i->phi[i], p_i->z[i],
136 p_f->r[i], p_f->phi[i], p_f->z[i], &sim->wall_data, &w_coll);
137 if(tile > 0) {
138 real w = w_coll;
139 p_f->time[i] = p_i->time[i] + w*(p_f->time[i] - p_i->time[i]);
140 p_f->r[i] = p_i->r[i] + w*(p_f->r[i] - p_i->r[i]);
141 p_f->phi[i] = p_i->phi[i] + w*(p_f->phi[i] - p_i->phi[i]);
142 p_f->z[i] = p_i->z[i] + w*(p_f->z[i] - p_i->z[i]);
143
144 p_f->walltile[i] = tile;
145 p_f->endcond[i] |= endcond_wall;
146 p_f->running[i] = 0;
147 }
148 }
149
150 /* Evaluate marker energy, and check if it is below the minimum
151 * energy limit or local thermal energy limit */
152 if(active_emin || active_therm) {
153
154 real Ti, vflow;
155 a5err errflag =
156 plasma_eval_temp(&Ti, p_f->rho[i], p_f->r[i], p_f->phi[i],
157 p_f->z[i], p_f->time[i], 1,
158 &sim->plasma_data);
159 plasma_eval_flow(&vflow, p_f->rho[i], p_f->r[i], p_f->phi[i],
160 p_f->z[i], p_f->time[i], &sim->plasma_data);
161
162 /* Error handling */
163 if(errflag) {
164 p_f->err[i] = errflag;
165 p_f->running[i] = 0;
166 Ti = 0;
167 vflow = 0;
168 }
169 real pnorm = math_normc(
170 p_f->p_r[i], p_f->p_phi[i], p_f->p_z[i]);
171 real gamma = physlib_gamma_pnorm(p_f->mass[i], pnorm);
172 real vplasma[3];
173 real bnorm = math_normc(p_f->B_r[i], p_f->B_phi[i], p_f->B_z[i]);
174 vplasma[0] = ( p_f->p_r[i] / ( gamma * p_f->mass[i] )
175 - vflow * p_f->B_r[i] / bnorm );
176 vplasma[1] = ( p_f->p_phi[i] / ( gamma * p_f->mass[i] )
177 - vflow * p_f->B_phi[i] / bnorm );
178 vplasma[2] = p_f->p_z[i] / ( gamma * p_f->mass[i] )
179 - vflow * p_f->B_z[i] / bnorm;
180
181 real vnorm = math_norm(vplasma);
182 pnorm = physlib_pnorm_vnorm(p_f->mass[i], vnorm);
183 real ekin = physlib_Ekin_pnorm(p_f->mass[i], pnorm);
184
185 if( active_emin && (ekin < sim->endcond_min_ekin) ) {
186 p_f->endcond[i] |= endcond_emin;
187 p_f->running[i] = 0;
188 }
189 if( active_therm && (ekin < (sim->endcond_min_thermal * Ti)) ) {
190 p_f->endcond[i] |= endcond_therm;
191 p_f->running[i] = 0;
192 }
193 }
194
195 /* Check if marker is not within the rho limits */
196 if(active_rhomax) {
197 if(p_f->rho[i] > sim->endcond_max_rho) {
198 p_f->endcond[i] |= endcond_rhomax;
199 p_f->running[i] = 0;
200 }
201 }
202 if(active_rhomin) {
203 if(p_f->rho[i] < sim->endcond_min_rho) {
204 p_f->endcond[i] |= endcond_rhomin;
205 p_f->running[i] = 0;
206 }
207 }
208
209 /* Check if marker exceeds toroidal or poloidal limits */
210 int maxorb = 0;
211 if(active_tormax) {
212 if(fabs(p_f->phi[i]) > sim->endcond_max_tororb) {
213 maxorb |= endcond_tormax;
214 }
215 }
216 if(active_polmax) {
217 if(fabs(p_f->theta[i]) > sim->endcond_max_polorb) {
218 maxorb |= endcond_polmax;
219 }
220 else if( p_f->bounces[i] - 1 >=
221 (int)(sim->endcond_max_polorb / CONST_2PI )) {
222 maxorb |= endcond_polmax;
223 }
224 }
225 if( sim->endcond_torandpol &&
226 maxorb & endcond_tormax && maxorb & endcond_polmax ) {
227 p_f->endcond[i] |= maxorb;
228 p_f->running[i] = 0;
229 }
230 else if(!sim->endcond_torandpol && maxorb) {
231 p_f->endcond[i] |= maxorb;
232 p_f->running[i] = 0;
233 }
234 /* Check if the time spent simulating this marker exceeds the
235 * given limit*/
236 if(active_cpumax) {
237 if(p_f->cputime[i] > sim->endcond_max_cputime) {
238 p_f->endcond[i] |= endcond_cpumax;
239 p_f->running[i] = 0;
240 }
241 }
242 /* Check if the particle has been neutralized */
243 if(active_neutr) {
244 if(p_i->charge[i] != 0.0 && p_f->charge[i] == 0.0) {
245 p_f->endcond[i] |= endcond_neutr;
246 p_f->running[i] = 0;
247 }
248 }
249
250 /* Check if the particle has been ionized */
251 if(active_ioniz) {
252 if(p_i->charge[i] == 0.0 && p_f->charge[i] != 0.0) {
253 p_f->endcond[i] |= endcond_ioniz;
254 p_f->running[i] = 0;
255 }
256 }
257
258 /* Zero end condition if error happened in this function */
259 if(p_f->err[i]) {
260 p_f->endcond[i] = 0;
261 }
262 }
263 }
264}
265
278 sim_data* sim) {
279 int i;
280
281 int active_tlim = sim->endcond_active & endcond_tlim;
282 int active_wall = sim->endcond_active & endcond_wall;
283 int active_emin = sim->endcond_active & endcond_emin;
284 int active_therm = sim->endcond_active & endcond_therm;
285 int active_rhomax = sim->endcond_active & endcond_rhomax;
286 int active_rhomin = sim->endcond_active & endcond_rhomin;
287 int active_polmax = sim->endcond_active & endcond_polmax;
288 int active_tormax = sim->endcond_active & endcond_tormax;
289 int active_cpumax = sim->endcond_active & endcond_cpumax;
290
291 GPU_PARALLEL_LOOP_ALL_LEVELS
292 for(i = 0; i < p_f->n_mrk; i++) {
293 if(p_f->running[i]) {
294 /* Update bounces if pitch changed sign */
295 if( p_i->ppar[i] * p_f->ppar[i] < 0 ) {
296 if(p_f->bounces[i] > 0) {
297 /* Half bounce */
298 p_f->bounces[i] *= -1;
299 }
300 else if(p_f->bounces[i] < 0) {
301 /* Bounce complete */
302 p_f->bounces[i] *= -1;
303 p_f->bounces[i] += 1;
304 }
305 else {
306 /* Initial bounce */
307 p_f->bounces[i] += 1;
308 }
309 }
310
311 /* Check if the marker time exceeds simulation time */
312 if(active_tlim) {
313 if(!sim->reverse_time && p_f->time[i] > sim->endcond_lim_simtime) {
314 p_f->endcond[i] |= endcond_tlim;
315 p_f->running[i] = 0;
316 }
317 if(sim->reverse_time && p_f->time[i] < sim->endcond_lim_simtime) {
318 p_f->endcond[i] |= endcond_tlim;
319 p_f->running[i] = 0;
320 }
321 if(p_f->mileage[i] > sim->endcond_max_mileage) {
322 p_f->endcond[i] |= endcond_tlim;
323 p_f->running[i] = 0;
324 }
325 }
326
327 /* Check, using the wall collision module, whether marker hit wall
328 * during this time-step. Store the wall element ID if it did. */
329 if(active_wall) {
330 real w_coll = 0;
331 int tile = wall_hit_wall(p_i->r[i], p_i->phi[i], p_i->z[i],
332 p_f->r[i], p_f->phi[i], p_f->z[i],
333 &sim->wall_data, &w_coll);
334 if(tile > 0) {
335 p_f->walltile[i] = tile;
336 p_f->endcond[i] |= endcond_wall;
337 p_f->running[i] = 0;
338 }
339 }
340
341 /* Evaluate marker energy, and check if it is below the minimum
342 * energy limit or local thermal energy limit */
343 if(active_emin || active_therm) {
344 real Bnorm = math_normc(
345 p_f->B_r[i], p_f->B_phi[i], p_f->B_z[i]);
346
347
348 real Ti, vflow;
349 a5err errflag =
350 plasma_eval_temp(&Ti, p_f->rho[i], p_f->r[i], p_f->phi[i],
351 p_f->z[i], p_f->time[i], 1,
352 &sim->plasma_data);
353 plasma_eval_flow(&vflow, p_f->rho[i], p_f->r[i], p_f->phi[i],
354 p_f->z[i], p_f->time[i], &sim->plasma_data);
355
356 /* Error handling */
357 if(errflag) {
358 p_f->err[i] = errflag;
359 p_f->running[i] = 0;
360 Ti = 0;
361 vflow = 0;
362 }
363 real pnorm = physlib_gc_p(
364 p_f->mass[i], p_f->mu[i], p_f->ppar[i], Bnorm);
365 real xi = physlib_gc_xi(
366 p_f->mass[i], p_f->mu[i], p_f->ppar[i], Bnorm);
367 real vnorm = physlib_vnorm_pnorm(p_f->mass[i], pnorm);
368 real vpar = xi * vnorm;
369 real vperp2 = (1 - xi * xi) * vnorm * vnorm;
370 vnorm = sqrt((vpar - vflow) * (vpar - vflow) + vperp2);
371 real gamma = physlib_gamma_vnorm(vnorm);
372 real ekin = physlib_Ekin_gamma(p_f->mass[i], gamma);
373
374 if(active_emin && (ekin < sim->endcond_min_ekin) ) {
375 p_f->endcond[i] |= endcond_emin;
376 p_f->running[i] = 0;
377 }
378 if( active_therm && (ekin < (sim->endcond_min_thermal * Ti)) ) {
379 p_f->endcond[i] |= endcond_therm;
380 p_f->running[i] = 0;
381 }
382 }
383
384 /* Check if marker is not within the rho limits */
385 if(active_rhomax) {
386 if(p_f->rho[i] > sim->endcond_max_rho) {
387 p_f->endcond[i] |= endcond_rhomax;
388 p_f->running[i] = 0;
389 }
390 }
391 if(active_rhomin) {
392 if(p_f->rho[i] < sim->endcond_min_rho) {
393 p_f->endcond[i] |= endcond_rhomin;
394 p_f->running[i] = 0;
395 }
396 }
397
398 /* Check if marker exceeds toroidal or poloidal limits */
399 int maxorb = 0;
400 if(active_tormax) {
401 if(fabs(p_f->phi[i]) > sim->endcond_max_tororb) {
402 maxorb |= endcond_tormax;
403 }
404 }
405 if(active_polmax) {
406 if(fabs(p_f->theta[i]) > sim->endcond_max_polorb) {
407 maxorb |= endcond_polmax;
408 }
409 else if(p_f->bounces[i] - 1 >=
410 (int)(sim->endcond_max_polorb / CONST_2PI)) {
411 maxorb |= endcond_polmax;
412 }
413 }
414 if( sim->endcond_torandpol &&
415 maxorb & endcond_tormax && maxorb & endcond_polmax ) {
416 p_f->endcond[i] |= maxorb;
417 p_f->running[i] = 0;
418 }
419 else if(!sim->endcond_torandpol && maxorb) {
420 p_f->endcond[i] |= maxorb;
421 p_f->running[i] = 0;
422 }
423
424 /* Check if the time spent simulating this marker exceeds the
425 * given limit*/
426 if(active_cpumax) {
427 if(p_f->cputime[i] > sim->endcond_max_cputime) {
428 p_f->endcond[i] |= endcond_cpumax;
429 p_f->running[i] = 0;
430 }
431 }
432
433 /* If hybrid mode is used, check whether this marker meets the hybrid
434 * condition. */
435 if(sim->sim_mode == 3) {
436 if(p_f->rho[i] > sim->endcond_max_rho) {
437 p_f->endcond[i] |= endcond_hybrid;
438 p_f->running[i] = 0;
439 }
440 }
441
442 /* Zero end condition if error happened in this function */
443 if(p_f->err[i]) {
444 p_f->endcond[i] = 0;
445 }
446 }
447 }
448}
449
462 sim_data* sim) {
463 int i;
464
465 int active_tlim = sim->endcond_active & endcond_tlim;
466 int active_wall = sim->endcond_active & endcond_wall;
467 int active_rhomax = sim->endcond_active & endcond_rhomax;
468 int active_rhomin = sim->endcond_active & endcond_rhomin;
469 int active_polmax = sim->endcond_active & endcond_polmax;
470 int active_tormax = sim->endcond_active & endcond_tormax;
471 int active_cpumax = sim->endcond_active & endcond_cpumax;
472
473 #pragma omp simd
474 for(i = 0; i < NSIMD; i++) {
475 if(p_f->running[i]) {
476 /* Check if the marker time exceeds simulation time */
477 if(active_tlim) {
478 if(!sim->reverse_time && p_f->time[i] > sim->endcond_lim_simtime) {
479 p_f->endcond[i] |= endcond_tlim;
480 p_f->running[i] = 0;
481 }
482 if(sim->reverse_time && p_f->time[i] < sim->endcond_lim_simtime) {
483 p_f->endcond[i] |= endcond_tlim;
484 p_f->running[i] = 0;
485 }
486 if(p_f->mileage[i] > sim->endcond_max_mileage) {
487 p_f->endcond[i] |= endcond_tlim;
488 p_f->running[i] = 0;
489 }
490 }
491
492 /* Check, using the wall collision module, whether marker hit wall
493 * during this time-step. Store the wall element ID if it did. */
494 if(active_wall) {
495 real w_coll = 0;
496 int tile = wall_hit_wall(p_i->r[i], p_i->phi[i], p_i->z[i],
497 p_f->r[i], p_f->phi[i], p_f->z[i],
498 &sim->wall_data, &w_coll);
499 if(tile > 0) {
500 p_f->walltile[i] = tile;
501 p_f->endcond[i] |= endcond_wall;
502 p_f->running[i] = 0;
503 }
504 }
505
506 /* Check if marker is not within the rho limits */
507 if(active_rhomax) {
508 if(p_f->rho[i] > sim->endcond_max_rho) {
509 p_f->endcond[i] |= endcond_rhomax;
510 p_f->running[i] = 0;
511 }
512 }
513 if(active_rhomin) {
514 if(p_f->rho[i] < sim->endcond_min_rho) {
515 p_f->endcond[i] |= endcond_rhomin;
516 p_f->running[i] = 0;
517 }
518 }
519
520 /* Check if marker exceeds toroidal or poloidal limits */
521 int maxorb = 0;
522 if(active_tormax) {
523 if(fabs(p_f->phi[i]) > sim->endcond_max_tororb) {
524 maxorb |= endcond_tormax;
525 }
526 }
527 if(active_polmax) {
528 if(fabs(p_f->theta[i]) > sim->endcond_max_polorb) {
529 maxorb |= endcond_polmax;
530 }
531 }
532 if( sim->endcond_torandpol &&
533 maxorb & endcond_tormax && maxorb & endcond_polmax ) {
534 p_f->endcond[i] |= maxorb;
535 p_f->running[i] = 0;
536 }
537 else if(!sim->endcond_torandpol && maxorb) {
538 p_f->endcond[i] |= maxorb;
539 p_f->running[i] = 0;
540 }
541
542 /* Check if the time spent simulating this marker exceeds the
543 * given limit*/
544 if(active_cpumax) {
545 if(p_f->cputime[i] > sim->endcond_max_cputime) {
546 p_f->endcond[i] |= endcond_cpumax;
547 p_f->running[i] = 0;
548 }
549 }
550 }
551 }
552}
553
564void endcond_parse(int endcond, int* endconds) {
565 int i = 0;
566
567 if(endcond & endcond_tlim) {endconds[i++] = 1;};
568 if(endcond & endcond_emin) {endconds[i++] = 2;};
569 if(endcond & endcond_therm) {endconds[i++] = 3;};
570 if(endcond & endcond_wall) {endconds[i++] = 4;};
571 if(endcond & endcond_rhomin) {endconds[i++] = 5;};
572 if(endcond & endcond_rhomax) {endconds[i++] = 6;};
573 if(endcond & endcond_polmax) {endconds[i++] = 7;};
574 if(endcond & endcond_tormax) {endconds[i++] = 8;};
575 if(endcond & endcond_cpumax) {endconds[i++] = 9;};
576 if(endcond & endcond_hybrid) {endconds[i++] = 10;};
577 if(endcond & endcond_neutr) {endconds[i++] = 11;};
578 if(endcond & endcond_ioniz) {endconds[i++] = 12;};
579}
580
590void endcond_parse2str(int endcond, char* str) {
591 int endconds[32];
592 endcond_parse(endcond, endconds);
593
594 switch(endcond) {
595 case 1:
596 sprintf(str, "Sim time limit");
597 break;
598 case 2:
599 sprintf(str, "Min energy");
600 break;
601 case 3:
602 sprintf(str, "Thermalization");
603 break;
604 case 4:
605 sprintf(str, "Wall collision");
606 break;
607 case 5:
608 sprintf(str, "Min rho");
609 break;
610 case 6:
611 sprintf(str, "Max rho");
612 break;
613 case 7:
614 sprintf(str, "Max poloidal orbits");
615 break;
616 case 8:
617 sprintf(str, "Max toroidal orbits");
618 break;
619 case 9:
620 sprintf(str, "CPU time exceeded");
621 break;
622 case 10:
623 sprintf(str, "Hybrid condition");
624 break;
625 case 11:
626 sprintf(str, "Neutralization");
627 break;
628 case 12:
629 sprintf(str, "Ionization");
630 break;
631 }
632}
double real
Definition ascot5.h:85
#define NSIMD
Number of particles simulated simultaneously in a particle group operations.
Definition ascot5.h:91
Header file containing physical and mathematical constants.
#define CONST_2PI
2*pi
Definition consts.h:14
void endcond_parse(int endcond, int *endconds)
Split endcond to an array of end conditions.
Definition endcond.c:564
void endcond_check_gc(particle_simd_gc *p_f, particle_simd_gc *p_i, sim_data *sim)
Check end conditions for GC markers.
Definition endcond.c:277
void endcond_check_fo(particle_simd_fo *p_f, particle_simd_fo *p_i, sim_data *sim)
Check end conditions for FO markers.
Definition endcond.c:73
void endcond_check_ml(particle_simd_ml *p_f, particle_simd_ml *p_i, sim_data *sim)
Check end conditions for ML markers.
Definition endcond.c:461
void endcond_parse2str(int endcond, char *str)
Represent end condition in human-readable format.
Definition endcond.c:590
Header file for endcond.c.
@ endcond_therm
Definition endcond.h:21
@ endcond_tormax
Definition endcond.h:26
@ endcond_emin
Definition endcond.h:20
@ endcond_rhomin
Definition endcond.h:23
@ endcond_tlim
Definition endcond.h:19
@ endcond_neutr
Definition endcond.h:29
@ endcond_cpumax
Definition endcond.h:27
@ endcond_polmax
Definition endcond.h:25
@ endcond_rhomax
Definition endcond.h:24
@ endcond_wall
Definition endcond.h:22
@ endcond_hybrid
Definition endcond.h:28
@ endcond_ioniz
Definition endcond.h:30
unsigned long int a5err
Simulation error flag.
Definition error.h:17
Header file for math.c.
#define math_normc(a1, a2, a3)
Calculate norm of 3D vector from its components a1, a2, a3.
Definition math.h:71
#define math_norm(a)
Calculate norm of 3D vector a.
Definition math.h:68
Header file for particle.c.
Methods to evaluate elementary physical quantities.
#define physlib_gamma_pnorm(m, p)
Evaluate Lorentz factor from momentum norm.
Definition physlib.h:46
#define physlib_gc_xi(m, mu, ppar, B)
Evaluate guiding center pitch from parallel momentum and magnetic moment.
Definition physlib.h:214
#define physlib_Ekin_pnorm(m, p)
Evaluate kinetic energy [J] from momentum norm.
Definition physlib.h:115
#define physlib_pnorm_vnorm(m, v)
Evaluate momentum norm [kg m/s] from velocity norm.
Definition physlib.h:154
#define physlib_vnorm_pnorm(m, p)
Evaluate velocity norm [m/s] from momentum norm.
Definition physlib.h:141
#define physlib_Ekin_gamma(m, gamma)
Evaluate kinetic energy [J] from Lorentz factor.
Definition physlib.h:91
#define physlib_gc_p(m, mu, ppar, B)
Evaluate guiding center momentum norm [kg m/s] from parallel momentum and magnetic moment.
Definition physlib.h:198
#define physlib_gamma_vnorm(v)
Evaluate Lorentz factor from velocity norm.
Definition physlib.h:21
a5err plasma_eval_flow(real *vflow, real rho, real r, real phi, real z, real t, plasma_data *pls_data)
Evalate plasma flow along the field lines.
Definition plasma.c:258
a5err plasma_eval_temp(real *temp, real rho, real r, real phi, real z, real t, int species, plasma_data *pls_data)
Evaluate plasma temperature.
Definition plasma.c:98
Header file for plasma.c.
Header file for simulate.c.
Struct representing NSIMD particle markers.
Definition particle.h:210
integer * endcond
Definition particle.h:247
integer * walltile
Definition particle.h:248
integer * running
Definition particle.h:252
Struct representing NSIMD guiding center markers.
Definition particle.h:275
integer * walltile
Definition particle.h:314
integer * endcond
Definition particle.h:313
integer * running
Definition particle.h:320
Struct representing NSIMD field line markers.
Definition particle.h:343
Simulation data struct.
Definition simulate.h:58
int endcond_torandpol
Definition simulate.h:127
real endcond_max_rho
Definition simulate.h:121
int sim_mode
Definition simulate.h:78
plasma_data plasma_data
Definition simulate.h:62
real endcond_max_tororb
Definition simulate.h:125
real endcond_min_thermal
Definition simulate.h:123
real endcond_max_mileage
Definition simulate.h:118
int endcond_active
Definition simulate.h:116
real endcond_max_polorb
Definition simulate.h:126
real endcond_max_cputime
Definition simulate.h:119
real endcond_min_rho
Definition simulate.h:120
real endcond_lim_simtime
Definition simulate.h:117
wall_data wall_data
Definition simulate.h:64
int reverse_time
Definition simulate.h:113
int wall_hit_wall(real r1, real phi1, real z1, real r2, real phi2, real z2, wall_data *w, real *w_coll)
Check if a given directed line segment intersects the wall.
Definition wall.c:80