aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Carpet/Carpet/src/Cycle.cc52
1 files changed, 51 insertions, 1 deletions
diff --git a/Carpet/Carpet/src/Cycle.cc b/Carpet/Carpet/src/Cycle.cc
index dcece6f13..ab11e4481 100644
--- a/Carpet/Carpet/src/Cycle.cc
+++ b/Carpet/Carpet/src/Cycle.cc
@@ -8,7 +8,7 @@
#include "carpet.hh"
-static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/Cycle.cc,v 1.8 2002/06/06 21:04:56 schnetter Exp $";
+static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/Cycle.cc,v 1.9 2002/07/18 14:30:44 shawley Exp $";
CCTK_FILEVERSION(Carpet_Cycle_cc)
@@ -63,5 +63,55 @@ namespace Carpet {
}
}
}
+
+
+ void FlipTimeLevelsOnCoarser (const cGH* cgh, const int cur_rl)
+ {
+ Checkpoint ("%*sFlipTimeLevels", 2*reflevel, "");
+
+ for (int group=0; group<CCTK_NumGroups(); ++group) {
+ if (CCTK_GroupTypeI(group) == CCTK_GF
+ && CCTK_QueryGroupStorageI(cgh, group)) {
+ for (int var=0; var<CCTK_NumVarsInGroupI(group); ++var) {
+
+ assert (group<(int)arrdata.size());
+ assert (var<(int)arrdata[group].data.size());
+ for (int rl=0; rl<arrdata[group].hh->reflevels(); ++rl) {
+ if (rl <= cur_rl) {
+ for (int c=0; c<arrdata[group].hh->components(rl); ++c) {
+ arrdata[group].data[var]->flip (rl, c, mglevel);
+ }
+ }
+ }
+
+ }
+ }
+ }
+ }
+
+ void CopyCurrToPrevTimeLevels (const cGH* cgh, const int cur_rl)
+ {
+ Checkpoint ("%*sFlipTimeLevels", 2*reflevel, "");
+
+ for (int group=0; group<CCTK_NumGroups(); ++group) {
+ if (CCTK_GroupTypeI(group) == CCTK_GF
+ && CCTK_QueryGroupStorageI(cgh, group)) {
+ for (int var=0; var<CCTK_NumVarsInGroupI(group); ++var) {
+
+ assert (group<(int)arrdata.size());
+ assert (var<(int)arrdata[group].data.size());
+ for (int rl=0; rl<arrdata[group].hh->reflevels(); ++rl) {
+ for (int c=0; c<arrdata[group].hh->components(rl); ++c) {
+ arrdata[group].data[var]->copytoprevs (rl, c, mglevel);
+ }
+ }
+
+ }
+ }
+ }
+ }
+
+
+
} // namespace Carpet