]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add hdf5_type_id to return HDF5 type
authorBenjamin Brands <benjamin.brands@fau.de>
Tue, 23 Jan 2018 08:47:26 +0000 (09:47 +0100)
committerBenjamin Brands <benjamin.brands@fau.de>
Mon, 29 Jan 2018 12:36:23 +0000 (13:36 +0100)
include/deal.II/lac/scalapack.templates.h

index cf532069ef6bf6c888f41303cc7163067b1f8331..1e57ba1d30e29ce31cf74047e42841be0c8fe8df 100644 (file)
 #include <deal.II/base/mpi.h>
 #include <deal.II/base/mpi.templates.h>
 
+#  ifdef DEAL_II_WITH_HDF5
+#include <hdf5.h>
+#  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<typename number>
+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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.