1D neutral data with linear interpolation
More...
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include "../ascot5.h"
#include "../error.h"
#include "../print.h"
#include "N0_1D.h"
#include "../linint/linint.h"
Go to the source code of this file.
|
int | N0_1D_init (N0_1D_data *data, int n_rho, real rho_min, real rho_max, int n_species, int *anum, int *znum, int *maxwellian, real *density, real *temperature) |
| Initialize data.
|
|
void | N0_1D_free (N0_1D_data *data) |
| Free allocated resources.
|
|
void | N0_1D_offload (N0_1D_data *data) |
| Offload data to the accelerator.
|
|
a5err | N0_1D_eval_n0 (real *n0, real rho, N0_1D_data *ndata) |
| Evaluate neutral density.
|
|
a5err | N0_1D_eval_t0 (real *t0, real rho, N0_1D_data *ndata) |
| Evaluate neutral temperature.
|
|
int | N0_1D_get_n_species (N0_1D_data *ndata) |
| Return number of neutral species.
|
|
1D neutral data with linear interpolation
Definition in file N0_1D.c.
◆ N0_1D_init()
int N0_1D_init |
( |
N0_1D_data * | data, |
|
|
int | n_rho, |
|
|
real | rho_min, |
|
|
real | rho_max, |
|
|
int | n_species, |
|
|
int * | anum, |
|
|
int * | znum, |
|
|
int * | maxwellian, |
|
|
real * | density, |
|
|
real * | temperature ) |
Initialize data.
- Parameters
-
data | pointer to data struct |
n_rho | number of r grid points in the data |
rho_min | minimum r coordinate in the grid in the data [m] |
rho_max | maximum r coordinate in the grid in the data [m] |
n_species | number of neutral species |
anum | neutral species mass number |
znum | neutral species charge number |
maxwellian | is the species distribution Maxwellian or monoenergetic |
- Returns
- zero if initialization succeeded
Definition at line 30 of file N0_1D.c.
◆ N0_1D_free()
Free allocated resources.
- Parameters
-
data | pointer to the data struct |
Definition at line 79 of file N0_1D.c.
◆ N0_1D_offload()
Offload data to the accelerator.
- Parameters
-
data | pointer to the data struct |
Definition at line 94 of file N0_1D.c.
◆ N0_1D_eval_n0()
Evaluate neutral density.
This function evaluates the neutral density at the given coordinates using linear interpolation on the 1D neutral density data.
- Parameters
-
n0 | n0 value will be stored in n0[0] |
rho | normalized poloidal flux coordinate |
ndata | pointer to neutral data struct |
- Returns
- zero if evaluation succeeded
Definition at line 110 of file N0_1D.c.
◆ N0_1D_eval_t0()
Evaluate neutral temperature.
This function evaluates the neutral temperature at the given coordinates using linear interpolation on the 1D neutral temperature data.
- Parameters
-
t0 | t0 value will be stored in t0[0] |
rho | normalized poloidal flux coordinate |
ndata | pointer to neutral data struct |
- Returns
- zero if evaluation succeeded
Definition at line 136 of file N0_1D.c.
◆ N0_1D_get_n_species()
Return number of neutral species.
- Parameters
-
ndata | pointer to neutral data struct |
- Returns
- number of neutral species
Definition at line 157 of file N0_1D.c.