IFEM  90A354
Public Member Functions | List of all members
HDF5Reader Class Reference

Read data from a HDF5 file. More...

#include <HDF5Reader.h>

Inheritance diagram for HDF5Reader:
Inheritance graph
[legend]
Collaboration diagram for HDF5Reader:
Collaboration graph
[legend]

Public Member Functions

 HDF5Reader (const std::string &name, const ProcessAdm &adm)
 The constructor opens a named HDF5-file. More...
 
bool readVector (const std::string &path, std::vector< int > &vec)
 Reads an integer vector. More...
 
bool readVector (const std::string &path, std::vector< double > &vec)
 Reads an double precision vector. More...
 
bool readDouble (const std::string &name, double &out)
 Reads a single double value. More...
 
bool readString (const std::string &name, std::string &out)
 Reads a text string. More...
 
bool read3DArray (const std::string &name, Matrix3D &data)
 Reads a 3D array. More...
 
int getFieldSize (const std::string &fieldPath)
 Returns number of patches for a field. More...
 
- Public Member Functions inherited from HDF5Base
 HDF5Base (const std::string &name, const ProcessAdm &adm)
 The constructor opens a named HDF5-file. More...
 
virtual ~HDF5Base ()
 The destructor closes the file.
 

Additional Inherited Members

- Protected Member Functions inherited from HDF5Base
bool openFile (unsigned int flag)
 Opens the HDF5 file. More...
 
void closeFile ()
 Closes the HDF5 file.
 
- Protected Attributes inherited from HDF5Base
std::string m_hdf5_name
 The file name of the HDF5 file.
 

Detailed Description

Read data from a HDF5 file.

Constructor & Destructor Documentation

◆ HDF5Reader()

HDF5Reader::HDF5Reader ( const std::string &  name,
const ProcessAdm adm 
)

The constructor opens a named HDF5-file.

Parameters
[in]nameThe name (without extension) of the data file
[in]admThe process administrator

Member Function Documentation

◆ getFieldSize()

int HDF5Reader::getFieldSize ( const std::string &  fieldPath)

Returns number of patches for a field.

Parameters
[in]fieldPathPath to field in hdf5 file

References HDF5Base::openFile().

Referenced by FieldFuncHDF5::load(), and SIMinput::setInitialCondition().

◆ read3DArray()

bool HDF5Reader::read3DArray ( const std::string &  name,
Matrix3D data 
)

Reads a 3D array.

Parameters
[in]nameThe name (path in HDF5 file) to the string
[out]dataThe 3D array to read data into

References HDF5Base::openFile(), and utl::matrix3d< T >::resize().

Referenced by TextureProperties::parse().

◆ readDouble()

bool HDF5Reader::readDouble ( const std::string &  name,
double &  out 
)

Reads a single double value.

Parameters
[in]nameThe name (path in HDF5 file) to the string
[out]outThe double to read data into

References HDF5Base::openFile().

Referenced by FieldFuncHDF5::findClosestLevel().

◆ readString()

bool HDF5Reader::readString ( const std::string &  name,
std::string &  out 
)

Reads a text string.

Parameters
[in]nameThe name (path in HDF5 file) to the string
[out]outThe string to read data into

References HDF5Base::openFile().

Referenced by FieldFuncHDF5::load(), and SIMinput::setInitialCondition().

◆ readVector() [1/2]

bool HDF5Reader::readVector ( const std::string &  path,
std::vector< double > &  vec 
)

Reads an double precision vector.

Parameters
[in]pathThe path to the dataset to read
[out]vecThe vector to read data into

References HDF5Base::openFile().

◆ readVector() [2/2]

bool HDF5Reader::readVector ( const std::string &  path,
std::vector< int > &  vec 
)

Reads an integer vector.

Helper for reading data from HDF5 file.

Parameters
[in]pathThe path to the dataset to read
[out]vecThe vector to read data into

References HDF5Base::openFile().

Referenced by FieldFuncHDF5::load(), and SIMinput::setInitialCondition().


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