diff options
Diffstat (limited to 'src/CopyBoundary.c')
-rw-r--r-- | src/CopyBoundary.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/CopyBoundary.c b/src/CopyBoundary.c index 171577c..0a46f02 100644 --- a/src/CopyBoundary.c +++ b/src/CopyBoundary.c @@ -959,7 +959,7 @@ void CCTK_FCALL CCTK_FNAME (BndCopyVN) #define MAXDIM 3 /* macro to compute the linear index of a 3D point */ -#define INDEX_3D(lsh, i, j, k) ((i) + (lsh)[0]*((j) + (lsh)[1]*(k))) +#define INDEX_3D(ash, i, j, k) ((i) + (ash)[0]*((j) + (ash)[1]*(k))) /*@@ @routine COPY_BOUNDARY @@ -1000,8 +1000,7 @@ void CCTK_FCALL CCTK_FNAME (BndCopyVN) { \ int _index; \ \ - \ - _index = INDEX_3D (lsh, ii, jj, kk) * vtypesize; \ + _index = INDEX_3D (ash, ii, jj, kk) * vtypesize; \ memcpy ((char *) GH->data[var_to][timelvl_to] + _index, \ (char *) GH->data[var_from][timelvl_from] + _index, \ vtypesize); \ @@ -1094,7 +1093,7 @@ static int ApplyBndCopy (const cGH *GH, int timelvl_to, timelvl_from; int gindex, gdim; int var_to, var_from, vtypesize; - int doBC[2*MAXDIM], lsh[MAXDIM]; + int doBC[2*MAXDIM], ash[MAXDIM], lsh[MAXDIM]; CCTK_INT widths[2*MAXDIM]; CCTK_INT symtable; CCTK_INT symbnd[2*MAXDIM]; @@ -1147,6 +1146,7 @@ static int ApplyBndCopy (const cGH *GH, so that we can use the INDEX_3D macro later on */ for (i = gdim; i < MAXDIM; i++) { + ash[i] = 0; lsh[i] = 0; } @@ -1180,6 +1180,7 @@ static int ApplyBndCopy (const cGH *GH, } for (i = 0; i < gdim; i++) { + ash[i] = GH->cctk_ash[i]; lsh[i] = GH->cctk_lsh[i]; doBC[i*2] &= GH->cctk_lsh[i] > widths[i*2] && GH->cctk_bbox[i*2]; doBC[i*2+1] &= GH->cctk_lsh[i] > widths[i*2+1] && GH->cctk_bbox[i*2+1]; |