diff options
author | eschnett <eschnett@6a38eb6e-646e-4a02-a296-d141613ad6c4> | 2013-03-19 02:54:09 +0000 |
---|---|---|
committer | eschnett <eschnett@6a38eb6e-646e-4a02-a296-d141613ad6c4> | 2013-03-19 02:54:09 +0000 |
commit | 932074d09d9bb230869f4b4246f1cd2933f7c433 (patch) | |
tree | eba1ca57a7a7ec12f1b688d77dcebc168af1934f /src/FlatBoundary.c | |
parent | c6844f3f2026a0bc60046322b8849e4523b2e816 (diff) |
Use cctk_ash to index grid functions
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Boundary/trunk@313 6a38eb6e-646e-4a02-a296-d141613ad6c4
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]; |