ASCOT5
|
Functions to write particle and guiding center information. More...
#include "diag_orb.h"
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "../ascot5.h"
#include "../consts.h"
#include "../simulate.h"
Go to the source code of this file.
Functions | |
void | diag_orb_init (diag_orb_data *data, diag_orb_offload_data *offload_data, real *offload_array) |
Initializes orbit diagnostics offload data. | |
void | diag_orb_free (diag_orb_data *data) |
Free orbit diagnostics data. | |
void | diag_orb_update_fo (diag_orb_data *data, particle_simd_fo *p_f, particle_simd_fo *p_i) |
Collects orbit diagnostics when marker represents a particle. | |
void | diag_orb_update_gc (diag_orb_data *data, particle_simd_gc *p_f, particle_simd_gc *p_i) |
Collects orbit diagnostics when marker represents a guiding center. | |
void | diag_orb_update_ml (diag_orb_data *data, particle_simd_ml *p_f, particle_simd_ml *p_i) |
Collects orbit diagnostics when marker represents a field line. | |
real | diag_orb_check_plane_crossing (real fang, real iang, real ang0) |
Check if marker has crossed a plane. | |
real | diag_orb_check_radial_crossing (real frho, real irho, real rho0) |
Check if marker has crossed given rho. | |
Functions to write particle and guiding center information.
Definition in file diag_orb.c.
void diag_orb_init | ( | diag_orb_data * | data, |
diag_orb_offload_data * | offload_data, | ||
real * | offload_array ) |
Initializes orbit diagnostics offload data.
The offload array should have a length of Nfld * Nmrk * Npnt and elements initialized to zero. The orbit data will be stored in this field as arr[i_field*N_markers*N_points + i_marker*N_points + i_point].
Note that not all markers fill all space assigned to them before their simulation is terminated.
data | orbit diagnostics data struct |
offload_data | orbit diagnostics offload data struct |
offload_array | offload data array |
Definition at line 28 of file diag_orb.c.
void diag_orb_free | ( | diag_orb_data * | data | ) |
Free orbit diagnostics data.
data | orbit diagnostics data struct |
Definition at line 147 of file diag_orb.c.
void diag_orb_update_fo | ( | diag_orb_data * | data, |
particle_simd_fo * | p_f, | ||
particle_simd_fo * | p_i ) |
Collects orbit diagnostics when marker represents a particle.
data | orbit diagnostics data struct |
p_f | pointer to SIMD struct storing marker states at the end of current time-step |
p_i | pointer to SIMD struct storing marker states at the beginning of current time-step |
Definition at line 161 of file diag_orb.c.
void diag_orb_update_gc | ( | diag_orb_data * | data, |
particle_simd_gc * | p_f, | ||
particle_simd_gc * | p_i ) |
Collects orbit diagnostics when marker represents a guiding center.
data | orbit diagnostics data struct |
p_f | pointer to SIMD struct storing marker states at the end of current time-step |
p_i | pointer to SIMD struct storing marker states at the beginning of current time-step |
Definition at line 367 of file diag_orb.c.
void diag_orb_update_ml | ( | diag_orb_data * | data, |
particle_simd_ml * | p_f, | ||
particle_simd_ml * | p_i ) |
Collects orbit diagnostics when marker represents a field line.
data | orbit diagnostics data struct |
p_f | pointer to SIMD struct storing marker states at the end of current time-step |
p_i | pointer to SIMD struct storing marker states at the beginning of current time-step |
Definition at line 574 of file diag_orb.c.
Check if marker has crossed a plane.
This helper function checks whether the angle, either toroidal or poloidal, that defines a Poincare plane is between marker's initial and final angles (of single timestep).
fang | marker final angle in radians. |
iang | marker initial angle in radians. |
ang0 | Poincare plane angle. |
Definition at line 758 of file diag_orb.c.
Check if marker has crossed given rho.
This helper function checks whether given rho that defines a Poincare plane is between marker's initial and final rhos (of single timestep).
frho | marker final rho in metres. |
irho | marker initial rho in metres. |
rho0 | Poincare plane rho. |
Definition at line 792 of file diag_orb.c.