[Commits] [svn:einsteintoolkit] Meudon_Bin_NS/trunk/src/ (Rev. 15)
roland.haas at physics.gatech.edu
roland.haas at physics.gatech.edu
Thu Jan 26 11:03:48 CST 2012
User: rhaas
Date: 2012/01/26 11:03 AM
Modified:
/trunk/src/
Bin_NS.cc
Log:
catch ios::failure exception from Bin_NS and transfer to CCTK_Warn
File Changes:
Directory: /trunk/src/
======================
File [modified]: Bin_NS.cc
Delta lines: +6 -0
===================================================================
--- trunk/src/Bin_NS.cc 2011-10-25 18:45:21 UTC (rev 14)
+++ trunk/src/Bin_NS.cc 2012-01-26 17:03:48 UTC (rev 15)
@@ -4,6 +4,7 @@
#include <cstdio>
#include <cassert>
#include <vector>
+#include <ios>
#include <cctk.h>
#include <cctk_Arguments.h>
@@ -80,6 +81,7 @@
CCTK_VInfo (CCTK_THORNSTRING, "Reading from file \"%s\"", filename);
+ try {
Bin_NS bin_ns (npoints, &xx[0], &yy[0], &zz[0], filename);
CCTK_VInfo (CCTK_THORNSTRING, "omega [rad/s]: %g", bin_ns.omega);
@@ -196,5 +198,9 @@
}
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