ASCOT5
|
Neutral interface. More...
#include <stdio.h>
#include "ascot5.h"
#include "error.h"
#include "print.h"
#include "neutral.h"
#include "neutral/N0_1D.h"
#include "neutral/N0_3D.h"
Go to the source code of this file.
Functions | |
int | neutral_init_offload (neutral_offload_data *offload_data, real **offload_array) |
Load neutral data and prepare parameters. | |
void | neutral_free_offload (neutral_offload_data *offload_data, real **offload_array) |
Free offload array and reset parameters. | |
int | neutral_init (neutral_data *ndata, neutral_offload_data *offload_data, real *offload_array) |
Initialize neutral data struct on target. | |
a5err | neutral_eval_n0 (real *n0, real rho, real r, real phi, real z, real t, neutral_data *ndata) |
Evaluate neutral density. | |
a5err | neutral_eval_t0 (real *t0, real rho, real r, real phi, real z, real t, neutral_data *ndata) |
Evaluate neutral temperature. | |
int | neutral_get_n_species (neutral_data *ndata) |
Get the number of neutral species. | |
Neutral interface.
This is an interface through which neutral data is initialized and accessed. Reading e.g. from disk is done elsewhere.
To add a new neutral data instance, make sure these functions are implemented and called from this interface, and that neutral.h contains enum type for the new instance.
The interface checks which instance given data corresponds to from the "type"-field in neutral_offload_data or neutral_data that is given as an argument, and calls the relevant function for that instance.
Definition in file neutral.c.
int neutral_init_offload | ( | neutral_offload_data * | offload_data, |
real ** | offload_array ) |
Load neutral data and prepare parameters.
This function fills the relevant neutral 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 neutral_free_offload | ( | neutral_offload_data * | offload_data, |
real ** | offload_array ) |
int neutral_init | ( | neutral_data * | ndata, |
neutral_offload_data * | offload_data, | ||
real * | offload_array ) |
Initialize neutral data struct on target.
This function copies the neutral data parameters from the offload struct to the struct on target and sets the neutral data pointers to correct offsets in the offload array.
ndata | pointer to data struct on target |
offload_data | pointer to offload data struct |
offload_array | pointer to offload array |
a5err neutral_eval_n0 | ( | real * | n0, |
real | rho, | ||
real | r, | ||
real | phi, | ||
real | z, | ||
real | t, | ||
neutral_data * | ndata ) |
Evaluate neutral density.
This function evaluates the neutral density n0 at the given coordinates.
This is a SIMD function.
n0 | pointer where neutral density is stored [m^-3] |
rho | normalized poloidal flux coordinate |
r | R coordinate [m] |
phi | phi coordinate [deg] |
z | z coordinate [m] |
t | time coordinate [s] |
ndata | pointer to neutral density data struct |
a5err neutral_eval_t0 | ( | real * | t0, |
real | rho, | ||
real | r, | ||
real | phi, | ||
real | z, | ||
real | t, | ||
neutral_data * | ndata ) |
Evaluate neutral temperature.
This function evaluates the neutral temperature t0 at the given coordinates.
This is a SIMD function.
t0 | pointer where neutral temperature is stored [J] |
rho | normalized poloidal flux coordinate |
r | R coordinate [m] |
phi | phi coordinate [deg] |
z | z coordinate [m] |
t | time coordinate [s] |
ndata | pointer to neutral temperature data struct |
int neutral_get_n_species | ( | neutral_data * | ndata | ) |