46 real** offload_array) {
49 switch(offload_data->
type) {
66 print_err(
"Error: Unregonized MHD type.");
74 *
sizeof(
real) / (1024.0*1024.0) );
91 real** offload_array) {
92 switch(offload_data->
type) {
122 real* offload_array) {
125 switch(offload_data->
type) {
139 print_err(
"Error: Unregonized electric field type.\n");
143 mhddata->type = offload_data->
type;
183 switch(mhddata->type) {
187 boozerdata, &(mhddata->stat), Bdata);
192 boozerdata, &(mhddata->nonstat), Bdata);
235 real t,
int pertonly,
int includemode,
240 switch(mhddata->type) {
244 includemode, boozerdata,
245 &(mhddata->stat), Bdata);
250 includemode, boozerdata,
251 &(mhddata->nonstat), Bdata);
272 switch(mhddata->type) {
274 val = mhddata->stat.n_modes;
277 val = mhddata->nonstat.n_modes;
291 const int* val = NULL;
292 switch(mhddata->type) {
294 val = mhddata->stat.nmode;
297 val = mhddata->nonstat.nmode;
311 const int* val = NULL;
312 switch(mhddata->type) {
314 val = mhddata->stat.mmode;
317 val = mhddata->nonstat.mmode;
331 const real* val = NULL;
332 switch(mhddata->type) {
334 val = mhddata->stat.amplitude_nm;
337 val = mhddata->nonstat.amplitude_nm;
351 const real* val = NULL;
352 switch(mhddata->type) {
354 val = mhddata->stat.omega_nm;
357 val = mhddata->nonstat.omega_nm;
371 const real* val = NULL;
372 switch(mhddata->type) {
374 val = mhddata->stat.phase_nm;
377 val = mhddata->nonstat.phase_nm;
Header file for B_field.c.
Main header file for ASCOT5.
Header file for boozer.c.
unsigned long int a5err
Simulation error flag.
static DECLARE_TARGET_SIMD a5err error_raise(error_type type, int line, error_file file)
Raise a new error.
int mhd_get_n_modes(mhd_data *mhddata)
Return number of modes.
const real * mhd_get_amplitude(mhd_data *mhddata)
Return mode amplitudes.
const int * mhd_get_nmode(mhd_data *mhddata)
Return mode toroidal numbers.
int mhd_init(mhd_data *mhddata, mhd_offload_data *offload_data, real *offload_array)
Initialize MHD data struct on target.
a5err mhd_perturbations(real pert_field[7], real r, real phi, real z, real t, int pertonly, int includemode, boozer_data *boozerdata, mhd_data *mhddata, B_field_data *Bdata)
Evaluate perturbed fields Btilde, Etilde and potential Phi explicitly.
const int * mhd_get_mmode(mhd_data *mhddata)
Return mode poloidal numbers.
const real * mhd_get_frequency(mhd_data *mhddata)
Return mode frequencies.
a5err mhd_eval(real mhd_dmhd[10], real r, real phi, real z, real t, int includemode, boozer_data *boozerdata, mhd_data *mhddata, B_field_data *Bdata)
Evaluate the needed quantities from MHD mode for orbit following.
const real * mhd_get_phase(mhd_data *mhddata)
Return mode phases.
int mhd_init_offload(mhd_offload_data *offload_data, real **offload_array)
Load MHD data and prepare parameters.
void mhd_free_offload(mhd_offload_data *offload_data, real **offload_array)
Free offload array and reset parameters.
void mhd_nonstat_init(mhd_nonstat_data *mhddata, mhd_nonstat_offload_data *offload_data, real *offload_array)
Initialize MHD data struct on target.
a5err mhd_nonstat_perturbations(real pert_field[7], real r, real phi, real z, real t, int pertonly, int includemode, boozer_data *boozerdata, mhd_nonstat_data *mhddata, B_field_data *Bdata)
Evaluate mhd perturbed fields Btilde, Etilde and potential Phi for full orbit.
int mhd_nonstat_init_offload(mhd_nonstat_offload_data *offload_data, real **offload_array)
Load MHD data and prepare parameters for offload.
void mhd_nonstat_free_offload(mhd_nonstat_offload_data *offload_data, real **offload_array)
Free offload array.
a5err mhd_nonstat_eval(real mhd_dmhd[10], real r, real phi, real z, real t, int includemode, boozer_data *boozerdata, mhd_nonstat_data *mhddata, B_field_data *Bdata)
Evaluate the needed quantities from MHD mode for orbit following.
Header file for mhd_nonstat.c.
void mhd_stat_free_offload(mhd_stat_offload_data *offload_data, real **offload_array)
Free offload array.
a5err mhd_stat_perturbations(real pert_field[7], real r, real phi, real z, real t, int pertonly, int includemode, boozer_data *boozerdata, mhd_stat_data *mhddata, B_field_data *Bdata)
Evaluate perturbed fields Btilde, Etilde and potential Phi explicitly.
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.
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_init(mhd_stat_data *mhddata, mhd_stat_offload_data *offload_data, real *offload_array)
Initialize MHD data struct on target.
Header file for mhd_stat.c.
Macros for printing console output.
#define print_out(v,...)
Print to standard output.
#define print_err(...)
Print to standard error.
Magnetic field simulation data.
Boozer parameters on the target.
mhd_nonstat_offload_data nonstat
mhd_stat_offload_data stat