|
SpECTRE
2021.08.02
|
Contains functions and classes for manipulating HDF5 files. More...
Classes | |
| class | Dat |
| Represents a multicolumn dat file inside an HDF5 file. More... | |
| class | H5File |
| Opens an HDF5 file for access and allows manipulation of data. More... | |
| class | Header |
| Writes header info about the build, git commit, branch, etc. More... | |
| class | Object |
| Abstract base class representing an object in an HDF5 file. More... | |
| class | SourceArchive |
| Writes an archive of the source tree into a dataset. More... | |
| class | StellarCollapseEos |
| Reads in tabulated equation of state file from stellarcollapse.org More... | |
| class | Version |
| Used to store the version of the file. More... | |
| class | VolumeData |
| A volume data subfile written inside an H5 file. More... | |
Enumerations | |
| enum class | AccessType { AccessType::ReadWrite , AccessType::ReadOnly } |
| Set the access type to the H5File. More... | |
Functions | |
| std::ostream & | operator<< (std::ostream &os, AccessType t) noexcept |
| template<typename T > | |
| void | write_data (hid_t group_id, const std::vector< T > &data, const std::vector< size_t > &extents, const std::string &name="scalar") noexcept |
Write a std::vector named name to the group group_id | |
| void | write_data (hid_t group_id, const DataVector &data, const std::string &name) noexcept |
Write a DataVector named name to the group group_id | |
| template<size_t Dim> | |
| void | write_extents (hid_t group_id, const Index< Dim > &extents, const std::string &name="Extents") |
Write the extents as an attribute named name to the group group_id. | |
| template<typename Type > | |
| void | write_to_attribute (hid_t location_id, const std::string &name, const Type &value) noexcept |
Write a value of type Type to an HDF5 attribute named name | |
| template<typename T > | |
| void | write_to_attribute (hid_t group_id, const std::string &name, const std::vector< T > &data) noexcept |
Write the vector data to the attribute attribute_name in the group group_id. | |
| template<typename Type > | |
| Type | read_value_attribute (hid_t location_id, const std::string &name) noexcept |
Read a value of type Type from an HDF5 attribute named name | |
| template<typename Type > | |
| std::vector< Type > | read_rank1_attribute (hid_t group_id, const std::string &name) noexcept |
Read rank-1 of type Type from an HDF5 attribute named name | |
| std::vector< std::string > | get_attribute_names (hid_t file_id, const std::string &group_name) |
| Get the names of all the attributes in a group. | |
| void | write_connectivity (hid_t group_id, const std::vector< int > &connectivity) noexcept |
| Write the connectivity into the group in the H5 file. | |
| std::vector< std::string > | get_group_names (hid_t file_id, const std::string &group_name) noexcept |
| Get the names of all the groups and datasets in a group. | |
| bool | contains_dataset_or_group (hid_t id, const std::string &group_name, const std::string &dataset_name) noexcept |
Check if name is a dataset or group in the subgroup group_name of id. More... | |
| bool | contains_attribute (hid_t file_id, const std::string &group_name, const std::string &attribute_name) |
| Check if an attribute is in a group. | |
| hid_t | open_dataset (hid_t group_id, const std::string &dataset_name) noexcept |
| Open an HDF5 dataset. | |
| void | close_dataset (hid_t dataset_id) noexcept |
| Close an HDF5 dataset. | |
| hid_t | open_dataspace (hid_t dataset_id) noexcept |
| Open an HDF5 dataspace. | |
| void | close_dataspace (hid_t dataspace_id) noexcept |
| Close an HDF5 dataspace. | |
| template<size_t Rank, typename T > | |
| T | read_data (hid_t group_id, const std::string &dataset_name) noexcept |
| Read an array of rank 0-3 into an object. More... | |
| template<size_t Dim> | |
| Index< Dim > | read_extents (hid_t group_id, const std::string &extents_name="Extents") |
| Read the HDF5 attribute representing extents from a group. | |
| template<typename T > | |
| hid_t | h5_type () |
Returns the HDF5 datatype for the corresponding type T More... | |
| hid_t | fortran_string () noexcept |
| Create an H5 FORTRAN string. | |
| std::pair< size_t, size_t > | offset_and_length_for_grid (const std::string &grid_name, const std::vector< std::string > &all_grid_names, const std::vector< std::vector< size_t > > &all_extents) noexcept |
Find the interval within the contiguous dataset stored in h5::VolumeData that holds data for a particular grid_name. More... | |
| auto | h5f_acc_rdonly () noexcept |
| auto | h5f_acc_rdwr () noexcept |
| auto | h5f_acc_trunc () noexcept |
| auto | h5p_default () noexcept |
| auto | h5s_all () noexcept |
| auto | h5s_unlimited () noexcept |
| auto | h5s_scalar () noexcept |
Contains functions and classes for manipulating HDF5 files.
Wraps many underlying C H5 routines making them easier to use and easier to manipulate H5 files.
|
noexcept |
Find the interval within the contiguous dataset stored in h5::VolumeData that holds data for a particular grid_name.
h5::VolumeData stores data for all grids that compose the volume contiguously. This function helps with reconstructing which part of that contiguous dataset belongs to a particular grid. See the h5::VolumeData documentation for more information on how it stores data.
To use this function, call h5::VolumeData::get_grid_names and h5::VolumeData::get_extents and pass the results for the all_grid_names and all_extents arguments, respectively. This means you can retrieve this information from an h5::VolumeData once and use it to call offset_and_length_for_grid multiple times with different grid_names.
Here is an example for using this function:
h5::VolumeData