ASCOT5
|
COM-distribution collecting and processing functions. More...
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "../ascot5.h"
#include "../consts.h"
#include "../physlib.h"
#include "../particle.h"
#include "dist_com.h"
Go to the source code of this file.
Functions | |
size_t | dist_COM_index (int i_mu, int i_Ekin, int i_Ptor, size_t step_2, size_t step_1) |
Internal function calculating the index in the histogram array. | |
int | dist_COM_init (dist_COM_data *data) |
Initializes distribution data. | |
void | dist_COM_free (dist_COM_data *data) |
Free allocated resources. | |
void | dist_COM_offload (dist_COM_data *data) |
Offload data to the accelerator. | |
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_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. | |
COM-distribution collecting and processing functions.
Definition in file dist_com.c.
size_t dist_COM_index | ( | int | i_mu, |
int | i_Ekin, | ||
int | i_Ptor, | ||
size_t | step_2, | ||
size_t | step_1 ) |
Internal function calculating the index in the histogram array.
Definition at line 17 of file dist_com.c.
int dist_COM_init | ( | dist_COM_data * | data | ) |
Initializes distribution data.
data | pointer to data struct |
Definition at line 29 of file dist_com.c.
void dist_COM_free | ( | dist_COM_data * | data | ) |
Free allocated resources.
data | pointer to the data struct |
Definition at line 46 of file dist_com.c.
void dist_COM_offload | ( | dist_COM_data * | data | ) |
Offload data to the accelerator.
data | pointer to the data struct |
Definition at line 55 of file dist_com.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.
dist | pointer to distribution parameter struct |
Bdata | pointer to magnetic field data |
p_f | pointer to SIMD fo struct at the end of current time step |
p_i | pointer to SIMD fo struct at the start of current time step |
Definition at line 67 of file dist_com.c.
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.
This function updates the histogram from the marker data. Bins are calculated as vector op and histogram is updates as an atomic operation to avoid race conditions.
dist | pointer to distribution parameter struct |
Bdata | pointer to magnetic field data |
p_f | pointer to SIMD gc struct at the end of current time step |
p_i | pointer to SIMD gc struct at the start of current time step |
Definition at line 124 of file dist_com.c.