Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Public Member Functions | Protected Types | Protected Member Functions | List of all members
HDF5::Group Class Reference

#include <deal.II/base/hdf5.h>

Inheritance diagram for HDF5::Group:
[legend]

Public Member Functions

Group open_group (const std::string &name) const
 
Group create_group (const std::string &name) const
 
DataSet open_dataset (const std::string &name) const
 
template<typename number >
DataSet create_dataset (const std::string &name, const std::vector< hsize_t > &dimensions) const
 
template<typename Container >
void write_dataset (const std::string &name, const Container &data) const
 
- Public Member Functions inherited from HDF5::HDF5Object
template<typename T >
get_attribute (const std::string &attr_name) const
 
template<typename T >
void set_attribute (const std::string &attr_name, const T value)
 
std::string get_name () const
 
template<>
bool get_attribute (const std::string &attr_name) const
 
template<>
void set_attribute (const std::string &attr_name, const std::string value)
 

Protected Types

enum  GroupAccessMode { GroupAccessMode::open, GroupAccessMode::create }
 

Protected Member Functions

 Group (const std::string &name, const Group &parent_group, const bool mpi, const GroupAccessMode mode)
 
 Group (const std::string &name, const bool mpi)
 
- Protected Member Functions inherited from HDF5::HDF5Object
 HDF5Object (const std::string &name, const bool mpi)
 

Additional Inherited Members

- Protected Attributes inherited from HDF5::HDF5Object
const std::string name
 
std::shared_ptr< hid_t > hdf5_reference
 
const bool mpi
 

Detailed Description

This class implements an HDF5 Group

Author
Daniel Garcia-Sanchez, 2018,2019.

Definition at line 968 of file hdf5.h.

Member Enumeration Documentation

◆ GroupAccessMode

enum HDF5::Group::GroupAccessMode
strongprotected

Group access mode

Enumerator
open 

Opens an existing group

create 

Creates a new group

Definition at line 974 of file hdf5.h.

Constructor & Destructor Documentation

◆ Group() [1/2]

HDF5::Group::Group ( const std::string &  name,
const Group parent_group,
const bool  mpi,
const GroupAccessMode  mode 
)
protected

This constructor creates or opens a group depending on the value of mode. The group will be placed inside the group parent_group. The parameter mpi defines if the I/O operations are serial or parallel. This is an internal constructor, the functions open_group() and create_group() of the current class should be used to open or create a group.

Definition at line 1302 of file hdf5.cc.

◆ Group() [2/2]

HDF5::Group::Group ( const std::string &  name,
const bool  mpi 
)
protected

Internal constructor used by File. The constructor sets the protected const members of HDF5Group: name and mpi. It does not create or open a Group.

Definition at line 1338 of file hdf5.cc.

Member Function Documentation

◆ open_group()

Group HDF5::Group::open_group ( const std::string &  name) const

Opens a sub-group of the current Group or File.

Definition at line 1345 of file hdf5.cc.

◆ create_group()

Group HDF5::Group::create_group ( const std::string &  name) const

Creates a sub-group in the current Group or File.

Definition at line 1353 of file hdf5.cc.

◆ open_dataset()

DataSet HDF5::Group::open_dataset ( const std::string &  name) const

Opens a dataset.

Definition at line 1361 of file hdf5.cc.

◆ create_dataset()

template<typename number >
DataSet HDF5::Group::create_dataset ( const std::string &  name,
const std::vector< hsize_t > &  dimensions 
) const

Creates a dataset. number can be float, double, std::complex<float>, std::complex<double>, int or unsigned int.

Datatype conversion takes place at the time of a read or write and is automatic. See the Data Transfer: Datatype Conversion and Selection section in the HDF5 User's Guide.

Definition at line 1370 of file hdf5.cc.

◆ write_dataset()

template<typename Container >
void HDF5::Group::write_dataset ( const std::string &  name,
const Container &  data 
) const

Create and write data to a dataset. number can be float, double, std::complex<float>, std::complex<double>, int or unsigned int.

Datatype conversion takes place at the time of a read or write and is automatic. See the Data Transfer: Datatype Conversion and Selection section in the HDF5 User's Guide.

Container can be std::vector<float>, std::vector<double>, std::vector<std::complex<float>>, std::vector<std::complex<double>>, std::vector<int>, std::vector<unsigned int>, Vector<float>, Vector<double>, Vector<std::complex<float>>, Vector<std::complex<double>>, FullMatrix<float>, FullMatrix<double>, FullMatrix<std::complex<float>> or FullMatrix<std::complex<double>>.

Definition at line 1381 of file hdf5.cc.


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