ASCOT5
|
Header file for B_2DS.c. More...
#include "../offload_acc_omp.h"
#include "../ascot5.h"
#include "../error.h"
#include "../spline/interp.h"
Go to the source code of this file.
Data Structures | |
struct | B_2DS_offload_data |
2D magnetic field parameters that will be offloaded to target More... | |
struct | B_2DS_data |
2D magnetic field parameters on the target More... | |
Functions | |
int | B_2DS_init_offload (B_2DS_offload_data *offload_data, real **offload_array) |
Initialize magnetic field offload data. | |
void | B_2DS_free_offload (B_2DS_offload_data *offload_data, real **offload_array) |
Free offload array. | |
void | B_2DS_init (B_2DS_data *Bdata, B_2DS_offload_data *offload_data, real *offload_array) |
Initialize magnetic field data struct on target. | |
a5err | B_2DS_eval_psi (real *psi, real r, real phi, real z, B_2DS_data *Bdata) |
Evaluate poloidal flux psi. | |
DECLARE_TARGET_END a5err | B_2DS_eval_psi_dpsi (real psi_dpsi[4], real r, real phi, real z, B_2DS_data *Bdata) |
Evaluate poloidal flux psi and its derivatives. | |
DECLARE_TARGET_END a5err | B_2DS_eval_rho_drho (real rho_drho[4], real r, real phi, real z, B_2DS_data *Bdata) |
Evaluate normalized poloidal flux rho and its derivatives. | |
DECLARE_TARGET_END a5err | B_2DS_eval_B (real B[3], real r, real phi, real z, B_2DS_data *Bdata) |
Evaluate magnetic field. | |
DECLARE_TARGET_END a5err | B_2DS_eval_B_dB (real B_dB[12], real r, real phi, real z, B_2DS_data *Bdata) |
Evaluate magnetic field and its derivatives. | |
DECLARE_TARGET_END a5err | B_2DS_get_axis_rz (real rz[2], B_2DS_data *Bdata) |
Return magnetic axis R-coordinate. | |
Header file for B_2DS.c.
Contains declaration of B_2DS_offload_data and B_2DS_data structs.
Definition in file B_2DS.h.
int B_2DS_init_offload | ( | B_2DS_offload_data * | offload_data, |
real ** | offload_array ) |
Initialize magnetic field offload data.
This function takes pre-initialized offload data struct and offload array as inputs. The data is used to fill rest of the offload struct and to construct bicubic splines whose coefficients are stored in re-allocated offload array.
The offload data struct must have the following fields initialized:
B_2DS_offload_data.offload_array_length is set here.
The offload array must contain the following data:
Sanity checks are printed if data was initialized succesfully.
offload_data | pointer to offload data struct |
offload_array | pointer to offload array which is reallocated here |
void B_2DS_free_offload | ( | B_2DS_offload_data * | offload_data, |
real ** | offload_array ) |
void B_2DS_init | ( | B_2DS_data * | Bdata, |
B_2DS_offload_data * | offload_data, | ||
real * | offload_array ) |
DECLARE_TARGET_END a5err B_2DS_eval_psi_dpsi | ( | real | psi_dpsi[4], |
real | r, | ||
real | phi, | ||
real | z, | ||
B_2DS_data * | Bdata ) |
Evaluate poloidal flux psi and its derivatives.
psi_dpsi | pointer for storing psi [V*s*m^-1] and its derivatives |
r | R coordinate [m] |
phi | phi coordinate [rad] |
z | z coordinate [m] |
Bdata | pointer to magnetic field data struct |
DECLARE_TARGET_END a5err B_2DS_eval_rho_drho | ( | real | rho_drho[4], |
real | r, | ||
real | phi, | ||
real | z, | ||
B_2DS_data * | Bdata ) |
Evaluate normalized poloidal flux rho and its derivatives.
rho_drho | pointer where rho and its derivatives will be stored |
r | R coordinate [m] |
phi | phi coordinate [rad] |
z | z coordinate [m] |
Bdata | pointer to magnetic field data struct |
Evaluate magnetic field.
B | pointer to array where magnetic field values are stored |
r | R coordinate [m] |
phi | phi coordinate [deg] |
z | z coordinate [m] |
Bdata | pointer to magnetic field data struct |
DECLARE_TARGET_END a5err B_2DS_eval_B_dB | ( | real | B_dB[12], |
real | r, | ||
real | phi, | ||
real | z, | ||
B_2DS_data * | Bdata ) |
Evaluate magnetic field and its derivatives.
B_dB | pointer to array where the field and its derivatives are stored |
r | R coordinate [m] |
phi | phi coordinate [deg] |
z | z coordinate [m] |
Bdata | pointer to magnetic field data struct |
DECLARE_TARGET_END a5err B_2DS_get_axis_rz | ( | real | rz[2], |
B_2DS_data * | Bdata ) |