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

Header file for B_TC.c. More...

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

Go to the source code of this file.

Data Structures

struct  B_TC_data
 TC magnetic field parameters on the target. More...
 

Functions

int B_TC_init (B_TC_data *data, real axisr, real axisz, real psival, real rhoval, real B[3], real dB[9])
 Initialize magnetic field data.
 
void B_TC_free (B_TC_data *data)
 Free allocated resources.
 
void B_TC_offload (B_TC_data *data)
 Offload data to the accelerator.
 
a5err B_TC_eval_B (real B[3], real r, real phi, real z, B_TC_data *Bdata)
 Evaluate magnetic field.
 
DECLARE_TARGET_END a5err B_TC_eval_psi (real *psi, real r, real phi, real z, B_TC_data *Bdata)
 Evaluate poloidal flux psi.
 
DECLARE_TARGET_END a5err B_TC_eval_psi_dpsi (real psi_dpsi[4], real r, real phi, real z, B_TC_data *Bdata)
 Evaluate poloidal flux psi and its derivatives.
 
DECLARE_TARGET_END a5err B_TC_eval_rho_drho (real rho_drho[4], real r, real phi, real z, B_TC_data *Bdata)
 Evaluate normalized poloidal flux rho and its derivatives.
 
DECLARE_TARGET_END a5err B_TC_eval_B_dB (real B_dB[12], real r, real phi, real z, B_TC_data *Bdata)
 Evaluate magnetic field and its derivatives.
 
DECLARE_TARGET_END a5err B_TC_get_axis_rz (real rz[2], B_TC_data *Bdata)
 Return magnetic axis R-coordinate.
 

Detailed Description

Header file for B_TC.c.

Contains declaration of B_TC_offload_data and B_TC_data structs.

Definition in file B_TC.h.

Function Documentation

◆ B_TC_init()

int B_TC_init ( B_TC_data * data,
real axisr,
real axisz,
real psival,
real rhoval,
real B[3],
real dB[9] )

Initialize magnetic field data.

Parameters
datapointer to the data struct
axisrvalue returned when quering magnetic axis R coordinate [m]
axiszvalue returned when quering magnetic axis z coordinate [m]
psivalvalue returned when quering magnetic flux [Vs/m]
rhovalvalue returned when quering normalized poloidal flux [1]
Bmagnetic field at origo [B_x, B_y, B_z] [T]
dBmagnetic field Jacobian [dB_x/dx, dB_x/dy, dB_x/dz, dB_y/dx, dB_y/dy, dB_y/dz, dB_z/dx, dB_z/dy, dB_z/dz] [T/m]
Returns
zero to indicate success

Definition at line 46 of file B_TC.c.

◆ B_TC_free()

void B_TC_free ( B_TC_data * data)

Free allocated resources.

Definition at line 83 of file B_TC.c.

◆ B_TC_offload()

void B_TC_offload ( B_TC_data * data)

Offload data to the accelerator.

Parameters
datapointer to the data struct

Definition at line 92 of file B_TC.c.

◆ B_TC_eval_B()

a5err B_TC_eval_B ( real B[3],
real r,
real phi,
real z,
B_TC_data * Bdata )

Evaluate magnetic field.

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

Definition at line 168 of file B_TC.c.

◆ B_TC_eval_psi()

DECLARE_TARGET_END a5err B_TC_eval_psi ( real * psi,
real r,
real phi,
real z,
B_TC_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 107 of file B_TC.c.

◆ B_TC_eval_psi_dpsi()

DECLARE_TARGET_END a5err B_TC_eval_psi_dpsi ( real psi_dpsi[4],
real r,
real phi,
real z,
B_TC_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 125 of file B_TC.c.

◆ B_TC_eval_rho_drho()

DECLARE_TARGET_END a5err B_TC_eval_rho_drho ( real rho_drho[4],
real r,
real phi,
real z,
B_TC_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 146 of file B_TC.c.

◆ B_TC_eval_B_dB()

DECLARE_TARGET_END a5err B_TC_eval_B_dB ( real B_dB[12],
real r,
real phi,
real z,
B_TC_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 [rad]
zz coordinate [m]
Bdatapointer to magnetic field data struct
Returns
zero to indicate success

Definition at line 200 of file B_TC.c.

◆ B_TC_get_axis_rz()

DECLARE_TARGET_END a5err B_TC_get_axis_rz ( real rz[2],
B_TC_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 239 of file B_TC.c.