ASCOT5
Loading...
Searching...
No Matches
Data Structures | Functions
plasma_1DS.h File Reference

Header file for plasma_1DS.c. More...

#include "../ascot5.h"
#include "../error.h"
#include "../spline/interp.h"

Go to the source code of this file.

Data Structures

struct  plasma_1DS_offload_data
 1D spline plasma parameters that will be offloaded to target More...
 
struct  plasma_1DS_data
 1D spline plasma parameters on the target More...
 

Functions

int plasma_1DS_init_offload (plasma_1DS_offload_data *offload_data, real **offload_array)
 Initialize 1DS plasma data and check inputs.
 
void plasma_1DS_free_offload (plasma_1DS_offload_data *offload_data, real **offload_array)
 Free offload array and reset parameters.
 
void plasma_1DS_init (plasma_1DS_data *pls_data, plasma_1DS_offload_data *offload_data, real *offload_array)
 Initialize magnetic field data struct on target.
 
a5err plasma_1DS_eval_temp (real *temp, real rho, int species, plasma_1DS_data *pls_data)
 Evaluate plasma temperature.
 
DECLARE_TARGET_END a5err plasma_1DS_eval_dens (real *dens, real rho, int species, plasma_1DS_data *pls_data)
 Evaluate plasma density.
 
DECLARE_TARGET_END a5err plasma_1DS_eval_densandtemp (real *dens, real *temp, real rho, plasma_1DS_data *pls_data)
 Evaluate plasma density and temperature for all species.
 

Detailed Description

Header file for plasma_1DS.c.

Definition in file plasma_1DS.h.

Function Documentation

◆ plasma_1DS_init_offload()

int plasma_1DS_init_offload ( plasma_1DS_offload_data * offload_data,
real ** offload_array )

Initialize 1DS plasma data and check inputs.

Before calling this function, the offload struct is expected to be fully initialized.

The offload array is expected to hold plasma data as &(*offload_array)[n_rho*0] = electron temperature &(*offload_array)[n_rho*1] = ion temperature &(*offload_array)[n_rho*2] = electron density &(*offload_array)[n_rho*3] = ion density

This function initializes splines to plasma profiles and prints some values as sanity checks.

Parameters
offload_datapointer to offload data struct
offload_arraypointer to pointer to offload array
Returns
zero if initialization succeeded

Definition at line 56 of file plasma_1DS.c.

◆ plasma_1DS_free_offload()

void plasma_1DS_free_offload ( plasma_1DS_offload_data * offload_data,
real ** offload_array )

Free offload array and reset parameters.

Parameters
offload_datapointer to offload data struct
offload_arraypointer to pointer to offload array

Definition at line 174 of file plasma_1DS.c.

◆ plasma_1DS_init()

void plasma_1DS_init ( plasma_1DS_data * plasma_data,
plasma_1DS_offload_data * offload_data,
real * offload_array )

Initialize magnetic field data struct on target.

This function copies the magnetic field parameters from the offload struct to the struct on target and sets the plasma data pointers to correct offsets in the offload array.

Parameters
plasma_datapointer to data struct on target
offload_datapointer to offload data struct
offload_arraypointer to offload array

Definition at line 191 of file plasma_1DS.c.

◆ plasma_1DS_eval_temp()

a5err plasma_1DS_eval_temp ( real * temp,
real rho,
int species,
plasma_1DS_data * plasma_data )

Evaluate plasma temperature.

Parameters
temptemperature value will be stored in temp[0]
rhoradial coordinate
speciesindex of plasma species
plasma_datapointer to plasma data struct
Returns
zero if evaluation succeeded

Definition at line 234 of file plasma_1DS.c.

◆ plasma_1DS_eval_dens()

DECLARE_TARGET_END a5err plasma_1DS_eval_dens ( real * dens,
real rho,
int species,
plasma_1DS_data * plasma_data )

Evaluate plasma density.

Parameters
densdensity value will be stored in dens[0]
rhoradial coordinate
speciesindex of plasma species
plasma_datapointer to plasma data struct
Returns
zero if evaluation succeeded

Definition at line 265 of file plasma_1DS.c.

◆ plasma_1DS_eval_densandtemp()

DECLARE_TARGET_END a5err plasma_1DS_eval_densandtemp ( real * dens,
real * temp,
real rho,
plasma_1DS_data * plasma_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 using spline interpolation.

Parameters
denspointer to where interpolated densities [m^-3] are stored
temppointer to where interpolated temperatures [J] are stored
rhoradial coordinate
plasma_datapointer to plasma data struct
Returns
zero if evaluation succeeded

Definition at line 300 of file plasma_1DS.c.