HDF5Input Class Reference#

DiFfRG: DiFfRG::HDF5Input Class Reference
DiFfRG

A class to output data to a CSV file. More...

#include <hdf5_input.hh>

Public Member Functions

 HDF5Input (const std::string file_name)
 
void load_map (const std::string &name, double *data, int series_number=-1)
 Load a map from the HDF5 file.
 
std::vector< double > load_map (const std::string &name, int series_number=-1)
 Load a map from the HDF5 file.
 
template<size_t dim>
std::vector< double > load_map_coord (const std::string &name, int series_number=-1)
 Load a map's coordinates from the HDF5 file.
 
template<typename Coordinates >
void load_map (const std::string &name, double *data, const Coordinates &coordinates)
 Load a map from the HDF5 file, while checking that the coordinates in the file match the provided coordinates.
 
template<typename T >
std::vector< T > load_scalar (const std::string &name)
 
DiFfRG::hdf5::Fileget_file ()
 

Private Member Functions

template<typename Coordinates >
void check_coordinates (const std::string &coord_name, const Coordinates &coordinates)
 

Private Attributes

const std::string file_name
 
DiFfRG::hdf5::File h5_file
 
DiFfRG::hdf5::Group scalars
 
DiFfRG::hdf5::Group maps
 
DiFfRG::hdf5::Group coords
 
std::filesystem::path path
 

Detailed Description

A class to output data to a CSV file.

In every time step, the user can add values to the output, which will be written to the file when flush is called. Every timestep has to contain the same values, but the order in which they are added can change.

Constructor & Destructor Documentation

◆ HDF5Input()

DiFfRG::HDF5Input::HDF5Input ( const std::string file_name)

Member Function Documentation

◆ check_coordinates()

template<typename Coordinates >
void DiFfRG::HDF5Input::check_coordinates ( const std::string & coord_name,
const Coordinates & coordinates )
inlineprivate

◆ get_file()

DiFfRG::hdf5::File & DiFfRG::HDF5Input::get_file ( )

◆ load_map() [1/3]

template<typename Coordinates >
void DiFfRG::HDF5Input::load_map ( const std::string & name,
double * data,
const Coordinates & coordinates )
inline

Load a map from the HDF5 file, while checking that the coordinates in the file match the provided coordinates.

Parameters
nameThe name of the map.
dataThe data buffer to load the map into.
coordinatesThe coordinates of the map.

◆ load_map() [2/3]

void DiFfRG::HDF5Input::load_map ( const std::string & name,
double * data,
int series_number = -1 )
inline

Load a map from the HDF5 file.

Parameters
nameThe name of the map.
dataThe data buffer to load the map into.

◆ load_map() [3/3]

std::vector< double > DiFfRG::HDF5Input::load_map ( const std::string & name,
int series_number = -1 )
inline

Load a map from the HDF5 file.

Parameters
nameThe name of the map.
dataThe data buffer to load the map into.

◆ load_map_coord()

template<size_t dim>
std::vector< double > DiFfRG::HDF5Input::load_map_coord ( const std::string & name,
int series_number = -1 )
inline

Load a map's coordinates from the HDF5 file.

Template Parameters
dimThe spatial dimension of the coordinate entries.
Parameters
nameThe name of the map.
series_numberThe series number to load (-1 for latest).
Returns
A flattened vector of doubles with size = num_points * dim.

◆ load_scalar()

template<typename T >
std::vector< T > DiFfRG::HDF5Input::load_scalar ( const std::string & name)
inline

Member Data Documentation

◆ coords

DiFfRG::hdf5::Group DiFfRG::HDF5Input::coords
private

◆ file_name

const std::string DiFfRG::HDF5Input::file_name
private

◆ h5_file

DiFfRG::hdf5::File DiFfRG::HDF5Input::h5_file
private

◆ maps

DiFfRG::hdf5::Group DiFfRG::HDF5Input::maps
private

◆ path

std::filesystem::path DiFfRG::HDF5Input::path
private

◆ scalars

DiFfRG::hdf5::Group DiFfRG::HDF5Input::scalars
private

The documentation for this class was generated from the following file:
  • /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/discretization/data/hdf5_input.hh