ASCOT5
Loading...
Searching...
No Matches
B_STS.h
Go to the documentation of this file.
1
5#ifndef B_STS_H
6#define B_STS_H
7#include "../offload.h"
8#include "../ascot5.h"
9#include "../linint/linint.h"
10#include "../spline/interp.h"
11
25
26int B_STS_init(B_STS_data* data,
27 int p_n_r, real p_r_min, real p_r_max,
28 int p_n_phi, real p_phi_min, real p_phi_max,
29 int p_n_z, real p_z_min, real p_z_max,
30 int b_n_r, real b_r_min, real b_r_max,
31 int b_n_phi, real b_phi_min, real b_phi_max,
32 int b_n_z, real b_z_min, real b_z_max,
33 int naxis, real axis_min, real axis_max,
35 real* psi, real* B_r, real* B_phi, real* B_z);
36void B_STS_free(B_STS_data* data);
37void B_STS_offload(B_STS_data* data);
38GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
39a5err B_STS_eval_psi(real* psi, real r, real phi, real z, B_STS_data* Bdata);
40DECLARE_TARGET_END
41GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
42a5err B_STS_eval_psi_dpsi(real psi_dpsi[4], real r, real phi, real z,
43 B_STS_data* Bdata);
44DECLARE_TARGET_END
45GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
46a5err B_STS_eval_rho_drho(real rho_drho[4], real r, real phi, real z,
47 B_STS_data* Bdata);
48DECLARE_TARGET_END
49GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
50a5err B_STS_eval_B(real B[3], real r, real phi, real z, B_STS_data* Bdata);
51DECLARE_TARGET_END
52GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
53a5err B_STS_eval_B_dB(real B_dB[12], real r, real phi, real z,
54 B_STS_data* Bdata);
55DECLARE_TARGET_END
56GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
57a5err B_STS_get_axis_rz(real rz[2], B_STS_data* Bdata, real phi);
58DECLARE_TARGET_END
59#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_STS_eval_B_dB(real B_dB[12], real r, real phi, real z, B_STS_data *Bdata)
Evaluate magnetic field and its derivatives.
Definition B_STS.c:370
void B_STS_offload(B_STS_data *data)
Offload data to the accelerator.
Definition B_STS.c:189
DECLARE_TARGET_END a5err B_STS_eval_rho_drho(real rho_drho[4], real r, real phi, real z, B_STS_data *Bdata)
Evaluate normalized poloidal flux rho and its derivatives.
Definition B_STS.c:286
DECLARE_TARGET_END a5err B_STS_get_axis_rz(real rz[2], B_STS_data *Bdata, real phi)
Return magnetic axis Rz-coordinates.
Definition B_STS.c:421
int B_STS_init(B_STS_data *data, int p_n_r, real p_r_min, real p_r_max, int p_n_phi, real p_phi_min, real p_phi_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, int naxis, real axis_min, real axis_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_STS.c:81
DECLARE_TARGET_END a5err B_STS_eval_psi_dpsi(real psi_dpsi[4], real r, real phi, real z, B_STS_data *Bdata)
Evaluate poloidal flux psi and its derivatives.
Definition B_STS.c:244
DECLARE_TARGET_END a5err B_STS_eval_B(real B[3], real r, real phi, real z, B_STS_data *Bdata)
Evaluate magnetic field.
Definition B_STS.c:335
void B_STS_free(B_STS_data *data)
Free allocated resources.
Definition B_STS.c:177
a5err B_STS_eval_psi(real *psi, real r, real phi, real z, B_STS_data *Bdata)
Evaluate poloidal flux psi.
Definition B_STS.c:212
Main header file for ASCOT5.
double real
Definition ascot5.h:85
unsigned long int a5err
Simulation error flag.
Definition error.h:17
Spline interpolation library.
Linear interpolation library.
stellarator magnetic field parameters on the target
Definition B_STS.h:15
interp3D_data psi
Definition B_STS.h:20
real psi1
Definition B_STS.h:17
real psi0
Definition B_STS.h:16
interp3D_data B_z
Definition B_STS.h:23
interp3D_data B_phi
Definition B_STS.h:22
linint1D_data axis_z
Definition B_STS.h:19
interp3D_data B_r
Definition B_STS.h:21
linint1D_data axis_r
Definition B_STS.h:18
Tricubic interpolation struct.
Definition interp.h:85
1D interpolation struct.
Definition linint.h:21