ASCOT5
Loading...
Searching...
No Matches
nbi.h File Reference

Header file for nbi.c. More...

#include "ascot5.h"
#include "particle.h"
#include "random.h"

Go to the source code of this file.

Data Structures

struct  nbi_injector
 Structure for describing an NBI injector. More...
 
struct  nbi_data
 NBI data consisting of ninj injectors. More...
 

Functions

int nbi_init (nbi_data *data, int ninj, int *id, int *anum, int *znum, real *mass, real *power, real *efrac, real *energy, real *div_h, real *div_v, real *div_halo_v, real *div_halo_h, real *div_halo_frac, int *nbeamlet, real *beamlet_xyz)
 Initialize NBI data struct on target.
 
void nbi_free (nbi_data *nbi)
 Free allocated resources.
 
void nbi_inject (real *xyz, real *vxyz, nbi_injector *inj, random_data *rng)
 Sample injected marker's coordinates.
 

Detailed Description

Header file for nbi.c.

Definition in file nbi.h.

Function Documentation

◆ nbi_init()

int nbi_init ( nbi_data * data,
int ninj,
int * id,
int * anum,
int * znum,
real * mass,
real * power,
real * efrac,
real * energy,
real * div_h,
real * div_v,
real * div_halo_v,
real * div_halo_h,
real * div_halo_frac,
int * nbeamlet,
real * beamlet_xyz )

Initialize NBI data struct on target.

Parameters
nbipointer to data struct on target
offload_datapointer to offload data struct
offload_arraypointer to offload array

Definition at line 22 of file nbi.c.

◆ nbi_free()

void nbi_free ( nbi_data * data)

Free allocated resources.

Parameters
datapointer to the data struct

Definition at line 96 of file nbi.c.

◆ nbi_inject()

void nbi_inject ( real * xyz,
real * vxyz,
nbi_injector * inj,
random_data * rng )

Sample injected marker's coordinates.

Parameters
injpointer to injector data
xyzinitialized marker's position in cartesian coordinates [m]
vxyzinitialized marker's velocity in cartesian coordinates [m/s]
rngpointer to random number generator data

Definition at line 118 of file nbi.c.