From 8b82d67c170b5a7497acfa7a5d627a6099f84b43 Mon Sep 17 00:00:00 2001 From: David Wells Date: Tue, 7 Mar 2017 20:10:27 -0500 Subject: [PATCH] Redo some checks to throw ExcIO. --- include/deal.II/lac/swappable_vector.h | 5 ++++- include/deal.II/lac/swappable_vector.templates.h | 2 +- source/grid/grid_in.cc | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/deal.II/lac/swappable_vector.h b/include/deal.II/lac/swappable_vector.h index b94a271dc1..f81e5add9a 100644 --- a/include/deal.II/lac/swappable_vector.h +++ b/include/deal.II/lac/swappable_vector.h @@ -128,11 +128,14 @@ public: /** * Remove the file to which the data has been stored the last time. After * this, the object does not own any file any more, so of course you can't - * call @p reload no more. + * call @p reload again. * * If this object does not own a file, for example since @p swap_out was not * called, or because @p kill_file has been called previously, then this * function does nothing. + * + * This throws a ExcIO exception if, for any reason, deleting the file + * failed. */ void kill_file (); diff --git a/include/deal.II/lac/swappable_vector.templates.h b/include/deal.II/lac/swappable_vector.templates.h index 230ef2fa0c..cd3c1e3eab 100644 --- a/include/deal.II/lac/swappable_vector.templates.h +++ b/include/deal.II/lac/swappable_vector.templates.h @@ -224,7 +224,7 @@ void SwappableVector::kill_file () { int status = std::remove (filename.c_str()); (void)status; - Assert (status == 0, ExcInternalError()); + AssertThrow (status == 0, ExcIO()); filename = ""; }; diff --git a/source/grid/grid_in.cc b/source/grid/grid_in.cc index c435304ada..05566995d4 100644 --- a/source/grid/grid_in.cc +++ b/source/grid/grid_in.cc @@ -1777,7 +1777,7 @@ void GridIn<2>::read_netcdf (const std::string &filename) vertex_indices_var->get(&*vertex_indices.begin(), n_bquads, vertices_per_quad); for (unsigned int i=0; i=0, ExcInternalError()); + AssertThrow(vertex_indices[i]>=0, ExcIO()); if (output) { @@ -1948,7 +1948,7 @@ void GridIn<3>::read_netcdf (const std::string &filename) vertex_indices_var->get(&*vertex_indices.begin(), n_cells, vertices_per_hex); for (unsigned int i=0; i=0, ExcInternalError()); + AssertThrow(vertex_indices[i]>=0, ExcIO()); if (output) { -- 2.39.5