ASCOT5
Loading...
Searching...
No Matches
B_GS.h File Reference

Header file for B_GS.c. More...

#include "../offload.h"
#include "../ascot5.h"
#include "../error.h"

Go to the source code of this file.

Data Structures

struct  B_GS_data
 Analytic magnetic field parameters on the target. More...
 

Functions

int B_GS_init (B_GS_data *data, real R0, real z0, real raxis, real zaxis, real B_phi0, real psi0, real psi1, real psi_mult, real c[14], int Nripple, real a0, real alpha0, real delta0)
 Initialize magnetic field data.
 
void B_GS_free (B_GS_data *data)
 Free allocated resources.
 
void B_GS_offload (B_GS_data *data)
 Offload data to the accelerator.
 
a5err B_GS_eval_B (real B[3], real r, real phi, real z, B_GS_data *Bdata)
 Evaluate magnetic field.
 
DECLARE_TARGET_END a5err B_GS_eval_psi (real *psi, real r, real phi, real z, B_GS_data *Bdata)
 Evaluate poloidal flux psi.
 
DECLARE_TARGET_END a5err B_GS_eval_psi_dpsi (real psi_dpsi[4], real r, real phi, real z, B_GS_data *Bdata)
 Evaluate poloidal flux psi and its derivatives.
 
DECLARE_TARGET_END a5err B_GS_eval_rho_drho (real rho_drho[4], real r, real phi, real z, B_GS_data *Bdata)
 Evaluate normalized poloidal flux rho and its derivatives.
 
DECLARE_TARGET_END a5err B_GS_eval_B_dB (real B_dB[12], real r, real phi, real z, B_GS_data *Bdata)
 Evaluate magnetic field and its derivatives.
 
DECLARE_TARGET_END a5err B_GS_get_axis_rz (real rz[2], B_GS_data *Bdata)
 Return magnetic axis R-coordinate.
 

Detailed Description

Header file for B_GS.c.

Definition in file B_GS.h.

Function Documentation

◆ B_GS_init()

int B_GS_init ( B_GS_data * data,
real R0,
real z0,
real raxis,
real zaxis,
real B_phi0,
real psi0,
real psi1,
real psi_mult,
real c[14],
int Nripple,
real a0,
real alpha0,
real delta0 )

Initialize magnetic field data.

Parameters
datapointer to the data struct
R0major radius R coordinate [m]
z0midplane z coordinate [m]
raxismagnetic axis R coordinate [m]
zaxismagnetic axis z coordinate [m]
B_phi0on-axis toroidal field [T]
psi0poloidal flux at axis [Vs/m]
psi1poloidal flux at separatrix [Vs/m]
psi_multpsi multiplier
psi_coeffcoefficients for evaluating psi
Nripplenumber of toroidal field coils
a0minor radius
alpha0ripple r-dependency delta ~ (r/a0)^alpha0
delta0ripple strength
Returns
zero to indicate success

Definition at line 96 of file B_GS.c.

◆ B_GS_free()

void B_GS_free ( B_GS_data * data)

Free allocated resources.

Parameters
datapointer to the data struct

Definition at line 150 of file B_GS.c.

◆ B_GS_offload()

void B_GS_offload ( B_GS_data * data)

Offload data to the accelerator.

Parameters
datapointer to the data struct

Definition at line 159 of file B_GS.c.

◆ B_GS_eval_B()

a5err B_GS_eval_B ( real B[3],
real r,
real phi,
real z,
B_GS_data * Bdata )

Evaluate magnetic field.

Parameters
Bpointer to array where magnetic field values are stored
rR coordinate [m]
phiphi coordinate [deg]
zz coordinate [m]
Bdatapointer to magnetic field data struct
Returns
zero to indicate success

Definition at line 327 of file B_GS.c.

◆ B_GS_eval_psi()

DECLARE_TARGET_END a5err B_GS_eval_psi ( real * psi,
real r,
real phi,
real z,
B_GS_data * Bdata )

Evaluate poloidal flux psi.

Parameters
psipointer where psi [V*s*m^-1] value will be stored
rR coordinate [m]
phiphi coordinate [rad]
zz coordinate [m]
Bdatapointer to magnetic field data struct
Returns
zero to indicate success

Definition at line 174 of file B_GS.c.

◆ B_GS_eval_psi_dpsi()

DECLARE_TARGET_END a5err B_GS_eval_psi_dpsi ( real psi_dpsi[4],
real r,
real phi,
real z,
B_GS_data * Bdata )

Evaluate poloidal flux psi and its derivatives.

Parameters
psi_dpsipointer for storing psi [V*s*m^-1] and its derivatives
rR coordinate [m]
phiphi coordinate [rad]
zz coordinate [m]
Bdatapointer to magnetic field data struct
Returns
zero to indicate success

Definition at line 227 of file B_GS.c.

◆ B_GS_eval_rho_drho()

DECLARE_TARGET_END a5err B_GS_eval_rho_drho ( real rho_drho[4],
real r,
real phi,
real z,
B_GS_data * Bdata )

Evaluate normalized poloidal flux rho and its derivatives.

Parameters
rho_drhopointer where rho and its derivatives will be stored
rR coordinate [m]
phiphi coordinate [rad]
zz coordinate [m]
Bdatapointer to magnetic field data struct
Returns
zero to indicate success

Definition at line 296 of file B_GS.c.

◆ B_GS_eval_B_dB()

DECLARE_TARGET_END a5err B_GS_eval_B_dB ( real B_dB[12],
real r,
real phi,
real z,
B_GS_data * Bdata )

Evaluate magnetic field and its derivatives.

Parameters
B_dBpointer to array where the field and its derivatives are stored
rR coordinate [m]
phiphi coordinate [deg]
zz coordinate [m]
Bdatapointer to magnetic field data struct
Returns
zero to indicate success

Definition at line 406 of file B_GS.c.

◆ B_GS_get_axis_rz()

DECLARE_TARGET_END a5err B_GS_get_axis_rz ( real rz[2],
B_GS_data * Bdata )

Return magnetic axis R-coordinate.

Parameters
rzpointer where axis R and z [m] values will be stored
Bdatapointer to magnetic field data struct
Returns
Zero a5err value as this function can't fail.

Definition at line 557 of file B_GS.c.