From 022c13aa3b2f902df69174950af3509660b1cbaf Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Tue, 25 Apr 2006 15:21:00 +0000 Subject: 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 --- Carpet/CarpetInterp/src/interp.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Carpet/CarpetInterp/src') 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 -- cgit v1.2.3