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_offload (boozer_offload_data *offload_data, real **offload_array) |
Load Boozer data and prepare parameters for offload. | |
void | boozer_init (boozer_data *boozerdata, boozer_offload_data *offload_data, real *offload_array) |
Initialize boozer data struct on target. | |
void | boozer_free_offload (boozer_offload_data *offload_data, real **offload_array) |
Free offload array. | |
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_offload | ( | boozer_offload_data * | offload_data, |
real ** | offload_array ) |
Load Boozer data and prepare parameters for offload.
This function fills the boozer offload struct with parameters and allocates and fills the offload array. Sets offload array length in the offload struct.
The offload data struct should be fully initialized before calling this function and offload array should hold the input data in order [psi, nu, theta_bzr]. This function fits splines to input data, reallocates the offload array and stores spline coefficients there.
Multidimensional arrays must be stored as
offload_data | pointer to offload data struct |
offload_array | pointer to pointer to offload array |
void boozer_init | ( | boozer_data * | boozerdata, |
boozer_offload_data * | offload_data, | ||
real * | offload_array ) |
void boozer_free_offload | ( | boozer_offload_data * | offload_data, |
real ** | offload_array ) |
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 |