ASCOT5
Loading...
Searching...
No Matches
dist_6D.c File Reference

6D distribution collecting and processing functions. More...

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "../ascot5.h"
#include "../consts.h"
#include "../physlib.h"
#include "dist_6D.h"
#include "../gctransform.h"

Go to the source code of this file.

Functions

size_t dist_6D_index (int i_r, int i_phi, int i_z, int i_pr, int i_pphi, int i_pz, int i_time, int i_q, size_t step_7, size_t step_6, size_t step_5, size_t step_4, size_t step_3, size_t step_2, size_t step_1)
 Internal function calculating the index in the histogram array.
 
int dist_6D_init (dist_6D_data *data)
 Initializes distribution data.
 
void dist_6D_free (dist_6D_data *data)
 Free allocated resources.
 
void dist_6D_offload (dist_6D_data *data)
 Offload data to the accelerator.
 
void dist_6D_update_fo (dist_6D_data *dist, particle_simd_fo *p_f, particle_simd_fo *p_i)
 Update the histogram from full-orbit particles.
 
void dist_6D_update_gc (dist_6D_data *dist, particle_simd_gc *p_f, particle_simd_gc *p_i)
 Update the histogram from guiding-center particles.
 

Detailed Description

6D distribution collecting and processing functions.

Definition in file dist_6D.c.

Function Documentation

◆ dist_6D_index()

size_t dist_6D_index ( int i_r,
int i_phi,
int i_z,
int i_pr,
int i_pphi,
int i_pz,
int i_time,
int i_q,
size_t step_7,
size_t step_6,
size_t step_5,
size_t step_4,
size_t step_3,
size_t step_2,
size_t step_1 )

Internal function calculating the index in the histogram array.

Definition at line 17 of file dist_6D.c.

◆ dist_6D_init()

int dist_6D_init ( dist_6D_data * data)

Initializes distribution data.

Definition at line 34 of file dist_6D.c.

◆ dist_6D_free()

void dist_6D_free ( dist_6D_data * data)

Free allocated resources.

Definition at line 60 of file dist_6D.c.

◆ dist_6D_offload()

void dist_6D_offload ( dist_6D_data * data)

Offload data to the accelerator.

Parameters
datapointer to the data struct

Definition at line 69 of file dist_6D.c.

◆ dist_6D_update_fo()

void dist_6D_update_fo ( dist_6D_data * dist,
particle_simd_fo * p_f,
particle_simd_fo * p_i )

Update the histogram from full-orbit particles.

This function updates the histogram from the particle data. Bins are calculated as vector op and histogram is updates as an atomic operation to avoid race conditions.

Parameters
distpointer to distribution parameter struct
p_ipointer to SIMD particle struct at the beginning of time step
p_fpointer to SIMD particle struct at the end of time step

Definition at line 86 of file dist_6D.c.

◆ dist_6D_update_gc()

void dist_6D_update_gc ( dist_6D_data * dist,
particle_simd_gc * p_f,
particle_simd_gc * p_i )

Update the histogram from guiding-center particles.

This function updates the histogram from the guiding center data. Bins are calculated as vector op and histogram is updates as an atomic operation to avoid race conditions.

Parameters
distpointer to distribution parameter struct
p_ipointer to SIMD GC struct at the beginning of time step
p_fpointer to SIMD GC struct at the end of time step

Definition at line 152 of file dist_6D.c.