aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgoodale <goodale@c78560ca-4b45-4335-b268-5f3340f3cb52>2000-02-17 09:02:34 +0000
committergoodale <goodale@c78560ca-4b45-4335-b268-5f3340f3cb52>2000-02-17 09:02:34 +0000
commit6f29655138146a00269de292322f0b02a24147c1 (patch)
tree25ef90aa6c0c8e3ccad5c07a0b356177c88df4f3
parent98520c2a2314ba13253d8054323ab6b4e1eea78c (diff)
Erik's changes to make things timelevel aware.
Tom git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/CartGrid3D/trunk@91 c78560ca-4b45-4335-b268-5f3340f3cb52
-rw-r--r--src/Symmetry.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/Symmetry.c b/src/Symmetry.c
index 21b262b..e833eaf 100644
--- a/src/Symmetry.c
+++ b/src/Symmetry.c
@@ -8,6 +8,7 @@
@enddesc
@@*/
+#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
@@ -56,7 +57,7 @@ void SetCartSymmetry(cGH *GH, int *sym, const char *imp_gf) {
sprintf(message,"Grid function %s has no index",imp_gf);
CCTK_WARN(0,message);
free(message);
- };
+ }
/* Reference the hash table in the GHex and tell it what kind of
symmetry is being applied
@@ -160,6 +161,7 @@ int CartSymBCGroupI(cGH *GH, int groupnum) {
SymmetryGHex *sGHex;
int first,last,index,j;
+ int time;
int doSym[6];
/* Get out if we are sure no symmetries should be applied */
@@ -181,6 +183,14 @@ int CartSymBCGroupI(cGH *GH, int groupnum) {
/*get the index of the first GF in the group and how many Vars there are*/
first = CCTK_FirstVarIndexI(groupnum);
last = first+CCTK_NumVarsInGroupI(groupnum)-1;
+ assert (first>=0 && last>=first);
+
+ /* Use next time level, if present */
+ time = CCTK_NumTimeLevelsFromVarI(first) - 1;
+ if (time < 0)
+ {
+ time = 0;
+ }
/* loop over the variables in the group */
for (index=first; index<=last; index++) {
@@ -218,7 +228,7 @@ int CartSymBCGroupI(cGH *GH, int groupnum) {
FORTRAN_NAME(SymmetryCondition)(
GH->cctk_lsh,
/* xyz-size of PE local grid */
- GH->data[index][0],
+ GH->data[index][time],
/* pointer to start of data array for GF[index]*/
GH->cctk_nghostzones,
/* number of ghost zones */
@@ -248,11 +258,20 @@ int CartSymBCVarI(cGH *GH, int varnum) {
SymmetryGHex *sGHex;
int j;
+ int time;
int doSym[6];
/* Get out if we are sure no symmetries should be applied */
if (CCTK_Equals(domain,"full")) return 0;
+ assert (varnum>=0);
+
+ /* Use next time level, if present */
+ time = CCTK_NumTimeLevelsFromVarI(varnum) - 1;
+ if (time < 0)
+ {
+ time = 0;
+ }
/* Get the pointer to the Symmetry GH extension */
sGHex = (SymmetryGHex*)GH->extensions[CCTK_GHExtensionHandle("Symmetry")];
@@ -292,7 +311,7 @@ int CartSymBCVarI(cGH *GH, int varnum) {
FORTRAN_NAME(SymmetryCondition)(
GH->cctk_lsh,
/* xyz-size of PE local grid */
- GH->data[varnum][0],
+ GH->data[varnum][time],
/* pointer to start of data array for GF[varnum]*/
GH->cctk_nghostzones,
/* number of ghost zones */