Commit 55eed7ce authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

add read_string

parent ecd9594f
Pipeline #13693 passed with stage
in 6 minutes and 5 seconds
......@@ -171,6 +171,23 @@ std::vector<dtype> hdf5_tools::read_vector_with_single_rank(
return data;
}
std::string hdf5_tools::read_string(
const hid_t group,
const std::string dset_name)
{
hid_t dset = H5Dopen(group, dset_name.c_str(), H5P_DEFAULT);
hid_t space = H5Dget_space(dset);
hid_t memtype = H5Dget_type(dset);
char *string_data = (char*)malloc(256);
H5Dread(dset, memtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, &string_data);
std::string std_string_data = std::string(string_data);
free(string_data);
H5Sclose(space);
H5Tclose(memtype);
H5Dclose(dset);
return std_string_data;
}
template
std::vector<int> hdf5_tools::read_vector<int>(
const hid_t,
......
......@@ -75,6 +75,10 @@ namespace hdf5_tools
const MPI_Comm COMM,
const hid_t group,
const std::string dset_name);
std::string read_string(
const hid_t group,
const std::string dset_name);
}
#endif//HDF5_TOOLS_HPP
......
......@@ -236,7 +236,9 @@ template <field_backend be,
kspace_dealias_type dt>
template <typename rnumber,
field_components fc>
void kspace<be, dt>::low_pass(typename fftw_interface<rnumber>::complex *__restrict__ a, const double kmax)
void kspace<be, dt>::low_pass(
typename fftw_interface<rnumber>::complex *__restrict__ a,
const double kmax)
{
const double km2 = kmax*kmax;
this->CLOOP_K2(
......@@ -456,6 +458,26 @@ template void kspace<FFTW, SMOOTH>::low_pass<double, THREExTHREE>(
typename fftw_interface<double>::complex *__restrict__ a,
const double kmax);
template void kspace<FFTW, SMOOTH>::Gauss_filter<float, ONE>(
typename fftw_interface<float>::complex *__restrict__ a,
const double kmax);
template void kspace<FFTW, SMOOTH>::Gauss_filter<float, THREE>(
typename fftw_interface<float>::complex *__restrict__ a,
const double kmax);
template void kspace<FFTW, SMOOTH>::Gauss_filter<float, THREExTHREE>(
typename fftw_interface<float>::complex *__restrict__ a,
const double kmax);
template void kspace<FFTW, SMOOTH>::Gauss_filter<double, ONE>(
typename fftw_interface<double>::complex *__restrict__ a,
const double kmax);
template void kspace<FFTW, SMOOTH>::Gauss_filter<double, THREE>(
typename fftw_interface<double>::complex *__restrict__ a,
const double kmax);
template void kspace<FFTW, SMOOTH>::Gauss_filter<double, THREExTHREE>(
typename fftw_interface<double>::complex *__restrict__ a,
const double kmax);
template void kspace<FFTW, SMOOTH>::dealias<float, ONE>(
typename fftw_interface<float>::complex *__restrict__ a);
template void kspace<FFTW, SMOOTH>::dealias<float, THREE>(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment