Loading...
Searching...
No Matches
Opm::HDF5File Class Reference

Class handling simple output to HDF5. More...

`#include <HDF5File.hpp>`

## Public Types

enum class | OpenMode { APPEND , OVERWRITE , READ }
| Enumeration of file opening modes. More...
enum class | DataSetMode { ROOT_ONLY , PROCESS_SPLIT }
| Enumeration of dataset modes. More...

## Public Member Functions

| HDF5File (const std::string &fileName, OpenMode mode, Parallel::Communication comm)
| Opens HDF5 file for I/O.
| ~HDF5File ()
| Destructor clears up any opened files.
void | write (const std::string &group, const std::string &dset, const std::vector< char > &buffer, DataSetMode mode=DataSetMode::PROCESS_SPLIT) const
| Write a char buffer to a specified location in file.
void | read (const std::string &group, const std::string &dset, std::vector< char > &buffer, DataSetMode mode=DataSetMode::PROCESS_SPLIT) const
| Read a char buffer from a specified location in file.
std::vector< std::string > | list (const std::string &group) const
| Lists the entries in a given group.

## Detailed Description

Class handling simple output to HDF5.

## Member Enumeration Documentation

## DataSetMode

enum class Opm::HDF5File::DataSetMode

strong

Enumeration of dataset modes.

Enumerator
ROOT_ONLY | A single dataset created at the root process.
PROCESS_SPLIT | One separate data set for each parallel process.

## OpenMode

enum class Opm::HDF5File::OpenMode

strong

Enumeration of file opening modes.

Enumerator
APPEND | Append to an existing file (creates new if not).
OVERWRITE | Overwrite and write to an existing file.
READ | Open existing file for reading.

## Constructor & Destructor Documentation

## HDF5File()

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

Opens HDF5 file for I/O.

Parameters

  fileName | Name of file to open
  mode | Open mode for file
  comm | Parallel communicator

## Member Function Documentation

## list()

std::vector< std::string > Opm::HDF5File::list | ( | const std::string & | group | ) | const

Lists the entries in a given group.

Note: Both datasets and subgroups are returned

## read()

void Opm::HDF5File::read | ( | const std::string & | group,
|  | const std::string & | dset,
|  | std::vector< char > & | buffer,
|  | DataSetMode | mode = DataSetMode::PROCESS_SPLIT ) const

Read a char buffer from a specified location in file.

Parameters

  group | Group ("directory") to read data from
  dset | Data set ("file") to read data from
  buffer | Vector to store read data in
  mode | Mode for dataset

Throws exception on failure

## write()

void Opm::HDF5File::write | ( | const std::string & | group,
|  | const std::string & | dset,
|  | const std::vector< char > & | buffer,
|  | DataSetMode | mode = DataSetMode::PROCESS_SPLIT ) const

Write a char buffer to a specified location in file.

Parameters

  group | Group ("directory") to write data to
  dset | Data set ("file") to write data to
  buffer | Data to write
  mode | Mode for dataset

Throws exception on failure

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

- opm/simulators/utils/HDF5File.hpp
- opm/simulators/utils/HDF5File.cpp