ASCOT5
|
Header file for mhd_stat.c. More...
#include "../ascot5.h"
#include "../error.h"
#include "../boozer.h"
#include "../spline/interp.h"
#include "../B_field.h"
Go to the source code of this file.
Data Structures | |
struct | mhd_stat_offload_data |
MHD stat parameters that will be offloaded to target. More... | |
struct | mhd_stat_data |
MHD stat parameters on the target. More... | |
Functions | |
int | mhd_stat_init_offload (mhd_stat_offload_data *offload_data, real **offload_array) |
Load MHD data and prepare parameters for offload. | |
void | mhd_stat_free_offload (mhd_stat_offload_data *offload_data, real **offload_array) |
Free offload array. | |
void | mhd_stat_init (mhd_stat_data *mhdata, mhd_stat_offload_data *offload_data, real *offload_array) |
Initialize MHD data struct on target. | |
a5err | mhd_stat_eval (real mhd_dmhd[10], real r, real phi, real z, real t, int includemode, boozer_data *boozerdata, mhd_stat_data *mhddata, B_field_data *Bdata) |
Evaluate the needed quantities from MHD mode for orbit following. | |
DECLARE_TARGET_SIMD_UNIFORM (boozerdata, mhddata, Bdata, pertonly, includemode) a5err mhd_stat_perturbations(real pert_field[7] | |
Variables | |
real | r |
real real | phi |
real real real | z |
real real real real | t |
real real real real int | pertonly |
real real real real int int | includemode |
real real real real int int boozer_data * | boozerdata |
real real real real int int boozer_data mhd_stat_data * | mhddata |
real real real real int int boozer_data mhd_stat_data B_field_data * | Bdata |
Header file for mhd_stat.c.
Definition in file mhd_stat.h.
int mhd_stat_init_offload | ( | mhd_stat_offload_data * | offload_data, |
real ** | offload_array ) |
Load MHD data and prepare parameters for offload.
This function fills the MHD offload struct with parameters and allocates and fills the offload array. Sets offload array length in the offload struct.
It is assumed that the offload_data struct is completely filled before calling this function (except for the offload_array_length and rhogrid). Furthermore, offload array should contain following data:
1D splines are constructed here and stored to offload array which is reallocated.
offload_data | pointer to offload data struct |
offload_array | pointer to pointer to offload array |
Definition at line 37 of file mhd_stat.c.
void mhd_stat_free_offload | ( | mhd_stat_offload_data * | offload_data, |
real ** | offload_array ) |
Free offload array.
offload_data | pointer to offload data struct |
offload_array | pointer to pointer to offload array |
Definition at line 100 of file mhd_stat.c.
void mhd_stat_init | ( | mhd_stat_data * | mhddata, |
mhd_stat_offload_data * | offload_data, | ||
real * | offload_array ) |
Initialize MHD data struct on target.
mhddata | pointer to data struct on target |
offload_data | pointer to offload data struct |
offload_array | pointer to offload array |
Definition at line 112 of file mhd_stat.c.
a5err mhd_stat_eval | ( | real | mhd_dmhd[10], |
real | r, | ||
real | phi, | ||
real | z, | ||
real | t, | ||
int | includemode, | ||
boozer_data * | boozerdata, | ||
mhd_stat_data * | mhddata, | ||
B_field_data * | Bdata ) |
Evaluate the needed quantities from MHD mode for orbit following.
The quantities to be evaluated are alpha, phi, grad alpha, grad phi, partial t alpha, partial t phi
The values are stored in the given array as:
mhd_dmhd | |
r | R coordinate [m] |
phi | phi coordinate [rad] |
z | z coordinate [m] |
t | time coordinate [s] |
includemode | mode number to include or MHD_INCLUDE_ALL |
boozerdata | pointer to boozer data |
mhddata | pointer to mhd data |
Bdata | pointer to magnetic field data |
Definition at line 174 of file mhd_stat.c.
real r |
Definition at line 72 of file mhd_stat.h.
Definition at line 72 of file mhd_stat.h.
Definition at line 72 of file mhd_stat.h.
real real real real int int boozer_data* boozerdata |
Definition at line 74 of file mhd_stat.h.
real real real real int int boozer_data mhd_stat_data* mhddata |
Definition at line 75 of file mhd_stat.h.
real real real real int int boozer_data mhd_stat_data B_field_data* Bdata |
Definition at line 75 of file mhd_stat.h.