23 int n_phi,
real phi_min,
real phi_max,
25 int n_species,
int* anum,
int* znum,
int* maxwellian,
28 data->
anum = (
int*) malloc(n_species *
sizeof(
int));
29 data->
znum = (
int*) malloc(n_species *
sizeof(
int));
30 data->
maxwellian = (
int*) malloc(n_species *
sizeof(
int));
33 for(
int i = 0; i < data->
n_species; i++) {
34 data->
anum[i] = anum[i];
35 data->
znum[i] = znum[i];
38 real* c = (
real*) malloc(n_r * n_phi * n_z *
sizeof(
real));
39 for(
int i = 0; i < n_r * n_phi * n_z; i++) {
44 r_min, r_max, phi_min, phi_max, z_min, z_max);
45 c = (
real*) malloc(n_r * n_phi * n_z *
sizeof(
real));
46 for(
int i = 0; i < n_r * n_phi * n_z; i++) {
47 c[i] = temperature[i];
51 r_min, r_max, phi_min, phi_max, z_min, z_max);
64 " Number of neutral species = %d\n",
85 for(
int i = 0; i < data->
n_species; i++) {
int N0_3D_init(N0_3D_data *data, int n_r, real r_min, real r_max, int n_phi, real phi_min, real phi_max, int n_z, real z_min, real z_max, int n_species, int *anum, int *znum, int *maxwellian, real *density, real *temperature)
Initialize neutral data.
a5err N0_3D_eval_n0(real *n0, real r, real phi, real z, N0_3D_data *ndata)
Evaluate neutral density.
int N0_3D_get_n_species(N0_3D_data *ndata)
Return number of neutral species.
a5err N0_3D_eval_t0(real *t0, real r, real phi, real z, N0_3D_data *ndata)
Evaluate neutral temperature.
void N0_3D_offload(N0_3D_data *data)
Offload data to the accelerator.
void N0_3D_free(N0_3D_data *data)
Free allocated resources.
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.
DECLARE_TARGET_END int linint3D_eval_f(real *f, linint3D_data *str, real x, real y, real z)
Evaluate interpolated value of 3D scalar field.
void linint3D_init(linint3D_data *str, real *c, int n_x, int n_y, int n_z, int bc_x, int bc_y, int bc_z, real x_min, real x_max, real y_min, real y_max, real z_min, real z_max)
Initialize linear interpolation struct for scalar 3D data.
Macros for printing console output.
#define print_out(v,...)
Print to standard output.
3D neutral parameters on the target