From bb2c73195c19312597c7b7620646f653a63f263f Mon Sep 17 00:00:00 2001 From: schnetter Date: Sun, 2 Mar 2003 13:16:04 +0000 Subject: Choose the correct destination regions. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/Slab/trunk@17 2e825fa2-fb71-486d-8b7f-a5ff3f0f6cb8 --- src/slab.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 69 insertions(+), 9 deletions(-) diff --git a/src/slab.c b/src/slab.c index ee45b77..5a4f8c4 100644 --- a/src/slab.c +++ b/src/slab.c @@ -40,6 +40,10 @@ CCTK_FILEVERSION(TAT_Slab_slab_c); /* Perform expensive self-checks? */ #undef CHECK +/* Byte value for poison checks: use 255 for nan, or e.g. 113 for a + large value */ +#define POISON_VALUE 254 + #ifdef DEBUG @@ -613,10 +617,59 @@ int Slab_Transfer (cGH * restrict const cctkGH, struct bbox const fake_bbox = { 0, 1, 1 }; struct arrays const fake_arrays = { fake_bbox, fake_bbox, fake_bbox, fake_bbox }; + + bbox_check (&fake_bbox); + info[d].src = fake_arrays; + assert (bbox_iscontained (&info[d].src.active, &info[d].src.local)); + assert (bbox_iscontained (&info[d].src.local, &info[d].src.global)); + info[d].dst = fake_arrays; + assert (bbox_iscontained (&info[d].dst.active, &info[d].dst.local)); + assert (bbox_iscontained (&info[d].dst.local, &info[d].dst.global)); + info[d].xpose = d; + assert (info[d].xpose >= 0 && info[d].xpose < SLAB_MAXDIM); info[d].flip = 0; + assert (info[d].flip == 0 || info[d].flip == 1); + } + + ifcheck { + ifdebug printf ("srcinfo:\n"); + for (d=0; d 0) assert (srcptr); if (dstlentot > 0) assert (dstptr); @@ -702,6 +756,8 @@ int Slab_Transfer (cGH * restrict const cctkGH, (allinfo[n*SLAB_MAXDIM+d].src.active.str == info[d].src.active.str); assert (allinfo[n*SLAB_MAXDIM+d].dst.active.str == info[d].dst.active.str); + /* 2003-03-01 schnetter: I don't know why the following two + should be necessary */ assert (allinfo[n*SLAB_MAXDIM+d].src.slab.str == info[d].src.slab.str); assert @@ -719,7 +775,7 @@ int Slab_Transfer (cGH * restrict const cctkGH, ifdebug printf ("srcdetail n=%d:\n", n); for (d=0; d