]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add get_name()
authorDaniel Garcia-Sanchez <daniel.garcia-sanchez@insp.upmc.fr>
Wed, 21 Nov 2018 19:40:25 +0000 (20:40 +0100)
committerDaniel Garcia-Sanchez <daniel.garcia-sanchez@insp.upmc.fr>
Wed, 9 Jan 2019 18:29:16 +0000 (19:29 +0100)
include/deal.II/base/hdf5.h
source/base/hdf5.cc
tests/base/hdf5_01.cc
tests/base/hdf5_01.with_hdf5=true.with_complex_values=off.output
tests/base/hdf5_01.with_hdf5=true.with_complex_values=on.output
tests/base/hdf5_02.cc
tests/base/hdf5_02.with_hdf5=true.with_complex_values=off.mpirun=1.output
tests/base/hdf5_02.with_hdf5=true.with_complex_values=off.mpirun=4.output
tests/base/hdf5_02.with_hdf5=true.with_complex_values=on.mpirun=1.output
tests/base/hdf5_02.with_hdf5=true.with_complex_values=on.mpirun=4.output

index 5215324273743576c38e3a708042d3f3b7236602..cf3a3b29d0ca5f48951ba68022bf8061eb596858 100644 (file)
@@ -354,10 +354,22 @@ namespace HDF5
     void
     set_attribute(const std::string &attr_name, const T value);
 
+    /**
+     * Returns the #name of the object. In the case of File, #name corresponds
+     * to the file name. In the case of Group and DataSet, #name corresponds to
+     * the name of the object in the HDF5 file.
+     */
+    std::string
+    get_name() const;
 
+  protected:
+    /**
+     * Name of the HDF5Oject. In the case of File, @p name corresponds to the
+     * file name. In the case of Group and DataSet @p name corresponds to the
+     * name of the object in the HDF5 file.
+     */
     const std::string name;
 
-  protected:
     /**
      * HDF5 identifier for the objects File, Group and DataSet. The
      * `std::shared_ptr<>` pointer allows the object to be copied. For example
index 0191383254075bcfa6349063700fb663010a3d00..6e3b2817e59b7f69a3dd2bf34c43a4ec5c3f7270 100644 (file)
@@ -513,6 +513,14 @@ namespace HDF5
 
 
 
+  std::string
+  HDF5Object::get_name() const
+  {
+    return name;
+  }
+
+
+
   DataSet::DataSet(const std::string &name,
                    const hid_t &      parent_group_id,
                    const bool         mpi)
index f1ab88dc97e83f800b70917c618c34c5dac60278..3429929db1c9d1d095647ea3f605feed00867ed4 100644 (file)
@@ -88,6 +88,7 @@ test()
 
     // Read attributes attached to a group
     auto test_group = data_file.open_group("test_group");
+    deallog << "group_name: " << test_group.get_name() << std::endl;
 
 #ifdef DEAL_II_WITH_COMPLEX_VALUES
     auto group_complex_float =
index 520572466ea24d4bfbfe9b2fbd68c1de0e1b0413..be163eeb194fe57b5b21b4e048a1d34a5abf93d4 100644 (file)
@@ -1,6 +1,7 @@
 
 DEAL::root_total calculated:-3.10361e+08
 DEAL::root_total read:-3.10361e+08
+DEAL::group_name: test_group
 DEAL::group_string read:test_string_attribute
 DEAL::dataset_double read:20.2000
 DEAL::dataset_string read:test_dataset_attribute
index 2885b923d3823811c34711400acba853da6ff3f1..593c225d879cc0cb7bc0512b8d3da2d3de294357 100644 (file)
@@ -1,6 +1,7 @@
 
 DEAL::root_total calculated:-3.10361e+08
 DEAL::root_total read:-3.10361e+08
+DEAL::group_name: test_group
 DEAL::group_complex_total calculated:(1.53171e+09,2.85468e+07)
 DEAL::group_complex_total read:(1.53171e+09,2.85468e+07)
 DEAL::group_string read:test_string_attribute
index c5d2618449bc097c0ccc7d35978526f606e8fd11..28afafd9e8701879c64d125b5233088b63d513d4 100644 (file)
@@ -92,6 +92,7 @@ test()
 
     // Read attributes attached to a group
     auto test_group = data_file.open_group("test_group");
+    deallog << "group_name: " << test_group.get_name() << std::endl;
 
 #ifdef DEAL_II_WITH_COMPLEX_VALUES
     auto group_complex_float =
index 520572466ea24d4bfbfe9b2fbd68c1de0e1b0413..be163eeb194fe57b5b21b4e048a1d34a5abf93d4 100644 (file)
@@ -1,6 +1,7 @@
 
 DEAL::root_total calculated:-3.10361e+08
 DEAL::root_total read:-3.10361e+08
+DEAL::group_name: test_group
 DEAL::group_string read:test_string_attribute
 DEAL::dataset_double read:20.2000
 DEAL::dataset_string read:test_dataset_attribute
index 520572466ea24d4bfbfe9b2fbd68c1de0e1b0413..be163eeb194fe57b5b21b4e048a1d34a5abf93d4 100644 (file)
@@ -1,6 +1,7 @@
 
 DEAL::root_total calculated:-3.10361e+08
 DEAL::root_total read:-3.10361e+08
+DEAL::group_name: test_group
 DEAL::group_string read:test_string_attribute
 DEAL::dataset_double read:20.2000
 DEAL::dataset_string read:test_dataset_attribute
index 2885b923d3823811c34711400acba853da6ff3f1..593c225d879cc0cb7bc0512b8d3da2d3de294357 100644 (file)
@@ -1,6 +1,7 @@
 
 DEAL::root_total calculated:-3.10361e+08
 DEAL::root_total read:-3.10361e+08
+DEAL::group_name: test_group
 DEAL::group_complex_total calculated:(1.53171e+09,2.85468e+07)
 DEAL::group_complex_total read:(1.53171e+09,2.85468e+07)
 DEAL::group_string read:test_string_attribute
index 2885b923d3823811c34711400acba853da6ff3f1..593c225d879cc0cb7bc0512b8d3da2d3de294357 100644 (file)
@@ -1,6 +1,7 @@
 
 DEAL::root_total calculated:-3.10361e+08
 DEAL::root_total read:-3.10361e+08
+DEAL::group_name: test_group
 DEAL::group_complex_total calculated:(1.53171e+09,2.85468e+07)
 DEAL::group_complex_total read:(1.53171e+09,2.85468e+07)
 DEAL::group_string read:test_string_attribute

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.