aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschnetter <schnetter@20f44201-0f4f-0410-9130-e5fc2714a787>2004-04-09 11:36:59 +0000
committerschnetter <schnetter@20f44201-0f4f-0410-9130-e5fc2714a787>2004-04-09 11:36:59 +0000
commitfebdf3f8176e7e5bfb6483482d806cd55398a361 (patch)
tree435db7741e707b350bef3955f862747c0c7fdcc6 /src
parent2ae7711961ab0ac3bd9bd374787e305e0cf1f7fd (diff)
Fix bugs, and move conditional into the schedule.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/RotatingSymmetry180/trunk@4 20f44201-0f4f-0410-9130-e5fc2714a787
Diffstat (limited to 'src')
-rw-r--r--src/registersymmetry.c36
-rw-r--r--src/rotatingsymmetry180.c20
2 files changed, 25 insertions, 31 deletions
diff --git a/src/registersymmetry.c b/src/registersymmetry.c
index 2916efd..50a286c 100644
--- a/src/registersymmetry.c
+++ b/src/registersymmetry.c
@@ -15,25 +15,21 @@ void Rot180_RegisterSymmetry (CCTK_ARGUMENTS)
CCTK_INT width[6];
CCTK_INT ierr;
- if (rotating_symmetry_180) {
-
- for (f=0; f<6; ++f) {
- faces[f] = 0;
- width[f] = 0;
- }
-
- faces[0] = 1;
- width[0] = cctk_nghostzones[0];
-
- handle = SymmetryRegister ("rotating_symmetry_180");
- if (handle < 0) {
- CCTK_WARN (0, "Could not register symmetry boundary condition");
- }
-
- ierr = SymmetryRegisterGrid (cctkGH, handle, faces, width);
- if (ierr < 0) {
- CCTK_WARN (0, "Could not register the symmetry boundaries -- probably some other thorn has already registered the same boundary faces for a different symmetry");
- }
-
+ for (f=0; f<6; ++f) {
+ faces[f] = 0;
+ width[f] = 0;
+ }
+
+ faces[0] = 1;
+ width[0] = cctk_nghostzones[0];
+
+ handle = SymmetryRegister ("rotating_symmetry_180");
+ if (handle < 0) {
+ CCTK_WARN (0, "Could not register symmetry boundary condition");
+ }
+
+ ierr = SymmetryRegisterGrid (cctkGH, handle, faces, width);
+ if (ierr < 0) {
+ CCTK_WARN (0, "Could not register the symmetry boundaries -- probably some other thorn has already registered the same boundary faces for a different symmetry");
}
}
diff --git a/src/rotatingsymmetry180.c b/src/rotatingsymmetry180.c
index ebff1db..d5143ea 100644
--- a/src/rotatingsymmetry180.c
+++ b/src/rotatingsymmetry180.c
@@ -42,7 +42,7 @@ int BndRot180VI (cGH const * restrict const cctkGH,
struct xferinfo * restrict xferinfo;
- int dirs[2];
+ int alldirs[2];
int dir; /* direction of the symmetry face */
int otherdir; /* the other direction of the rotation */
int q;
@@ -54,8 +54,6 @@ int BndRot180VI (cGH const * restrict const cctkGH,
assert (stencil);
assert (vi>=0 && vi<CCTK_NumVars());
- if (! rotating_symmetry_180) return;
-
if (verbose) {
fullname = CCTK_FullName(vi);
assert (fullname);
@@ -65,11 +63,6 @@ int BndRot180VI (cGH const * restrict const cctkGH,
free (fullname);
}
- for (d=0; d<group.dim; ++d) {
- x0[d] = CCTK_ORIGIN_SPACE(d);
- dx[d] = CCTK_DELTA_SPACE(d);
- }
-
/* Get and check group info */
gi = CCTK_GroupIndexFromVarI (vi);
assert (gi>=0 && gi<CCTK_NumGroups());
@@ -86,6 +79,11 @@ int BndRot180VI (cGH const * restrict const cctkGH,
varptr = CCTK_VarDataPtrI (cctkGH, 0, vi);
assert (varptr);
+ for (d=0; d<group.dim; ++d) {
+ x0[d] = CCTK_ORIGIN_SPACE(d);
+ dx[d] = CCTK_DELTA_SPACE(d);
+ }
+
/* find parity */
{
char tensortypealias[100];
@@ -190,12 +188,12 @@ int BndRot180VI (cGH const * restrict const cctkGH,
}
/* directions */
- dirs[0] = 0;
- dirs[1] = 1;
+ alldirs[0] = 0;
+ alldirs[1] = 1;
/* Find grid point that corresponds to the origin */
for (q=0; q<2; ++q) {
- d = dirs[q];
+ d = alldirs[q];
/* x0 + dx * origin == 0 */
origin[d] = - x0[d] / dx[d];
dorigin[d] = origin[d] - floor(origin[d]);