Header file for B_GS.c.
More...
#include "../offload_acc_omp.h"
#include "../ascot5.h"
#include "../error.h"
Go to the source code of this file.
|
int | B_GS_init_offload (B_GS_offload_data *offload_data, real **offload_array) |
| Initialize magnetic field offload data.
|
|
void | B_GS_free_offload (B_GS_offload_data *offload_data, real **offload_array) |
| Free offload array.
|
|
void | B_GS_init (B_GS_data *Bdata, B_GS_offload_data *offload_data, real *offload_array) |
| Initialize magnetic field data struct on target.
|
|
a5err | B_GS_eval_B (real B[3], real r, real phi, real z, B_GS_data *Bdata) |
| Evaluate magnetic field.
|
|
DECLARE_TARGET_END a5err | B_GS_eval_psi (real *psi, real r, real phi, real z, B_GS_data *Bdata) |
| Evaluate poloidal flux psi.
|
|
DECLARE_TARGET_END a5err | B_GS_eval_psi_dpsi (real psi_dpsi[4], real r, real phi, real z, B_GS_data *Bdata) |
| Evaluate poloidal flux psi and its derivatives.
|
|
DECLARE_TARGET_END a5err | B_GS_eval_rho_drho (real rho_drho[4], real r, real phi, real z, B_GS_data *Bdata) |
| Evaluate normalized poloidal flux rho and its derivatives.
|
|
DECLARE_TARGET_END a5err | B_GS_eval_B_dB (real B_dB[12], real r, real phi, real z, B_GS_data *Bdata) |
| Evaluate magnetic field and its derivatives.
|
|
DECLARE_TARGET_END a5err | B_GS_get_axis_rz (real rz[2], B_GS_data *Bdata) |
| Return magnetic axis R-coordinate.
|
|
Header file for B_GS.c.
Definition in file B_GS.h.
◆ B_GS_init_offload()
Initialize magnetic field offload data.
The offload data struct is very simple and contains only the necessary fields which are all initialized when the data is read (except B_GS.offload_array_length). The offload array is not required at all. Therefore, this function only sets the offload_array_length to zero, assigns a NULL pointer to offload_array, and prints sanity checks so that user may verify that data was initialized succesfully.
- Parameters
-
offload_data | pointer to offload data struct |
offload_array | pointer to offload array |
- Returns
- zero to indicate success
Definition at line 91 of file B_GS.c.
◆ B_GS_free_offload()
Free offload array.
- Parameters
-
offload_data | pointer to offload data struct |
offload_array | pointer to pointer to offload array |
Definition at line 131 of file B_GS.c.
◆ B_GS_init()
Initialize magnetic field data struct on target.
- Parameters
-
Bdata | pointer to data struct on target |
offload_data | pointer to offload data struct |
offload_array | offload array |
Definition at line 144 of file B_GS.c.
◆ B_GS_eval_B()
Evaluate magnetic field.
- Parameters
-
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 |
- Returns
- zero to indicate success
Definition at line 327 of file B_GS.c.
◆ B_GS_eval_psi()
Evaluate poloidal flux psi.
- Parameters
-
psi | pointer where psi [V*s*m^-1] value will be stored |
r | R coordinate [m] |
phi | phi coordinate [rad] |
z | z coordinate [m] |
Bdata | pointer to magnetic field data struct |
- Returns
- zero to indicate success
Definition at line 174 of file B_GS.c.
◆ B_GS_eval_psi_dpsi()
Evaluate poloidal flux psi and its derivatives.
- Parameters
-
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 |
- Returns
- zero to indicate success
Definition at line 227 of file B_GS.c.
◆ B_GS_eval_rho_drho()
Evaluate normalized poloidal flux rho and its derivatives.
- Parameters
-
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 |
- Returns
- zero to indicate success
Definition at line 296 of file B_GS.c.
◆ B_GS_eval_B_dB()
Evaluate magnetic field and its derivatives.
- Parameters
-
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 |
- Returns
- zero to indicate success
Definition at line 406 of file B_GS.c.
◆ B_GS_get_axis_rz()
Return magnetic axis R-coordinate.
- Parameters
-
rz | pointer where axis R and z [m] values will be stored |
Bdata | pointer to magnetic field data struct |
- Returns
- Zero a5err value as this function can't fail.
Definition at line 557 of file B_GS.c.