ASCOT5
Loading...
Searching...
No Matches
rfof.h
Go to the documentation of this file.
1
6#include <stdlib.h>
7#include "ascot5.h"
8
9#ifndef RFOF_H
10#define RFOF_H
11
19typedef struct rfof_marker {
20 void* p[NSIMD];
25 int nrow[NSIMD];
26 int ncol[NSIMD];
27
29
35typedef struct {
38 void* rfglobal;
39} rfof_data;
40
41void rfof_init(rfof_data* rfof);
42
43void rfof_free(rfof_data* rfof);
44
46 rfof_marker* rfof_mrk, int* id, real* weight, real* R, real* phi, real* z,
47 real* psi, real* charge, real* mass, real* Ekin, real* vnorm, real* mu,
48 real* Pphi, real* vpar, real* vperp, real* gyrof, real* vdriftRho,
49 real* acceleration, int* is_accelerated, int* is_already_allocated);
50
52
53void rfof_tear_down(rfof_marker* rfof_mrk);
54
55void rfof_clear_history(rfof_marker* rfof_mrk, int imrk);
56
58 particle_simd_gc* p, real* hin, real* hout_rfof, rfof_marker* rfof_mrk,
60
62 real* e_plus_real, real* e_minus_real, real* e_plus_imag,
63 real* e_minus_imag, real R, real z, rfof_data* rfof);
65 real* omega_res, int* nharm, rfof_marker* rfof_mrk, rfof_data* rfof);
66#endif
Main header file for ASCOT5.
double real
Definition ascot5.h:85
#define NSIMD
Number of particles simulated simultaneously in a particle group operations.
Definition ascot5.h:91
@ R
Definition hist.h:18
void rfof_resonance_check_and_kick_gc(particle_simd_gc *p, real *hin, real *hout_rfof, rfof_marker *rfof_mrk, rfof_data *rfof_data, B_field_data *Bdata)
Check if the marker is in resonance and apply kick.
Definition rfof.c:206
void rfof_clear_history(rfof_marker *rfof_mrk, int imrk)
Clears resonance history of an RFOF marker.
Definition rfof.c:177
void rfof_tear_down(rfof_marker *rfof_mrk)
Deallocates the data structs used by the RFOF marker simulation data.
Definition rfof.c:153
void rfof_init(rfof_data *rfof)
Initialise input data.
Definition rfof.c:83
void rfof_set_marker_manually(rfof_marker *rfof_mrk, int *id, real *weight, real *R, real *phi, real *z, real *psi, real *charge, real *mass, real *Ekin, real *vnorm, real *mu, real *Pphi, real *vpar, real *vperp, real *gyrof, real *vdriftRho, real *acceleration, int *is_accelerated, int *is_already_allocated)
Explicitly set the coordinates in a marker struct.
Definition rfof.c:357
void rfof_free(rfof_data *rfof)
Deallocates the rfof_input_param struct on the fortran side.
Definition rfof.c:100
void rfof_eval_rf_wave(real *e_plus_real, real *e_minus_real, real *e_plus_imag, real *e_minus_imag, real R, real z, rfof_data *rfof)
Calculate the local E+ and E- values of the ICRH field.
Definition rfof.c:392
void rfof_eval_resonance_function(real *omega_res, int *nharm, rfof_marker *rfof_mrk, rfof_data *rfof)
Evaluate the value of resonance function (zero at the resonance)
Definition rfof.c:423
void rfof_set_up(rfof_marker *rfof_mrk, rfof_data *rfof_data)
Initialises resonance history, diagnostics, and the marker struct.
Definition rfof.c:116
Magnetic field simulation data.
Definition B_field.h:41
Struct representing NSIMD guiding center markers.
Definition particle.h:275
RFOF simulation input data.
Definition rfof.h:35
void * rfof_input_params
Definition rfof.h:36
void * rfglobal
Definition rfof.h:38
Reusable struct for storing marker specific data during the simulation loop.
Definition rfof.h:19
void * diag_array[NSIMD]
Definition rfof.h:23
void * p[NSIMD]
Definition rfof.h:20
void * history_array[NSIMD]
Definition rfof.h:21
int nrow[NSIMD]
Definition rfof.h:25
int ncol[NSIMD]
Definition rfof.h:26