aboutsummaryrefslogtreecommitdiff
path: root/Carpet/Carpet/src/Storage.cc
diff options
context:
space:
mode:
authorschnetter <>2003-05-08 13:35:00 +0000
committerschnetter <>2003-05-08 13:35:00 +0000
commite639a79b9b9c715bc3213f2ed9fd7b80e509f9b3 (patch)
treeee121ff0ad95d5361cff3fe9d6af698131956010 /Carpet/Carpet/src/Storage.cc
parent53e40a949768a1161b57a8abc6cff5cb29384921 (diff)
Implement a proper separation between global, level, and local mode.
Implement a proper separation between global, level, and local mode. This is a major change that might break things. darcs-hash:20030508133549-07bb3-95ccfb6eb2b64e72353d301afddd8722a92c64a3.gz
Diffstat (limited to 'Carpet/Carpet/src/Storage.cc')
-rw-r--r--Carpet/Carpet/src/Storage.cc29
1 files changed, 23 insertions, 6 deletions
diff --git a/Carpet/Carpet/src/Storage.cc b/Carpet/Carpet/src/Storage.cc
index 322b51b27..50ae6793a 100644
--- a/Carpet/Carpet/src/Storage.cc
+++ b/Carpet/Carpet/src/Storage.cc
@@ -10,7 +10,7 @@
#include "carpet.hh"
extern "C" {
- static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/Storage.cc,v 1.15 2003/05/02 14:20:26 schnetter Exp $";
+ static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/Storage.cc,v 1.16 2003/05/08 15:35:49 schnetter Exp $";
CCTK_FILEVERSION(Carpet_Carpet_Storage_cc);
}
@@ -39,6 +39,9 @@ namespace Carpet {
const int group = CCTK_GroupIndex(groupname);
assert (group>=0 && group<CCTK_NumGroups());
+ // No storage change in local mode
+ assert (! (component!=-1 && CCTK_GroupTypeI(group)==CCTK_GF));
+
if (CCTK_QueryGroupStorageI(cgh, group)) {
// storage was enabled previously
return 1;
@@ -96,10 +99,15 @@ namespace Carpet {
default:
UnsupportedVarType(n);
} // switch
+
+ if (CCTK_GroupTypeI(group) != CCTK_GF) {
+ for (int tl=0; tl<num_tl; ++tl) {
+ cgh->data[n][tl] = ((*arrdata[group].data[var]) (-tl, 0, 0, 0)->storage());
+ }
+ }
+
} // for
- // Reinitialise Cactus variables
- if (component!=-1) set_component (cgh, component);
PoisonGroup (cgh, group, alltimes);
// storage was not enabled previously
@@ -115,6 +123,9 @@ namespace Carpet {
const int group = CCTK_GroupIndex(groupname);
assert (group>=0 && group<CCTK_NumGroups());
+ // No storage change in local mode
+ assert (! (component!=-1 && CCTK_GroupTypeI(group)==CCTK_GF));
+
if (! CCTK_QueryGroupStorageI(cgh, group)) {
// storage was disabled previously
return 0;
@@ -125,6 +136,9 @@ namespace Carpet {
return 1;
const int n0 = CCTK_FirstVarIndexI(group);
+ assert (n0>=0);
+ const int num_tl = CCTK_NumTimeLevelsFromVarI(n0);
+ assert (num_tl>0);
assert (arrdata[group].data.size());
assert (arrdata[group].data[0]);
@@ -141,11 +155,14 @@ namespace Carpet {
UnsupportedVarType(n);
} // switch
arrdata[group].data[var] = 0;
+
+ if (CCTK_GroupTypeI(group) != CCTK_GF) {
+ for (int tl=0; tl<num_tl; ++tl) {
+ cgh->data[n][tl] = 0;
+ }
+ }
} // for
- // Reinitialise Cactus variables
- set_component (cgh, component);
-
// storage was not disabled previously
return 1;
}