From: Benjamin Brands Date: Tue, 23 Jan 2018 08:47:26 +0000 (+0100) Subject: add hdf5_type_id to return HDF5 type X-Git-Tag: v9.0.0-rc1~483^2~6 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b28b746c36bda53b959ce28f93babe6bd0a8b29;p=dealii.git add hdf5_type_id to return HDF5 type --- diff --git a/include/deal.II/lac/scalapack.templates.h b/include/deal.II/lac/scalapack.templates.h index cf532069ef..1e57ba1d30 100644 --- a/include/deal.II/lac/scalapack.templates.h +++ b/include/deal.II/lac/scalapack.templates.h @@ -24,6 +24,10 @@ #include #include +# ifdef DEAL_II_WITH_HDF5 +#include +# endif + // useful examples: // https://stackoverflow.com/questions/14147705/cholesky-decomposition-scalapack-error/14203864 // http://icl.cs.utk.edu/lapack-forum/viewtopic.php?t=139 // second post by Julien Langou @@ -1488,6 +1492,44 @@ inline void pgels(const char *trans, psgels_(trans,m,n,nrhs,A,ia,ja,desca,B,ib,jb,descb,work,lwork,info); } + +# ifdef DEAL_II_WITH_HDF5 + +template +inline hid_t hdf5_type_id (const number *) +{ + Assert (false, dealii::ExcNotImplemented()); + //don't know what to put here; it does not matter + return -1; +} + +inline hid_t hdf5_type_id (const double *) +{ + return H5T_NATIVE_DOUBLE; +} + +inline hid_t hdf5_type_id (const float *) +{ + return H5T_NATIVE_FLOAT; +} + +inline hid_t hdf5_type_id (const int *) +{ + return H5T_NATIVE_INT; +} + +inline hid_t hdf5_type_id (const unsigned int *) +{ + return H5T_NATIVE_UINT; +} + +inline hid_t hdf5_type_id (const char *) +{ + return H5T_NATIVE_CHAR; +} + +# endif // DEAL_II_WITH_HDF5 + #endif // DEAL_II_WITH_SCALAPACK #endif // dealii_scalapack_templates_h