diff options
author | rhaas <rhaas@9a8dfbc3-8997-403f-b745-98a780c092cc> | 2012-01-26 17:05:05 +0000 |
---|---|---|
committer | rhaas <rhaas@9a8dfbc3-8997-403f-b745-98a780c092cc> | 2012-01-26 17:05:05 +0000 |
commit | 60fbc3af7df852c95188b1c1bacc6b3d6f9e92ea (patch) | |
tree | 6eafeed3368414900e6722bd86a6593338251735 | |
parent | 1868a0bbd2157744830bec00bc3bee79a88804b0 (diff) |
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinInitialData/Meudon_Mag_NS/trunk@15 9a8dfbc3-8997-403f-b745-98a780c092cc
-rw-r--r-- | src/Mag_NS.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Mag_NS.cc b/src/Mag_NS.cc index 8b578a4..7c1cf61 100644 --- a/src/Mag_NS.cc +++ b/src/Mag_NS.cc @@ -1,6 +1,7 @@ #include <cassert> #include <cstdio> #include <vector> +#include <ios> #include <cctk.h> #include <cctk_Arguments.h> @@ -69,6 +70,7 @@ void ID_Mag_NS_initialise (CCTK_ARGUMENTS) 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 @@ void ID_Mag_NS_initialise (CCTK_ARGUMENTS) 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()); + } } |