]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Place most of the instantiations in hdf5.inst.in
authorDaniel Garcia-Sanchez <daniel.garcia-sanchez@insp.upmc.fr>
Wed, 22 Aug 2018 12:41:28 +0000 (14:41 +0200)
committerDaniel Garcia-Sanchez <daniel.garcia-sanchez@insp.upmc.fr>
Wed, 9 Jan 2019 18:08:18 +0000 (19:08 +0100)
source/base/CMakeLists.txt
source/base/hdf5.cc
source/base/hdf5.inst.in [new file with mode: 0644]

index 34b1e95033d8078c126e895d00d3a4922b555ccf..eacda918d507ac6e557ca12698f76839c53fa77a 100644 (file)
@@ -117,6 +117,7 @@ SET(_inst
   function_time.inst.in
   incremental_function.inst.in
   geometric_utilities.inst.in
+  hdf5.inst.in
   mpi.inst.in
   partitioner.inst.in
   partitioner.cuda.inst.in
index 18409500c94dbb24dc2a461d119b9277ef0ddf84..1f01a10cbf30b5610b4b40b18c63e17e745b7cfd 100644 (file)
@@ -1302,91 +1302,38 @@ namespace HDF5
 
 #  ifndef DOXYGEN
 
-  // explicit instantiations of functions
-  template float
-  HDF5Object::attr<float>(const std::string attr_name) const;
-  template double
-  HDF5Object::attr<double>(const std::string attr_name) const;
-  template std::complex<float>
-  HDF5Object::attr<std::complex<float>>(const std::string attr_name) const;
-  template std::complex<double>
-  HDF5Object::attr<std::complex<double>>(const std::string attr_name) const;
+  // instantiations of functions
+
+#    include "hdf5.inst"
+
+  // Instantiations for int and unsigned int can be found below. Only
+  // std::vector is provided with instantiations with int and unsigned int.
+  // Instantiations of FullMatrix and Vector are provided with float, double,
+  // std::complex<float> and std::complex<double> in hdf5.inst
+
   template int
   HDF5Object::attr<int>(const std::string attr_name) const;
   template unsigned int
   HDF5Object::attr<unsigned int>(const std::string attr_name) const;
-  // The specialization of HDF5Object::attr<std::string> has been defined above
+  // The specializations of HDF5Object::attr<std::string>
+  // and HDF5Object::attr<bool> have been defined above
 
-  template void
-  HDF5Object::write_attr<float>(const std::string attr_name, float value) const;
-  template void
-  HDF5Object::write_attr<double>(const std::string attr_name,
-                                 double            value) const;
-  template void
-  HDF5Object::write_attr<std::complex<float>>(const std::string   attr_name,
-                                              std::complex<float> value) const;
-  template void
-  HDF5Object::write_attr<std::complex<double>>(
-    const std::string    attr_name,
-    std::complex<double> value) const;
   template void
   HDF5Object::write_attr<int>(const std::string attr_name, int value) const;
   template void
   HDF5Object::write_attr<unsigned int>(const std::string attr_name,
                                        unsigned int      value) const;
 
-  template std::vector<float>
-  DataSet::read<std::vector, float>();
-  template std::vector<double>
-  DataSet::read<std::vector, double>();
-  template std::vector<std::complex<float>>
-  DataSet::read<std::vector, std::complex<float>>();
-  template std::vector<std::complex<double>>
-  DataSet::read<std::vector, std::complex<double>>();
   template std::vector<int>
   DataSet::read<std::vector, int>();
   template std::vector<unsigned int>
   DataSet::read<std::vector, unsigned int>();
-  template FullMatrix<float>
-  DataSet::read<FullMatrix, float>();
-  template FullMatrix<double>
-  DataSet::read<FullMatrix, double>();
-  template FullMatrix<std::complex<float>>
-  DataSet::read<FullMatrix, std::complex<float>>();
-  template FullMatrix<std::complex<double>>
-  DataSet::read<FullMatrix, std::complex<double>>();
-
-  template std::vector<float>
-  DataSet::read_selection<float>(const std::vector<hsize_t> coordinates);
-  template std::vector<double>
-  DataSet::read_selection<double>(const std::vector<hsize_t> coordinates);
-  template std::vector<std::complex<float>>
-  DataSet::read_selection<std::complex<float>>(
-    const std::vector<hsize_t> coordinates);
-  template std::vector<std::complex<double>>
-  DataSet::read_selection<std::complex<double>>(
-    const std::vector<hsize_t> coordinates);
+
   template std::vector<int>
   DataSet::read_selection<int>(const std::vector<hsize_t> coordinates);
   template std::vector<unsigned int>
   DataSet::read_selection<unsigned int>(const std::vector<hsize_t> coordinates);
 
-  template std::vector<float>
-  DataSet::read_hyperslab<std::vector, float>(
-    const std::vector<hsize_t> &offset,
-    const std::vector<hsize_t> &count);
-  template std::vector<double>
-  DataSet::read_hyperslab<std::vector, double>(
-    const std::vector<hsize_t> &offset,
-    const std::vector<hsize_t> &count);
-  template std::vector<std::complex<float>>
-  DataSet::read_hyperslab<std::vector, std::complex<float>>(
-    const std::vector<hsize_t> &offset,
-    const std::vector<hsize_t> &count);
-  template std::vector<std::complex<double>>
-  DataSet::read_hyperslab<std::vector, std::complex<double>>(
-    const std::vector<hsize_t> &offset,
-    const std::vector<hsize_t> &count);
   template std::vector<int>
   DataSet::read_hyperslab<std::vector, int>(const std::vector<hsize_t> &offset,
                                             const std::vector<hsize_t> &count);
@@ -1394,76 +1341,19 @@ namespace HDF5
   DataSet::read_hyperslab<std::vector, unsigned int>(
     const std::vector<hsize_t> &offset,
     const std::vector<hsize_t> &count);
-  template FullMatrix<float>
-  DataSet::read_hyperslab<FullMatrix, float>(const std::vector<hsize_t> &offset,
-                                             const std::vector<hsize_t> &count);
-  template FullMatrix<double>
-  DataSet::read_hyperslab<FullMatrix, double>(
-    const std::vector<hsize_t> &offset,
-    const std::vector<hsize_t> &count);
-  template FullMatrix<std::complex<float>>
-  DataSet::read_hyperslab<FullMatrix, std::complex<float>>(
-    const std::vector<hsize_t> &offset,
-    const std::vector<hsize_t> &count);
-  template FullMatrix<std::complex<double>>
-  DataSet::read_hyperslab<FullMatrix, std::complex<double>>(
-    const std::vector<hsize_t> &offset,
-    const std::vector<hsize_t> &count);
 
-  template void
-  DataSet::read_none<float>();
-  template void
-  DataSet::read_none<double>();
-  template void
-  DataSet::read_none<std::complex<float>>();
-  template void
-  DataSet::read_none<std::complex<double>>();
   template void
   DataSet::read_none<int>();
   template void
   DataSet::read_none<unsigned int>();
 
-  template void
-  DataSet::write<std::vector, float>(const std::vector<float> &data);
-  template void
-  DataSet::write<std::vector, double>(const std::vector<double> &data);
-  template void
-  DataSet::write<std::vector, std::complex<float>>(
-    const std::vector<std::complex<float>> &data);
-  template void
-  DataSet::write<std::vector, std::complex<double>>(
-    const std::vector<std::complex<double>> &data);
   template void
   DataSet::write<std::vector, int>(const std::vector<int> &data);
   template void
   DataSet::write<std::vector, unsigned int>(
     const std::vector<unsigned int> &data);
-  template void
-  DataSet::write<FullMatrix, float>(const FullMatrix<float> &data);
-  template void
-  DataSet::write<FullMatrix, double>(const FullMatrix<double> &data);
-  template void
-  DataSet::write<FullMatrix, std::complex<float>>(
-    const FullMatrix<std::complex<float>> &data);
-  template void
-  DataSet::write<FullMatrix, std::complex<double>>(
-    const FullMatrix<std::complex<double>> &data);
 
   template void
-  DataSet::write_selection<float>(const std::vector<float> & data,
-                                  const std::vector<hsize_t> coordinates);
-  template void
-  DataSet::write_selection<double>(const std::vector<double> &data,
-                                   const std::vector<hsize_t> coordinates);
-  template void
-  DataSet::write_selection<std::complex<float>>(
-    const std::vector<std::complex<float>> &data,
-    const std::vector<hsize_t>              coordinates);
-  template void
-  DataSet::write_selection<std::complex<double>>(
-    const std::vector<std::complex<double>> &data,
-    const std::vector<hsize_t>               coordinates);
-  template void
   DataSet::write_selection<int>(const std::vector<int> &   data,
                                 const std::vector<hsize_t> coordinates);
   template void
@@ -1472,26 +1362,6 @@ namespace HDF5
     const std::vector<hsize_t>       coordinates);
 
   template void
