HDF5Output Class Reference#

DiFfRG: DiFfRG::HDF5Output Class Reference
DiFfRG

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

#include <hdf5_output.hh>

Public Member Functions

 HDF5Output (const std::string top_folder, const std::string output_name, const JSONValue &json)
 Construct a new Csv Output object.
 
 ~HDF5Output ()
 
void write_series_record (DiFfRG::hdf5::Group &group, const int series_number)
 
template<typename T >
void scalar (const std::string &name, const T value)
 Add a value to the output.
 
void scalar (const std::string &name, const char *value)
 
template<typename COORD >
requires is_coordinates<COORD>
void map (const std::string &name, const COORD &coordinates)
 
template<typename COORD , typename T >
requires is_coordinates<COORD>
void map (const std::string &name, const COORD &coordinates, T *data)
 
template<typename INTERP >
requires is_interpolator<INTERP>
void map (const std::string &name, const INTERP &_interpolator)
 
template<typename INTERP >
requires is_interpolator<INTERP>
void map (const std::string &name, const std::string &coord_name, const INTERP &_interpolator)
 
DiFfRG::hdf5::Fileget_file ()
 
void flush (const double time)
 
void open_file ()
 
void close_file ()
 

Private Member Functions

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

Private Attributes

const JSONValuejson
 
const std::string top_folder
 
const std::string output_name
 
bool opened
 
std::list< std::string > written_scalars
 
std::list< std::string > written_maps
 
std::map< std::string, size_t > map_series_numbers
 
std::map< std::string, std::string > coord_identifiers
 
std::list< std::string > initial_scalars
 
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

◆ HDF5Output()

DiFfRG::HDF5Output::HDF5Output ( const std::string top_folder,
const std::string output_name,
const JSONValue & json )

Construct a new Csv Output object.

Parameters
top_folderThe top folder to store the output in.
output_nameThe name of the output file.
jsonThe JSON object containing the parameters.

◆ ~HDF5Output()

DiFfRG::HDF5Output::~HDF5Output ( )

Member Function Documentation

◆ check_coordinates()

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

◆ close_file()

void DiFfRG::HDF5Output::close_file ( )

◆ flush()

void DiFfRG::HDF5Output::flush ( const double time)

◆ get_file()

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

◆ map() [1/4]

template<typename COORD >
requires is_coordinates<COORD>
void DiFfRG::HDF5Output::map ( const std::string & name,
const COORD & coordinates )
inline

◆ map() [2/4]

template<typename COORD , typename T >
requires is_coordinates<COORD>
void DiFfRG::HDF5Output::map ( const std::string & name,
const COORD & coordinates,
T * data )
inline

◆ map() [3/4]

template<typename INTERP >
requires is_interpolator<INTERP>
void DiFfRG::HDF5Output::map ( const std::string & name,
const INTERP & _interpolator )
inline

◆ map() [4/4]

template<typename INTERP >
requires is_interpolator<INTERP>
void DiFfRG::HDF5Output::map ( const std::string & name,
const std::string & coord_name,
const INTERP & _interpolator )
inline

◆ open_file()

void DiFfRG::HDF5Output::open_file ( )

◆ scalar() [1/2]

void DiFfRG::HDF5Output::scalar ( const std::string & name,
const char * value )
inline

◆ scalar() [2/2]

template<typename T >
void DiFfRG::HDF5Output::scalar ( const std::string & name,
const T value )
inline

Add a value to the output.

Parameters
nameThe name of the value.
valueThe value to add.

◆ write_series_record()

void DiFfRG::HDF5Output::write_series_record ( DiFfRG::hdf5::Group & group,
const int series_number )
inline

Member Data Documentation

◆ coord_identifiers

std::map<std::string, std::string> DiFfRG::HDF5Output::coord_identifiers
private

◆ coords

DiFfRG::hdf5::Group DiFfRG::HDF5Output::coords
private

◆ h5_file

DiFfRG::hdf5::File DiFfRG::HDF5Output::h5_file
private

◆ initial_scalars

std::list<std::string> DiFfRG::HDF5Output::initial_scalars
private

◆ json

const JSONValue& DiFfRG::HDF5Output::json
private

◆ map_series_numbers

std::map<std::string, size_t> DiFfRG::HDF5Output::map_series_numbers
private

◆ maps

DiFfRG::hdf5::Group DiFfRG::HDF5Output::maps
private

◆ opened

bool DiFfRG::HDF5Output::opened
private

◆ output_name

const std::string DiFfRG::HDF5Output::output_name
private

◆ path

std::filesystem::path DiFfRG::HDF5Output::path
private

◆ scalars

DiFfRG::hdf5::Group DiFfRG::HDF5Output::scalars
private

◆ top_folder

const std::string DiFfRG::HDF5Output::top_folder
private

◆ written_maps

std::list<std::string> DiFfRG::HDF5Output::written_maps
private

◆ written_scalars

std::list<std::string> DiFfRG::HDF5Output::written_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_output.hh