ASCOT5
Loading...
Searching...
No Matches
N0_1D.h File Reference

Header file for N0_1D.c. More...

#include "../ascot5.h"
#include "../offload.h"
#include "../linint/linint.h"

Go to the source code of this file.

Data Structures

struct  N0_1D_data
 1D neutral parameters on the target More...
 

Functions

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.
 

Detailed Description

Header file for N0_1D.c.

Definition in file N0_1D.h.

Function Documentation

◆ 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
datapointer to data struct
n_rhonumber of r grid points in the data
rho_minminimum r coordinate in the grid in the data [m]
rho_maxmaximum r coordinate in the grid in the data [m]
n_speciesnumber of neutral species
anumneutral species mass number
znumneutral species charge number
maxwellianis the species distribution Maxwellian or monoenergetic
Returns
zero if initialization succeeded

Definition at line 30 of file N0_1D.c.

◆ N0_1D_free()

void N0_1D_free ( N0_1D_data * data)

Free allocated resources.

Parameters
datapointer to the data struct

Definition at line 79 of file N0_1D.c.

◆ N0_1D_offload()

void N0_1D_offload ( N0_1D_data * data)

Offload data to the accelerator.

Parameters
datapointer to the data struct

Definition at line 94 of file N0_1D.c.

◆ N0_1D_eval_n0()

a5err N0_1D_eval_n0 ( real * n0,
real rho,
N0_1D_data * ndata )

Evaluate neutral density.

This function evaluates the neutral density at the given coordinates using linear interpolation on the 1D neutral density data.

Parameters
n0n0 value will be stored in n0[0]
rhonormalized poloidal flux coordinate
ndatapointer to neutral data struct
Returns
zero if evaluation succeeded

Definition at line 110 of file N0_1D.c.

◆ N0_1D_eval_t0()

a5err N0_1D_eval_t0 ( real * t0,
real rho,
N0_1D_data * ndata )

Evaluate neutral temperature.

This function evaluates the neutral temperature at the given coordinates using linear interpolation on the 1D neutral temperature data.

Parameters
t0t0 value will be stored in t0[0]
rhonormalized poloidal flux coordinate
ndatapointer to neutral data struct
Returns
zero if evaluation succeeded

Definition at line 136 of file N0_1D.c.

◆ N0_1D_get_n_species()

int N0_1D_get_n_species ( N0_1D_data * ndata)

Return number of neutral species.

Parameters
ndatapointer to neutral data struct
Returns
number of neutral species

Definition at line 157 of file N0_1D.c.