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

Module for reading neutral data from HDF5 file. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <hdf5.h>
#include <hdf5_hl.h>
#include "../ascot5.h"
#include "../neutral.h"
#include "../neutral/N0_1D.h"
#include "../neutral/N0_3D.h"
#include "../consts.h"
#include "../math.h"
#include "hdf5_neutral.h"
#include "hdf5_helpers.h"

Go to the source code of this file.

Macros

#define NPATH
 
#define NPATH   "/neutral/N0_1D_XXXXXXXXXX/"
 
#define NPATH   "/neutral/N0_3D_XXXXXXXXXX/"
 

Functions

int hdf5_neutral_read_1D (hid_t f, N0_1D_offload_data *offload_data, real **offload_array, char *qid)
 Load neutral data from HDF5 file and prepare parameters.
 
int hdf5_neutral_read_3D (hid_t f, N0_3D_offload_data *offload_data, real **offload_array, char *qid)
 Load neutral data from HDF5 file and prepare parameters.
 
int hdf5_neutral_init_offload (hid_t f, neutral_offload_data *offload_data, real **offload_array, char *qid)
 Initialize neutral data from HDF5 file.
 

Detailed Description

Module for reading neutral data from HDF5 file.

Neutral data must be read by calling hdf5_neutral_init_offload() contained in this module. This module contains reading routines for all neutral data types.

Definition in file hdf5_neutral.c.

Macro Definition Documentation

◆ NPATH [1/3]

#define NPATH

Macro that is used to store paths to data groups

Definition at line 23 of file hdf5_neutral.c.

◆ NPATH [2/3]

#define NPATH   "/neutral/N0_1D_XXXXXXXXXX/"

Macro that is used to store paths to data groups

Definition at line 23 of file hdf5_neutral.c.

◆ NPATH [3/3]

#define NPATH   "/neutral/N0_3D_XXXXXXXXXX/"

Macro that is used to store paths to data groups

Definition at line 23 of file hdf5_neutral.c.

Function Documentation

◆ hdf5_neutral_read_1D()

int hdf5_neutral_read_1D ( hid_t f,
N0_1D_offload_data * offload_data,
real ** offload_array,
char * qid )

Load neutral data from HDF5 file and prepare parameters.

This function reads the 1D neutral 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 that is to be read
Returns
zero on success

Definition at line 85 of file hdf5_neutral.c.

◆ hdf5_neutral_read_3D()

int hdf5_neutral_read_3D ( hid_t f,
N0_3D_offload_data * offload_data,
real ** offload_array,
char * qid )

Load neutral data from HDF5 file and prepare parameters.

This function reads the 3D neutral 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 that is to be read
Returns
zero on success

Definition at line 146 of file hdf5_neutral.c.

◆ hdf5_neutral_init_offload()

int hdf5_neutral_init_offload ( hid_t f,
neutral_offload_data * offload_data,
real ** offload_array,
char * qid )

Initialize neutral data from HDF5 file.

Parameters
fHDF5 file identifier for a file which is opened and closed outside of this function
offload_datapointer to offload data struct which is initialized here
offload_arraypointer to offload array which is allocated and initialized here
qidQID of the data that is to be read
Returns
zero if reading and initialization succeeded

Definition at line 42 of file hdf5_neutral.c.