ASCOT5
|
1D linearly interpolated plasma More...
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "../ascot5.h"
#include "../error.h"
#include "../consts.h"
#include "../print.h"
#include "plasma_1D.h"
Go to the source code of this file.
Functions | |
int | plasma_1D_init_offload (plasma_1D_offload_data *offload_data, real **offload_array) |
Initialize 1D plasma data and check inputs. | |
void | plasma_1D_free_offload (plasma_1D_offload_data *offload_data, real **offload_array) |
Free offload array and reset parameters. | |
void | plasma_1D_init (plasma_1D_data *pls_data, plasma_1D_offload_data *offload_data, real *offload_array) |
Initialize magnetic field data struct on target. | |
a5err | plasma_1D_eval_temp (real *temp, real rho, int species, plasma_1D_data *pls_data) |
Evaluate plasma temperature. | |
a5err | plasma_1D_eval_dens (real *dens, real rho, int species, plasma_1D_data *pls_data) |
Evaluate plasma density. | |
a5err | plasma_1D_eval_densandtemp (real *dens, real *temp, real rho, plasma_1D_data *pls_data) |
Evaluate plasma density and temperature for all species. | |
1D linearly interpolated plasma
Plasma data which is defined in a 1D uniform grid from which the values are interpolated linearly. The coordinate is the normalized poloidal flux.
Definition in file plasma_1D.c.
int plasma_1D_init_offload | ( | plasma_1D_offload_data * | offload_data, |
real ** | offload_array ) |
Initialize 1D 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
Since this data requires no initialization, the only thing this function does is that it prints some values as sanity check.
offload_data | pointer to offload data struct |
offload_array | pointer to pointer to offload array |
Definition at line 39 of file plasma_1D.c.
void plasma_1D_free_offload | ( | plasma_1D_offload_data * | offload_data, |
real ** | offload_array ) |
Free offload array and reset parameters.
This function deallocates the offload_array.
offload_data | pointer to offload data struct |
offload_array | pointer to pointer to offload array |
Definition at line 97 of file plasma_1D.c.
void plasma_1D_init | ( | plasma_1D_data * | pls_data, |
plasma_1D_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.
pls_data | pointer to data struct on target |
offload_data | pointer to offload data struct |
offload_array | pointer to offload array |
Definition at line 114 of file plasma_1D.c.
a5err plasma_1D_eval_temp | ( | real * | temp, |
real | rho, | ||
int | species, | ||
plasma_1D_data * | pls_data ) |
Evaluate plasma temperature.
This function evaluates the temperature of a plasma species at the given radial coordinate using linear interpolation.
temp | pointer to where evaluated temperature [J] is stored |
rho | radial coordinate |
species | index of plasma species |
pls_data | pointer to plasma data struct |
Definition at line 145 of file plasma_1D.c.
a5err plasma_1D_eval_dens | ( | real * | dens, |
real | rho, | ||
int | species, | ||
plasma_1D_data * | pls_data ) |
Evaluate plasma density.
This function evaluates the density of a plasma species at the given radial coordinate using linear interpolation.
dens | pointer to where evaluated density [m^-3] is stored |
rho | radial coordinate |
species | index of plasma species |
pls_data | pointer to plasma data struct |
Definition at line 185 of file plasma_1D.c.
a5err plasma_1D_eval_densandtemp | ( | real * | dens, |
real * | temp, | ||
real | rho, | ||
plasma_1D_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 using linear interpolation.
dens | pointer to where interpolated densities [m^-3] are stored |
temp | pointer to where interpolated temperatures [J] are stored |
rho | radial coordinate |
pls_data | pointer to plasma data struct |
Definition at line 225 of file plasma_1D.c.