Header file for boozer.c.
More...
#include "ascot5.h"
#include "error.h"
#include "B_field.h"
#include "spline/interp.h"
Go to the source code of this file.
|
| struct | boozer_data |
| | Data for mapping between the cylindrical and Boozer coordinates. More...
|
| |
|
| int | boozer_init (boozer_data *data, int npsi, real psi_min, real psi_max, int ntheta, int nthetag, real *nu, real *theta, int nrzs, real *rs, real *zs) |
| | Initialize boozer coordinate transformation.
|
| |
| void | boozer_free (boozer_data *data) |
| | Free allocated resources.
|
| |
| void | boozer_offload (boozer_data *data) |
| | Offload data to the accelerator.
|
| |
| a5err | boozer_eval_psithetazeta (real psithetazeta[12], int *isinside, real r, real phi, real z, B_field_data *Bdata, boozer_data *boozerdata) |
| | Evaluate Boozer coordinates and partial derivatives.
|
| |
Header file for boozer.c.
Definition in file boozer.h.
◆ boozer_init()
| int boozer_init |
( |
boozer_data * | data, |
|
|
int | npsi, |
|
|
real | psi_min, |
|
|
real | psi_max, |
|
|
int | ntheta, |
|
|
int | nthetag, |
|
|
real * | nu, |
|
|
real * | theta, |
|
|
int | nrzs, |
|
|
real * | rs, |
|
|
real * | zs ) |
Initialize boozer coordinate transformation.
Multidimensional arrays must be stored as
- nu(psi_i, theta_j) = array[j*npsi + i]
- theta(psi_i, thetag_j) = array[j*npsi + i]
- Parameters
-
| data | pointer to the data struct |
| npsi | Number of psi grid points in nu and theta data |
| psi_min | minimum value in the psi grid |
| psi_max | maximum value in the psi grid |
| ntheta | number of boozer theta grid points in nu data |
| nthetag | number of geometric theta grid points in theta data |
| nu | the difference between cylindrical angle phi and toroidal boozer coordinate zeta, phi = zeta + nu [rad] |
| theta | the boozer poloidal angle [rad] |
| nrzs | the number of elements in rs and zs |
| rs | separatrix contour R coordinates [m] |
| zs | separatrix contour z coordinates [m] |
- Returns
- zero if initialization succeeded.
Definition at line 38 of file boozer.c.
◆ boozer_free()
Free allocated resources.
- Parameters
-
| data | pointer to the data struct |
Definition at line 79 of file boozer.c.
◆ boozer_offload()
Offload data to the accelerator.
- Parameters
-
| data | pointer to the data struct |
Definition at line 91 of file boozer.c.
◆ boozer_eval_psithetazeta()
Evaluate Boozer coordinates and partial derivatives.
The output vector has the following elements:
- psithetazeta[0] = psi
- psithetazeta[1] = dpsi/dR
- psithetazeta[2] = dpsi/dphi
- psithetazeta[3] = dpsi/dz
- psithetazeta[4] = theta
- psithetazeta[5] = dtheta/dR
- psithetazeta[6] = dtheta/dphi
- psithetazeta[7] = dtheta/dz
- psithetazeta[8] = zeta
- psithetazeta[9] = dzeta/dR
- psithetazeta[10] = dzeta/dphi
- psithetazeta[11] = dzeta/dz
- Parameters
-
| psithetazeta | evaluated Boozer coordinates and their gradients. |
| isinside | a flag indicating whether the queried point was inside boozer grid |
| r | R coordinate |
| phi | phi coordinate |
| z | z coordinate |
| Bdata | pointer to magnetic field data |
| boozerdata | pointer to boozerdata |
- Returns
- zero on success
Definition at line 124 of file boozer.c.