ASCOT5
Loading...
Searching...
No Matches
nbi.h
Go to the documentation of this file.
1
5#ifndef NBI_H
6#define NBI_H
7
8#include "ascot5.h"
9#include "particle.h"
10#include "random.h"
11
36
40typedef struct {
41 int ninj;
42 int id[NBI_MAX_INJ];
43 int n_beamlet[NBI_MAX_INJ];
45 real energy[NBI_MAX_INJ];
46 real efrac[NBI_MAX_INJ*3];
49 real div_halo_frac[NBI_MAX_INJ];
50 real div_halo_h[NBI_MAX_INJ];
51 real div_halo_v[NBI_MAX_INJ];
52 int anum[NBI_MAX_INJ];
53 int znum[NBI_MAX_INJ];
57
61typedef struct {
62 int ninj;
64} nbi_data;
65
66int nbi_init_offload(nbi_offload_data* offload_data, real** offload_array);
67void nbi_init(nbi_data* nbi, nbi_offload_data* offload_data,
68 real* offload_array);
69void nbi_free_offload(nbi_offload_data* offload_data, real** offload_array);
70void nbi_inject(real* xyz, real* vxyz, nbi_injector* inj, random_data* rng);
71
72#endif
Main header file for ASCOT5.
double real
Definition ascot5.h:85
#define NBI_MAX_INJ
Maximum number of NBI injectors.
Definition ascot5.h:107
void nbi_free_offload(nbi_offload_data *offload_data, real **offload_array)
Free offload array.
Definition nbi.c:97
void nbi_init(nbi_data *nbi, nbi_offload_data *offload_data, real *offload_array)
Initialize NBI data struct on target.
Definition nbi.c:59
int nbi_init_offload(nbi_offload_data *offload_data, real **offload_array)
Load NBI data and prepare parameters for offload.
Definition nbi.c:23
void nbi_inject(real *xyz, real *vxyz, nbi_injector *inj, random_data *rng)
Sample injected marker's coordinates.
Definition nbi.c:114
Header file for particle.c.
Header file for random.c.
void * random_data
Definition random.h:87
NBI data on target.
Definition nbi.h:61
int ninj
Definition nbi.h:62
Structure for describing an NBI injector.
Definition nbi.h:15
real mass
Definition nbi.h:34
int id
Definition nbi.h:16
real * beamlet_x
Definition nbi.h:18
int anum
Definition nbi.h:32
real * beamlet_dy
Definition nbi.h:22
real energy
Definition nbi.h:25
real div_halo_h
Definition nbi.h:30
real power
Definition nbi.h:24
real * beamlet_y
Definition nbi.h:19
int znum
Definition nbi.h:33
real * beamlet_dz
Definition nbi.h:23
real div_halo_frac
Definition nbi.h:29
real * beamlet_dx
Definition nbi.h:21
real * beamlet_z
Definition nbi.h:20
int n_beamlet
Definition nbi.h:17
real div_halo_v
Definition nbi.h:31
real div_v
Definition nbi.h:28
real div_h
Definition nbi.h:27
NBI parameters consisting of a bundle of injectors.
Definition nbi.h:40
int offload_array_length
Definition nbi.h:55