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

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_rho5D.h"
#include "../particle.h"

Go to the source code of this file.

Functions

size_t dist_rho5D_index (int i_rho, int i_theta, int i_phi, int i_ppara, int i_pperp, int i_time, int i_q, 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_rho5D_init (dist_rho5D_data *data)
 Initializes distribution data.
 
void dist_rho5D_free (dist_rho5D_data *data)
 Free the allocated resources.
 
void dist_rho5D_offload (dist_rho5D_data *data)
 Offload data to the accelerator.
 
void dist_rho5D_update_fo (dist_rho5D_data *dist, particle_simd_fo *p_f, particle_simd_fo *p_i)
 Update the histogram from full-orbit particles.
 
void dist_rho5D_update_gc (dist_rho5D_data *dist, particle_simd_gc *p_f, particle_simd_gc *p_i)
 Update the histogram from guiding center markers.
 

Detailed Description

Distribution collecting and processing functions.

Definition in file dist_rho5D.c.

Function Documentation

◆ dist_rho5D_index()

size_t dist_rho5D_index ( int i_rho,
int i_theta,
int i_phi,
int i_ppara,
int i_pperp,
int i_time,
int i_q,
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_rho5D.c.

◆ dist_rho5D_init()

int dist_rho5D_init ( dist_rho5D_data * data)

Initializes distribution data.

Parameters
dist_datapointer to distribution data struct

Definition at line 35 of file dist_rho5D.c.

◆ dist_rho5D_free()

void dist_rho5D_free ( dist_rho5D_data * data)

Free the allocated resources.

Parameters
offload_datapointer to data

Definition at line 61 of file dist_rho5D.c.

◆ dist_rho5D_offload()

void dist_rho5D_offload ( dist_rho5D_data * data)

Offload data to the accelerator.

Parameters
datapointer to the data struct

Definition at line 70 of file dist_rho5D.c.

◆ dist_rho5D_update_fo()

void dist_rho5D_update_fo ( dist_rho5D_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_fpointer to SIMD particle struct at the end of current time step
p_ipointer to SIMD particle struct at the start of current time step

Definition at line 87 of file dist_rho5D.c.

◆ dist_rho5D_update_gc()

void dist_rho5D_update_gc ( dist_rho5D_data * dist,
particle_simd_gc * p_f,
particle_simd_gc * p_i )

Update the histogram from guiding center markers.

This function updates the histogram from the marker 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_fpointer to SIMD gc struct at the end of current time step
p_ipointer to SIMD gc struct at the start of current time step

Definition at line 167 of file dist_rho5D.c.