aboutsummaryrefslogtreecommitdiff
path: root/src/ScalarBoundary.c
diff options
context:
space:
mode:
authoreschnett <eschnett@6a38eb6e-646e-4a02-a296-d141613ad6c4>2013-03-19 02:54:09 +0000
committereschnett <eschnett@6a38eb6e-646e-4a02-a296-d141613ad6c4>2013-03-19 02:54:09 +0000
commit932074d09d9bb230869f4b4246f1cd2933f7c433 (patch)
treeeba1ca57a7a7ec12f1b688d77dcebc168af1934f /src/ScalarBoundary.c
parentc6844f3f2026a0bc60046322b8849e4523b2e816 (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/ScalarBoundary.c')
-rw-r--r--src/ScalarBoundary.c8
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];