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_acc_omp.h"
8#include "../ascot5.h"
9#include "../error.h"
10#include "../spline/interp.h"
11
39
53
54int B_3DS_init_offload(B_3DS_offload_data* offload_data, real** offload_array);
55void B_3DS_free_offload(B_3DS_offload_data* offload_data, real** offload_array);
56
57void B_3DS_init(B_3DS_data* Bdata, B_3DS_offload_data* offload_data,
58 real* offload_array);
59GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
60a5err B_3DS_eval_psi(real* psi, real r, real phi, real z, B_3DS_data* Bdata);
61DECLARE_TARGET_END
62GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
63a5err B_3DS_eval_psi_dpsi(real psi_dpsi[4], real r, real phi, real z,
64 B_3DS_data* Bdata);
65DECLARE_TARGET_END
66GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
67a5err B_3DS_eval_rho_drho(real rho_drho[4], real r, real phi, real z,
68 B_3DS_data* Bdata);
69DECLARE_TARGET_END
70GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
71a5err B_3DS_eval_B(real B[3], real r, real phi, real z, B_3DS_data* Bdata);
72DECLARE_TARGET_END
73GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
74a5err B_3DS_eval_B_dB(real B_dB[12], real r, real phi, real z,
75 B_3DS_data* Bdata);
76DECLARE_TARGET_END
77GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
79DECLARE_TARGET_END
80#endif
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:378
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:340
void B_3DS_free_offload(B_3DS_offload_data *offload_data, real **offload_array)
Free offload array.
Definition B_3DS.c:202
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:425
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:489
int B_3DS_init_offload(B_3DS_offload_data *offload_data, real **offload_array)
Initialize magnetic field offload data.
Definition B_3DS.c:93
void B_3DS_init(B_3DS_data *Bdata, B_3DS_offload_data *offload_data, real *offload_array)
Initialize magnetic field data struct on target.
Definition B_3DS.c:215
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:285
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:309
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 on the target
Definition B_3DS.h:43
interp2D_data psi
Definition B_3DS.h:48
interp3D_data B_r
Definition B_3DS.h:49
real axis_z
Definition B_3DS.h:47
real psi0
Definition B_3DS.h:44
real psi1
Definition B_3DS.h:45
real axis_r
Definition B_3DS.h:46
interp3D_data B_phi
Definition B_3DS.h:50
interp3D_data B_z
Definition B_3DS.h:51
3D magnetic field parameters on the host
Definition B_3DS.h:15
real psigrid_z_max
Definition B_3DS.h:21
real Bgrid_phi_max
Definition B_3DS.h:31
real psigrid_r_min
Definition B_3DS.h:18
real psigrid_z_min
Definition B_3DS.h:20
int offload_array_length
Definition B_3DS.h:37
real psigrid_r_max
Definition B_3DS.h:19
real Bgrid_phi_min
Definition B_3DS.h:30
Bicubic interpolation struct.
Definition interp.h:68
Tricubic interpolation struct.
Definition interp.h:85