ASCOT5
|
Module for transforming between cylindrical and Boozer coordinates. More...
#include <stdlib.h>
#include <math.h>
#include "print.h"
#include "ascot5.h"
#include "consts.h"
#include "error.h"
#include "B_field.h"
#include "boozer.h"
#include "spline/interp.h"
Go to the source code of this file.
Functions | |
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. | |
Module for transforming between cylindrical and Boozer coordinates.
Definition in file boozer.c.
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
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] |
void boozer_free | ( | boozer_data * | data | ) |
void boozer_offload | ( | boozer_data * | data | ) |
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.
The output vector has the following elements:
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 |