ASCOT5
|
Header file for hdf5_interface.c. More...
Go to the source code of this file.
Enumerations | |
enum | input_group { hdf5_input_options = 0x1 , hdf5_input_bfield = 0x2 , hdf5_input_efield = 0x4 , hdf5_input_plasma = 0x8 , hdf5_input_neutral = 0x10 , hdf5_input_wall = 0x20 , hdf5_input_marker = 0x40 , hdf5_input_boozer = 0x80 , hdf5_input_mhd = 0x100 , hdf5_input_asigma = 0x200 , hdf5_input_nbi = 0x400 } |
Enum to represent different input groups for HDF5 file reading. More... | |
Functions | |
int | hdf5_interface_read_input (sim_data *sim, int input_active, input_particle **p, int *n_markers) |
Read and initialize input data. | |
int | hdf5_interface_init_results (sim_data *sim, char *qid, char *run) |
Initialize run group. | |
int | hdf5_interface_write_state (char *fn, char *state, integer n, particle_state *p) |
Write marker state to HDF5 output. | |
int | hdf5_interface_write_diagnostics (sim_data *sim) |
Write diagnostics to HDF5 output. | |
void | hdf5_generate_qid (char *qid) |
Generate an identification number for a run. | |
Header file for hdf5_interface.c.
Definition in file hdf5_interface.h.
enum input_group |
Enum to represent different input groups for HDF5 file reading.
This enum is used to specify which input groups should be read from the HDF5 file. Each group corresponds to a specific data type in the simulationa.
Definition at line 20 of file hdf5_interface.h.
int hdf5_interface_read_input | ( | sim_data * | sim, |
int | input_active, | ||
input_particle ** | p, | ||
int * | n_markers ) |
Read and initialize input data.
This function reads input from HDF5 file, initializes it, and allocates offload arrays and returns the pointers to them.
sim | pointer to simulation offload struct |
input_active | bitflags for input types to read |
p | pointer to marker offload data |
n_markers | pointer to integer notating how many markers were read |
Definition at line 52 of file hdf5_interface.c.
int hdf5_interface_init_results | ( | sim_data * | sim, |
char * | qid, | ||
char * | run ) |
Initialize run group.
This functions creates results group (if one does not already exist) and creates run group corresponding to this run. Run group is named as /results/<run>_XXXXXXXXXX/ where X's are the qid of current run and <run> is the type of the run: "run" for ascot5_main and "bbnbi" for bbnbi5.
The group is initialized by writing qids of all used inputs as string attributes in the run group. Also the date and empty "details" fields are written.
sim | pointer to simulation struct |
qid | qid of this run |
run | type of this run |
Definition at line 342 of file hdf5_interface.c.
int hdf5_interface_write_state | ( | char * | fn, |
char * | state, | ||
integer | n, | ||
particle_state * | p ) |
Write marker state to HDF5 output.
fn | HDF5 output filename |
state | name of the state to be written |
n | number of markers in marker array |
p | array of markers to be written |
Definition at line 485 of file hdf5_interface.c.
int hdf5_interface_write_diagnostics | ( | sim_data * | sim | ) |
Write diagnostics to HDF5 output.
sim | pointer to simulation data |
out | HDF5 output filename |
Definition at line 544 of file hdf5_interface.c.
void hdf5_generate_qid | ( | char * | qid | ) |
Generate an identification number for a run.
The identification number (QID) is a 32 bit unsigned integer represented in a string format, i.e., by ten characters. QID is a random integer between 0 and 4 294 967 295, and it is padded with leading zeroes in string representation.
qid | a pointer to 11 chars wide array where generated QID is stored |
Definition at line 682 of file hdf5_interface.c.