From 5880beb0793f87e6b0c2917783c02ffb2c9e1b9c Mon Sep 17 00:00:00 2001 From: eschnett Date: Wed, 4 Jul 2012 01:28:08 +0000 Subject: 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/CartGrid3D/trunk@262 c78560ca-4b45-4335-b268-5f3340f3cb52 --- src/Symmetry.c | 52 +++++++++++++++++++++++----------------------------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/src/Symmetry.c b/src/Symmetry.c index 2433fc4..1e19f53 100644 --- a/src/Symmetry.c +++ b/src/Symmetry.c @@ -351,56 +351,56 @@ void CCTK_FCALL CCTK_FNAME (CartSymVN) /* apply symmetry to the z faces */ \ if (doSym[4] == GFSYM_REFLECTION) \ { \ - APPLY_LOWER (4, k, j, i, lssh[1], lssh[0], i, j, offset[4]-k, itype); \ + APPLY_LOWER (4, k, j, i, lsh[1], lsh[0], i, j, offset[4]-k, itype); \ } \ if (doSym[5] == GFSYM_REFLECTION) \ { \ - APPLY_UPPER (5, k, j, i, lssh[1], lssh[0], i, j, offset[5]-k, itype); \ + APPLY_UPPER (5, k, j, i, lsh[1], lsh[0], i, j, offset[5]-k, itype); \ } \ if (doSym[4] == GFSYM_ROTATION_X) \ { \ - APPLY_LOWER (4, k, j, i, lssh[1], lssh[0], i, lssh[1]-j-1, offset[4]-k, itype);\ + APPLY_LOWER (4, k, j, i, lsh[1], lsh[0], i, lsh[1]-j-1, offset[4]-k, itype);\ } \ if (doSym[5] == GFSYM_ROTATION_X) \ { \ - APPLY_UPPER (5, k, j, i, lssh[1], lssh[0], i, lssh[1]-j-1, offset[5]-k, itype);\ + APPLY_UPPER (5, k, j, i, lsh[1], lsh[0], i, lsh[1]-j-1, offset[5]-k, itype);\ } \ if (doSym[4] == GFSYM_ROTATION_Y) \ { \ - APPLY_LOWER (4, k, j, i, lssh[1], lssh[0], lssh[0]-i-1, j, offset[4]-k, itype);\ + APPLY_LOWER (4, k, j, i, lsh[1], lsh[0], lsh[0]-i-1, j, offset[4]-k, itype);\ } \ if (doSym[5] == GFSYM_ROTATION_Y) \ { \ - APPLY_UPPER (5, k, j, i, lssh[1], lssh[0], lssh[0]-i-1, j, offset[5]-k, itype);\ + APPLY_UPPER (5, k, j, i, lsh[1], lsh[0], lsh[0]-i-1, j, offset[5]-k, itype);\ } \ /* FALL THROUGH */ \ case 2: \ /* apply symmetry to the y faces */ \ if (doSym[2] == GFSYM_REFLECTION) \ { \ - APPLY_LOWER (2, j, k, i, lssh[2], lssh[0], i, offset[2]-j, k, itype); \ + APPLY_LOWER (2, j, k, i, lsh[2], lsh[0], i, offset[2]-j, k, itype); \ } \ if (doSym[3] == GFSYM_REFLECTION) \ { \ - APPLY_UPPER (3, j, k, i, lssh[2], lssh[0], i, offset[3]-j, k, itype); \ + APPLY_UPPER (3, j, k, i, lsh[2], lsh[0], i, offset[3]-j, k, itype); \ } \ if (doSym[2] == GFSYM_ROTATION_Z) \ { \ - APPLY_LOWER (2, j, k, i, lssh[2], lssh[0], lssh[0]-i-1, offset[2]-j, k, itype);\ + APPLY_LOWER (2, j, k, i, lsh[2], lsh[0], lsh[0]-i-1, offset[2]-j, k, itype);\ } \ if (doSym[3] == GFSYM_ROTATION_Z) \ { \ - APPLY_UPPER (3, j, k, i, lssh[2], lssh[0], lssh[0]-i-1, offset[3]-j, k, itype);\ + APPLY_UPPER (3, j, k, i, lsh[2], lsh[0], lsh[0]-i-1, offset[3]-j, k, itype);\ } \ if (group_static_data.dim > 2) \ { \ if (doSym[2] == GFSYM_ROTATION_X) \ { \ - APPLY_LOWER (2, j, k, i, lssh[2], lssh[0], i, offset[2]-j, lssh[2]-k-1, itype);\ + APPLY_LOWER (2, j, k, i, lsh[2], lsh[0], i, offset[2]-j, lsh[2]-k-1, itype);\ } \ if (doSym[3] == GFSYM_ROTATION_X) \ { \ - APPLY_UPPER (3, j, k, i, lssh[2], lssh[0], i, offset[3]-j, lssh[2]-k-1, itype);\ + APPLY_UPPER (3, j, k, i, lsh[2], lsh[0], i, offset[3]-j, lsh[2]-k-1, itype);\ } \ } \ /* FALL THROUGH */ \ @@ -408,32 +408,32 @@ void CCTK_FCALL CCTK_FNAME (CartSymVN) /* apply symmetry to the x faces */ \ if (doSym[0] == GFSYM_REFLECTION) \ { \ - APPLY_LOWER (0, i, j, k, lssh[1], lssh[2], offset[0]-i, j, k, itype); \ + APPLY_LOWER (0, i, j, k, lsh[1], lsh[2], offset[0]-i, j, k, itype); \ } \ if (doSym[1] == GFSYM_REFLECTION) \ { \ - APPLY_UPPER (1, i, j, k, lssh[1], lssh[2], offset[1]-i, j, k, itype); \ + APPLY_UPPER (1, i, j, k, lsh[1], lsh[2], offset[1]-i, j, k, itype); \ } \ if (group_static_data.dim > 1) \ { \ if (doSym[0] == GFSYM_ROTATION_Z) \ { \ - APPLY_LOWER (0, i, j, k, lssh[1], lssh[2], offset[0]-i, lssh[1]-j-1, k, itype);\ + APPLY_LOWER (0, i, j, k, lsh[1], lsh[2], offset[0]-i, lsh[1]-j-1, k, itype);\ } \ if (doSym[1] == GFSYM_ROTATION_Z) \ { \ - APPLY_UPPER (1, i, j, k, lssh[1], lssh[2], offset[1]-i, lssh[1]-j-1, k, itype);\ + APPLY_UPPER (1, i, j, k, lsh[1], lsh[2], offset[1]-i, lsh[1]-j-1, k, itype);\ } \ } \ if (group_static_data.dim > 2) \ { \ if (doSym[0] == GFSYM_ROTATION_Y) \ { \ - APPLY_LOWER (0, i, j, k, lssh[1], lssh[2], offset[0]-i, j, lssh[2]-k-1, itype);\ + APPLY_LOWER (0, i, j, k, lsh[1], lsh[2], offset[0]-i, j, lsh[2]-k-1, itype);\ } \ if (doSym[1] == GFSYM_ROTATION_Y) \ { \ - APPLY_UPPER (1, i, j, k, lssh[1], lssh[2], offset[1]-i, j, lssh[2]-k-1, itype);\ + APPLY_UPPER (1, i, j, k, lsh[1], lsh[2], offset[1]-i, j, lsh[2]-k-1, itype);\ } \ } \ /* FALL THROUGH */ \ @@ -444,7 +444,7 @@ void CCTK_FCALL CCTK_FNAME (CartSymVN) /* Function to apply above macros. */ #define SYMMETRY_FUNCTION(cctk_type,integral_type,SUFFIX) \ - static void cctk_type ## _SymBC ## SUFFIX(const cGH *GH, const int vindex, const int *doSym, const int *offset, const int *lsh, const int *lssh, const cGroup group_static_data, const cGroupDynamicData gdata, int **GFSym) { int i,j,k; SYMMETRY_BOUNDARY(cctk_type, integral_type); } + static void cctk_type ## _SymBC ## SUFFIX(const cGH *GH, const int vindex, const int *doSym, const int *offset, const int *lsh, const cGroup group_static_data, const cGroupDynamicData gdata, int **GFSym) { int i,j,k; SYMMETRY_BOUNDARY(cctk_type, integral_type); } /* Create functions to apply macros. * This is much easier for the optiser to deal with. @@ -505,7 +505,7 @@ SYMMETRY_FUNCTION(CCTK_REAL16,CCTK_REAL16,R) #endif #undef NUMBER_PART -#define CALL_SYMBC(cctk_type,SUFFIX) cctk_type ## _SymBC ## SUFFIX(GH, vindex, doSym, offset, lsh, lssh, group_static_data, gdata, GFSym) +#define CALL_SYMBC(cctk_type,SUFFIX) cctk_type ## _SymBC ## SUFFIX(GH, vindex, doSym, offset, lsh, group_static_data, gdata, GFSym) /*@@ @routine ApplySymmetry @@ -539,7 +539,6 @@ SYMMETRY_FUNCTION(CCTK_REAL16,CCTK_REAL16,R) @calls CCTK_GroupData CCTK_GroupDynamicData - CCTK_StaggerDirArray SYMMETRY_BOUNDARY @history @hdate Sat 02 Nov 2002 @@ -561,7 +560,7 @@ static int ApplySymmetry (const cGH *GH, int gindex, int first_vindex, int i, dim, vindex, retval; int **GFSym; int domainsym[2*MAX_DIM], doSym[2*MAX_DIM], offset[2*MAX_DIM]; - int dstag[MAX_DIM], lsh[MAX_DIM], lssh[MAX_DIM], cntstag[MAX_DIM]; + int lsh[MAX_DIM], cntstag[MAX_DIM]; cGroup group_static_data; cGroupDynamicData gdata; DECLARE_CCTK_PARAMETERS @@ -597,10 +596,6 @@ static int ApplySymmetry (const cGH *GH, int gindex, int first_vindex, cntstag[1] = no_origin && no_originy && avoid_origin && avoid_originy; cntstag[2] = no_origin && no_originz && avoid_origin && avoid_originz; - /* get the directional staggering of the group */ - CCTK_StaggerDirArray (dstag, group_static_data.dim, - group_static_data.stagtype); - /* initialize array for variables with less dimensions than MAX_DIM so that we can use the INDEX_3D macro later on */ for (i = 0; i < MAX_DIM; i++) @@ -608,11 +603,10 @@ static int ApplySymmetry (const cGH *GH, int gindex, int first_vindex, if (i < group_static_data.dim) { lsh[i] = gdata.lsh[i]; - lssh[i] = GH->cctk_lssh[CCTK_LSSH_IDX (dstag[i], i)]; } else { - lsh[i] = lssh[i] = 1; + lsh[i] = 1; } offset[2*i+0] = 2*gdata.nghostzones[i] - cntstag[i]; offset[2*i+1] = 2*(lsh[i]-1) - offset[2*i+0]; @@ -641,7 +635,7 @@ static int ApplySymmetry (const cGH *GH, int gindex, int first_vindex, doSym[dim] = (GFSym[vindex][dim] != GFSYM_NOSYM && GFSym[vindex][dim] != GFSYM_UNSET && - lssh[dim/2] > 1 && GH->cctk_bbox[dim]) ? domainsym[dim] : 0; + lsh[dim/2] > 1 && GH->cctk_bbox[dim]) ? domainsym[dim] : 0; } switch (group_static_data.vartype) -- cgit v1.2.3