ASCOT5
Loading...
Searching...
No Matches
B_2DS.h
Go to the documentation of this file.
1
7#ifndef B_2DS_H
8#define B_2DS_H
9#include "../offload_acc_omp.h"
10#include "../ascot5.h"
11#include "../error.h"
12#include "../spline/interp.h"
13
30
44
45int B_2DS_init_offload(B_2DS_offload_data* offload_data, real** offload_array);
46void B_2DS_free_offload(B_2DS_offload_data* offload_data, real** offload_array);
47
48void B_2DS_init(B_2DS_data* Bdata, B_2DS_offload_data* offload_data,
49 real* offload_array);
50GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
51a5err B_2DS_eval_psi(real* psi, real r, real phi, real z, B_2DS_data* Bdata);
52DECLARE_TARGET_END
53GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
54a5err B_2DS_eval_psi_dpsi(real psi_dpsi[4], real r, real phi, real z,
55 B_2DS_data* Bdata);
56DECLARE_TARGET_END
57GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
58a5err B_2DS_eval_rho_drho(real rho_drho[4], real r, real phi, real z,
59 B_2DS_data* Bdata);
60DECLARE_TARGET_END
61GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
62a5err B_2DS_eval_B(real B[3], real r, real phi, real z, B_2DS_data* Bdata);
63DECLARE_TARGET_END
64GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
65a5err B_2DS_eval_B_dB(real B_dB[12], real r, real phi, real z, B_2DS_data* Bdata);
66DECLARE_TARGET_END
67GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
69DECLARE_TARGET_END
70#endif
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.
Definition B_2DS.c:375
a5err B_2DS_eval_psi(real *psi, real r, real phi, real z, B_2DS_data *Bdata)
Evaluate poloidal flux psi.
Definition B_2DS.c:237
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.
Definition B_2DS.c:260
DECLARE_TARGET_END a5err B_2DS_eval_B(real B[3], real r, real phi, real z, B_2DS_data *Bdata)
Evaluate magnetic field.
Definition B_2DS.c:329
DECLARE_TARGET_END a5err B_2DS_get_axis_rz(real rz[2], B_2DS_data *Bdata)
Return magnetic axis R-coordinate.
Definition B_2DS.c:444
void B_2DS_free_offload(B_2DS_offload_data *offload_data, real **offload_array)
Free offload array.
Definition B_2DS.c:163
void B_2DS_init(B_2DS_data *Bdata, B_2DS_offload_data *offload_data, real *offload_array)
Initialize magnetic field data struct on target.
Definition B_2DS.c:176
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.
Definition B_2DS.c:291
int B_2DS_init_offload(B_2DS_offload_data *offload_data, real **offload_array)
Initialize magnetic field offload data.
Definition B_2DS.c:69
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.
2D magnetic field parameters on the target
Definition B_2DS.h:34
interp2D_data psi
Definition B_2DS.h:39
real psi1
Definition B_2DS.h:36
interp2D_data B_phi
Definition B_2DS.h:41
interp2D_data B_z
Definition B_2DS.h:42
interp2D_data B_r
Definition B_2DS.h:40
real psi0
Definition B_2DS.h:35
real axis_z
Definition B_2DS.h:38
real axis_r
Definition B_2DS.h:37
2D magnetic field parameters that will be offloaded to target
Definition B_2DS.h:17
int offload_array_length
Definition B_2DS.h:28
Bicubic interpolation struct.
Definition interp.h:68