-  DataSet::write_hyperslab<std::vector, float>(
-    const std::vector<float> &  data,
-    const std::vector<hsize_t> &offset,
-    const std::vector<hsize_t> &count);
-  template void
-  DataSet::write_hyperslab<std::vector, double>(
-    const std::vector<double> & data,
-    const std::vector<hsize_t> &offset,
-    const std::vector<hsize_t> &count);
-  template void
-  DataSet::write_hyperslab<std::vector, std::complex<float>>(
-    const std::vector<std::complex<float>> &data,
-    const std::vector<hsize_t> &            offset,
-    const std::vector<hsize_t> &            count);
-  template void
-  DataSet::write_hyperslab<std::vector, std::complex<double>>(
-    const std::vector<std::complex<double>> &data,
-    const std::vector<hsize_t> &             offset,
-    const std::vector<hsize_t> &             count);
-  template void
   DataSet::write_hyperslab<std::vector, int>(const std::vector<int> &    data,
                                              const std::vector<hsize_t> &offset,
                                              const std::vector<hsize_t> &count);
@@ -1500,60 +1370,8 @@ namespace HDF5
     const std::vector<unsigned int> &data,
     const std::vector<hsize_t> &     offset,
     const std::vector<hsize_t> &     count);
-  template void
-  DataSet::write_hyperslab<FullMatrix, float>(
-    const FullMatrix<float> &   data,
-    const std::vector<hsize_t> &offset,
-    const std::vector<hsize_t> &count);
-  template void
-  DataSet::write_hyperslab<FullMatrix, double>(
-    const FullMatrix<double> &  data,
-    const std::vector<hsize_t> &offset,
-    const std::vector<hsize_t> &count);
-  template void
-  DataSet::write_hyperslab<FullMatrix, std::complex<float>>(
-    const FullMatrix<std::complex<float>> &data,
-    const std::vector<hsize_t> &           offset,
-    const std::vector<hsize_t> &           count);
-  template void
-  DataSet::write_hyperslab<FullMatrix, std::complex<double>>(
-    const FullMatrix<std::complex<double>> &data,
-    const std::vector<hsize_t> &            offset,
-    const std::vector<hsize_t> &            count);
 
   template void
-  DataSet::write_hyperslab<std::vector, float>(
-    const std::vector<float> &  data,
-    const std::vector<hsize_t> &data_dimensions,
-    const std::vector<hsize_t> &offset,
-    const std::vector<hsize_t> &stride,
-    const std::vector<hsize_t> &count,
-    const std::vector<hsize_t> &block);
-  template void
-  DataSet::write_hyperslab<std::vector, double>(
-    const std::vector<double> & data,
-    const std::vector<hsize_t> &data_dimensions,
-    const std::vector<hsize_t> &offset,
-    const std::vector<hsize_t> &stride,
-    const std::vector<hsize_t> &count,
-    const std::vector<hsize_t> &block);
-  template void
-  DataSet::write_hyperslab<std::vector, std::complex<float>>(
-    const std::vector<std::complex<float>> &data,
-    const std::vector<hsize_t> &            data_dimensions,
-    const std::vector<hsize_t> &            offset,
-    const std::vector<hsize_t> &            stride,
-    const std::vector<hsize_t> &            count,
-    const std::vector<hsize_t> &            block);
-  template void
-  DataSet::write_hyperslab<std::vector, std::complex<double>>(
-    const std::vector<std::complex<double>> &data,
-    const std::vector<hsize_t> &             data_dimensions,
-    const std::vector<hsize_t> &             offset,
-    const std::vector<hsize_t> &             stride,
-    const std::vector<hsize_t> &             count,
-    const std::vector<hsize_t> &             block);
-  template void
   DataSet::write_hyperslab<std::vector, int>(
     const std::vector<int> &    data,
     const std::vector<hsize_t> &data_dimensions,
@@ -1569,66 +1387,12 @@ namespace HDF5
     const std::vector<hsize_t> &     stride,
     const std::vector<hsize_t> &     count,
     const std::vector<hsize_t> &     block);
-  template void
-  DataSet::write_hyperslab<FullMatrix, float>(
-    const FullMatrix<float> &   data,
-    const std::vector<hsize_t> &data_dimensions,
-    const std::vector<hsize_t> &offset,
-    const std::vector<hsize_t> &stride,
-    const std::vector<hsize_t> &count,
-    const std::vector<hsize_t> &block);
-  template void
-  DataSet::write_hyperslab<FullMatrix, double>(
-    const FullMatrix<double> &  data,
-    const std::vector<hsize_t> &data_dimensions,
-    const std::vector<hsize_t> &offset,
-    const std::vector<hsize_t> &stride,
-    const std::vector<hsize_t> &count,
-    const std::vector<hsize_t> &block);
-  template void
-  DataSet::write_hyperslab<FullMatrix, std::complex<float>>(
-    const FullMatrix<std::complex<float>> &data,
-    const std::vector<hsize_t> &           data_dimensions,
-    const std::vector<hsize_t> &           offset,
-    const std::vector<hsize_t> &           stride,
-    const std::vector<hsize_t> &           count,
-    const std::vector<hsize_t> &           block);
-  template void
-  DataSet::write_hyperslab<FullMatrix, std::complex<double>>(
-    const FullMatrix<std::complex<double>> &data,
-    const std::vector<hsize_t> &            data_dimensions,
-    const std::vector<hsize_t> &            offset,
-    const std::vector<hsize_t> &            stride,
-    const std::vector<hsize_t> &            count,
-    const std::vector<hsize_t> &            block);
 
-  template void
-  DataSet::write_none<float>();
-  template void
-  DataSet::write_none<double>();
-  template void
-  DataSet::write_none<std::complex<float>>();
-  template void
-  DataSet::write_none<std::complex<double>>();
   template void
   DataSet::write_none<int>();
   template void
   DataSet::write_none<unsigned int>();
 
-  template DataSet
-  Group::create_dataset<float>(const std::string          name,
-                               const std::vector<hsize_t> dimensions) const;
-  template DataSet
-  Group::create_dataset<double>(const std::string          name,
-                                const std::vector<hsize_t> dimensions) const;
-  template DataSet
-  Group::create_dataset<std::complex<float>>(
-    const std::string          name,
-    const std::vector<hsize_t> dimensions) const;
-  template DataSet
-  Group::create_dataset<std::complex<double>>(
-    const std::string          name,
-    const std::vector<hsize_t> dimensions) const;
   template DataSet
   Group::create_dataset<int>(const std::string          name,
                              const std::vector<hsize_t> dimensions) const;
@@ -1638,35 +1402,12 @@ namespace HDF5
     const std::vector<hsize_t> dimensions) const;
 
   template void
