ASCOT5
|
Header file for asigma.c. More...
Go to the source code of this file.
Data Structures | |
struct | asigma_offload_data |
Atomic reaction offload data. More... | |
struct | asigma_data |
Atomic reaction simulation data. More... | |
Typedefs | |
typedef enum asigma_type | asigma_type |
Atomic reaction data types. | |
typedef enum asigma_reac_type | asigma_reac_type |
Reaction types for atomic reaction data. | |
Enumerations | |
enum | asigma_type { asigma_type_loc } |
Atomic reaction data types. More... | |
enum | asigma_reac_type { sigma_ioniz = 1 , sigma_recomb = 2 , sigma_CX = 3 , sigmav_ioniz = 4 , sigmav_recomb = 5 , sigmav_CX = 6 , sigmav_BMS = 7 , sigmaveff_ioniz = 8 , sigmaveff_recomb = 9 , sigmaveff_CX = 10 } |
Reaction types for atomic reaction data. More... | |
Functions | |
int | asigma_init_offload (asigma_offload_data *offload_data, real **offload_array) |
Load atomic reaction data and prepare parameters. | |
void | asigma_free_offload (asigma_offload_data *offload_data, real **offload_array) |
Free offload array and reset parameters. | |
void | asigma_extrapolate (int extrapolate) |
Toggle extrapolation when evaluating cross sections. | |
int | asigma_init (asigma_data *asigma_data, asigma_offload_data *offload_data, real *offload_array) |
Initializes atomic reaction data struct on target. | |
a5err | asigma_eval_sigma (real *sigma, int z_1, int a_1, int z_2, int a_2, real E_coll_per_amu, asigma_reac_type reac_type, asigma_data *asigmadata) |
Evaluate atomic reaction cross-section. | |
a5err | asigma_eval_sigmav (real *sigmav, int z_1, int a_1, real m_1, int z_2, int a_2, real E, real T_e, real T_0, real n_i, asigma_reac_type reac_type, asigma_data *asigmadata) |
Evaluate atomic reaction rate coefficient. | |
a5err | asigma_eval_cx (real *ratecoeff, int z_1, int a_1, real E, real mass, int nspec, const int *znum, const int *anum, real T_0, real *n_0, asigma_data *asigmadata) |
Evaluate charge exchange rate coefficient. | |
a5err | asigma_eval_bms (real *ratecoeff, int z_1, int a_1, real E, real mass, int nion, const int *znum, const int *anum, real T_e, real *n_i, asigma_data *asigmadata) |
Evaluate beam stopping rate coefficient. | |
Header file for asigma.c.
Contains a list declaring all atomic reaction data types, and declaration of asigma_offload_data and asigma_data structs.
Definition in file asigma.h.
typedef enum asigma_type asigma_type |
Atomic reaction data types.
Atomic reaction data types are used in the atomic reaction data interface (asigma.c) to direct function calls to correct atomic reaction data instances. Each atomic reaction data instance must have a corresponding type.
typedef enum asigma_reac_type asigma_reac_type |
Reaction types for atomic reaction data.
The reaction type of atomic reactions is one of the reaction indentifier parameters. It specifies the nature of the reaction and the form of the reaction probability data.
enum asigma_type |
Atomic reaction data types.
Atomic reaction data types are used in the atomic reaction data interface (asigma.c) to direct function calls to correct atomic reaction data instances. Each atomic reaction data instance must have a corresponding type.
Enumerator | |
---|---|
asigma_type_loc | Atomic reaction data from local files |
enum asigma_reac_type |
int asigma_init_offload | ( | asigma_offload_data * | offload_data, |
real ** | offload_array ) |
Load atomic reaction data and prepare parameters.
This function fills the relevant atomic sigma offload struct with parameters and allocates and fills the offload array. Sets offload array length in the offload struct.
The offload data has to have a type when this function is called as it should be set when the offload data is constructed from inputs.
This function is host only.
offload_data | pointer to offload data struct |
offload_array | pointer to pointer to offload array |
void asigma_free_offload | ( | asigma_offload_data * | offload_data, |
real ** | offload_array ) |
void asigma_extrapolate | ( | int | extrapolate | ) |
int asigma_init | ( | asigma_data * | asigma_data, |
asigma_offload_data * | offload_data, | ||
real * | offload_array ) |
Initializes atomic reaction data struct on target.
This function copies some atomic reaction parameters from the offload struct to the struct on target and sets the atomic reaction data pointers to correct offsets in the offload array.
asigma_data | pointer to data struct on target |
offload_data | pointer to offload data struct |
offload_array | pointer to offload array |
a5err asigma_eval_sigma | ( | real * | sigma, |
int | z_1, | ||
int | a_1, | ||
int | z_2, | ||
int | a_2, | ||
real | E_coll_per_amu, | ||
asigma_reac_type | reac_type, | ||
asigma_data * | asigma_data ) |
Evaluate atomic reaction cross-section.
This function evaluates the cross-section (sigma) for the atomic reaction corresponding to the reaction identifiers given as parameters at the given mass-normalized collision energy.
This is a SIMD function.
sigma | pointer to evaluated cross-section |
z_1 | atomic number of fast particle |
a_1 | atomic mass number of fast particle |
z_2 | atomic number of bulk particle |
a_2 | atomic mass number of bulk particle |
E_coll_per_amu | energy per amu corresponding to collision speed |
reac_type | reaction type |
asigma_data | pointer to atomic data struct |
a5err asigma_eval_sigmav | ( | real * | sigmav, |
int | z_1, | ||
int | a_1, | ||
real | m_1, | ||
int | z_2, | ||
int | a_2, | ||
real | E, | ||
real | T_e, | ||
real | T_0, | ||
real | n_i, | ||
asigma_reac_type | reac_type, | ||
asigma_data * | asigma_data ) |
Evaluate atomic reaction rate coefficient.
This function evaluates the rate coefficient (<sigma*v>) for the atomic reaction corresponding to the reaction identifiers given as parameters at the given fast particle energy and bulk plasma conditions.
This is a SIMD function.
sigmav | pointer to evaluated rate coefficient |
z_1 | atomic number of fast particle |
a_1 | atomic mass number of fast particle |
m_1 | mass of fast particle |
z_2 | atomic number of bulk particle |
a_2 | atomic mass number of bulk particle |
E | energy of fast particle |
T_e | electron temperature of bulk plasma |
T_0 | temperature of bulk neutrals |
n_i | ion density of bulk plasma |
reac_type | reaction type |
asigma_data | pointer to atomic data struct |
a5err asigma_eval_cx | ( | real * | ratecoeff, |
int | z_1, | ||
int | a_1, | ||
real | E, | ||
real | mass, | ||
int | nspec, | ||
const int * | znum, | ||
const int * | anum, | ||
real | T_0, | ||
real * | n_0, | ||
asigma_data * | asigma_data ) |
Evaluate charge exchange rate coefficient.
This is a SIMD function.
ratecoeff | pointer to evaluated rate coefficient |
z_1 | atomic number of fast particle |
a_1 | atomic mass number of fast particle |
E | energy of fast particle |
mass | mass of fast particle |
nspec | number of bulk neutral species |
znum | atomic numbers of bulk particles |
anum | atomic mass numbers of bulk particles |
T_0 | temperature of bulk neutrals |
n_0 | densities of bulk neutrals |
asigma_data | pointer to atomic data struct |
a5err asigma_eval_bms | ( | real * | ratecoeff, |
int | z_1, | ||
int | a_1, | ||
real | E, | ||
real | mass, | ||
int | nion, | ||
const int * | znum, | ||
const int * | anum, | ||
real | T_e, | ||
real * | n_i, | ||
asigma_data * | asigma_data ) |
Evaluate beam stopping rate coefficient.
This is a SIMD function.
ratecoeff | pointer to evaluated rate coefficient |
z_1 | atomic number of fast particle |
a_1 | atomic mass number of fast particle |
E | energy of fast particle |
mass | mass of fast particle |
nion | number of bulk ion species |
znum | atomic numbers of bulk particles |
anum | atomic mass numbers of bulk particles |
T_e | electron temperature of bulk plasma |
n_i | densities of bulk ions |
asigma_data | pointer to atomic data struct |