From febdf3f8176e7e5bfb6483482d806cd55398a361 Mon Sep 17 00:00:00 2001 From: schnetter Date: Fri, 9 Apr 2004 11:36:59 +0000 Subject: 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 --- param.ccl | 4 ---- schedule.ccl | 22 +++++++++++++--------- src/registersymmetry.c | 36 ++++++++++++++++-------------------- src/rotatingsymmetry180.c | 20 +++++++++----------- 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=0 && gi