diff --git a/dune/fufem/hdf5/attributes.hh b/dune/fufem/hdf5/attributes.hh index 93c6462a005229ea576256f2ad5603ae2c9a61b9..bde685019249f6a001a35c8e27b47c458ab80e0f 100644 --- a/dune/fufem/hdf5/attributes.hh +++ b/dune/fufem/hdf5/attributes.hh @@ -22,11 +22,11 @@ public: hid_t attrtype = H5Aget_type(attr); if (H5Tget_class(attrtype) != H5T_STRING) DUNE_THROW(Dune::Exception, - "Only string attributes are supported at this point."); + "Only string attributes are supported"); if (H5Tis_variable_str(attrtype)) DUNE_THROW(Dune::Exception, - "Variable-size attributes are not support at this point."); + "Variable-size attributes are not supported"); hid_t nativetype = H5Tget_native_type(attrtype, H5T_DIR_ASCEND); std::vector<char> buffer(H5Tget_size(attrtype)); diff --git a/dune/fufem/hdf5/file.hh b/dune/fufem/hdf5/file.hh index 42fee1581de47230dd35970f4315e2ddd9ff45de..a6dc21c454beb18534632d2c758e6a42f8b76312 100644 --- a/dune/fufem/hdf5/file.hh +++ b/dune/fufem/hdf5/file.hh @@ -68,7 +68,7 @@ public: file_ = fileExists ? H5Fopen(filename.c_str(), flags, fapl) : H5Fcreate(filename.c_str(), flags, H5P_DEFAULT, fapl); if (file_ < 0) - DUNE_THROW(Dune::Exception, "Unable to open file"); + DUNE_THROW(Dune::Exception, "Unable to open file: " << filename); } void flush() { H5Fflush(file_, H5F_SCOPE_LOCAL); } diff --git a/dune/fufem/hdf5/sequenceio.hh b/dune/fufem/hdf5/sequenceio.hh index 6e7e8fb1a29b90731d73864f92376649773bb82a..f96341fb012c27aa96314b5f36dc27011ee7ee11 100644 --- a/dune/fufem/hdf5/sequenceio.hh +++ b/dune/fufem/hdf5/sequenceio.hh @@ -58,7 +58,7 @@ public: void add(size_t timeStep, std::vector<ctype> const &buffer) { if (buffer.size() != entrySize()) - DUNE_THROW(Dune::Exception, "buffer size incorrect"); + DUNE_THROW(Dune::Exception, "Buffer size incorrect"); auto dims = getExtent(); if (timeStep >= dims[0]) { @@ -73,7 +73,7 @@ public: #if H5_VERSION_GE(1, 10, 0) void append(std::vector<ctype> const &buffer, size_t skip = 0) { if (buffer.size() != entrySize()) - DUNE_THROW(Dune::Exception, "buffer size incorrect"); + DUNE_THROW(Dune::Exception, "Buffer size incorrect"); H5DOappend(dset_, H5P_DEFAULT, skip, 1, TypeTraits<ctype>::getType(), buffer.data()); @@ -89,7 +89,7 @@ public: std::array<T, dimensions> dims; H5Sget_simple_extent_dims(file_space, dims.data(), NULL); if (timeStep >= dims[0]) - DUNE_THROW(Dune::Exception, "Reading non-existant entry."); + DUNE_THROW(Dune::Exception, "Tried to read past final entry"); auto const start = minExtent(timeStep); auto const count = maxExtent(1); @@ -123,16 +123,16 @@ private: hid_t plist = H5Dget_create_plist(dset_); H5D_layout_t layout = H5Pget_layout(plist); if (layout != H5D_CHUNKED) - DUNE_THROW(Dune::Exception, "layout not chunked"); + DUNE_THROW(Dune::Exception, "Layout not chunked"); std::array<T, dimensions> chunk_dims; int const rank = H5Pget_chunk(plist, dimensions, chunk_dims.data()); if (rank != dimensions) - DUNE_THROW(Dune::Exception, "unexpected chunk rank"); + DUNE_THROW(Dune::Exception, "Unexpected chunk rank"); if (!std::equal(capacity_.begin(), capacity_.end(), chunk_dims.begin() + 1)) - DUNE_THROW(Dune::Exception, "unexpected chunk dimensions"); + DUNE_THROW(Dune::Exception, "Unexpected chunk dimensions"); if (chunk_dims[0] != 1) - DUNE_THROW(Dune::Exception, "unexpected chunk length"); + DUNE_THROW(Dune::Exception, "Unexpected chunk length"); H5Pclose(plist); } @@ -143,16 +143,16 @@ private: int const rank = H5Sget_simple_extent_dims(file_space, dims.data(), NULL); if (rank != dimensions) - DUNE_THROW(Dune::Exception, "unexpected dataset rank"); + DUNE_THROW(Dune::Exception, "Unexpected dataset rank"); if (!std::equal(capacity_.begin(), capacity_.end(), dims.begin() + 1)) - DUNE_THROW(Dune::Exception, "unexpected dataset dimensions"); + DUNE_THROW(Dune::Exception, "Unexpected dataset dimensions"); H5Sclose(file_space); } void checkDatatype() { if (!H5Tequal(H5Dget_type(dset_), TypeTraits<ctype>::getType())) - DUNE_THROW(Dune::Exception, "unexpected data type"); + DUNE_THROW(Dune::Exception, "Unexpected data type"); } std::array<T, dimensions> minExtent(T timeSteps) { diff --git a/dune/fufem/hdf5/singletonwriter.hh b/dune/fufem/hdf5/singletonwriter.hh index fcd3571a8b39958932773a1454b5ca5edd7f65c2..c82c6a0405bf4930fe8e015a387e4266e30acd11 100644 --- a/dune/fufem/hdf5/singletonwriter.hh +++ b/dune/fufem/hdf5/singletonwriter.hh @@ -51,7 +51,7 @@ public: void set(std::vector<ctype> const &buffer) { if (buffer.size() != entrySize()) - DUNE_THROW(Dune::Exception, "buffer size incorrect"); + DUNE_THROW(Dune::Exception, "Buffer size incorrect"); hid_t file_space = H5Dget_space(dset_); auto const start = minExtent(); @@ -76,7 +76,7 @@ private: hid_t plist = H5Dget_create_plist(dset_); H5D_layout_t layout = H5Pget_layout(plist); if (layout != H5D_CONTIGUOUS) - DUNE_THROW(Dune::Exception, "layout not contiguous"); + DUNE_THROW(Dune::Exception, "Layout not contiguous"); H5Pclose(plist); } @@ -87,7 +87,7 @@ private: int const rank = H5Sget_simple_extent_dims(file_space, dims.data(), NULL); if (rank != dimensions) - DUNE_THROW(Dune::Exception, "unexpected dataset rank"); + DUNE_THROW(Dune::Exception, "Unexpected dataset rank"); if (capacity_ != dims) DUNE_THROW(Dune::Exception, "unexpected dataset dimensions"); @@ -96,7 +96,7 @@ private: void checkDatatype() { if (!H5Tequal(H5Dget_type(dset_), TypeTraits<ctype>::getType())) - DUNE_THROW(Dune::Exception, "unexpected data type"); + DUNE_THROW(Dune::Exception, "Unexpected data type"); } std::array<T, dimensions> minExtent() { diff --git a/dune/fufem/hdf5/typetraits.hh b/dune/fufem/hdf5/typetraits.hh index 73b9b48f34393f104b7534f41d9a33a2fe1ef686..84328fafc28c71f4094ea2c4a07502e6337dfb93 100644 --- a/dune/fufem/hdf5/typetraits.hh +++ b/dune/fufem/hdf5/typetraits.hh @@ -5,7 +5,7 @@ namespace HDF5 { template <typename ctype> struct TypeTraits { static hid_t getType() { - DUNE_THROW(Dune::Exception, "Not a recognised type."); + DUNE_THROW(Dune::Exception, "Type not recognised"); } };