ASCOT5
Loading...
Searching...
No Matches
Functions
nbi.c File Reference

Functions for NBI simulation and particle generation. More...

#include <stdlib.h>
#include <math.h>
#include "print.h"
#include "ascot5.h"
#include "consts.h"
#include "physlib.h"
#include "random.h"
#include "nbi.h"

Go to the source code of this file.

Functions

int nbi_init_offload (nbi_offload_data *offload_data, real **offload_array)
 Load NBI data and prepare parameters for offload.
 
void nbi_init (nbi_data *nbi, nbi_offload_data *offload_data, real *offload_array)
 Initialize NBI data struct on target.
 
void nbi_free_offload (nbi_offload_data *offload_data, real **offload_array)
 Free offload array.
 
void nbi_inject (real *xyz, real *vxyz, nbi_injector *inj, random_data *rng)
 Sample injected marker's coordinates.
 

Detailed Description

Functions for NBI simulation and particle generation.

Definition in file nbi.c.

Function Documentation

◆ nbi_init_offload()

int nbi_init_offload ( nbi_offload_data * offload_data,
real ** offload_array )

Load NBI data and prepare parameters for offload.

Parameters
offload_datapointer to offload data struct
offload_arraypointer to pointer to offload array
Returns
zero if initialization succeeded.

Definition at line 23 of file nbi.c.

◆ nbi_init()

void nbi_init ( nbi_data * nbi,
nbi_offload_data * offload_data,
real * offload_array )

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 59 of file nbi.c.

◆ nbi_free_offload()

void nbi_free_offload ( nbi_offload_data * offload_data,
real ** offload_array )

Free offload array.

Parameters
offload_datapointer to offload data struct
offload_arraypointer to pointer to offload array

Definition at line 97 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 114 of file nbi.c.