aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreschnett <eschnett@6a38eb6e-646e-4a02-a296-d141613ad6c4>2012-07-04 01:28:00 +0000
committereschnett <eschnett@6a38eb6e-646e-4a02-a296-d141613ad6c4>2012-07-04 01:28:00 +0000
commit049f6d5c2f70977702964b929c971befe25a32e2 (patch)
tree7201c1e7cc523f456381b8ee40b375cee0c07d9c
parent485f1ede87f931586a1570e91087ef6e67fa87f2 (diff)
Introduce cctk_ash, retire cctk_lssh
Introduce cctk_ash, describing the process-local array shape that has been allocated. This may be larger than cctk_lsh, the process-local shape that should be used. Retire cctk_lssh and related infrastructure to handle staggered grid functions. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Boundary/trunk@309 6a38eb6e-646e-4a02-a296-d141613ad6c4
-rw-r--r--doc/documentation.tex2
-rw-r--r--src/CopyBoundary.c21
-rw-r--r--src/FlatBoundary.c21
-rw-r--r--src/ScalarBoundary.c27
-rw-r--r--src/StaticBoundary.c21
5 files changed, 36 insertions, 56 deletions
diff --git a/doc/documentation.tex b/doc/documentation.tex
index 559fce1..4fade96 100644
--- a/doc/documentation.tex
+++ b/doc/documentation.tex
@@ -358,7 +358,7 @@ boundary conditions, which you would like to use instead.
Note that the number of boundary zones, as expressed in the
\texttt{boundary\_width} argument or the \texttt{BOUNDARY\_WIDTH}
array, is taken from the total number of grid points presented by
-Cactus through \texttt{cctk\_lssh}, etc.
+Cactus through \texttt{cctk\_lsh}, etc.
%In this sense they do not
%somehow `lie outside the grid', as `external ghostzones'.
diff --git a/src/CopyBoundary.c b/src/CopyBoundary.c
index 1f285fb..171577c 100644
--- a/src/CopyBoundary.c
+++ b/src/CopyBoundary.c
@@ -1094,7 +1094,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], dstag[MAXDIM], lsh[MAXDIM], lssh[MAXDIM];
+ int doBC[2*MAXDIM], lsh[MAXDIM];
CCTK_INT widths[2*MAXDIM];
CCTK_INT symtable;
CCTK_INT symbnd[2*MAXDIM];
@@ -1147,13 +1147,9 @@ static int ApplyBndCopy (const cGH *GH,
so that we can use the INDEX_3D macro later on */
for (i = gdim; i < MAXDIM; i++)
{
- lssh[i] = 1;
- lsh[i] = 0;
+ lsh[i] = 0;
}
- /* get the directional staggering of the group */
- CCTK_GroupStaggerDirArrayGI (dstag, gdim, gindex);
-
/* get the current timelevel */
timelvl_to = 0;
timelvl_from = 0;
@@ -1185,7 +1181,6 @@ static int ApplyBndCopy (const cGH *GH,
for (i = 0; i < gdim; i++)
{
lsh[i] = GH->cctk_lsh[i];
- lssh[i] = GH->cctk_lssh[CCTK_LSSH_IDX (dstag[i], 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];
if (dir != 0)
@@ -1199,23 +1194,23 @@ static int ApplyBndCopy (const cGH *GH,
if (gdim > 0)
{
/* lower x */
- COPY_BOUNDARY (doBC[0], widths[0], lssh[1], lssh[2], i, j, k);
+ COPY_BOUNDARY (doBC[0], widths[0], lsh[1], lsh[2], i, j, k);
/* upper x */
- COPY_BOUNDARY (doBC[1], widths[1], lssh[1], lssh[2], lssh[0]-i-1, j, k);
+ COPY_BOUNDARY (doBC[1], widths[1], lsh[1], lsh[2], lsh[0]-i-1, j, k);
}
if (gdim > 1)
{
/* lower y */
- COPY_BOUNDARY (doBC[2], lssh[0], widths[2], lssh[2], i, j, k);
+ COPY_BOUNDARY (doBC[2], lsh[0], widths[2], lsh[2], i, j, k);
/* upper y */
- COPY_BOUNDARY (doBC[3], lssh[0], widths[3], lssh[2], i, lssh[1]-j-1, k);
+ COPY_BOUNDARY (doBC[3], lsh[0], widths[3], lsh[2], i, lsh[1]-j-1, k);
}
if (gdim > 2)
{
/* lower z */
- COPY_BOUNDARY (doBC[4], lssh[0], lssh[1], widths[4], i, j, k);
+ COPY_BOUNDARY (doBC[4], lsh[0], lsh[1], widths[4], i, j, k);
/* upper z */
- COPY_BOUNDARY (doBC[5], lssh[0], lssh[1], widths[5], i, j, lssh[2]-k-1);
+ COPY_BOUNDARY (doBC[5], lsh[0], lsh[1], widths[5], i, j, lsh[2]-k-1);
}
}
diff --git a/src/FlatBoundary.c b/src/FlatBoundary.c
index dd597de..8d18023 100644
--- a/src/FlatBoundary.c
+++ b/src/FlatBoundary.c
@@ -922,7 +922,7 @@ static int ApplyBndFlat (const cGH *GH,
{
int i, j, k;
int var, vtypesize, gindex, gdim, timelvl;
- int doBC[2*MAXDIM], dstag[MAXDIM], lsh[MAXDIM], lssh[MAXDIM];
+ int doBC[2*MAXDIM], lsh[MAXDIM];
CCTK_INT widths[2*MAXDIM];
CCTK_INT symtable;
CCTK_INT symbnd[2*MAXDIM];
@@ -975,13 +975,9 @@ static int ApplyBndFlat (const cGH *GH,
so that we can use the INDEX_3D macro later on */
for (i = gdim; i < MAXDIM; i++)
{
- lsh[i] = 0;
- lssh[i] = 1;
+ lsh[i] = 0;
}
- /* get the directional staggering of the group */
- CCTK_GroupStaggerDirArrayGI (dstag, gdim, gindex);
-
/* get the current timelevel */
timelvl = 0;
@@ -1010,7 +1006,6 @@ static int ApplyBndFlat (const cGH *GH,
for (i = 0; i < gdim; i++)
{
lsh[i] = GH->cctk_lsh[i];
- lssh[i] = GH->cctk_lssh[CCTK_LSSH_IDX (dstag[i], 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];
if (dir != 0)
@@ -1034,9 +1029,9 @@ static int ApplyBndFlat (const cGH *GH,
}
#endif /* DEBUG_BOUNDARY */
/* lower x */
- FLAT_BOUNDARY (doBC[0], widths[0], lssh[1], lssh[2], i, j, k, widths[0], j, k);
+ FLAT_BOUNDARY (doBC[0], widths[0], lsh[1], lsh[2], i, j, k, widths[0], j, k);
/* upper x */
- FLAT_BOUNDARY (doBC[1], widths[1], lssh[1], lssh[2], lssh[0]-i-1, j, k, lssh[0]-widths[1]-1, j, k);
+ FLAT_BOUNDARY (doBC[1], widths[1], lsh[1], lsh[2], lsh[0]-i-1, j, k, lsh[0]-widths[1]-1, j, k);
}
if (gdim > 1)
{
@@ -1051,9 +1046,9 @@ static int ApplyBndFlat (const cGH *GH,
}
#endif /* DEBUG_BOUNDARY */
/* lower y */
- FLAT_BOUNDARY (doBC[2], lssh[0], widths[2], lssh[2], i, j, k, i, widths[2], k);
+ FLAT_BOUNDARY (doBC[2], lsh[0], widths[2], lsh[2], i, j, k, i, widths[2], k);
/* upper y */
- FLAT_BOUNDARY (doBC[3], lssh[0], widths[3], lssh[2], i, lssh[1]-j-1, k, i, lssh[1]-widths[3]-1, k);
+ FLAT_BOUNDARY (doBC[3], lsh[0], widths[3], lsh[2], i, lsh[1]-j-1, k, i, lsh[1]-widths[3]-1, k);
}
if (gdim > 2)
{
@@ -1068,9 +1063,9 @@ static int ApplyBndFlat (const cGH *GH,
}
#endif /* DEBUG_BOUNDARY */
/* lower z */
- FLAT_BOUNDARY (doBC[4], lssh[0], lssh[1], widths[4], i, j, k, i, j, widths[4]);
+ FLAT_BOUNDARY (doBC[4], lsh[0], lsh[1], widths[4], i, j, k, i, j, widths[4]);
/* upper z */
- FLAT_BOUNDARY (doBC[5], lssh[0], lssh[1], widths[5], i, j, lssh[2]-k-1, i, j, lssh[2]-widths[5]-1);
+ FLAT_BOUNDARY (doBC[5], lsh[0], lsh[1], widths[5], i, j, lsh[2]-k-1, i, j, lsh[2]-widths[5]-1);
}
}
diff --git a/src/ScalarBoundary.c b/src/ScalarBoundary.c
index e978344..eb84636 100644
--- a/src/ScalarBoundary.c
+++ b/src/ScalarBoundary.c
@@ -954,29 +954,29 @@ void CCTK_FCALL CCTK_FNAME (BndScalarVN)
if (gdim > 0) \
{ \
/* lower x */ \
- SCALAR_BOUNDARY_TYPED (doBC[0], widths[0], lssh[1], lssh[2], \
+ SCALAR_BOUNDARY_TYPED (doBC[0], widths[0], lsh[1], lsh[2], \
i, j, k, left_cctk_type, right_cctk_type); \
/* upper x */ \
- SCALAR_BOUNDARY_TYPED (doBC[1], widths[1], lssh[1], lssh[2], \
- lssh[0]-i-1, j, k, left_cctk_type, right_cctk_type);\
+ SCALAR_BOUNDARY_TYPED (doBC[1], widths[1], lsh[1], lsh[2], \
+ lsh[0]-i-1, j, k, left_cctk_type, right_cctk_type);\
} \
if (gdim > 1) \
{ \
/* lower y */ \
- SCALAR_BOUNDARY_TYPED (doBC[2], lssh[0], widths[2], lssh[2], \
+ SCALAR_BOUNDARY_TYPED (doBC[2], lsh[0], widths[2], lsh[2], \
i, j, k, left_cctk_type, right_cctk_type); \
/* upper y */ \
- SCALAR_BOUNDARY_TYPED (doBC[3], lssh[0], widths[3], lssh[2], \
- i, lssh[1]-j-1, k, left_cctk_type, right_cctk_type);\
+ SCALAR_BOUNDARY_TYPED (doBC[3], lsh[0], widths[3], lsh[2], \
+ i, lsh[1]-j-1, k, left_cctk_type, right_cctk_type);\
} \
if (gdim > 2) \
{ \
/* lower z */ \
- SCALAR_BOUNDARY_TYPED (doBC[4], lssh[0], lssh[1], widths[4], \
+ SCALAR_BOUNDARY_TYPED (doBC[4], lsh[0], lsh[1], widths[4], \
i, j, k, left_cctk_type, right_cctk_type); \
/* upper z */ \
- SCALAR_BOUNDARY_TYPED (doBC[5], lssh[0], lssh[1], widths[5], \
- i, j, lssh[2]-k-1, left_cctk_type, right_cctk_type);\
+ SCALAR_BOUNDARY_TYPED (doBC[5], lsh[0], lsh[1], widths[5], \
+ i, j, lsh[2]-k-1, left_cctk_type, right_cctk_type);\
} \
}
@@ -1062,7 +1062,7 @@ static int ApplyBndScalar (const cGH *GH,
int i, j, k;
int gindex, gdim;
int var, timelvl;
- int doBC[2*MAXDIM], dstag[MAXDIM], lsh[MAXDIM], lssh[MAXDIM];
+ int doBC[2*MAXDIM], lsh[MAXDIM];
CCTK_INT widths[2*MAXDIM];
CCTK_INT symtable;
CCTK_INT symbnd[2*MAXDIM];
@@ -1111,13 +1111,9 @@ static int ApplyBndScalar (const cGH *GH,
so that we can use the INDEX_3D macro later on */
for (i = gdim; i < MAXDIM; i++)
{
- lsh[i] = 0;
- lssh[i] = 1;
+ lsh[i] = 0;
}
- /* get the directional staggering of the group */
- CCTK_GroupStaggerDirArrayGI (dstag, gdim, gindex);
-
/* get the current timelevel */
timelvl = 0;
@@ -1146,7 +1142,6 @@ static int ApplyBndScalar (const cGH *GH,
for (i = 0; i < gdim; i++)
{
lsh[i] = GH->cctk_lsh[i];
- lssh[i] = GH->cctk_lssh[CCTK_LSSH_IDX (dstag[i], 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];
if (dir != 0)
diff --git a/src/StaticBoundary.c b/src/StaticBoundary.c
index e7f1ff5..74372e5 100644
--- a/src/StaticBoundary.c
+++ b/src/StaticBoundary.c
@@ -935,7 +935,7 @@ static int ApplyBndStatic (const cGH *GH,
int timelvl_to, timelvl_from;
int gindex, gdim;
int var, vtypesize;
- int doBC[2*MAXDIM], dstag[MAXDIM], lsh[MAXDIM], lssh[MAXDIM];
+ int doBC[2*MAXDIM], lsh[MAXDIM];
CCTK_INT widths[2*MAXDIM];
CCTK_INT symtable;
CCTK_INT symbnd[2*MAXDIM];
@@ -992,13 +992,9 @@ static int ApplyBndStatic (const cGH *GH,
so that we can use the INDEX_3D macro later on */
for (i = gdim; i < MAXDIM; i++)
{
- lssh[i] = 1;
- lsh[i] = 0;
+ lsh[i] = 0;
}
- /* get the directional staggering of the group */
- CCTK_GroupStaggerDirArrayGI (dstag, gdim, gindex);
-
/* get the current timelevel */
timelvl_to = 0;
timelvl_from = 1;
@@ -1036,7 +1032,6 @@ static int ApplyBndStatic (const cGH *GH,
for (i = 0; i < gdim; i++)
{
lsh[i] = GH->cctk_lsh[i];
- lssh[i] = GH->cctk_lssh[CCTK_LSSH_IDX (dstag[i], 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];
if (dir != 0)
@@ -1050,23 +1045,23 @@ static int ApplyBndStatic (const cGH *GH,
if (gdim > 0)
{
/* lower x */
- STATIC_BOUNDARY (doBC[0], widths[0], lssh[1], lssh[2], i, j, k);
+ STATIC_BOUNDARY (doBC[0], widths[0], lsh[1], lsh[2], i, j, k);
/* upper x */
- STATIC_BOUNDARY (doBC[1], widths[1], lssh[1], lssh[2], lssh[0]-i-1, j, k);
+ STATIC_BOUNDARY (doBC[1], widths[1], lsh[1], lsh[2], lsh[0]-i-1, j, k);
}
if (gdim > 1)
{
/* lower y */
- STATIC_BOUNDARY (doBC[2], lssh[0], widths[2], lssh[2], i, j, k);
+ STATIC_BOUNDARY (doBC[2], lsh[0], widths[2], lsh[2], i, j, k);
/* upper y */
- STATIC_BOUNDARY (doBC[3], lssh[0], widths[3], lssh[2], i, lssh[1]-j-1,k);
+ STATIC_BOUNDARY (doBC[3], lsh[0], widths[3], lsh[2], i, lsh[1]-j-1,k);
}
if (gdim > 2)
{
/* lower z */
- STATIC_BOUNDARY (doBC[4], lssh[0], lssh[1], widths[4], i, j, k);
+ STATIC_BOUNDARY (doBC[4], lsh[0], lsh[1], widths[4], i, j, k);
/* upper z */
- STATIC_BOUNDARY (doBC[5], lssh[0], lssh[1], widths[5], i, j,lssh[2]-k-1);
+ STATIC_BOUNDARY (doBC[5], lsh[0], lsh[1], widths[5], i, j,lsh[2]-k-1);
}
}