Opm::HDF5Serializer Class Reference

Class for (de-)serializing using HDF5. More...

#include <HDF5Serializer.hpp>

Inheritance diagram for Opm::HDF5Serializer:
Inheritance graph

Public Member Functions

 HDF5Serializer (const std::string &fileName, HDF5File::OpenMode mode, Parallel::Communication comm)
 
template<class T >
void write (T &data, const std::string &group, const std::string &dset, HDF5File::DataSetMode mode=HDF5File::DataSetMode::PROCESS_SPLIT)
 Serialize and write data to restart file. More...
 
void writeHeader (const std::string &simulator_name, const std::string &module_version, const std::string &time_stamp, const std::string &case_name, const std::string &params, int num_procs)
 Writes a header to the file. More...
 
template<class T >
void read (T &data, const std::string &group, const std::string &dset, HDF5File::DataSetMode mode=HDF5File::DataSetMode::PROCESS_SPLIT)
 Read data and deserialize from restart file. More...
 
int lastReportStep () const
 Returns the last report step stored in file. More...
 
std::vector< int > reportSteps () const
 Returns a list of report steps stored in restart file. More...
 

Detailed Description

Class for (de-)serializing using HDF5.

Constructor & Destructor Documentation

◆ HDF5Serializer()

Opm::HDF5Serializer::HDF5Serializer ( const std::string &  fileName,
HDF5File::OpenMode  mode,
Parallel::Communication  comm 
)
inline

Member Function Documentation

◆ lastReportStep()

int Opm::HDF5Serializer::lastReportStep ( ) const

Returns the last report step stored in file.

◆ read()

template<class T >
void Opm::HDF5Serializer::read ( T &  data,
const std::string &  group,
const std::string &  dset,
HDF5File::DataSetMode  mode = HDF5File::DataSetMode::PROCESS_SPLIT 
)
inline

Read data and deserialize from restart file.

Template Parameters
TType of class to read
Parameters
dataClass to read restart data for
groupGroup to read dataset from
dsetData set to read
modeMode for dataset

References Opm::HDF5File::read().

◆ reportSteps()

std::vector< int > Opm::HDF5Serializer::reportSteps ( ) const

Returns a list of report steps stored in restart file.

◆ write()

template<class T >
void Opm::HDF5Serializer::write ( T &  data,
const std::string &  group,
const std::string &  dset,
HDF5File::DataSetMode  mode = HDF5File::DataSetMode::PROCESS_SPLIT 
)
inline

Serialize and write data to restart file.

Template Parameters
TType of class to write
Parameters
dataClass to write restart data for
groupGroup to write dataset to
dsetData set to write
modeMode for dataset

References Opm::PVUtil::pack(), and Opm::HDF5File::write().

◆ writeHeader()

void Opm::HDF5Serializer::writeHeader ( const std::string &  simulator_name,
const std::string &  module_version,
const std::string &  time_stamp,
const std::string &  case_name,
const std::string &  params,
int  num_procs 
)

Writes a header to the file.

Parameters
simulator_nameName of simulator used
module_versionVersion of simulator used
time_stampBuild time-stamp for simulator used
case_nameName of case file is associated with
paramsList of parameter values
num_procsNumber of processes used

The documentation for this class was generated from the following file: