aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetInterp/src
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2006-04-25 15:21:00 +0000
committerErik Schnetter <schnetter@cct.lsu.edu>2006-04-25 15:21:00 +0000
commit022c13aa3b2f902df69174950af3509660b1cbaf (patch)
treee6757e46203e0aa6eef037f1ca2df731cb4de838 /Carpet/CarpetInterp/src
parente3acc837a27e7a8fe0a5cb7d8cb7ddaf5c8a5616 (diff)
CarpetInterp: Emit an error message if there are not enough time levels active
Emit an error message instead of an assertion failure if there are not enough time levels active. darcs-hash:20060425152153-dae7b-20f5040a55b781b4467cd740933cfa8d08abe8d0.gz
Diffstat (limited to 'Carpet/CarpetInterp/src')
-rw-r--r--Carpet/CarpetInterp/src/interp.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/Carpet/CarpetInterp/src/interp.cc b/Carpet/CarpetInterp/src/interp.cc
index 9babd7c89..2bd2cfec6 100644
--- a/Carpet/CarpetInterp/src/interp.cc
+++ b/Carpet/CarpetInterp/src/interp.cc
@@ -1229,6 +1229,18 @@ namespace CarpetInterp {
// Do a dummy interpolation from a later timelevel
// if the desired timelevel does not exist
int const my_tl = tl >= interp_num_tl ? 0 : tl;
+ assert (my_tl < num_tl);
+
+ // Are there enough time levels?
+ int const active_tl = CCTK_ActiveTimeLevelsVI (cctkGH, vi);
+ if (active_tl <= my_tl) {
+ char * const fullname = CCTK_FullName(vi);
+ CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Grid function \"%s\" has only %d active time levels on refinement level %d; this is not enough for time interpolation",
+ fullname, active_tl, reflevel);
+ free (fullname);
+ }
+
#if 0
input_arrays[n] = CCTK_VarDataPtrI (cctkGH, my_tl, vi);
#else