HDF5Input Class Reference#

DiFfRG: HDF5Input Class Reference
DiFfRG
Discretization Framework for functional Renormalization Group flows
HDF5Input Class Reference

Read scalars and maps from an HDF5 file written by HDF5Output, e.g. to initialize a run from a previous one. More...

#include <hdf5_input.hh>

Public Member Functions

 HDF5Input (const std::string file_name)
 Open file_name (".h5" appended if missing) read-only; throws if it does not exist or lacks the groups.
 
void load_map (const std::string &name, std::span< double > data, int series_number=-1)
 Copy the values of a map series into data, as doubles in the grid's linear index order.
 
void load_map (const std::string &name, double *data, int series_number=-1)
 
std::vector< double > load_map (const std::string &name, int series_number=-1)
 The values of a map series, as doubles in the grid's linear index order; series_number -1 for the latest.
 
template<size_t dim>
std::vector< double > load_map_coord (const std::string &name, int series_number=-1)
 The grid points of a map series (through its coordinates link).
 
template<typename Coordinates >
void load_map (const std::string &name, std::span< double > data, const Coordinates &coordinates)
 Copy the latest series of a map into data, after checking coordinates against the file.
 
template<typename Coordinates >
void load_map (const std::string &name, double *data, const Coordinates &coordinates)
 
template<typename T >
std::vector< T > load_scalar (const std::string &name)
 All values of /scalars/<name>, one per frame.
 
DiFfRG::hdf5::File & get_file ()
 The open file, for direct access.
 

Detailed Description

Read scalars and maps from an HDF5 file written by HDF5Output, e.g. to initialize a run from a previous one.

A map series is /maps/<name>/<series>; series_number = -1 selects the latest (highest) series.

Constructor & Destructor Documentation

◆ HDF5Input()

HDF5Input ( const std::string file_name)

Open file_name (".h5" appended if missing) read-only; throws if it does not exist or lacks the groups.

Member Function Documentation

◆ get_file()

DiFfRG::hdf5::File & get_file ( )

The open file, for direct access.

◆ load_map() [1/5]

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

◆ load_map() [2/5]

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

◆ load_map() [3/5]

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

The values of a map series, as doubles in the grid's linear index order; series_number -1 for the latest.

◆ load_map() [4/5]

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

Copy the latest series of a map into data, after checking coordinates against the file.

The grid is looked up as /coordinates/<coordinates.to_string()> and must agree point by point (to 1e-12) with coordinates; throws otherwise. Whether the map's own coordinates link points to this grid is not checked.

◆ load_map() [5/5]

void load_map ( const std::string & name,
std::span< double > data,
int series_number = -1 )
inline

Copy the values of a map series into data, as doubles in the grid's linear index order.

Parameters
nameThe map name.
dataBuffer, e.g. a std::vector<double>; its size must equal the number of values in the map.
series_numberSeries to read; -1 for the latest.

◆ load_map_coord()

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

The grid points of a map series (through its coordinates link).

Template Parameters
dimNumber of coordinates per grid point.
Parameters
nameThe map name.
series_numberSeries to read; -1 for the latest.
Returns
All points one after another: \((x^0_0, \dots, x^0_{dim-1}, x^1_0, \dots)\).

◆ load_scalar()

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

All values of /scalars/<name>, one per frame.


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