ASCOT5
|
Header file for B_3DS.c. More...
Go to the source code of this file.
Data Structures | |
struct | B_3DS_data |
3D magnetic field parameters More... | |
Functions | |
int | B_3DS_init (B_3DS_data *data, int p_n_r, real p_r_min, real p_r_max, int p_n_z, real p_z_min, real p_z_max, int b_n_r, real b_r_min, real b_r_max, int b_n_phi, real b_phi_min, real b_phi_max, int b_n_z, real b_z_min, real b_z_max, real axis_r, real axis_z, real psi0, real psi1, real *psi, real *B_r, real *B_phi, real *B_z) |
Initialize magnetic field data. | |
void | B_3DS_free (B_3DS_data *data) |
Free allocated resources. | |
void | B_3DS_offload (B_3DS_data *data) |
Offload data to the accelerator. | |
a5err | B_3DS_eval_psi (real *psi, real r, real phi, real z, B_3DS_data *Bdata) |
Evaluate poloidal flux psi. | |
DECLARE_TARGET_END a5err | B_3DS_eval_psi_dpsi (real psi_dpsi[4], real r, real phi, real z, B_3DS_data *Bdata) |
Evaluate poloidal flux psi and its derivatives. | |
DECLARE_TARGET_END a5err | B_3DS_eval_rho_drho (real rho_drho[4], real r, real phi, real z, B_3DS_data *Bdata) |
Evaluate normalized poloidal flux rho and its derivatives. | |
DECLARE_TARGET_END a5err | B_3DS_eval_B (real B[3], real r, real phi, real z, B_3DS_data *Bdata) |
Evaluate magnetic field. | |
DECLARE_TARGET_END a5err | B_3DS_eval_B_dB (real B_dB[12], real r, real phi, real z, B_3DS_data *Bdata) |
Evaluate magnetic field and its derivatives. | |
DECLARE_TARGET_END a5err | B_3DS_get_axis_rz (real rz[2], B_3DS_data *Bdata) |
Return magnetic axis R-coordinate. | |
int B_3DS_init | ( | B_3DS_data * | data, |
int | p_n_r, | ||
real | p_r_min, | ||
real | p_r_max, | ||
int | p_n_z, | ||
real | p_z_min, | ||
real | p_z_max, | ||
int | b_n_r, | ||
real | b_r_min, | ||
real | b_r_max, | ||
int | b_n_phi, | ||
real | b_phi_min, | ||
real | b_phi_max, | ||
int | b_n_z, | ||
real | b_z_min, | ||
real | b_z_max, | ||
real | axis_r, | ||
real | axis_z, | ||
real | psi0, | ||
real | psi1, | ||
real * | psi, | ||
real * | B_r, | ||
real * | B_phi, | ||
real * | B_z ) |
Initialize magnetic field data.
The offload array must contain the following data:
data | pointer to the data struct |
p_n_r | number of r grid points in psi data |
p_r_min | minimum R coordinate in psi data grid [m] |
p_r_max | maximum R coordinate in psi data grid [m] |
p_n_z | number of z grid points in psi data |
p_z_min | minimum z coordinate in psi data grid [m] |
p_z_max | maximum z coordinate in psi data grid [m] |
p_n_r | number of r grid points in B data |
b_r_min | minimum R coordinate in B data grid [m] |
b_r_max | maximum R coordinate in B data grid [m] |
b_n_phi | number of phi grid points in B data |
b_phi_min | minimum phi coordinate in B data grid [rad] |
b_phi_max | maximum phi coordinate in B data grid [rad] |
b_n_z | number of z grid points in B data |
b_z_min | minimum z coordinate in B data grid [m] |
b_z_max | maximum z coordinate in B data grid [m] |
axis_r | R coordinate of magnetic axis [m] |
axis_z | z coordinate of magnetic axis [m] |
psi0 | poloidal flux at magnetic axis [Vs/m] |
psi1 | poloidal flux at separatrix [Vs/m] |
psi | poloidal flux psi(R_i,z_j) = arr[j*n_r + i] [Vs/m] |
B_r | Magnetic field R component B_r(R_i,phi_j,z_k) = arr[k*b_n_r*b_n_phi + j*b_n_r + i] [T] |
B_phi | Magnetic field phi component B_phi(R_i,phi_j,z_k) = arr[k*b_n_r*b_n_phi + j*b_n_r + i] [T] |
B_z | Magnetic field z component B_z(R_i,phi_j,z_k) = arr[k*b_n_r*b_n_phi + j*b_n_r + i] [T] |
void B_3DS_free | ( | B_3DS_data * | data | ) |
void B_3DS_offload | ( | B_3DS_data * | data | ) |
DECLARE_TARGET_END a5err B_3DS_eval_psi_dpsi | ( | real | psi_dpsi[4], |
real | r, | ||
real | phi, | ||
real | z, | ||
B_3DS_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_3DS_eval_rho_drho | ( | real | rho_drho[4], |
real | r, | ||
real | phi, | ||
real | z, | ||
B_3DS_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_3DS_eval_B_dB | ( | real | B_dB[12], |
real | r, | ||
real | phi, | ||
real | z, | ||
B_3DS_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_3DS_get_axis_rz | ( | real | rz[2], |
B_3DS_data * | Bdata ) |