aboutsummaryrefslogtreecommitdiff
path: root/Carpet/Carpet/src/modes.hh
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2011-01-03 23:04:03 -0500
committerBarry Wardell <barry.wardell@gmail.com>2011-12-14 18:25:53 +0000
commitd707da354918f3003420f26c2c2cc31fe1540913 (patch)
treefd90463042e5b4f1aff3540259c3519dc784d73f /Carpet/Carpet/src/modes.hh
parent33bba04684049f70919c71e3b5ca5efcce2d99bd (diff)
Carpet: Set times of past timelevels correctly
Redesign the way in which the times of the past timelevels are set. If cctk_delta_time changes during initialisation, re-set the times of the past timelevels accordingly.
Diffstat (limited to 'Carpet/Carpet/src/modes.hh')
-rw-r--r--Carpet/Carpet/src/modes.hh33
1 files changed, 33 insertions, 0 deletions
diff --git a/Carpet/Carpet/src/modes.hh b/Carpet/Carpet/src/modes.hh
index 37d3ec646..fe322c7be 100644
--- a/Carpet/Carpet/src/modes.hh
+++ b/Carpet/Carpet/src/modes.hh
@@ -269,6 +269,39 @@ namespace Carpet {
+#if 0
+// TODO: Introduce such maybe-loops for the other loops as well
+
+#define BEGIN_MAYBE_TIMELEVEL_LOOP(cctkGH) \
+ do { \
+ bool timelevel_maybe_loop_ = true; \
+ assert (do_allow_past_timelevels); \
+ int const min_tl = timelevel == -1 ? 0 : timelevel; \
+ int const max_tl = timelevel == -1 ? timelevels : timelevel+1; \
+ int const old_timelevel = timelevel; \
+ bool const old_do_allow_past_timelevels = do_allow_past_timelevels; \
+ do_allow_past_timelevels = timelevel != -1; \
+ for (timelevel = min_tl; timelevel < max_tl; ++ timelevel) { \
+ if (mglevel != -1 and reflevel != -1) { \
+ cctkGH->cctk_time = tt->get_time (mglevel, reflevel, timelevel); \
+ } \
+ {
+#define END_MAYBE_TIMELEVEL_LOOP \
+ } \
+ } \
+ assert (timelevel_maybe_loop_); \
+ timelevel_maybe_loop_ = false; \
+ timelevel = old_timelevel; \
+ if (mglevel != -1 and reflevel != -1) { \
+ int const tl = timelevel == -1 ? 0 : timelevel; \
+ cctkGH->cctk_time = tt->get_time (mglevel, reflevel, tl); \
+ } \
+ do_allow_past_timelevels = old_do_allow_past_timelevels; \
+ } while (false)
+#endif
+
+
+
// Mode escapes
class singlemap_escape {