]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Redo some checks to throw ExcIO.
authorDavid Wells <wellsd2@rpi.edu>
Wed, 8 Mar 2017 01:10:27 +0000 (20:10 -0500)
committerDavid Wells <wellsd2@rpi.edu>
Wed, 8 Mar 2017 01:10:27 +0000 (20:10 -0500)
include/deal.II/lac/swappable_vector.h
include/deal.II/lac/swappable_vector.templates.h
source/grid/grid_in.cc

index b94a271dc143caedbfd957d9e7bf95aabae4feb0..f81e5add9aa00b00d474e20be9c74e8dbb0ca4b4 100644 (file)
@@ -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 ();
 
index 230ef2fa0cd7299dafbb57e9af9cd2e936f20074..cd3c1e3eab1f23f3d74657e8b8bd02d49e0ea23e 100644 (file)
@@ -224,7 +224,7 @@ void SwappableVector<number>::kill_file ()
     {
       int status = std::remove (filename.c_str());
       (void)status;
-      Assert (status == 0, ExcInternalError());
+      AssertThrow (status == 0, ExcIO());
 
       filename = "";
     };
index c435304ada46c94c4a7937cdf483132008695d56..05566995d412b3b04edf38cb53421653fdea0191 100644 (file)
@@ -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<vertex_indices.size(); ++i)
-    Assert(vertex_indices[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<vertex_indices.size(); ++i)
-    Assert(vertex_indices[i]>=0, ExcInternalError());
+    AssertThrow(vertex_indices[i]>=0, ExcIO());
 
   if (output)
     {

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.