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