35 for(
int i = 0; i < nrho; i++) {
36 temp[i] = reff * dvdrho[i];
42 print_err(
"Error: Failed to initialize splines.\n");
49 nrho, rhomin, rhomax);
68 GPU_MAP_TO_DEVICE( data->
dV, data->
dV.
c[0:data->
dV.
n_x*NSIZE_COMP1D] )
99 rho_drho[2] = rho_drho[2]/r;
101 if (rho_drho[0] < Edata->
dV.
x_min || rho_drho[0] > Edata->
dV.
x_max ) {
110 E[0] = -dV * rho_drho[1];
111 E[1] = -dV * rho_drho[2];
112 E[2] = -dV * rho_drho[3];
a5err B_field_eval_rho_drho(real rho_drho[4], real r, real phi, real z, B_field_data *Bdata)
Evaluate normalized poloidal flux rho and its derivatives.
Header file for B_field.c.
void E_1DS_free(E_1DS_data *data)
Free allocated resources.
void E_1DS_offload(E_1DS_data *data)
Offload data to the accelerator.
int E_1DS_init(E_1DS_data *data, int nrho, real rhomin, real rhomax, real reff, real *dvdrho)
Initialize 1DS electric field data.
a5err E_1DS_eval_E(real E[3], real r, real phi, real z, E_1DS_data *Edata, B_field_data *Bdata)
Evaluate 1D spline radial electric field.
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.
Spline interpolation library.
a5err interp1Dcomp_eval_f(real *f, interp1D_data *str, real x)
Evaluate interpolated value of 1D scalar field.
int interp1Dcomp_setup(interp1D_data *str, real *f, int n_x, int bc_x, real x_min, real x_max)
Set up splines to interpolate 1D scalar data.
Macros for printing console output.
#define print_out(v,...)
Print to standard output.
#define print_err(...)
Print to standard error.
Magnetic field simulation data.
1D spline electric field parameters on the target