ASCOT5
Loading...
Searching...
No Matches
asigma.h File Reference

Header file for asigma.c. More...

#include "ascot5.h"
#include "error.h"
#include "asigma/asigma_loc.h"

Go to the source code of this file.

Data Structures

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

void asigma_free (asigma_data *data)
 Free allocated resources.
 
void asigma_offload (asigma_data *data)
 Offload data to the accelerator.
 
void asigma_extrapolate (int extrapolate)
 Toggle extrapolation when evaluating cross sections.
 
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.
 

Detailed Description

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 Documentation

◆ asigma_type

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.

◆ 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.

Enumeration Type Documentation

◆ 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

Definition at line 23 of file asigma.h.

◆ 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.

Definition at line 34 of file asigma.h.

Function Documentation

◆ asigma_free()

void asigma_free ( asigma_data * data)

Free allocated resources.

Parameters
datapointer to the data struct

Definition at line 54 of file asigma.c.

◆ asigma_offload()

void asigma_offload ( asigma_data * data)

Offload data to the accelerator.

Parameters
datapointer to the data struct

Definition at line 67 of file asigma.c.

◆ asigma_extrapolate()

void asigma_extrapolate ( int extrapolate)

Toggle extrapolation when evaluating cross sections.

In this context the extrapolation means values outside the abscissae are set to zero instead of raising an error.

Parameters
extrapolateflag whether to extrapolate

Definition at line 45 of file asigma.c.

◆ asigma_eval_sigma()

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.

Parameters
sigmapointer to evaluated cross-section
z_1atomic number of fast particle
a_1atomic mass number of fast particle
z_2atomic number of bulk particle
a_2atomic mass number of bulk particle
E_coll_per_amuenergy per amu corresponding to collision speed
reac_typereaction type
asigma_datapointer to atomic data struct
Returns
Non-zero a5err value if evaluation failed, zero otherwise

Definition at line 95 of file asigma.c.

◆ asigma_eval_sigmav()

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.

Parameters
sigmavpointer to evaluated rate coefficient
z_1atomic number of fast particle
a_1atomic mass number of fast particle
m_1mass of fast particle
z_2atomic number of bulk particle
a_2atomic mass number of bulk particle
Eenergy of fast particle
T_eelectron temperature of bulk plasma
T_0temperature of bulk neutrals
n_iion density of bulk plasma
reac_typereaction type
asigma_datapointer to atomic data struct
Returns
Non-zero a5err value if evaluation failed, zero otherwise

Definition at line 145 of file asigma.c.

◆ asigma_eval_cx()

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.

Parameters
ratecoeffpointer to evaluated rate coefficient
z_1atomic number of fast particle
a_1atomic mass number of fast particle
Eenergy of fast particle
massmass of fast particle
nspecnumber of bulk neutral species
znumatomic numbers of bulk particles
anumatomic mass numbers of bulk particles
T_0temperature of bulk neutrals
n_0densities of bulk neutrals
asigma_datapointer to atomic data struct
Returns
Non-zero a5err value if evaluation failed, zero otherwise

Definition at line 191 of file asigma.c.

◆ asigma_eval_bms()

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.

Parameters
ratecoeffpointer to evaluated rate coefficient
z_1atomic number of fast particle
a_1atomic mass number of fast particle
Eenergy of fast particle
massmass of fast particle
nionnumber of bulk ion species
znumatomic numbers of bulk particles
anumatomic mass numbers of bulk particles
T_eelectron temperature of bulk plasma
n_idensities of bulk ions
asigma_datapointer to atomic data struct
Returns
Non-zero a5err value if evaluation failed, zero otherwise

Definition at line 237 of file asigma.c.