ASCOT5
Loading...
Searching...
No Matches
B_field.h
Go to the documentation of this file.
1
8#ifndef B_FIELD_H
9#define B_FIELD_H
10
11#include "ascot5.h"
12#include "offload.h"
13#include "error.h"
14#include "Bfield/B_GS.h"
15#include "Bfield/B_2DS.h"
16#include "Bfield/B_3DS.h"
17#include "Bfield/B_STS.h"
18#include "Bfield/B_TC.h"
19
34
49
50void B_field_free(B_field_data* data);
52GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
54 real* psi, real r, real phi, real z, real t, B_field_data* Bdata);
55DECLARE_TARGET_END
56GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
58 real psi_dpsi[4], real r, real phi, real z, real t, B_field_data* Bdata);
59DECLARE_TARGET_END
60GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
61a5err B_field_eval_rho(real rho[2], real psi, B_field_data* Bdata);
62DECLARE_TARGET_END
63GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
65 real rho_drho[4], real r, real phi, real z, B_field_data* Bdata);
66DECLARE_TARGET_END
67GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
68a5err B_field_eval_B(real B[3], real r, real phi, real z, real t,
69 B_field_data* Bdata);
70DECLARE_TARGET_END
71GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
73 real B_dB[15], real r, real phi, real z, real t, B_field_data* Bdata);
74DECLARE_TARGET_END
75GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
77DECLARE_TARGET_END
78
79#endif
Header file for B_2DS.c.
Header file for B_3DS.c.
Header file for B_GS.c.
Header file for B_STS.c.
Header file for B_TC.c.
void B_field_offload(B_field_data *data)
Offload data to the accelerator.
Definition B_field.c:61
DECLARE_TARGET_END a5err B_field_eval_B_dB(real B_dB[15], real r, real phi, real z, real t, B_field_data *Bdata)
Evaluate magnetic field and its derivatives.
Definition B_field.c:449
DECLARE_TARGET_END a5err B_field_eval_B(real B[3], real r, real phi, real z, real t, B_field_data *Bdata)
Evaluate magnetic field.
Definition B_field.c:374
a5err B_field_eval_psi(real *psi, real r, real phi, real z, real t, B_field_data *Bdata)
Evaluate poloidal flux psi.
Definition B_field.c:102
void B_field_free(B_field_data *data)
Free allocated resources.
Definition B_field.c:32
DECLARE_TARGET_END a5err B_field_eval_rho_drho(real rho_drho[4], real r, real phi, real z, B_field_data *Bdata)
Evaluate normalized poloidal flux rho and its derivatives.
Definition B_field.c:312
DECLARE_TARGET_END a5err B_field_eval_psi_dpsi(real psi_dpsi[4], real r, real phi, real z, real t, B_field_data *Bdata)
Evaluate poloidal flux psi and its derivatives.
Definition B_field.c:166
B_field_type
Magnetic field types.
Definition B_field.h:27
@ B_field_type_2DS
Definition B_field.h:29
@ B_field_type_TC
Definition B_field.h:32
@ B_field_type_3DS
Definition B_field.h:30
@ B_field_type_STS
Definition B_field.h:31
@ B_field_type_GS
Definition B_field.h:28
DECLARE_TARGET_END a5err B_field_get_axis_rz(real rz[2], B_field_data *Bdata, real phi)
Return magnetic axis Rz-coordinates.
Definition B_field.c:501
DECLARE_TARGET_END a5err B_field_eval_rho(real rho[2], real psi, B_field_data *Bdata)
Evaluate normalized poloidal flux rho and its psi derivative.
Definition B_field.c:228
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
2D magnetic field parameters
Definition B_2DS.h:17
3D magnetic field parameters
Definition B_3DS.h:15
Analytic magnetic field parameters on the target.
Definition B_GS.h:14
stellarator magnetic field parameters on the target
Definition B_STS.h:15
TC magnetic field parameters on the target.
Definition B_TC.h:16
Magnetic field simulation data.
Definition B_field.h:41
B_STS_data BSTS
Definition B_field.h:46
B_TC_data BTC
Definition B_field.h:47
B_2DS_data B2DS
Definition B_field.h:44
B_field_type type
Definition B_field.h:42
B_GS_data BGS
Definition B_field.h:43
B_3DS_data B3DS
Definition B_field.h:45