ASCOT5
Loading...
Searching...
No Matches
B_3DS.h
Go to the documentation of this file.
1
5#ifndef B_3DS_H
6#define B_3DS_H
7#include "../offload.h"
8#include "../ascot5.h"
9#include "../error.h"
10#include "../spline/interp.h"
11
25
26int B_3DS_init(B_3DS_data* data,
27 int p_n_r, real p_r_min, real p_r_max,
28 int p_n_z, real p_z_min, real p_z_max,
29 int b_n_r, real b_r_min, real b_r_max,
30 int b_n_phi, real b_phi_min, real b_phi_max,
31 int b_n_z, real b_z_min, real b_z_max,
33 real* psi, real* B_r, real* B_phi, real* B_z);
34void B_3DS_free(B_3DS_data* data);
35void B_3DS_offload(B_3DS_data* data);
36GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
37a5err B_3DS_eval_psi(real* psi, real r, real phi, real z, B_3DS_data* Bdata);
38DECLARE_TARGET_END
39GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
40a5err B_3DS_eval_psi_dpsi(real psi_dpsi[4], real r, real phi, real z,
41 B_3DS_data* Bdata);
42DECLARE_TARGET_END
43GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
44a5err B_3DS_eval_rho_drho(real rho_drho[4], real r, real phi, real z,
45 B_3DS_data* Bdata);
46DECLARE_TARGET_END
47GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
48a5err B_3DS_eval_B(real B[3], real r, real phi, real z, B_3DS_data* Bdata);
49DECLARE_TARGET_END
50GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
51a5err B_3DS_eval_B_dB(real B_dB[12], real r, real phi, real z,
52 B_3DS_data* Bdata);
53DECLARE_TARGET_END
54GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
56DECLARE_TARGET_END
57#endif
real axis_r
Definition B_3DS.c:61
real axis_z
Definition B_3DS.c:62
real psi0
Definition B_3DS.c:59
real psi1
Definition B_3DS.c:60
DECLARE_TARGET_END a5err B_3DS_eval_B(real B[3], real r, real phi, real z, B_3DS_data *Bdata)
Evaluate magnetic field.
Definition B_3DS.c:317
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.
Definition B_3DS.c:279
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.
Definition B_3DS.c:364
DECLARE_TARGET_END a5err B_3DS_get_axis_rz(real rz[2], B_3DS_data *Bdata)
Return magnetic axis R-coordinate.
Definition B_3DS.c:428
void B_3DS_free(B_3DS_data *data)
Free allocated resources.
Definition B_3DS.c:191
a5err B_3DS_eval_psi(real *psi, real r, real phi, real z, B_3DS_data *Bdata)
Evaluate poloidal flux psi.
Definition B_3DS.c:224
void B_3DS_offload(B_3DS_data *data)
Offload data to the accelerator.
Definition B_3DS.c:203
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.
Definition B_3DS.c:106
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.
Definition B_3DS.c:248
Main header file for ASCOT5.
double real
Definition ascot5.h:85
Error module for ASCOT5.
unsigned long int a5err
Simulation error flag.
Definition error.h:17
Spline interpolation library.
3D magnetic field parameters
Definition B_3DS.h:15
interp2D_data psi
Definition B_3DS.h:20
interp3D_data B_r
Definition B_3DS.h:21
real axis_z
Definition B_3DS.h:19
real psi0
Definition B_3DS.h:16
real psi1
Definition B_3DS.h:17
real axis_r
Definition B_3DS.h:18
interp3D_data B_phi
Definition B_3DS.h:22
interp3D_data B_z
Definition B_3DS.h:23
Bicubic interpolation struct.
Definition interp.h:68
Tricubic interpolation struct.
Definition interp.h:85