ASCOT5
|
Header file for plasma.c. More...
#include "ascot5.h"
#include "error.h"
#include "plasma/plasma_1D.h"
#include "plasma/plasma_1Dt.h"
#include "plasma/plasma_1DS.h"
Go to the source code of this file.
Data Structures | |
struct | plasma_offload_data |
Plasma offload data. More... | |
struct | plasma_data |
Plasma simulation data. More... | |
Typedefs | |
typedef enum plasma_type | plasma_type |
Plasma data types. | |
Enumerations | |
enum | plasma_type { plasma_type_1D , plasma_type_1Dt , plasma_type_1DS } |
Plasma data types. More... | |
Functions | |
int | plasma_init_offload (plasma_offload_data *offload_data, real **offload_array) |
Load plasma data and prepare parameters. | |
void | plasma_free_offload (plasma_offload_data *offload_data, real **offload_array) |
Free offload array and reset parameters. | |
int | plasma_init (plasma_data *plasma_data, plasma_offload_data *offload_data, real *offload_array) |
Initialize plasma data struct on target. | |
a5err | plasma_eval_temp (real *temp, real rho, real r, real phi, real z, real t, int species, plasma_data *pls_data) |
Evaluate plasma temperature. | |
DECLARE_TARGET_END a5err | plasma_eval_dens (real *dens, real rho, real r, real phi, real z, real t, int species, plasma_data *pls_data) |
Evaluate plasma density. | |
DECLARE_TARGET_END a5err | plasma_eval_densandtemp (real *dens, real *temp, real rho, real r, real phi, real z, real t, plasma_data *pls_data) |
Evaluate plasma density and temperature for all species. | |
DECLARE_TARGET_END int | plasma_get_n_species (plasma_data *pls_data) |
Get the number of plasma species. | |
DECLARE_TARGET_END const real * | plasma_get_species_mass (plasma_data *pls_data) |
Get mass of all plasma species. | |
DECLARE_TARGET_END const real * | plasma_get_species_charge (plasma_data *pls_data) |
Get charge of all plasma species. | |
DECLARE_TARGET_END const int * | plasma_get_species_znum (plasma_data *pls_data) |
Get charge number of ion species. | |
DECLARE_TARGET_END const int * | plasma_get_species_anum (plasma_data *pls_data) |
Get atomic mass number of ion species. | |
Header file for plasma.c.
Contains a list declaring all plasma data, and declaration of plasma_offload_data and plasma_data structs.
Definition in file plasma.h.
typedef enum plasma_type plasma_type |
Plasma data types.
Plasma data types are used in the plassma interface (plasma.c) to direct function calls to correct plasma data instances. Each plasma data instance must have a corresponding type.
enum plasma_type |
Plasma data types.
Plasma data types are used in the plassma interface (plasma.c) to direct function calls to correct plasma data instances. Each plasma data instance must have a corresponding type.
Enumerator | |
---|---|
plasma_type_1D | Linear-interpolated 1D plasma data |
plasma_type_1Dt | Linear-interpolated time-dependent 1D plasma data |
plasma_type_1DS | Spline-interpolated 1D plasma data |
int plasma_init_offload | ( | plasma_offload_data * | offload_data, |
real ** | offload_array ) |
Load plasma data and prepare parameters.
This function fills the relevant plasma 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 plasma_free_offload | ( | plasma_offload_data * | offload_data, |
real ** | offload_array ) |
int plasma_init | ( | plasma_data * | pls_data, |
plasma_offload_data * | offload_data, | ||
real * | offload_array ) |
Initialize plasma data struct on target.
This function copies the plasma parameters from the offload struct to the struct on target and sets the plasma data pointers to correct offsets in the offload array.
pls_data | pointer to data struct on target |
offload_data | pointer to offload data struct |
offload_array | pointer to offload array |
a5err plasma_eval_temp | ( | real * | temp, |
real | rho, | ||
real | r, | ||
real | phi, | ||
real | z, | ||
real | t, | ||
int | species, | ||
plasma_data * | pls_data ) |
Evaluate plasma temperature.
This function evaluates the temperature of a given plasma species at the given position.
This is a SIMD function.
temp | array where evaluated temperature [J] is stored |
rho | normalized poloidal flux coordinate |
r | R-coordinate [m] |
phi | phi-coordinate [rad] |
z | z-coordinate [m] |
t | time coordinate [s] |
species | index of plasma species, 1 refers to electrons |
pls_data | pointer to plasma data struct |
DECLARE_TARGET_END a5err plasma_eval_dens | ( | real * | dens, |
real | rho, | ||
real | r, | ||
real | phi, | ||
real | z, | ||
real | t, | ||
int | species, | ||
plasma_data * | pls_data ) |
Evaluate plasma density.
This function evaluates the density of a plasma species at the given radial coordinate.
This is a SIMD function.
dens | array where evaluated density will be stored |
rho | normalized poloidal flux coordinate |
r | R-coordinate [m] |
phi | phi-coordinate [rad] |
z | z-coordinate [m] |
t | time coordinate [s] |
species | index of plasma species, 1 refers to electrons |
pls_data | pointer to plasma data struct |
DECLARE_TARGET_END a5err plasma_eval_densandtemp | ( | real * | dens, |
real * | temp, | ||
real | rho, | ||
real | r, | ||
real | phi, | ||
real | z, | ||
real | t, | ||
plasma_data * | pls_data ) |
Evaluate plasma density and temperature for all species.
This function evaluates the density and temperature of all plasma species at the given radial coordinate.
This is a SIMD function.
dens | pointer where density [m^-3] will be stored |
temp | pointer where temperature [J] will be stored |
rho | normalized poloidal flux coordinate |
r | R-coordinate [m] |
phi | phi-coordinate [rad] |
z | z-coordinate [m] |
t | time coordinate [s] |
pls_data | pointer to plasma data struct |
DECLARE_TARGET_END int plasma_get_n_species | ( | plasma_data * | pls_data | ) |
DECLARE_TARGET_END const real * plasma_get_species_mass | ( | plasma_data * | pls_data | ) |
DECLARE_TARGET_END const real * plasma_get_species_charge | ( | plasma_data * | pls_data | ) |
DECLARE_TARGET_END const int * plasma_get_species_znum | ( | plasma_data * | pls_data | ) |
DECLARE_TARGET_END const int * plasma_get_species_anum | ( | plasma_data * | pls_data | ) |