aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetReduce
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@aei.mpg.de>2005-04-28 15:11:00 +0000
committerErik Schnetter <schnetter@aei.mpg.de>2005-04-28 15:11:00 +0000
commit9fb3492e2c0740f4c84a177a73722d91d1f57348 (patch)
treee3f6858dabdb262c1804e8c139f273620c7549b6 /Carpet/CarpetReduce
parent19eeb87cced8bfdaaa2a9293d1d19b2bb6c3e67b (diff)
CapretReduce: Do not crash on grid functions with only one time level
When a grid function has only one time level, emit a level 1 warning instead of aborting with an assertion failure. darcs-hash:20050428151159-891bb-53d3330b499a68f0304e99f86aa176af2ca00ecf.gz
Diffstat (limited to 'Carpet/CarpetReduce')
-rw-r--r--Carpet/CarpetReduce/src/reduce.cc38
1 files changed, 18 insertions, 20 deletions
diff --git a/Carpet/CarpetReduce/src/reduce.cc b/Carpet/CarpetReduce/src/reduce.cc
index eef15d3d1..fa46cba07 100644
--- a/Carpet/CarpetReduce/src/reduce.cc
+++ b/Carpet/CarpetReduce/src/reduce.cc
@@ -967,29 +967,27 @@ namespace CarpetReduce {
// Are there enough time levels?
int const max_tl = CCTK_MaxTimeLevelsVI(vi);
int const active_tl = CCTK_ActiveTimeLevelsVI(cgh, vi);
- if (active_tl < num_tl) {
- if (max_tl == 1) {
- num_tl = 1;
- need_time_interp = false;
- static vector<bool> have_warned;
- if (have_warned.empty()) {
- have_warned.resize (CCTK_NumVars(), false);
- }
- if (! have_warned.at(vi)) {
- char * const fullname = CCTK_FullName(vi);
- CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
- "Grid function \"%s\" has only %d time levels; this is not enough for time interpolation",
- fullname, max_tl);
- free (fullname);
- have_warned.at(vi) = true;
- }
- } else {
+ if (max_tl == 1) {
+ num_tl = 1;
+ need_time_interp = false;
+ static vector<bool> have_warned;
+ if (have_warned.empty()) {
+ have_warned.resize (CCTK_NumVars(), false);
+ }
+ if (! have_warned.at(vi)) {
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);
+ CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Grid function \"%s\" has only %d time levels on refinement level %d; this is not enough for time interpolation",
+ fullname, max_tl, reflevel);
free (fullname);
+ have_warned.at(vi) = true;
}
+ } else if (active_tl < num_tl) {
+ char * const fullname = CCTK_FullName(vi);
+ CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Grid function \"%s\" has only %d active time levels out of %d maximum time levels on refinement level %d; this is not enough for time interpolation",
+ fullname, active_tl, max_tl, reflevel);
+ free (fullname);
}
} else {