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

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.

Data Structures

struct  boozer_data
 Data for mapping between the cylindrical and Boozer coordinates. More...
 

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.
 

Detailed Description

Header file for boozer.c.

Definition in file boozer.h.

Function Documentation

◆ 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
datapointer to the data struct
npsiNumber of psi grid points in nu and theta data
psi_minminimum value in the psi grid
psi_maxmaximum value in the psi grid
nthetanumber of boozer theta grid points in nu data
nthetagnumber of geometric theta grid points in theta data
nuthe difference between cylindrical angle phi and toroidal boozer coordinate zeta, phi = zeta + nu [rad]
thetathe boozer poloidal angle [rad]
nrzsthe number of elements in rs and zs
rsseparatrix contour R coordinates [m]
zsseparatrix contour z coordinates [m]
Returns
zero if initialization succeeded.

Definition at line 38 of file boozer.c.

◆ boozer_free()

void boozer_free ( boozer_data * data)

Free allocated resources.

Parameters
datapointer to the data struct

Definition at line 79 of file boozer.c.

◆ boozer_offload()

void boozer_offload ( boozer_data * data)

Offload data to the accelerator.

Parameters
datapointer to the data struct

Definition at line 91 of file boozer.c.

◆ boozer_eval_psithetazeta()

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[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
psithetazetaevaluated Boozer coordinates and their gradients.
isinsidea flag indicating whether the queried point was inside boozer grid
rR coordinate
phiphi coordinate
zz coordinate
Bdatapointer to magnetic field data
boozerdatapointer to boozerdata
Returns
zero on success

Definition at line 124 of file boozer.c.