diff options
Diffstat (limited to 'src/FlatBoundary.c')
-rw-r--r-- | src/FlatBoundary.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/FlatBoundary.c b/src/FlatBoundary.c index 8d18023..7d09cf1 100644 --- a/src/FlatBoundary.c +++ b/src/FlatBoundary.c @@ -789,7 +789,7 @@ void CCTK_FCALL CCTK_FNAME (BndFlatVN) #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 FLAT_BOUNDARY @@ -836,8 +836,8 @@ void CCTK_FCALL CCTK_FNAME (BndFlatVN) { \ int _index_to, _index_from; \ \ - _index_to = INDEX_3D (lsh, ii_to, jj_to, kk_to) * vtypesize; \ - _index_from = INDEX_3D (lsh, ii_from, jj_from, kk_from) * vtypesize;\ + _index_to = INDEX_3D (ash, ii_to, jj_to, kk_to) * vtypesize; \ + _index_from = INDEX_3D (ash, ii_from, jj_from, kk_from) * vtypesize;\ memcpy ((char *) GH->data[var][timelvl] + _index_to, \ (char *) GH->data[var][timelvl] + _index_from, \ vtypesize); \ @@ -922,7 +922,7 @@ static int ApplyBndFlat (const cGH *GH, { int i, j, k; int var, vtypesize, gindex, gdim, timelvl; - 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]; @@ -975,6 +975,7 @@ static int ApplyBndFlat (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; } @@ -1005,6 +1006,7 @@ static int ApplyBndFlat (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]; |