-  Group::write_dataset(const std::string         name,
-                       const std::vector<float> &data) const;
-  template void
-  Group::write_dataset(const std::string          name,
-                       const std::vector<double> &data) const;
-  template void
-  Group::write_dataset(const std::string                       name,
-                       const std::vector<std::complex<float>> &data) const;
-  template void
-  Group::write_dataset(const std::string                        name,
-                       const std::vector<std::complex<double>> &data) const;
-  template void
   Group::write_dataset(const std::string       name,
                        const std::vector<int> &data) const;
   template void
   Group::write_dataset(const std::string                name,
                        const std::vector<unsigned int> &data) const;
-  template void
-  Group::write_dataset(const std::string        name,
-                       const FullMatrix<float> &data) const;
-  template void
-  Group::write_dataset(const std::string         name,
-                       const FullMatrix<double> &data) const;
-  template void
-  Group::write_dataset(const std::string                      name,
-                       const FullMatrix<std::complex<float>> &data) const;
-  template void
-  Group::write_dataset(const std::string                       name,
-                       const FullMatrix<std::complex<double>> &data) const;
+
 #  endif // DOXYGEN
 
 } // namespace HDF5
diff --git a/source/base/hdf5.inst.in b/source/base/hdf5.inst.in
new file mode 100644 (file)
index 0000000..83cb2f5
--- /dev/null
@@ -0,0 +1,81 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2016 - 2018 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+
+for (number : REAL_AND_COMPLEX_SCALARS)
+  {
+    template number HDF5Object::attr<number>(const std::string attr_name) const;
+    template void   HDF5Object::write_attr<number>(const std::string attr_name,
+                                                 number            value) const;
+
+    template std::vector<number> DataSet::read<std::vector, number>();
+    template FullMatrix<number>  DataSet::read<FullMatrix, number>();
+
+    template std::vector<number> DataSet::read_selection<number>(
+      const std::vector<hsize_t> coordinates);
+
+    template std::vector<number> DataSet::read_hyperslab<std::vector, number>(
+      const std::vector<hsize_t> &offset, const std::vector<hsize_t> &count);
+
+    template FullMatrix<number> DataSet::read_hyperslab<FullMatrix, number>(
+      const std::vector<hsize_t> &offset, const std::vector<hsize_t> &count);
+
+    template void DataSet::read_none<number>();
+
+    template void DataSet::write<std::vector, number>(
+      const std::vector<number> &data);
+
+    template void DataSet::write<FullMatrix, number>(
+      const FullMatrix<number> &data);
+
+    template void DataSet::write_selection<number>(
+      const std::vector<number> &data, const std::vector<hsize_t> coordinates);
+    template void DataSet::write_hyperslab<std::vector, number>(
+      const std::vector<number> & data,
+      const std::vector<hsize_t> &offset,
+      const std::vector<hsize_t> &count);
+
+    template void DataSet::write_hyperslab<FullMatrix, number>(
+      const FullMatrix<number> &  data,
+      const std::vector<hsize_t> &offset,
+      const std::vector<hsize_t> &count);
+
+    template void DataSet::write_hyperslab<std::vector, number>(
+      const std::vector<number> & data,
+      const std::vector<hsize_t> &data_dimensions,
+      const std::vector<hsize_t> &offset,
+      const std::vector<hsize_t> &stride,
+      const std::vector<hsize_t> &count,
+      const std::vector<hsize_t> &block);
+
+    template void DataSet::write_hyperslab<FullMatrix, number>(
+      const FullMatrix<number> &  data,
+      const std::vector<hsize_t> &data_dimensions,
+      const std::vector<hsize_t> &offset,
+      const std::vector<hsize_t> &stride,
+      const std::vector<hsize_t> &count,
+      const std::vector<hsize_t> &block);
+
+    template void DataSet::write_none<number>();
+
+    template DataSet Group::create_dataset<number>(
+      const std::string name, const std::vector<hsize_t> dimensions) const;
+
+    template void Group::write_dataset(const std::string          name,
+                                       const std::vector<number> &data) const;
+
+    template void Group::write_dataset(const std::string         name,
+                                       const FullMatrix<number> &data) const;
+  }
\ No newline at end of file

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.