diff options
author | schnetter <schnetter@20f44201-0f4f-0410-9130-e5fc2714a787> | 2007-03-01 00:01:01 +0000 |
---|---|---|
committer | schnetter <schnetter@20f44201-0f4f-0410-9130-e5fc2714a787> | 2007-03-01 00:01:01 +0000 |
commit | 655126e98267998083de5d436930af235ef79485 (patch) | |
tree | c8ddaf69a322c64eaea763c5d06f850144429cd1 | |
parent | 88e31e9d6a89ebeef3ce4426452d8c341f4b648c (diff) |
Make option RotatingSymmetry90::poison_boundaries work, which can be
used to ensure that this symmetry condition does not omit grid points.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/RotatingSymmetry180/trunk@41 20f44201-0f4f-0410-9130-e5fc2714a787
-rw-r--r-- | src/rotatingsymmetry180.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/src/rotatingsymmetry180.c b/src/rotatingsymmetry180.c index dcfde4b..2779e7a 100644 --- a/src/rotatingsymmetry180.c +++ b/src/rotatingsymmetry180.c @@ -380,14 +380,10 @@ int BndRot180VI (cGH const * restrict const cctkGH, int imin[3], imax[3]; int i, j, k; for (d=0; d<3; ++d) { - assert (0); /* xferinfo has not yet been allocated */ - imin[d] = xferinfo[d].dst.off; - imax[d] = xferinfo[d].dst.off + xferinfo[d].dst.len; - imin[d] -= cctk_lbnd[d]; - imax[d] -= cctk_lbnd[d]; - if (imin[d] < 0) imin[d] = 0; - if (imax[d] >= cctk_lsh[d]) imax[d] = cctk_lsh[d]; + imin[d] = 0; + imax[d] = cctk_lsh[d]; } + imax[dir] = cctk_nghostzones[dir]; var = 0; @@ -401,7 +397,7 @@ int BndRot180VI (cGH const * restrict const cctkGH, for (j=imin[1]; j<imax[1]; ++j) { for (i=imin[2]; i<imax[0]; ++i) { const int ind = CCTK_GFINDEX3D(cctkGH, i, j, k); - ((CCTK_REAL *) varptrs[var]) [ind] = poison_value; + ((CCTK_REAL * restrict) varptrs[var]) [ind] = poison_value; } } } @@ -471,13 +467,10 @@ int BndRot180VI (cGH const * restrict const cctkGH, int imin[3], imax[3]; int i, j, k; for (d=0; d<3; ++d) { - imin[d] = xferinfo[d].dst.off; - imax[d] = xferinfo[d].dst.off + xferinfo[d].dst.len; - imin[d] -= cctk_lbnd[d]; - imax[d] -= cctk_lbnd[d]; - if (imin[d] < 0) imin[d] = 0; - if (imax[d] >= cctk_lsh[d]) imax[d] = cctk_lsh[d]; + imin[d] = 0; + imax[d] = cctk_lsh[d]; } + imax[dir] = cctk_nghostzones[dir]; var = 0; @@ -491,8 +484,11 @@ int BndRot180VI (cGH const * restrict const cctkGH, for (j=imin[1]; j<imax[1]; ++j) { for (i=imin[2]; i<imax[0]; ++i) { const int ind = CCTK_GFINDEX3D(cctkGH, i, j, k); - CCTK_REAL const val = ((CCTK_REAL const *) varptrs[var]) [ind]; - assert (val != poison_value); + CCTK_REAL const val = + ((CCTK_REAL const * restrict) varptrs[var]) [ind]; + if (val == poison_value) { + CCTK_WARN (CCTK_WARN_ABORT, "Poison found in symmetry regions -- there is an error in this thorn"); + } } } } @@ -531,7 +527,7 @@ int BndRot180VI (cGH const * restrict const cctkGH, for (j=imin[1]; j<imax[1]; ++j) { for (i=imin[2]; i<imax[0]; ++i) { const int ind = CCTK_GFINDEX3D(cctkGH, i, j, k); - ((CCTK_INT *) varptrs[var]) [ind] *= -1; + ((CCTK_INT * restrict) varptrs[var]) [ind] *= -1; } } } @@ -541,7 +537,7 @@ int BndRot180VI (cGH const * restrict const cctkGH, for (j=imin[1]; j<imax[1]; ++j) { for (i=imin[2]; i<imax[0]; ++i) { const int ind = CCTK_GFINDEX3D(cctkGH, i, j, k); - ((CCTK_REAL *) varptrs[var]) [ind] *= -1; + ((CCTK_REAL * restrict) varptrs[var]) [ind] *= -1; } } } @@ -554,7 +550,7 @@ int BndRot180VI (cGH const * restrict const cctkGH, for (i=imin[2]; i<imax[0]; ++i) { const int ind = CCTK_GFINDEX3D(cctkGH, i, j, k); CCTK_COMPLEX * restrict const ptr = - & ((CCTK_COMPLEX *) varptrs[var]) [ind]; + & ((CCTK_COMPLEX * restrict) varptrs[var]) [ind]; * ptr = CCTK_CmplxSub (czero, * ptr); } } |