Commit f1ddbbf9 authored by gbalduzz's avatar gbalduzz
Browse files

Failing to read the domain-sizes is not fatal.

parent c6897b95
Loading
Loading
Loading
Loading
+19 −14
Original line number Diff line number Diff line
@@ -242,6 +242,7 @@ bool HDF5Reader::execute(const std::string& name, func::function<Scalartype, dom

  H5::DataSet dataset = file_->openDataSet(full_name.c_str());

  try {
    // Read sizes.
    std::vector<hsize_t> dims;
    auto domain_attribute = dataset.openAttribute("domain-sizes");
@@ -257,6 +258,10 @@ bool HDF5Reader::execute(const std::string& name, func::function<Scalartype, dom
      if (dims[i] != f[i])
        throw(std::length_error("The size of domain " + std::to_string(i) + " is different"));
    }
  }
  catch (H5::Exception& err) {
    std::cerr << "Could not perform a size check on the function  " << name << std::endl;
  }

  read(full_name, HDF5_TYPE<Scalartype>::get_PredType(), f.values());