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_acc_omp.h"
8#include "../ascot5.h"
9#include "../linint/linint.h"
10#include "../spline/interp.h"
11
45
59
60int B_STS_init_offload(B_STS_offload_data* offload_data, real** offload_array);
61void B_STS_free_offload(B_STS_offload_data* offload_data, real** offload_array);
62
63void B_STS_init(B_STS_data* Bdata, B_STS_offload_data* offload_data,
64 real* offload_array);
65GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
66a5err B_STS_eval_psi(real* psi, real r, real phi, real z, B_STS_data* Bdata);
67DECLARE_TARGET_END
68GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
69a5err B_STS_eval_psi_dpsi(real psi_dpsi[4], real r, real phi, real z,
70 B_STS_data* Bdata);
71DECLARE_TARGET_END
72GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
73a5err B_STS_eval_rho_drho(real rho_drho[4], real r, real phi, real z,
74 B_STS_data* Bdata);
75DECLARE_TARGET_END
76GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
77a5err B_STS_eval_B(real B[3], real r, real phi, real z, B_STS_data* Bdata);
78DECLARE_TARGET_END
79GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
80a5err B_STS_eval_B_dB(real B_dB[12], real r, real phi, real z,
81 B_STS_data* Bdata);
82DECLARE_TARGET_END
83GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
84a5err B_STS_get_axis_rz(real rz[2], B_STS_data* Bdata, real phi);
85DECLARE_TARGET_END
86#endif
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:480
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:396
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:531
void B_STS_free_offload(B_STS_offload_data *offload_data, real **offload_array)
Free offload array.
Definition B_STS.c:225
void B_STS_init(B_STS_data *Bdata, B_STS_offload_data *offload_data, real *offload_array)
Initialize magnetic field data struct on target.
Definition B_STS.c:237
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:354
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:445
int B_STS_init_offload(B_STS_offload_data *offload_data, real **offload_array)
Initialize magnetic field offload data.
Definition B_STS.c:98
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:322
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:49
interp3D_data psi
Definition B_STS.h:54
real psi1
Definition B_STS.h:51
real psi0
Definition B_STS.h:50
interp3D_data B_z
Definition B_STS.h:57
interp3D_data B_phi
Definition B_STS.h:56
linint1D_data axis_z
Definition B_STS.h:53
interp3D_data B_r
Definition B_STS.h:55
linint1D_data axis_r
Definition B_STS.h:52
stellarator magnetic field parameters on the host
Definition B_STS.h:15
real psigrid_r_max
Definition B_STS.h:20
int offload_array_length
Definition B_STS.h:38
real Bgrid_phi_max
Definition B_STS.h:34
real Bgrid_phi_min
Definition B_STS.h:33
real psigrid_phi_min
Definition B_STS.h:23
real psigrid_z_min
Definition B_STS.h:21
real psigrid_r_min
Definition B_STS.h:19
real psigrid_phi_max
Definition B_STS.h:24
real psigrid_z_max
Definition B_STS.h:22
Tricubic interpolation struct.
Definition interp.h:85
1D interpolation struct.
Definition linint.h:21