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

Module for writing marker state to HDF5 file. More...

#include <string.h>
#include <stdlib.h>
#include <hdf5.h>
#include <hdf5_hl.h>
#include "../ascot5.h"
#include "../consts.h"
#include "../physlib.h"
#include "../particle.h"
#include "hdf5_helpers.h"
#include "hdf5_state.h"

Go to the source code of this file.

Functions

int hdf5_state_write (hid_t f, char *run, char *state, integer n, particle_state *p)
 Writes marker state to an ASCOT5 HDF5 file.
 

Detailed Description

Module for writing marker state to HDF5 file.

Definition in file hdf5_state.c.

Function Documentation

◆ hdf5_state_write()

int hdf5_state_write ( hid_t f,
char * run,
char * state,
integer n,
particle_state * p )

Writes marker state to an ASCOT5 HDF5 file.

Markers are written in ../state/ group.

All fields in particle_state struct are written. Fields are written as they are except some unit conversions. Each field is written as n length array (the order is same between all fields) and each dataset includes string attribute that indicates the unit of the stored quantity.

Parameters
foutput HDF5 file id
runrun group where the state is written
statename of the state
nnumber of markers in state array
parray holding marker states
Returns
Zero on success

Definition at line 36 of file hdf5_state.c.