diff options
Diffstat (limited to 'src/ScalarBoundary.c')
-rw-r--r-- | src/ScalarBoundary.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ScalarBoundary.c b/src/ScalarBoundary.c index c943367..3fa9703 100644 --- a/src/ScalarBoundary.c +++ b/src/ScalarBoundary.c @@ -870,7 +870,7 @@ void CCTK_FCALL CCTK_FNAME (BndScalarVN) #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))) /* an empty macro */ #define NOTHING @@ -922,7 +922,7 @@ void CCTK_FCALL CCTK_FNAME (BndScalarVN) int _index; \ \ \ - _index = INDEX_3D (lsh, ii, jj, kk); \ + _index = INDEX_3D (ash, ii, jj, kk); \ ((left_cctk_type *) GH->data[var][timelvl])[_index] = \ (right_cctk_type) scalar; \ } \ @@ -1062,7 +1062,7 @@ static int ApplyBndScalar (const cGH *GH, int i, j, k; int gindex, gdim; int var, 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]; @@ -1111,6 +1111,7 @@ static int ApplyBndScalar (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; } @@ -1141,6 +1142,7 @@ static int ApplyBndScalar (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]; |