ASCOT5
|
Module for reading electric field data from HDF5 file. More...
#include <stdio.h>
#include <stdlib.h>
#include <hdf5.h>
#include <hdf5_hl.h>
#include "../ascot5.h"
#include "../E_field.h"
#include "../Efield/E_TC.h"
#include "../Efield/E_1DS.h"
#include "../print.h"
#include "hdf5_helpers.h"
#include "hdf5_efield.h"
Go to the source code of this file.
Macros | |
#define | EPATH |
#define | EPATH "/efield/E_1DS_XXXXXXXXXX/" |
#define | EPATH "/efield/E_TC_XXXXXXXXXX/" |
Functions | |
int | hdf5_efield_read_1DS (hid_t f, E_1DS_offload_data *offload_data, real **offload_array, char *qid) |
Read E1DS electric field data from HDF5 file. | |
int | hdf5_efield_read_TC (hid_t f, E_TC_offload_data *offload_data, real **offload_array, char *qid) |
Read magnetic field data of type E_TC. | |
int | hdf5_efield_init_offload (hid_t f, E_field_offload_data *offload_data, real **offload_array, char *qid) |
Read electric field data from HDF5 file. | |
Module for reading electric field data from HDF5 file.
Electric field must be read by calling hdf5_efield_init_offload() contained in this module. This module contains reading routines for all electric field types.
Note: the routines within this module that read the data from HDF5 file may use the offload data struct and offload arrays as (temporary) storage. However, the actual initialization is done at the specific E_field_init_offload() function the electric field data corresponds to. Check from that function what the offload data and the offload array are expected to contain. As a rule of thumb, the reading routines here should only read the data and maybe do some trivial computations but nothing complicated.
Definition in file hdf5_efield.c.
#define EPATH |
Macro that is used to store paths to data groups
Definition at line 29 of file hdf5_efield.c.
#define EPATH "/efield/E_1DS_XXXXXXXXXX/" |
Macro that is used to store paths to data groups
Definition at line 29 of file hdf5_efield.c.
#define EPATH "/efield/E_TC_XXXXXXXXXX/" |
Macro that is used to store paths to data groups
Definition at line 29 of file hdf5_efield.c.
int hdf5_efield_read_1DS | ( | hid_t | f, |
E_1DS_offload_data * | offload_data, | ||
real ** | offload_array, | ||
char * | qid ) |
Read E1DS electric field data from HDF5 file.
f | HDF5 file from which data is read |
offload_data | pointer to offload data |
offload_array | pointer to offload array |
qid | QID of the data |
Definition at line 96 of file hdf5_efield.c.
int hdf5_efield_read_TC | ( | hid_t | f, |
E_TC_offload_data * | offload_data, | ||
real ** | offload_array, | ||
char * | qid ) |
Read magnetic field data of type E_TC.
The E_TC data is stored in HDF5 file under the group /efield/E_TC-XXXXXXXXXX/ where X's mark the QID.
This function assumes the group holds the following datasets:
f | HDF5 file identifier for a file which is opened and closed outside of this function |
offload_data | pointer to offload data struct which is allocated here |
offload_array | pointer to offload array but no data is stored there so it is not allocated and NULL pointer is returned instead |
qid | QID of the B_TC field that is to be read |
Definition at line 146 of file hdf5_efield.c.
int hdf5_efield_init_offload | ( | hid_t | f, |
E_field_offload_data * | offload_data, | ||
real ** | offload_array, | ||
char * | qid ) |
Read electric field data from HDF5 file.
This function reads electric field data with given qid while also initializing offload data and allocating and filling offload array. The file is opened and closed outside this function.
The electric field data is stored under /efield/ group in ASCOT5 HDF5 file. Several electric fields of same or different type maybe stored there in their respective groups as long as the group name contains QID as an identifier.
f | HDF5 file identifier for a file which is opened and closed outside of this function |
offload_data | pointer to offload data struct which is initialized here |
offload_array | pointer to offload array which is allocated and initialized here |
qid | QID of the data that is to be read |
Definition at line 57 of file hdf5_efield.c.