ASCOT5
Loading...
Searching...
No Matches
Data Structures | Functions
diag.h File Reference

Header file for diag.c. More...

#include "ascot5.h"
#include "particle.h"
#include "B_field.h"
#include "diag/dist_5D.h"
#include "diag/dist_6D.h"
#include "diag/dist_rho5D.h"
#include "diag/dist_rho6D.h"
#include "diag/dist_com.h"
#include "diag/diag_orb.h"
#include "diag/diag_transcoef.h"

Go to the source code of this file.

Data Structures

struct  diag_offload_data
 Diagnostics offload data struct. More...
 
struct  diag_data
 Diagnostics data struct. More...
 

Functions

int diag_init_offload (diag_offload_data *data, real **offload_array, int Nmrk)
 Initializes offload array from offload data.
 
void diag_free_offload (diag_offload_data *data, real **offload_array)
 Frees the offload array.
 
void diag_sum (diag_offload_data *data, real *array1, real *array2)
 Sum offload data arrays as one.
 
void diag_init (diag_data *data, diag_offload_data *offload_data, real *offload_array)
 Initializes diagnostics from offload data.
 
void diag_free (diag_data *data)
 Free diagnostics data.
 
void diag_update_fo (diag_data *data, B_field_data *Bdata, particle_simd_fo *p_f, particle_simd_fo *p_i)
 Collects diagnostics when marker represents a particle.
 
void diag_update_gc (diag_data *data, B_field_data *Bdata, particle_simd_gc *p_f, particle_simd_gc *p_i)
 Collects diagnostics when marker represents a guiding center.
 
void diag_update_ml (diag_data *data, particle_simd_ml *p_f, particle_simd_ml *p_i)
 Collects diagnostics when marker represents a magnetic field line.
 

Detailed Description

Header file for diag.c.

Definition in file diag.h.

Function Documentation

◆ diag_init_offload()

int diag_init_offload ( diag_offload_data * data,
real ** offload_array,
int Nmrk )

Initializes offload array from offload data.

Parameters
datadiagnostics offload data
offload_arraypointer to offload array which is allocated here
Nmrknumber of markers that will be simulated
Returns
zero if initialization succeeded

Definition at line 40 of file diag.c.

◆ diag_free_offload()

void diag_free_offload ( diag_offload_data * data,
real ** offload_array )

Frees the offload array.

Parameters
datadiagnostics offload data
offload_arrayoffload array

Definition at line 140 of file diag.c.

◆ diag_sum()

void diag_sum ( diag_offload_data * data,
real * array1,
real * array2 )

Sum offload data arrays as one.

The data in both arrays have identical order so distributions can be summed trivially. For orbits and transport coefficients the first array already have space for appending the orbit data from the second array, so we only need to move those elements.

Parameters
datapointer to diagnostics data struct
array1the array to which array2 is summed
array2the array which is to be summed

Definition at line 323 of file diag.c.

◆ diag_init()

void diag_init ( diag_data * data,
diag_offload_data * offload_data,
real * offload_array )

Initializes diagnostics from offload data.

Parameters
datadiagnostics data
offload_datadiagnostics offload data
offload_arrayoffload array

Definition at line 152 of file diag.c.

◆ diag_free()

void diag_free ( diag_data * data)

Free diagnostics data.

Parameters
datadiagnostics data struct

Definition at line 204 of file diag.c.

◆ diag_update_fo()

void diag_update_fo ( diag_data * data,
B_field_data * Bdata,
particle_simd_fo * p_f,
particle_simd_fo * p_i )

Collects diagnostics when marker represents a particle.

Parameters
datadiagnostics data struct
Bdatapointer to magnetic field data
p_fpointer to SIMD struct storing marker states at the end of current time-step
p_ipointer to SIMD struct storing marker states at the beginning of current time-step

Definition at line 223 of file diag.c.

◆ diag_update_gc()

void diag_update_gc ( diag_data * data,
B_field_data * Bdata,
particle_simd_gc * p_f,
particle_simd_gc * p_i )

Collects diagnostics when marker represents a guiding center.

Parameters
datapointer to diagnostics data struct
Bdatapointer to magnetic field data
p_fpointer to SIMD struct storing marker states at the end of current time-step
p_ipointer to SIMD struct storing marker states at the beginning of current time-step

Definition at line 258 of file diag.c.

◆ diag_update_ml()

void diag_update_ml ( diag_data * data,
particle_simd_ml * p_f,
particle_simd_ml * p_i )

Collects diagnostics when marker represents a magnetic field line.

Distributions are not updated for magnetic field lines.

Parameters
datapointer to diagnostics data struct
p_fpointer to SIMD struct storing marker states at the end of current time-step
p_ipointer to SIMD struct storing marker states at the beginning of current time-step

Definition at line 300 of file diag.c.