31 int n_species,
int* anum,
int* znum,
int* maxwellian,
35 data->
anum = (
int*) malloc(n_species *
sizeof(
int));
36 data->
znum = (
int*) malloc(n_species *
sizeof(
int));
37 data->
maxwellian = (
int*) malloc(n_species *
sizeof(
int));
40 for(
int i = 0; i < data->
n_species; i++) {
41 data->
anum[i] = anum[i];
42 data->
znum[i] = znum[i];
46 for(
int i = 0; i < n_rho; i++) {
50 c = (
real*) malloc(n_rho *
sizeof(
real));
51 for(
int i = 0; i < n_rho; i++) {
52 c[i] = temperature[i];
59 "Grid: nrho = %4.d rhomin = %3.3f rhomax = %3.3f\n",
60 n_rho, rho_min, rho_max);
83 for(
int i = 0; i < data->
n_species; i++) {
void N0_1D_offload(N0_1D_data *data)
Offload data to the accelerator.
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.
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.
Main header file for ASCOT5.
unsigned long int a5err
Simulation error flag.
static DECLARE_TARGET_SIMD a5err error_raise(error_type type, int line, error_file file)
Raise a new error.
Linear interpolation library.
int linint1D_eval_f(real *f, linint1D_data *str, real x)
Evaluate interpolated value of 1D scalar field.
void linint1D_init(linint1D_data *str, real *c, int n_x, int bc_x, real x_min, real x_max)
Initialize linear interpolation struct for scalar 1D data.
Macros for printing console output.
#define print_out(v,...)
Print to standard output.
1D neutral parameters on the target