ASCOT5
Loading...
Searching...
No Matches
Macros | Functions
hdf5_plasma.c File Reference

Module for reading plasma input from HDF5 file. More...

#include <stdio.h>
#include <stdlib.h>
#include <hdf5.h>
#include <hdf5_hl.h>
#include "../ascot5.h"
#include "../plasma.h"
#include "../plasma/plasma_1D.h"
#include "../plasma/plasma_1Dt.h"
#include "../plasma/plasma_1DS.h"
#include "../consts.h"
#include "hdf5_helpers.h"
#include "hdf5_plasma.h"

Go to the source code of this file.

Macros

#define PLSPATH
 
#define PLSPATH   "/plasma/plasma_1D_XXXXXXXXXX/"
 
#define PLSPATH   "/plasma/plasma_1Dt_XXXXXXXXXX/"
 
#define PLSPATH   "/plasma/plasma_1DS_XXXXXXXXXX/"
 

Functions

int hdf5_plasma_read_1D (hid_t f, plasma_1D_offload_data *offload_data, real **offload_array, char *qid)
 Read 1D plasma data from HDF5 file.
 
int hdf5_plasma_read_1Dt (hid_t f, plasma_1Dt_offload_data *offload_data, real **offload_array, char *qid)
 Read 1Dt plasma data from HDF5 file.
 
int hdf5_plasma_read_1DS (hid_t f, plasma_1DS_offload_data *offload_data, real **offload_array, char *qid)
 Load plasma data from HDF5 file and prepare parameters.
 
int hdf5_plasma_init_offload (hid_t f, plasma_offload_data *offload_data, real **offload_array, char *qid)
 Read plasma data from HDF5 file.
 

Detailed Description

Module for reading plasma input from HDF5 file.

Plasma data must be read by calling hdf5_plasma_init_offload() contained in this module. This module contains reading routines for all plasma data types.

Definition in file hdf5_plasma.c.

Macro Definition Documentation

◆ PLSPATH [1/4]

#define PLSPATH

Macro that is used to store paths to data groups

Definition at line 22 of file hdf5_plasma.c.

◆ PLSPATH [2/4]

#define PLSPATH   "/plasma/plasma_1D_XXXXXXXXXX/"

Macro that is used to store paths to data groups

Definition at line 22 of file hdf5_plasma.c.

◆ PLSPATH [3/4]

#define PLSPATH   "/plasma/plasma_1Dt_XXXXXXXXXX/"

Macro that is used to store paths to data groups

Definition at line 22 of file hdf5_plasma.c.

◆ PLSPATH [4/4]

#define PLSPATH   "/plasma/plasma_1DS_XXXXXXXXXX/"

Macro that is used to store paths to data groups

Definition at line 22 of file hdf5_plasma.c.

Function Documentation

◆ hdf5_plasma_read_1D()

int hdf5_plasma_read_1D ( hid_t f,
plasma_1D_offload_data * offload_data,
real ** offload_array,
char * qid )

Read 1D plasma data from HDF5 file.

Parameters
fHDF5 file from which data is read
offload_datapointer to offload data
offload_arraypointer to offload array
qidQID of the data
Returns
Zero if reading succeeded

Definition at line 91 of file hdf5_plasma.c.

◆ hdf5_plasma_read_1Dt()

int hdf5_plasma_read_1Dt ( hid_t f,
plasma_1Dt_offload_data * offload_data,
real ** offload_array,
char * qid )

Read 1Dt plasma data from HDF5 file.

Parameters
fHDF5 file from which data is read
offload_datapointer to offload data
offload_arraypointer to offload array
qidQID of the data
Returns
Zero if reading succeeded

Definition at line 175 of file hdf5_plasma.c.

◆ hdf5_plasma_read_1DS()

int hdf5_plasma_read_1DS ( hid_t f,
plasma_1DS_offload_data * offload_data,
real ** offload_array,
char * qid )

Load plasma data from HDF5 file and prepare parameters.

This function reads the 1D plasma data from file f, fills the offload struct with parameters and allocates and fills the offload array.

Parameters
fhdf5 file identifier
offload_datapointer to offload data struct
offload_arraypointer to pointer to offload array
qidQID of the data
Returns
zero on success

Definition at line 309 of file hdf5_plasma.c.

◆ hdf5_plasma_init_offload()

int hdf5_plasma_init_offload ( hid_t f,
plasma_offload_data * offload_data,
real ** offload_array,
char * qid )

Read plasma data from HDF5 file.

This function reads plasma data with given qid while also initializing offload data and allocating and filling offload array. The file is opened and closed outside this function.

Parameters
fHDF5 file from which data is read
offload_datapointer to offload data
offload_arraypointer to offload array
qidQID of the data
Returns
Zero if reading and initialization of data succeeded

Definition at line 44 of file hdf5_plasma.c.