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.h"
10#include "../ascot5.h"
11#include "../error.h"
12#include "../spline/interp.h"
13
27
28int B_2DS_init(B_2DS_data* data,
29 int n_r, real r_min, real r_max,
30 int n_z, real z_min, real z_max,
32 real* psi, real* B_r, real* B_phi, real* B_z);
33void B_2DS_free(B_2DS_data* data);
34void B_2DS_offload(B_2DS_data* data);
35GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
36a5err B_2DS_eval_psi(real* psi, real r, real phi, real z, B_2DS_data* Bdata);
37DECLARE_TARGET_END
38GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
39a5err B_2DS_eval_psi_dpsi(real psi_dpsi[4], real r, real phi, real z,
40 B_2DS_data* Bdata);
41DECLARE_TARGET_END
42GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
43a5err B_2DS_eval_rho_drho(real rho_drho[4], real r, real phi, real z,
44 B_2DS_data* Bdata);
45DECLARE_TARGET_END
46GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
47a5err B_2DS_eval_B(real B[3], real r, real phi, real z, B_2DS_data* Bdata);
48DECLARE_TARGET_END
49GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
50a5err B_2DS_eval_B_dB(real B_dB[12], real r, real phi, real z, B_2DS_data* Bdata);
51DECLARE_TARGET_END
52GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
54DECLARE_TARGET_END
55#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:296
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:158
int B_2DS_init(B_2DS_data *data, int n_r, real r_min, real r_max, int n_z, real z_min, real 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_2DS.c:55
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:181
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:250
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:365
void B_2DS_offload(B_2DS_data *data)
Offload data to the accelerator.
Definition B_2DS.c:137
void B_2DS_free(B_2DS_data *data)
Free allocated resources.
Definition B_2DS.c:125
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:212
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
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
Definition B_2DS.h:17
interp2D_data psi
Definition B_2DS.h:22
real psi1
Definition B_2DS.h:19
interp2D_data B_phi
Definition B_2DS.h:24
interp2D_data B_z
Definition B_2DS.h:25
interp2D_data B_r
Definition B_2DS.h:23
real psi0
Definition B_2DS.h:18
real axis_z
Definition B_2DS.h:21
real axis_r
Definition B_2DS.h:20
Bicubic interpolation struct.
Definition interp.h:68