aboutsummaryrefslogtreecommitdiff
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
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
-rw-r--r--param.ccl4
-rw-r--r--schedule.ccl22
-rw-r--r--src/registersymmetry.c36
-rw-r--r--src/rotatingsymmetry180.c20
4 files changed, 38 insertions, 44 deletions
diff --git a/param.ccl b/param.ccl
index 9af5db6..3a16a52 100644
--- a/param.ccl
+++ b/param.ccl
@@ -8,7 +8,3 @@ BOOLEAN verbose "Produce screen output while applying boundary conditions"
BOOLEAN rotating_symmetry_180 "Apply 180 degree rotating symmetry boundary conditions?"
{
} "no"
-
-BOOLEAN avoid_origin "Avoid the origin?"
-{
-} "no"
diff --git a/schedule.ccl b/schedule.ccl
index 1f341e6..8daa722 100644
--- a/schedule.ccl
+++ b/schedule.ccl
@@ -1,12 +1,16 @@
# Schedule definitions for thorn RotatingSymmetry180
# $Header$
-SCHEDULE Rot180_RegisterSymmetry IN SymmetryRegister
-{
- LANG: C
-} "Register symmetry boundaries"
-
-SCHEDULE Rot180_ApplyBC IN BoundaryConditions
-{
- LANG: C
-} "Apply 180 degree rotational symmetry boundary condition"
+if (rotating_symmetry_180) {
+
+ SCHEDULE Rot180_RegisterSymmetry IN SymmetryRegister
+ {
+ LANG: C
+ } "Register symmetry boundaries"
+
+ SCHEDULE Rot180_ApplyBC IN BoundaryConditions
+ {
+ LANG: C
+ } "Apply 180 degree rotational symmetry boundary condition"
+
+}
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]);