ASCOT5
Loading...
Searching...
No Matches
mhd.h
Go to the documentation of this file.
1
8#ifndef MHD_H
9#define MHD_H
10
11#include "ascot5.h"
12#include "error.h"
13#include "B_field.h"
14#include "boozer.h"
15#include "mhd/mhd_stat.h"
16#include "mhd/mhd_nonstat.h"
17
19#define MHD_INCLUDE_ALL -1
20
31
47
62
63int mhd_init_offload(mhd_offload_data* offload_data,
64 real** offload_array);
65void mhd_free_offload(mhd_offload_data* offload_data,
66 real** offload_array);
67
68int mhd_init(mhd_data* data, mhd_offload_data* offload_data,
69 real* offload_array);
70DECLARE_TARGET_SIMD_UNIFORM(boozerdata, mhddata, Bdata, includemode)
71a5err mhd_eval(real mhd_dmhd[10], real r, real phi, real z, real t,
72 int includemode, boozer_data* boozerdata, mhd_data* mhddata,
73 B_field_data* Bdata);
74DECLARE_TARGET_SIMD_UNIFORM(boozerdata, mhddata, Bdata, pertonly,\
75 includemode)
76a5err mhd_perturbations(real pert_field[7], real r, real phi, real z,
77 real t, int pertonly, int includemode,
78 boozer_data* boozerdata, mhd_data* mhddata,
79 B_field_data* Bdata);
80DECLARE_TARGET_SIMD_UNIFORM(mhddata)
81int mhd_get_n_modes(mhd_data* mhddata);
82DECLARE_TARGET_SIMD_UNIFORM(mhddata)
83const int* mhd_get_nmode(mhd_data* mhddata);
84DECLARE_TARGET_SIMD_UNIFORM(mhddata)
85const int* mhd_get_mmode(mhd_data* mhddata);
86DECLARE_TARGET_SIMD_UNIFORM(mhddata)
87const real* mhd_get_amplitude(mhd_data* mhddata);
88DECLARE_TARGET_SIMD_UNIFORM(mhddata)
89const real* mhd_get_frequency(mhd_data* mhddata);
90DECLARE_TARGET_SIMD_UNIFORM(mhddata)
91const real* mhd_get_phase(mhd_data* mhddata);
92#endif
Header file for B_field.c.
Main header file for ASCOT5.
double real
Definition ascot5.h:85
Header file for boozer.c.
Error module for ASCOT5.
unsigned long int a5err
Simulation error flag.
Definition error.h:17
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.
Definition mhd.c:234
int mhd_get_n_modes(mhd_data *mhddata)
Return number of modes.
Definition mhd.c:270
const real * mhd_get_amplitude(mhd_data *mhddata)
Return mode amplitudes.
Definition mhd.c:330
const int * mhd_get_nmode(mhd_data *mhddata)
Return mode toroidal numbers.
Definition mhd.c:290
const int * mhd_get_mmode(mhd_data *mhddata)
Return mode poloidal numbers.
Definition mhd.c:310
const real * mhd_get_frequency(mhd_data *mhddata)
Return mode frequencies.
Definition mhd.c:350
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.
Definition mhd.c:178
mhd_type
MHD input types.
Definition mhd.h:27
@ mhd_type_stat
Definition mhd.h:28
@ mhd_type_nonstat
Definition mhd.h:29
int mhd_init(mhd_data *data, mhd_offload_data *offload_data, real *offload_array)
Initialize MHD data struct on target.
Definition mhd.c:121
const real * mhd_get_phase(mhd_data *mhddata)
Return mode phases.
Definition mhd.c:370
int mhd_init_offload(mhd_offload_data *offload_data, real **offload_array)
Load MHD data and prepare parameters.
Definition mhd.c:45
void mhd_free_offload(mhd_offload_data *offload_data, real **offload_array)
Free offload array and reset parameters.
Definition mhd.c:90
Header file for mhd_nonstat.c.
Header file for mhd_stat.c.
Magnetic field simulation data.
Definition B_field.h:63
Boozer parameters on the target.
Definition boozer.h:29
MHD simulation data.
Definition mhd.h:57
mhd_type type
Definition mhd.h:58
mhd_stat_data stat
Definition mhd.h:59
mhd_nonstat_data nonstat
Definition mhd.h:60
MHD parameters on the target.
Definition mhd_nonstat.h:39
MHD parameters that will be offloaded to target.
Definition mhd_nonstat.h:17
MHD offload data.
Definition mhd.h:41
mhd_type type
Definition mhd.h:42
int offload_array_length
Definition mhd.h:45
mhd_nonstat_offload_data nonstat
Definition mhd.h:44
mhd_stat_offload_data stat
Definition mhd.h:43
MHD stat parameters on the target.
Definition mhd_stat.h:36
MHD stat parameters that will be offloaded to target.
Definition mhd_stat.h:17