return t_type;
}
+
+
// Several HDF5 functions such as H5Screate_simple() require a
// one-dimensional array that specifies the size of each dimension of the
// container, see:
return std::vector<hsize_t>{data.size()};
}
+
+
template <typename Container>
typename std::enable_if<
std::is_same<Container, Vector<typename Container::value_type>>::value,
return std::vector<hsize_t>{data.size()};
}
+
+
template <typename Container>
typename std::enable_if<
std::is_same<Container,
}
+
// This function returns the total size of the container.
// For a std::vector the function returns int(vector_size)
// For a Vector the function returns int(vector_size)
return static_cast<unsigned int>(data.size());
}
+
+
template <typename Container>
typename std::enable_if<
std::is_same<Container, Vector<typename Container::value_type>>::value,
return static_cast<unsigned int>(data.size());
}
+
+
template <typename Container>
typename std::enable_if<
std::is_same<Container,
return static_cast<unsigned int>(data.m() * data.n());
}
+
+
// This function returns the pointer to the raw data of a container
template <typename Container>
typename std::enable_if<
return data.data();
}
+
+
template <typename Container>
typename std::enable_if<
std::is_same<Container, Vector<typename Container::value_type>>::value,
return &data[0];
}
+
+
template <typename Container>
typename std::enable_if<
std::is_same<Container,
return &data[0][0];
}
+
+
// This function returns the pointer to the raw data of a container
// The returned pointer is const, which means that it can be used only to
// read the data
return data.data();
}
+
+
template <typename Container>
typename std::enable_if<
std::is_same<Container, Vector<typename Container::value_type>>::value,
}
+
template <typename Container>
typename std::enable_if<
std::is_same<Container,
return &data[0][0];
}
+
+
// This function initializes and returns a container of type std::vector,
// Vector or FullMatrix. The function does not set the values of the
// elements of the container. The container can store data of a HDF5 dataset
dimensions.begin(), dimensions.end(), 1, std::multiplies<int>()));
}
+
+
template <typename Container>
typename std::enable_if<
std::is_same<Container, Vector<typename Container::value_type>>::value,
dimensions.begin(), dimensions.end(), 1, std::multiplies<int>()));
}
+
+
template <typename Container>
typename std::enable_if<
std::is_same<Container,
return Container(dimensions[0], dimensions[1]);
}
+
+
// Convert a HDF5 no_collective_cause code to a human readable string
std::string
no_collective_cause_to_string(uint32_t no_collective_cause)
} // namespace internal
+
HDF5Object::HDF5Object(const std::string name, const bool mpi)
: name(name)
, mpi(mpi)
{}
+
+
template <typename T>
T
HDF5Object::attr(const std::string &attr_name)
return value;
}
+
+
template <>
bool
HDF5Object::attr(const std::string &attr_name)
return bool_value;
}
+
+
template <>
std::string
HDF5Object::attr(const std::string &attr_name)
return string_value;
}
+
+
template <typename T>
void
HDF5Object::write_attr(const std::string &attr_name, const T value)
Assert(ret >= 0, ExcMessage("Error at H5Aclose"));
}
+
+
template <>
void
HDF5Object::write_attr(const std::string &attr_name, const std::string value)
Assert(ret >= 0, ExcMessage("Error at H5Aclose"));
}
+
+
DataSet::DataSet(const std::string &name,
const hid_t & parent_group_id,
const bool mpi)
}
}
+
+
DataSet::DataSet(const std::string & name,
const hid_t & parent_group_id,
const std::vector<hsize_t> &dimensions,
}
}
+
+
template <typename Container>
Container
DataSet::read()
return data;
}
+
+
template <typename number>
std::vector<number>
DataSet::read_selection(const std::vector<hsize_t> &coordinates)
return data;
}
+
+
template <typename Container>
Container
DataSet::read_hyperslab(const std::vector<hsize_t> &offset,
return data;
}
+
+
template <typename number>
void
DataSet::read_none()
Assert(ret >= 0, ExcMessage("Error at H5SClose"));
}
+
+
template <typename Container>
void
DataSet::write(const Container &data)
}
}
+
+
template <typename number>
void
DataSet::write_selection(const std::vector<number> & data,
Assert(ret >= 0, ExcMessage("Error at H5SClose"));
}
+
+
template <typename Container>
void
DataSet::write_hyperslab(const Container & data,
Assert(ret >= 0, ExcMessage("Error at H5Sclose"));
}
+
+
template <typename Container>
void
DataSet::write_hyperslab(const Container & data,
Assert(ret >= 0, ExcMessage("Error at H5Sclose"));
}
+
+
template <typename number>
void
DataSet::write_none()
Assert(ret >= 0, ExcMessage("Error at H5Sclose"));
}
+
+
template <>
H5D_mpio_actual_io_mode_t
DataSet::io_mode()
return std::string("Internal error");
}
+
+
template <>
uint32_t
DataSet::local_no_collective_cause()
return internal::no_collective_cause_to_string(_local_no_collective_cause);
}
+
+
template <>
uint32_t
DataSet::global_no_collective_cause()
return internal::no_collective_cause_to_string(_global_no_collective_cause);
}
+
+
bool
DataSet::query_io_mode() const
{
return _query_io_mode;
}
+
+
void
DataSet::query_io_mode(bool query_io_mode)
{
_query_io_mode = query_io_mode;
}
+
+
std::vector<hsize_t>
DataSet::dimensions() const
{
return _dimensions;
}
+
+
unsigned int
DataSet::size() const
{
return _size;
}
+
+
unsigned int
DataSet::rank() const
{
return _rank;
}
+
+
Group::Group(const std::string &name,
const Group & parentGroup,
const bool mpi,
}
}
+
+
Group::Group(const std::string &name, const bool mpi)
: HDF5Object(name, mpi)
{}
+
+
Group
Group::group(const std::string &name)
{
return Group(name, *this, mpi, Mode::open);
}
+
+
Group
Group::create_group(const std::string &name)
{
return Group(name, *this, mpi, Mode::create);
}
+
+
DataSet
Group::dataset(const std::string &name)
{
return DataSet(name, *hdf5_reference, mpi);
}
+
+
template <typename number>
DataSet
Group::create_dataset(const std::string & name,
return DataSet(name, *hdf5_reference, dimensions, t_type, mpi);
}
+
+
template <typename Container>
void
Group::write_dataset(const std::string &name, const Container &data) const
}
}
+
+
File::File(const std::string &name,
const MPI_Comm mpi_communicator,
const Mode mode)
: File(name, true, mpi_communicator, mode)
{}
+
+
File::File(const std::string &name, const Mode mode)
: File(name, false, MPI_COMM_NULL, mode)
{}
+
+
# ifndef DOXYGEN
// instantiations of functions