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 "offload_acc_omp.h"
12#include "ascot5.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
53
71
73 real** offload_array);
75 real** offload_array);
76
77int B_field_init(
78 B_field_data* Bdata, B_field_offload_data* offload_data,
79 real* offload_array);
80GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
82 real* psi, real r, real phi, real z, real t, B_field_data* Bdata);
83DECLARE_TARGET_END
84GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
86 real psi_dpsi[4], real r, real phi, real z, real t, B_field_data* Bdata);
87DECLARE_TARGET_END
88GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
89a5err B_field_eval_rho(real rho[2], real psi, B_field_data* Bdata);
90DECLARE_TARGET_END
91GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
93 real rho_drho[4], real r, real phi, real z, B_field_data* Bdata);
94DECLARE_TARGET_END
95GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
96a5err B_field_eval_B(real B[3], real r, real phi, real z, real t,
97 B_field_data* Bdata);
98DECLARE_TARGET_END
99GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
101 real B_dB[15], real r, real phi, real z, real t, B_field_data* Bdata);
102DECLARE_TARGET_END
103GPU_DECLARE_TARGET_SIMD_UNIFORM(Bdata)
105DECLARE_TARGET_END
106
107#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.
int B_field_init_offload(B_field_offload_data *offload_data, real **offload_array)
Load magnetic field data and prepare parameters.
Definition B_field.c:44
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:547
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:472
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:201
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:410
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:265
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:599
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:327
int B_field_init(B_field_data *Bdata, B_field_offload_data *offload_data, real *offload_array)
Initialize magnetic field data struct on target.
Definition B_field.c:143
void B_field_free_offload(B_field_offload_data *offload_data, real **offload_array)
Free offload array and reset parameters.
Definition B_field.c:105
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 on the target
Definition B_2DS.h:34
2D magnetic field parameters that will be offloaded to target
Definition B_2DS.h:17
3D magnetic field parameters on the target
Definition B_3DS.h:43
3D magnetic field parameters on the host
Definition B_3DS.h:15
Analytic magnetic field parameters on the target.
Definition B_GS.h:35
Analytic magnetic field parameters that will be offloaded to target.
Definition B_GS.h:14
stellarator magnetic field parameters on the target
Definition B_STS.h:49
stellarator magnetic field parameters on the host
Definition B_STS.h:15
TC magnetic field parameters on the target.
Definition B_TC.h:37
TC magnetic field parameters that will be offloaded to target.
Definition B_TC.h:16
Magnetic field simulation data.
Definition B_field.h:63
B_STS_data BSTS
Definition B_field.h:68
B_TC_data BTC
Definition B_field.h:69
B_2DS_data B2DS
Definition B_field.h:66
B_field_type type
Definition B_field.h:64
B_GS_data BGS
Definition B_field.h:65
B_3DS_data B3DS
Definition B_field.h:67
Magnetic field offload data.
Definition B_field.h:44
B_2DS_offload_data B2DS
Definition B_field.h:47
B_field_type type
Definition B_field.h:45
B_TC_offload_data BTC
Definition B_field.h:50
B_GS_offload_data BGS
Definition B_field.h:46
B_STS_offload_data BSTS
Definition B_field.h:49
B_3DS_offload_data B3DS
Definition B_field.h:48