[Commits] [svn:einsteintoolkit] Meudon_Bin_BH/trunk/src/ (Rev. 13)

roland.haas at physics.gatech.edu roland.haas at physics.gatech.edu
Thu Jan 26 11:04:26 CST 2012


User: rhaas
Date: 2012/01/26 11:04 AM

Modified:
 /trunk/src/
  Bin_BH.cc

Log:
 catch ios::failure exception from Bin_NS and transfer to CCTK_Warn

File Changes:

Directory: /trunk/src/
======================

File [modified]: Bin_BH.cc
Delta lines: +6 -0
===================================================================
--- trunk/src/Bin_BH.cc	2011-10-25 18:45:20 UTC (rev 12)
+++ trunk/src/Bin_BH.cc	2012-01-26 17:04:26 UTC (rev 13)
@@ -2,6 +2,7 @@
 #include <cmath>
 #include <cstdio>
 #include <vector>
+#include <ios>
 
 #include <cctk.h>
 #include <cctk_Arguments.h>
@@ -63,6 +64,7 @@
   
   CCTK_VInfo (CCTK_THORNSTRING, "Reading from file \"%s\"", filename);
   
+  try {
   Bin_BH bin_bh (npoints, &xx[0], &yy[0], &zz[0], 1, filename);
   
   CCTK_VInfo (CCTK_THORNSTRING, "Omega [1/a]: %g", bin_bh.omega);
@@ -165,4 +167,8 @@
   
   
   CCTK_INFO ("Done.");
+  } catch (ios::failure e) {
+    CCTK_VWarn (CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING,
+                "Could not read initial data from file '%s': %s", filename, e.what());
+  }
 }



More information about the Commits mailing list