deal.II version GIT relicensing-2206-gaa53ff9447 2024-12-02 09:10:00+00:00
\(\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\}}\)
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
HDF5::HDF5Object Class Reference

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

Inheritance diagram for HDF5::HDF5Object:
Inheritance graph
[legend]

Public Member Functions

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<>
std::string get_attribute (const std::string &attr_name) const
 
template<>
void set_attribute (const std::string &attr_name, const std::string value)
 

Protected Member Functions

 HDF5Object (const std::string &name, const bool mpi)
 

Protected Attributes

const std::string name
 
std::shared_ptr< hid_t > hdf5_reference
 
const bool mpi
 

Detailed Description

Base class for the HDF5 objects.

Definition at line 349 of file hdf5.h.

Constructor & Destructor Documentation

◆ HDF5Object()

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

Constructor. string_name is the name of the HDF5 Object. If mpi is True then MPI I/O is used.

Definition at line 68 of file hdf5.cc.

Member Function Documentation

◆ get_attribute() [1/2]

template<typename T >
T HDF5::HDF5Object::get_attribute ( const std::string &  attr_name) const

Reads an attribute. T can be float, double, std::complex<float>, std::complex<double>, int, unsigned int, bool or std::string. Note that the encoding of std::string is UTF8 in order to be compatible with python3.

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 1597 of file hdf5.h.

◆ set_attribute() [1/2]

template<typename T >
void HDF5::HDF5Object::set_attribute ( const std::string &  attr_name,
const T  value 
)

Writes an attribute. T can be float, double, std::complex<float>, std::complex<double>, int, unsigned int, bool or std::string. Note that the encoding of std::string is UTF8 in order to be compatible with python3.

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 1674 of file hdf5.h.

◆ get_name()

std::string HDF5::HDF5Object::get_name ( ) const

Returns the name of the object. In the case of File, name corresponds to the file name. In the case of Group and DataSet, name corresponds to the name of the object in the HDF5 file.

Definition at line 76 of file hdf5.cc.

◆ get_attribute() [2/2]

template<>
std::string HDF5::HDF5Object::get_attribute ( const std::string &  attr_name) const
inline

Definition at line 1620 of file hdf5.h.

◆ set_attribute() [2/2]

template<>
void HDF5::HDF5Object::set_attribute ( const std::string &  attr_name,
const std::string  value 
)
inline

Definition at line 1714 of file hdf5.h.

Member Data Documentation

◆ name

const std::string HDF5::HDF5Object::name
protected

Name of the HDF5Object. In the case of File, name corresponds to the file name. In the case of Group and DataSet name corresponds to the name of the object in the HDF5 file.

Definition at line 405 of file hdf5.h.

◆ hdf5_reference

std::shared_ptr<hid_t> HDF5::HDF5Object::hdf5_reference
protected

HDF5 identifier for the objects File, Group and DataSet. The std::shared_ptr<> pointer allows the object to be copied. For example several parts of the program can share and access the same group; when all the functions that access the group are closed, the HDF5 resources of the group will be automatically released.

Definition at line 414 of file hdf5.h.

◆ mpi

const bool HDF5::HDF5Object::mpi
protected

If true use parallel HDF5, if false use serial HDF5.

Definition at line 419 of file hdf5.h.


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