124 *offload_array = malloc(n *
sizeof(
real));
125 if(*offload_array == NULL) {
129 memset(*offload_array, 0, n *
sizeof(
real));
141 free(*offload_array);
142 *offload_array = NULL;
153 real* offload_array) {
329 memcpy(&(array1[arr_start+arr_length]),
330 &(array2[arr_start]),
331 arr_length*
sizeof(
real));
338 memcpy(&(array1[arr_start+arr_length]),
339 &(array2[arr_start]),
340 arr_length*
sizeof(
real));
345 size_t stop = start + (size_t)(data->
dist5D.
n_r)
354 size_t stop = start + (size_t)(data->
dist6D.
n_r)
404 for(
size_t i = start; i < stop; i++) {
405 array1[i] += array2[i];
Header file for B_field.c.
Main header file for ASCOT5.
void diag_update_fo(diag_data *data, B_field_data *Bdata, particle_simd_fo *p_f, particle_simd_fo *p_i)
Collects diagnostics when marker represents a particle.
void diag_sum(diag_offload_data *data, real *array1, real *array2)
Sum offload data arrays as one.
void diag_free_offload(diag_offload_data *data, real **offload_array)
Frees the offload array.
int diag_init_offload(diag_offload_data *data, real **offload_array, int Nmrk)
Initializes offload array from offload data.
void diag_init(diag_data *data, diag_offload_data *offload_data, real *offload_array)
Initializes diagnostics from offload data.
void diag_arraysum(size_t start, size_t stop, real *array1, real *array2)
Simple helper function for summing elements of two arrays of same size.
void diag_free(diag_data *data)
Free diagnostics data.
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 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 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_init(diag_orb_data *data, diag_orb_offload_data *offload_data, real *offload_array)
Initializes orbit diagnostics offload data.
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.
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_free(diag_orb_data *data)
Free orbit diagnostics data.
Header file for diag_orb.c.
#define DIAG_ORB_POINCARE
#define DIAG_ORB_HYBRIDFIELDS
#define DIAG_ORB_INTERVAL
#define DIAG_ORB_GCFIELDS
#define DIAG_ORB_FOFIELDS
#define DIAG_ORB_MLFIELDS
void diag_transcoef_update_ml(diag_transcoef_data *data, particle_simd_ml *p_f, particle_simd_ml *p_i)
Collect transport diagnostics for ml simulation.
void diag_transcoef_update_gc(diag_transcoef_data *data, particle_simd_gc *p_f, particle_simd_gc *p_i)
Collect transport diagnostics for gc simulation.
void diag_transcoef_update_fo(diag_transcoef_data *data, particle_simd_fo *p_f, particle_simd_fo *p_i)
Collect transport diagnostics for fo simulation.
void diag_transcoef_free(diag_transcoef_data *data)
Free transport coefficient data on target.
void diag_transcoef_init(diag_transcoef_data *data, diag_transcoef_offload_data *offload_data, real *offload_array)
Initializes orbit diagnostics offload data.
Header file for diag_transcoef.c.
void dist_5D_update_gc(dist_5D_data *dist, particle_simd_gc *p_f, particle_simd_gc *p_i)
Update the histogram from guiding center markers.
void dist_5D_init(dist_5D_data *dist_data, dist_5D_offload_data *offload_data, real *offload_array)
Initializes distribution from offload data.
void dist_5D_update_fo(dist_5D_data *dist, particle_simd_fo *p_f, particle_simd_fo *p_i)
Update the histogram from full-orbit particles.
Header file for dist_5D.c.
void dist_6D_update_fo(dist_6D_data *dist, particle_simd_fo *p_f, particle_simd_fo *p_i)
Update the histogram from full-orbit particles.
void dist_6D_init(dist_6D_data *dist_data, dist_6D_offload_data *offload_data, real *offload_array)
Initializes distribution from offload data.
void dist_6D_update_gc(dist_6D_data *dist, particle_simd_gc *p_f, particle_simd_gc *p_i)
Update the histogram from guiding-center particles.
Header file for dist_6D.c.
void dist_COM_update_fo(dist_COM_data *dist, B_field_data *Bdata, particle_simd_fo *p_f, particle_simd_fo *p_i)
Update the histogram from full-orbit markers.
void dist_COM_init(dist_COM_data *dist_data, dist_COM_offload_data *offload_data, real *offload_array)
Initializes distribution from offload data.
void dist_COM_update_gc(dist_COM_data *dist, B_field_data *Bdata, particle_simd_gc *p_f, particle_simd_gc *p_i)
Update the histogram from guiding center markers.
Header file for dist_com.c.
void dist_rho5D_update_gc(dist_rho5D_data *dist, particle_simd_gc *p_f, particle_simd_gc *p_i)
Update the histogram from guiding center markers.
void dist_rho5D_init(dist_rho5D_data *dist_data, dist_rho5D_offload_data *offload_data, real *offload_array)
Initializes distribution from offload data.
void dist_rho5D_update_fo(dist_rho5D_data *dist, particle_simd_fo *p_f, particle_simd_fo *p_i)
Update the histogram from full-orbit particles.
Header file for dist_rho5D.c.
void dist_rho6D_update_gc(dist_rho6D_data *dist, particle_simd_gc *p_f, particle_simd_gc *p_i)
Update the histogram from guiding-center particles.
void dist_rho6D_init(dist_rho6D_data *dist_data, dist_rho6D_offload_data *offload_data, real *offload_array)
Initializes distribution from offload data.
void dist_rho6D_update_fo(dist_rho6D_data *dist, particle_simd_fo *p_f, particle_simd_fo *p_i)
Update the histogram from full-orbit particles.
Header file for dist_rho6D.c.
Header file for particle.c.
Header file for simulate.c.
Magnetic field simulation data.
diag_transcoef_data diagtrcof
dist_rho6D_data distrho6D
dist_rho5D_data distrho5D
Diagnostics offload data struct.
dist_rho5D_offload_data distrho5D
size_t offload_distCOM_index
size_t offload_dist_length
diag_transcoef_offload_data diagtrcof
dist_5D_offload_data dist5D
size_t offload_distrho6D_index
size_t offload_distrho5D_index
size_t offload_dist6D_index
size_t offload_diagtrcof_index
dist_6D_offload_data dist6D
dist_rho6D_offload_data distrho6D
size_t offload_dist5D_index
size_t offload_array_length
dist_COM_offload_data distCOM
size_t offload_diagorb_index
diag_orb_offload_data diagorb
Struct representing NSIMD particle markers.
Struct representing NSIMD guiding center markers.
Struct representing NSIMD field line markers.