45 real* dV_drho = (
real*) malloc(NSIZE_COMP1D * offload_data->
n_rho
53 print_err(
"Error: Failed to initialize splines.\n");
59 *offload_array = dV_drho;
79 real** offload_array) {
81 *offload_array = NULL;
96 real* offload_array) {
132 rho_drho[2] = rho_drho[2]/r;
134 if (rho_drho[0] < Edata->
dV.
x_min || rho_drho[0] > Edata->
dV.
x_max ) {
143 E[0] = -dV * rho_drho[1];
144 E[1] = -dV * rho_drho[2];
145 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_offload(E_1DS_offload_data *offload_data, real **offload_array)
Free offload array and reset parameters.
int E_1DS_init_offload(E_1DS_offload_data *offload_data, real **offload_array)
Initialize 1DS electric field data.
void E_1DS_init(E_1DS_data *Edata, E_1DS_offload_data *offload_data, real *offload_array)
Initialize 1D spline electric field data struct on target.
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.
int interp1Dcomp_init_coeff(real *c, real *f, int n_x, int bc_x, real x_min, real x_max)
Calculate cubic spline interpolation coefficients for scalar 1D data.
a5err interp1Dcomp_eval_f(real *f, interp1D_data *str, real x)
Evaluate interpolated value of 1D scalar field.
void interp1Dcomp_init_spline(interp1D_data *str, real *c, int n_x, int bc_x, real x_min, real x_max)
Initialize a cubic spline.
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
1D spline electric field parameters that will be offloaded to target