From 5890fa36427bdea8efe70079e3cd1e5612312e77 Mon Sep 17 00:00:00 2001 From: eschnett Date: Wed, 4 Jul 2012 01:25:29 +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/flesh/trunk@4841 17b73243-c579-4c4c-a9d2-2d5706c11dac --- src/comm/CactusDefaultComm.c | 4 +- src/include/cGH.h | 4 +- src/include/cctk_Constants.h | 3 - src/include/cctk_Groups.h | 3 - src/include/cctk_GroupsOnGH.h | 11 +- src/include/cctk_Loop.h | 328 +++++++++++++++---------------- src/include/cctk_Loop.h.pl | 52 ++--- src/include/cctk_Stagger.h | 35 ---- src/include/cctk_core.h | 63 +++--- src/include/cctki_Groups.h | 1 - src/include/cctki_Stagger.h | 79 -------- src/main/DebugDefines.c | 16 +- src/main/Groups.c | 47 +---- src/main/GroupsOnGH.c | 102 +++++----- src/main/Stagger.c | 440 ------------------------------------------ src/main/make.code.defn | 1 - 16 files changed, 290 insertions(+), 899 deletions(-) delete mode 100644 src/include/cctk_Stagger.h delete mode 100644 src/include/cctki_Stagger.h delete mode 100644 src/main/Stagger.c (limited to 'src') diff --git a/src/comm/CactusDefaultComm.c b/src/comm/CactusDefaultComm.c index 1cbc82e3..b3d341c9 100644 --- a/src/comm/CactusDefaultComm.c +++ b/src/comm/CactusDefaultComm.c @@ -171,7 +171,7 @@ cGH *CactusDefaultSetupGH(tFleshConfig *config, int convergence_level) thisGH->cctk_lbnd = malloc(cctk_dim*sizeof(int)); thisGH->cctk_ubnd = malloc(cctk_dim*sizeof(int)); - thisGH->cctk_lssh = malloc(CCTK_NSTAGGER*cctk_dim*sizeof(int)); + thisGH->cctk_ash = malloc(cctk_dim*sizeof(int)); thisGH->cctk_to = malloc(cctk_dim*sizeof(int)); thisGH->cctk_from = malloc(cctk_dim*sizeof(int)); thisGH->cctk_bbox = malloc(2*cctk_dim*sizeof(int)); @@ -221,7 +221,7 @@ cGH *CactusDefaultSetupGH(tFleshConfig *config, int convergence_level) thisGH->cctk_lsh && thisGH->cctk_lbnd && thisGH->cctk_ubnd && - thisGH->cctk_lssh && + thisGH->cctk_ash && thisGH->cctk_from && thisGH->cctk_to && thisGH->cctk_bbox && diff --git a/src/include/cGH.h b/src/include/cGH.h index e2f62098..f92be81e 100644 --- a/src/include/cGH.h +++ b/src/include/cGH.h @@ -30,8 +30,8 @@ typedef struct _cGH int *cctk_lbnd; int *cctk_ubnd; - /* local stagger shape lssh[3*dim] (3 staggerings) */ - int *cctk_lssh; + /* allocated shape */ + int *cctk_ash; /* unused */ int *cctk_to; diff --git a/src/include/cctk_Constants.h b/src/include/cctk_Constants.h index 89f561ad..680e77f5 100644 --- a/src/include/cctk_Constants.h +++ b/src/include/cctk_Constants.h @@ -40,9 +40,6 @@ #define CCTK_STEERABLE_ALWAYS 201 #define CCTK_STEERABLE_RECOVER 202 -/* number of staggerings */ -#define CCTK_NSTAGGER 3 - /* group distributions */ #define CCTK_DISTRIB_CONSTANT 301 #define CCTK_DISTRIB_DEFAULT 302 diff --git a/src/include/cctk_Groups.h b/src/include/cctk_Groups.h index 0d101a76..bcd64402 100644 --- a/src/include/cctk_Groups.h +++ b/src/include/cctk_Groups.h @@ -16,7 +16,6 @@ typedef struct int grouptype; int vartype; int disttype; - int stagtype; int dim; int numvars; int numtimelevels; @@ -34,8 +33,6 @@ extern "C" #include "cctk_Types.h" -int CCTK_StaggerVars(void); - int CCTK_DecomposeName(const char *fullname, char **implementation, char **name); diff --git a/src/include/cctk_GroupsOnGH.h b/src/include/cctk_GroupsOnGH.h index e2e38c96..2883afa8 100644 --- a/src/include/cctk_GroupsOnGH.h +++ b/src/include/cctk_GroupsOnGH.h @@ -18,8 +18,7 @@ typedef struct GROUPDYNAMICDATA const int *lsh; const int *lbnd; const int *ubnd; -#define CCTK_GROUPDYNAMICDATA_HAS_LSSH - const int *lssh; + const int *ash; const int *bbox; const int *nghostzones; int activetimelevels; @@ -55,10 +54,10 @@ int CCTK_GrouplshVN(const cGH *GH, int dim, int *lsh, const char *varname); int CCTK_GrouplshGI(const cGH *GH, int dim, int *lsh, int groupindex); int CCTK_GrouplshVI(const cGH *GH, int dim, int *lsh, int varindex); -int CCTK_GrouplsshGN(const cGH *GH, int dim, int *lssh, const char *groupname); -int CCTK_GrouplsshVN(const cGH *GH, int dim, int *lssh, const char *varname); -int CCTK_GrouplsshGI(const cGH *GH, int dim, int *lssh, int groupindex); -int CCTK_GrouplsshVI(const cGH *GH, int dim, int *lssh, int varindex); +int CCTK_GroupashGN(const cGH *GH, int dim, int *ash, const char *groupname); +int CCTK_GroupashVN(const cGH *GH, int dim, int *ash, const char *varname); +int CCTK_GroupashGI(const cGH *GH, int dim, int *ash, int groupindex); +int CCTK_GroupashVI(const cGH *GH, int dim, int *ash, int varindex); int CCTK_GroupgshGN(const cGH *GH, int dim, int *gsh, const char *groupname); int CCTK_GroupgshVN(const cGH *GH, int dim, int *gsh, const char *varname); diff --git a/src/include/cctk_Loop.h b/src/include/cctk_Loop.h index aae37034..3919dc16 100644 --- a/src/include/cctk_Loop.h +++ b/src/include/cctk_Loop.h @@ -27,14 +27,14 @@ idir, \ imin, \ imax, \ - ilsh) \ + iash) \ CCTK_LOOP1STR_NORMAL(name, \ i, \ ni, \ (idir), \ (imin), \ (imax), \ - (ilsh), \ + (iash), \ 1) \ #define CCTK_ENDLOOP1_NORMAL(name) \ @@ -46,7 +46,7 @@ idir, \ imin, \ imax, \ - ilsh, \ + iash, \ istr) \ do { \ typedef int cctki0_loop1_normal_##name; \ @@ -72,12 +72,12 @@ i, \ imin, \ imax, \ - ilsh) \ + iash) \ CCTK_LOOP1STR(name, \ i, \ (imin), \ (imax), \ - (ilsh), \ + (iash), \ 1) \ #define CCTK_ENDLOOP1(name) \ @@ -87,7 +87,7 @@ i, \ imin, \ imax, \ - ilsh, \ + iash, \ istr) \ CCTK_LOOP1STR_NORMAL(name, \ i, \ @@ -95,7 +95,7 @@ 0, \ imin, \ imax, \ - ilsh, \ + iash, \ istr) \ #define CCTK_ENDLOOP1STR(name) \ @@ -134,8 +134,8 @@ CCTK_LOOP1STR(name##_interior, \ i, \ (iblo), \ - cctki2_cctkGH->CCTK_LSSH(0,0)-(ibhi), \ - cctki2_cctkGH->cctk_lsh[0], \ + cctki2_cctkGH->cctk_lsh[0]-(ibhi), \ + cctki2_cctkGH->cctk_ash[0], \ (istr)) { \ #define CCTK_ENDLOOP1STR_INTERIOR(name) \ @@ -185,7 +185,7 @@ int const cctki2_blo[] = { (iblo) }; \ int const cctki2_bhi[] = { (ibhi) }; \ int const cctki2_bbox[] = { (ibboxlo), (ibboxhi) }; \ - int const cctki2_lssh[] = { cctki2_cctkGH->CCTK_LSSH(0,0) }; \ + int const cctki2_lsh[] = { cctki2_cctkGH->cctk_lsh[0] }; \ int const cctki2_istr1 CCTK_ATTRIBUTE_UNUSED = (istr); \ /* Loop over all faces, edges, and corners */ \ for (int cctki2_idir=-1; cctki2_idir<=+1; ++cctki2_idir) { \ @@ -193,10 +193,10 @@ (cctki2_idir==-1 ? cctki2_bbox[0] : 0) || (cctki2_idir==+1 ? cctki2_bbox[1] : 0); \ if (cctki2_any_bbox) { \ int const cctki2_bmin[] = { \ - cctki2_idir==-1 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lssh[0] - cctki2_bhi[0], \ + cctki2_idir==-1 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lsh[0] - cctki2_bhi[0], \ }; \ int const cctki2_bmax[] = { \ - cctki2_idir==-1 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lssh[0] - cctki2_bhi[0] : cctki2_lssh[0], \ + cctki2_idir==-1 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lsh[0] - cctki2_bhi[0] : cctki2_lsh[0], \ }; \ CCTK_LOOP1STR_NORMAL(name##_boundaries, \ i, \ @@ -204,7 +204,7 @@ cctki2_idir, \ cctki2_bmin[0], \ cctki2_bmax[0], \ - cctki2_cctkGH->cctk_lsh[0], \ + cctki2_cctkGH->cctk_ash[0], \ cctki2_istr1) { \ #define CCTK_ENDLOOP1STR_BOUNDARIES(name) \ @@ -256,7 +256,7 @@ int const cctki2_blo[] = { (iblo) }; \ int const cctki2_bhi[] = { (ibhi) }; \ int const cctki2_bbox[] = { (ibboxlo), (ibboxhi) }; \ - int const cctki2_lssh[] = { cctki2_cctkGH->CCTK_LSSH(0,0) }; \ + int const cctki2_lsh[] = { cctki2_cctkGH->cctk_lsh[0] }; \ int const cctki2_istr1 CCTK_ATTRIBUTE_UNUSED = (istr); \ /* Loop over all faces, edges, and corners */ \ for (int cctki2_idir=-1; cctki2_idir<=+1; ++cctki2_idir) { \ @@ -266,10 +266,10 @@ (cctki2_idir==-1 ? cctki2_bbox[0] : 1) && (cctki2_idir==+1 ? cctki2_bbox[1] : 1); \ if (cctki2_all_bbox && cctki2_any_bbox) { \ int const cctki2_bmin[] = { \ - cctki2_idir==-1 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lssh[0] - cctki2_bhi[0], \ + cctki2_idir==-1 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lsh[0] - cctki2_bhi[0], \ }; \ int const cctki2_bmax[] = { \ - cctki2_idir==-1 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lssh[0] - cctki2_bhi[0] : cctki2_lssh[0], \ + cctki2_idir==-1 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lsh[0] - cctki2_bhi[0] : cctki2_lsh[0], \ }; \ CCTK_LOOP1STR_NORMAL(name##_intboundaries, \ i, \ @@ -277,7 +277,7 @@ cctki2_idir, \ cctki2_bmin[0], \ cctki2_bmax[0], \ - cctki2_cctkGH->cctk_lsh[0], \ + cctki2_cctkGH->cctk_ash[0], \ cctki2_istr1) { \ #define CCTK_ENDLOOP1STR_INTBOUNDARIES(name) \ @@ -314,8 +314,8 @@ CCTK_LOOP1STR(name##_all, \ i, \ 0, \ - cctki3_cctkGH->CCTK_LSSH(0,0), \ cctki3_cctkGH->cctk_lsh[0], \ + cctki3_cctkGH->cctk_ash[0], \ (istr)) { \ #define CCTK_ENDLOOP1STR_ALL(name) \ @@ -483,19 +483,19 @@ i, \ imin, \ imax, \ - ilsh) \ + iash) \ CCTK_LOOP1STR(name, \ i, \ imin, \ imax, \ - ilsh, \ + iash, \ 1) \ #define CCTK_LOOP1STR(name, \ i, \ imin, \ imax, \ - ilsh, \ + iash, \ istr) \ && name/**/_imin = imin \ && name/**/_imax = imax \ @@ -530,8 +530,8 @@ CCTK_LOOP1STR(name, \ i, \ 1, \ - CCTK_LSSH(0,1), \ cctk_lsh(1), \ + cctk_ash(1), \ istr) \ #define CCTK_ENDLOOP1_ALL(name) \ @@ -568,8 +568,8 @@ CCTK_LOOP1STR(name, \ i, \ (iblo), \ - CCTK_LSSH(0,1)-(ibhi), \ - cctk_lsh(1), \ + cctk_lsh(1)-(ibhi), \ + cctk_ash(1), \ istr) \ #define CCTK_ENDLOOP1_INTERIOR(name) \ @@ -615,7 +615,7 @@ && do lc_face=1,2 \ && do lc_d=1,1 \ && lc_bmin(lc_d) = 1 \ - && lc_bmax(lc_d) = CCTK_LSSH(0,lc_d) \ + && lc_bmax(lc_d) = cctk_lsh(lc_d) \ && if (lc_dCCTK_LSSH(0,0)-(ibhi), \ - cctki2_cctkGH->CCTK_LSSH(0,1)-(jbhi), \ - cctki2_cctkGH->cctk_lsh[0], \ - cctki2_cctkGH->cctk_lsh[1], \ + cctki2_cctkGH->cctk_lsh[0]-(ibhi), \ + cctki2_cctkGH->cctk_lsh[1]-(jbhi), \ + cctki2_cctkGH->cctk_ash[0], \ + cctki2_cctkGH->cctk_ash[1], \ (istr)) { \ #define CCTK_ENDLOOP2STR_INTERIOR(name) \ @@ -823,7 +823,7 @@ int const cctki2_blo[] = { (iblo),(jblo) }; \ int const cctki2_bhi[] = { (ibhi),(jbhi) }; \ int const cctki2_bbox[] = { (ibboxlo), (ibboxhi),(jbboxlo), (jbboxhi) }; \ - int const cctki2_lssh[] = { cctki2_cctkGH->CCTK_LSSH(0,0),cctki2_cctkGH->CCTK_LSSH(0,1) }; \ + int const cctki2_lsh[] = { cctki2_cctkGH->cctk_lsh[0],cctki2_cctkGH->cctk_lsh[1] }; \ int const cctki2_istr1 CCTK_ATTRIBUTE_UNUSED = (istr); \ /* Loop over all faces, edges, and corners */ \ for (int cctki2_jdir=-1; cctki2_jdir<=+1; ++cctki2_jdir) { \ @@ -833,12 +833,12 @@ (cctki2_jdir==-1 ? cctki2_bbox[2] : 0) || (cctki2_jdir==+1 ? cctki2_bbox[3] : 0); \ if (cctki2_any_bbox) { \ int const cctki2_bmin[] = { \ - cctki2_idir==-1 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lssh[0] - cctki2_bhi[0], \ - cctki2_jdir==-1 ? 0 : cctki2_jdir==0 ? cctki2_blo[1] : cctki2_lssh[1] - cctki2_bhi[1], \ + cctki2_idir==-1 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lsh[0] - cctki2_bhi[0], \ + cctki2_jdir==-1 ? 0 : cctki2_jdir==0 ? cctki2_blo[1] : cctki2_lsh[1] - cctki2_bhi[1], \ }; \ int const cctki2_bmax[] = { \ - cctki2_idir==-1 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lssh[0] - cctki2_bhi[0] : cctki2_lssh[0], \ - cctki2_jdir==-1 ? cctki2_blo[1] : cctki2_jdir==0 ? cctki2_lssh[1] - cctki2_bhi[1] : cctki2_lssh[1], \ + cctki2_idir==-1 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lsh[0] - cctki2_bhi[0] : cctki2_lsh[0], \ + cctki2_jdir==-1 ? cctki2_blo[1] : cctki2_jdir==0 ? cctki2_lsh[1] - cctki2_bhi[1] : cctki2_lsh[1], \ }; \ CCTK_LOOP2STR_NORMAL(name##_boundaries, \ i,j, \ @@ -846,8 +846,8 @@ cctki2_idir,cctki2_jdir, \ cctki2_bmin[0],cctki2_bmin[1], \ cctki2_bmax[0],cctki2_bmax[1], \ - cctki2_cctkGH->cctk_lsh[0], \ - cctki2_cctkGH->cctk_lsh[1], \ + cctki2_cctkGH->cctk_ash[0], \ + cctki2_cctkGH->cctk_ash[1], \ cctki2_istr1) { \ #define CCTK_ENDLOOP2STR_BOUNDARIES(name) \ @@ -900,7 +900,7 @@ int const cctki2_blo[] = { (iblo),(jblo) }; \ int const cctki2_bhi[] = { (ibhi),(jbhi) }; \ int const cctki2_bbox[] = { (ibboxlo), (ibboxhi),(jbboxlo), (jbboxhi) }; \ - int const cctki2_lssh[] = { cctki2_cctkGH->CCTK_LSSH(0,0),cctki2_cctkGH->CCTK_LSSH(0,1) }; \ + int const cctki2_lsh[] = { cctki2_cctkGH->cctk_lsh[0],cctki2_cctkGH->cctk_lsh[1] }; \ int const cctki2_istr1 CCTK_ATTRIBUTE_UNUSED = (istr); \ /* Loop over all faces, edges, and corners */ \ for (int cctki2_jdir=-1; cctki2_jdir<=+1; ++cctki2_jdir) { \ @@ -913,12 +913,12 @@ (cctki2_jdir==-1 ? cctki2_bbox[2] : 1) && (cctki2_jdir==+1 ? cctki2_bbox[3] : 1); \ if (cctki2_all_bbox && cctki2_any_bbox) { \ int const cctki2_bmin[] = { \ - cctki2_idir==-1 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lssh[0] - cctki2_bhi[0], \ - cctki2_jdir==-1 ? 0 : cctki2_jdir==0 ? cctki2_blo[1] : cctki2_lssh[1] - cctki2_bhi[1], \ + cctki2_idir==-1 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lsh[0] - cctki2_bhi[0], \ + cctki2_jdir==-1 ? 0 : cctki2_jdir==0 ? cctki2_blo[1] : cctki2_lsh[1] - cctki2_bhi[1], \ }; \ int const cctki2_bmax[] = { \ - cctki2_idir==-1 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lssh[0] - cctki2_bhi[0] : cctki2_lssh[0], \ - cctki2_jdir==-1 ? cctki2_blo[1] : cctki2_jdir==0 ? cctki2_lssh[1] - cctki2_bhi[1] : cctki2_lssh[1], \ + cctki2_idir==-1 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lsh[0] - cctki2_bhi[0] : cctki2_lsh[0], \ + cctki2_jdir==-1 ? cctki2_blo[1] : cctki2_jdir==0 ? cctki2_lsh[1] - cctki2_bhi[1] : cctki2_lsh[1], \ }; \ CCTK_LOOP2STR_NORMAL(name##_intboundaries, \ i,j, \ @@ -926,8 +926,8 @@ cctki2_idir,cctki2_jdir, \ cctki2_bmin[0],cctki2_bmin[1], \ cctki2_bmax[0],cctki2_bmax[1], \ - cctki2_cctkGH->cctk_lsh[0], \ - cctki2_cctkGH->cctk_lsh[1], \ + cctki2_cctkGH->cctk_ash[0], \ + cctki2_cctkGH->cctk_ash[1], \ cctki2_istr1) { \ #define CCTK_ENDLOOP2STR_INTBOUNDARIES(name) \ @@ -965,10 +965,10 @@ CCTK_LOOP2STR(name##_all, \ i,j, \ 0,0, \ - cctki3_cctkGH->CCTK_LSSH(0,0), \ - cctki3_cctkGH->CCTK_LSSH(0,1), \ cctki3_cctkGH->cctk_lsh[0], \ cctki3_cctkGH->cctk_lsh[1], \ + cctki3_cctkGH->cctk_ash[0], \ + cctki3_cctkGH->cctk_ash[1], \ (istr)) { \ #define CCTK_ENDLOOP2STR_ALL(name) \ @@ -1136,19 +1136,19 @@ i,j, \ imin,jmin, \ imax,jmax, \ - ilsh,jlsh) \ + iash,jash) \ CCTK_LOOP2STR(name, \ i,j, \ imin,jmin, \ imax,jmax, \ - ilsh,jlsh, \ + iash,jash, \ 1) \ #define CCTK_LOOP2STR(name, \ i,j, \ imin,jmin, \ imax,jmax, \ - ilsh,jlsh, \ + iash,jash, \ istr) \ && name/**/_imin = imin \ && name/**/_jmin = jmin \ @@ -1187,8 +1187,8 @@ CCTK_LOOP2STR(name, \ i,j, \ 1,1, \ - CCTK_LSSH(0,1),CCTK_LSSH(0,2), \ cctk_lsh(1),cctk_lsh(2), \ + cctk_ash(1),cctk_ash(2), \ istr) \ #define CCTK_ENDLOOP2_ALL(name) \ @@ -1225,9 +1225,9 @@ CCTK_LOOP2STR(name, \ i,j, \ (iblo),(jblo), \ - CCTK_LSSH(0,1)-(ibhi), \ - CCTK_LSSH(0,2)-(jbhi), \ - cctk_lsh(1),cctk_lsh(2), \ + cctk_lsh(1)-(ibhi), \ + cctk_lsh(2)-(jbhi), \ + cctk_ash(1),cctk_ash(2), \ istr) \ #define CCTK_ENDLOOP2_INTERIOR(name) \ @@ -1273,7 +1273,7 @@ && do lc_face=1,2 \ && do lc_d=1,2 \ && lc_bmin(lc_d) = 1 \ - && lc_bmax(lc_d) = CCTK_LSSH(0,lc_d) \ + && lc_bmax(lc_d) = cctk_lsh(lc_d) \ && if (lc_dCCTK_LSSH(0,0)-(ibhi), \ - cctki2_cctkGH->CCTK_LSSH(0,1)-(jbhi), \ - cctki2_cctkGH->CCTK_LSSH(0,2)-(kbhi), \ - cctki2_cctkGH->cctk_lsh[0], \ - cctki2_cctkGH->cctk_lsh[1], \ - cctki2_cctkGH->cctk_lsh[2], \ + cctki2_cctkGH->cctk_lsh[0]-(ibhi), \ + cctki2_cctkGH->cctk_lsh[1]-(jbhi), \ + cctki2_cctkGH->cctk_lsh[2]-(kbhi), \ + cctki2_cctkGH->cctk_ash[0], \ + cctki2_cctkGH->cctk_ash[1], \ + cctki2_cctkGH->cctk_ash[2], \ (istr)) { \ #define CCTK_ENDLOOP3STR_INTERIOR(name) \ @@ -1489,7 +1489,7 @@ int const cctki2_blo[] = { (iblo),(jblo),(kblo) }; \ int const cctki2_bhi[] = { (ibhi),(jbhi),(kbhi) }; \ int const cctki2_bbox[] = { (ibboxlo), (ibboxhi),(jbboxlo), (jbboxhi),(kbboxlo), (kbboxhi) }; \ - int const cctki2_lssh[] = { cctki2_cctkGH->CCTK_LSSH(0,0),cctki2_cctkGH->CCTK_LSSH(0,1),cctki2_cctkGH->CCTK_LSSH(0,2) }; \ + int const cctki2_lsh[] = { cctki2_cctkGH->cctk_lsh[0],cctki2_cctkGH->cctk_lsh[1],cctki2_cctkGH->cctk_lsh[2] }; \ int const cctki2_istr1 CCTK_ATTRIBUTE_UNUSED = (istr); \ /* Loop over all faces, edges, and corners */ \ for (int cctki2_kdir=-1; cctki2_kdir<=+1; ++cctki2_kdir) { \ @@ -1501,14 +1501,14 @@ (cctki2_kdir==-1 ? cctki2_bbox[4] : 0) || (cctki2_kdir==+1 ? cctki2_bbox[5] : 0); \ if (cctki2_any_bbox) { \ int const cctki2_bmin[] = { \ - cctki2_idir==-1 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lssh[0] - cctki2_bhi[0], \ - cctki2_jdir==-1 ? 0 : cctki2_jdir==0 ? cctki2_blo[1] : cctki2_lssh[1] - cctki2_bhi[1], \ - cctki2_kdir==-1 ? 0 : cctki2_kdir==0 ? cctki2_blo[2] : cctki2_lssh[2] - cctki2_bhi[2], \ + cctki2_idir==-1 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lsh[0] - cctki2_bhi[0], \ + cctki2_jdir==-1 ? 0 : cctki2_jdir==0 ? cctki2_blo[1] : cctki2_lsh[1] - cctki2_bhi[1], \ + cctki2_kdir==-1 ? 0 : cctki2_kdir==0 ? cctki2_blo[2] : cctki2_lsh[2] - cctki2_bhi[2], \ }; \ int const cctki2_bmax[] = { \ - cctki2_idir==-1 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lssh[0] - cctki2_bhi[0] : cctki2_lssh[0], \ - cctki2_jdir==-1 ? cctki2_blo[1] : cctki2_jdir==0 ? cctki2_lssh[1] - cctki2_bhi[1] : cctki2_lssh[1], \ - cctki2_kdir==-1 ? cctki2_blo[2] : cctki2_kdir==0 ? cctki2_lssh[2] - cctki2_bhi[2] : cctki2_lssh[2], \ + cctki2_idir==-1 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lsh[0] - cctki2_bhi[0] : cctki2_lsh[0], \ + cctki2_jdir==-1 ? cctki2_blo[1] : cctki2_jdir==0 ? cctki2_lsh[1] - cctki2_bhi[1] : cctki2_lsh[1], \ + cctki2_kdir==-1 ? cctki2_blo[2] : cctki2_kdir==0 ? cctki2_lsh[2] - cctki2_bhi[2] : cctki2_lsh[2], \ }; \ CCTK_LOOP3STR_NORMAL(name##_boundaries, \ i,j,k, \ @@ -1516,9 +1516,9 @@ cctki2_idir,cctki2_jdir,cctki2_kdir, \ cctki2_bmin[0],cctki2_bmin[1],cctki2_bmin[2], \ cctki2_bmax[0],cctki2_bmax[1],cctki2_bmax[2], \ - cctki2_cctkGH->cctk_lsh[0], \ - cctki2_cctkGH->cctk_lsh[1], \ - cctki2_cctkGH->cctk_lsh[2], \ + cctki2_cctkGH->cctk_ash[0], \ + cctki2_cctkGH->cctk_ash[1], \ + cctki2_cctkGH->cctk_ash[2], \ cctki2_istr1) { \ #define CCTK_ENDLOOP3STR_BOUNDARIES(name) \ @@ -1572,7 +1572,7 @@ int const cctki2_blo[] = { (iblo),(jblo),(kblo) }; \ int const cctki2_bhi[] = { (ibhi),(jbhi),(kbhi) }; \ int const cctki2_bbox[] = { (ibboxlo), (ibboxhi),(jbboxlo), (jbboxhi),(kbboxlo), (kbboxhi) }; \ - int const cctki2_lssh[] = { cctki2_cctkGH->CCTK_LSSH(0,0),cctki2_cctkGH->CCTK_LSSH(0,1),cctki2_cctkGH->CCTK_LSSH(0,2) }; \ + int const cctki2_lsh[] = { cctki2_cctkGH->cctk_lsh[0],cctki2_cctkGH->cctk_lsh[1],cctki2_cctkGH->cctk_lsh[2] }; \ int const cctki2_istr1 CCTK_ATTRIBUTE_UNUSED = (istr); \ /* Loop over all faces, edges, and corners */ \ for (int cctki2_kdir=-1; cctki2_kdir<=+1; ++cctki2_kdir) { \ @@ -1588,14 +1588,14 @@ (cctki2_kdir==-1 ? cctki2_bbox[4] : 1) && (cctki2_kdir==+1 ? cctki2_bbox[5] : 1); \ if (cctki2_all_bbox && cctki2_any_bbox) { \ int const cctki2_bmin[] = { \ - cctki2_idir==-1 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lssh[0] - cctki2_bhi[0], \ - cctki2_jdir==-1 ? 0 : cctki2_jdir==0 ? cctki2_blo[1] : cctki2_lssh[1] - cctki2_bhi[1], \ - cctki2_kdir==-1 ? 0 : cctki2_kdir==0 ? cctki2_blo[2] : cctki2_lssh[2] - cctki2_bhi[2], \ + cctki2_idir==-1 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lsh[0] - cctki2_bhi[0], \ + cctki2_jdir==-1 ? 0 : cctki2_jdir==0 ? cctki2_blo[1] : cctki2_lsh[1] - cctki2_bhi[1], \ + cctki2_kdir==-1 ? 0 : cctki2_kdir==0 ? cctki2_blo[2] : cctki2_lsh[2] - cctki2_bhi[2], \ }; \ int const cctki2_bmax[] = { \ - cctki2_idir==-1 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lssh[0] - cctki2_bhi[0] : cctki2_lssh[0], \ - cctki2_jdir==-1 ? cctki2_blo[1] : cctki2_jdir==0 ? cctki2_lssh[1] - cctki2_bhi[1] : cctki2_lssh[1], \ - cctki2_kdir==-1 ? cctki2_blo[2] : cctki2_kdir==0 ? cctki2_lssh[2] - cctki2_bhi[2] : cctki2_lssh[2], \ + cctki2_idir==-1 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lsh[0] - cctki2_bhi[0] : cctki2_lsh[0], \ + cctki2_jdir==-1 ? cctki2_blo[1] : cctki2_jdir==0 ? cctki2_lsh[1] - cctki2_bhi[1] : cctki2_lsh[1], \ + cctki2_kdir==-1 ? cctki2_blo[2] : cctki2_kdir==0 ? cctki2_lsh[2] - cctki2_bhi[2] : cctki2_lsh[2], \ }; \ CCTK_LOOP3STR_NORMAL(name##_intboundaries, \ i,j,k, \ @@ -1603,9 +1603,9 @@ cctki2_idir,cctki2_jdir,cctki2_kdir, \ cctki2_bmin[0],cctki2_bmin[1],cctki2_bmin[2], \ cctki2_bmax[0],cctki2_bmax[1],cctki2_bmax[2], \ - cctki2_cctkGH->cctk_lsh[0], \ - cctki2_cctkGH->cctk_lsh[1], \ - cctki2_cctkGH->cctk_lsh[2], \ + cctki2_cctkGH->cctk_ash[0], \ + cctki2_cctkGH->cctk_ash[1], \ + cctki2_cctkGH->cctk_ash[2], \ cctki2_istr1) { \ #define CCTK_ENDLOOP3STR_INTBOUNDARIES(name) \ @@ -1644,12 +1644,12 @@ CCTK_LOOP3STR(name##_all, \ i,j,k, \ 0,0,0, \ - cctki3_cctkGH->CCTK_LSSH(0,0), \ - cctki3_cctkGH->CCTK_LSSH(0,1), \ - cctki3_cctkGH->CCTK_LSSH(0,2), \ cctki3_cctkGH->cctk_lsh[0], \ cctki3_cctkGH->cctk_lsh[1], \ cctki3_cctkGH->cctk_lsh[2], \ + cctki3_cctkGH->cctk_ash[0], \ + cctki3_cctkGH->cctk_ash[1], \ + cctki3_cctkGH->cctk_ash[2], \ (istr)) { \ #define CCTK_ENDLOOP3STR_ALL(name) \ @@ -1817,19 +1817,19 @@ i,j,k, \ imin,jmin,kmin, \ imax,jmax,kmax, \ - ilsh,jlsh,klsh) \ + iash,jash,kash) \ CCTK_LOOP3STR(name, \ i,j,k, \ imin,jmin,kmin, \ imax,jmax,kmax, \ - ilsh,jlsh,klsh, \ + iash,jash,kash, \ 1) \ #define CCTK_LOOP3STR(name, \ i,j,k, \ imin,jmin,kmin, \ imax,jmax,kmax, \ - ilsh,jlsh,klsh, \ + iash,jash,kash, \ istr) \ && name/**/_imin = imin \ && name/**/_jmin = jmin \ @@ -1872,8 +1872,8 @@ CCTK_LOOP3STR(name, \ i,j,k, \ 1,1,1, \ - CCTK_LSSH(0,1),CCTK_LSSH(0,2),CCTK_LSSH(0,3), \ cctk_lsh(1),cctk_lsh(2),cctk_lsh(3), \ + cctk_ash(1),cctk_ash(2),cctk_ash(3), \ istr) \ #define CCTK_ENDLOOP3_ALL(name) \ @@ -1910,10 +1910,10 @@ CCTK_LOOP3STR(name, \ i,j,k, \ (iblo),(jblo),(kblo), \ - CCTK_LSSH(0,1)-(ibhi), \ - CCTK_LSSH(0,2)-(jbhi), \ - CCTK_LSSH(0,3)-(kbhi), \ - cctk_lsh(1),cctk_lsh(2),cctk_lsh(3), \ + cctk_lsh(1)-(ibhi), \ + cctk_lsh(2)-(jbhi), \ + cctk_lsh(3)-(kbhi), \ + cctk_ash(1),cctk_ash(2),cctk_ash(3), \ istr) \ #define CCTK_ENDLOOP3_INTERIOR(name) \ @@ -1959,7 +1959,7 @@ && do lc_face=1,2 \ && do lc_d=1,3 \ && lc_bmin(lc_d) = 1 \ - && lc_bmax(lc_d) = CCTK_LSSH(0,lc_d) \ + && lc_bmax(lc_d) = cctk_lsh(lc_d) \ && if (lc_dCCTK_LSSH(0,0)-(ibhi), \ - cctki2_cctkGH->CCTK_LSSH(0,1)-(jbhi), \ - cctki2_cctkGH->CCTK_LSSH(0,2)-(kbhi), \ - cctki2_cctkGH->CCTK_LSSH(0,3)-(lbhi), \ - cctki2_cctkGH->cctk_lsh[0], \ - cctki2_cctkGH->cctk_lsh[1], \ - cctki2_cctkGH->cctk_lsh[2], \ - cctki2_cctkGH->cctk_lsh[3], \ + cctki2_cctkGH->cctk_lsh[0]-(ibhi), \ + cctki2_cctkGH->cctk_lsh[1]-(jbhi), \ + cctki2_cctkGH->cctk_lsh[2]-(kbhi), \ + cctki2_cctkGH->cctk_lsh[3]-(lbhi), \ + cctki2_cctkGH->cctk_ash[0], \ + cctki2_cctkGH->cctk_ash[1], \ + cctki2_cctkGH->cctk_ash[2], \ + cctki2_cctkGH->cctk_ash[3], \ (istr)) { \ #define CCTK_ENDLOOP4STR_INTERIOR(name) \ @@ -2183,7 +2183,7 @@ int const cctki2_blo[] = { (iblo),(jblo),(kblo),(lblo) }; \ int const cctki2_bhi[] = { (ibhi),(jbhi),(kbhi),(lbhi) }; \ int const cctki2_bbox[] = { (ibboxlo), (ibboxhi),(jbboxlo), (jbboxhi),(kbboxlo), (kbboxhi),(lbboxlo), (lbboxhi) }; \ - int const cctki2_lssh[] = { cctki2_cctkGH->CCTK_LSSH(0,0),cctki2_cctkGH->CCTK_LSSH(0,1),cctki2_cctkGH->CCTK_LSSH(0,2),cctki2_cctkGH->CCTK_LSSH(0,3) }; \ + int const cctki2_lsh[] = { cctki2_cctkGH->cctk_lsh[0],cctki2_cctkGH->cctk_lsh[1],cctki2_cctkGH->cctk_lsh[2],cctki2_cctkGH->cctk_lsh[3] }; \ int const cctki2_istr1 CCTK_ATTRIBUTE_UNUSED = (istr); \ /* Loop over all faces, edges, and corners */ \ for (int cctki2_ldir=-1; cctki2_ldir<=+1; ++cctki2_ldir) { \ @@ -2197,16 +2197,16 @@ (cctki2_ldir==-1 ? cctki2_bbox[6] : 0) || (cctki2_ldir==+1 ? cctki2_bbox[7] : 0); \ if (cctki2_any_bbox) { \ int const cctki2_bmin[] = { \ - cctki2_idir==-1 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lssh[0] - cctki2_bhi[0], \ - cctki2_jdir==-1 ? 0 : cctki2_jdir==0 ? cctki2_blo[1] : cctki2_lssh[1] - cctki2_bhi[1], \ - cctki2_kdir==-1 ? 0 : cctki2_kdir==0 ? cctki2_blo[2] : cctki2_lssh[2] - cctki2_bhi[2], \ - cctki2_ldir==-1 ? 0 : cctki2_ldir==0 ? cctki2_blo[3] : cctki2_lssh[3] - cctki2_bhi[3], \ + cctki2_idir==-1 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lsh[0] - cctki2_bhi[0], \ + cctki2_jdir==-1 ? 0 : cctki2_jdir==0 ? cctki2_blo[1] : cctki2_lsh[1] - cctki2_bhi[1], \ + cctki2_kdir==-1 ? 0 : cctki2_kdir==0 ? cctki2_blo[2] : cctki2_lsh[2] - cctki2_bhi[2], \ + cctki2_ldir==-1 ? 0 : cctki2_ldir==0 ? cctki2_blo[3] : cctki2_lsh[3] - cctki2_bhi[3], \ }; \ int const cctki2_bmax[] = { \ - cctki2_idir==-1 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lssh[0] - cctki2_bhi[0] : cctki2_lssh[0], \ - cctki2_jdir==-1 ? cctki2_blo[1] : cctki2_jdir==0 ? cctki2_lssh[1] - cctki2_bhi[1] : cctki2_lssh[1], \ - cctki2_kdir==-1 ? cctki2_blo[2] : cctki2_kdir==0 ? cctki2_lssh[2] - cctki2_bhi[2] : cctki2_lssh[2], \ - cctki2_ldir==-1 ? cctki2_blo[3] : cctki2_ldir==0 ? cctki2_lssh[3] - cctki2_bhi[3] : cctki2_lssh[3], \ + cctki2_idir==-1 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lsh[0] - cctki2_bhi[0] : cctki2_lsh[0], \ + cctki2_jdir==-1 ? cctki2_blo[1] : cctki2_jdir==0 ? cctki2_lsh[1] - cctki2_bhi[1] : cctki2_lsh[1], \ + cctki2_kdir==-1 ? cctki2_blo[2] : cctki2_kdir==0 ? cctki2_lsh[2] - cctki2_bhi[2] : cctki2_lsh[2], \ + cctki2_ldir==-1 ? cctki2_blo[3] : cctki2_ldir==0 ? cctki2_lsh[3] - cctki2_bhi[3] : cctki2_lsh[3], \ }; \ CCTK_LOOP4STR_NORMAL(name##_boundaries, \ i,j,k,l, \ @@ -2214,10 +2214,10 @@ cctki2_idir,cctki2_jdir,cctki2_kdir,cctki2_ldir, \ cctki2_bmin[0],cctki2_bmin[1],cctki2_bmin[2],cctki2_bmin[3], \ cctki2_bmax[0],cctki2_bmax[1],cctki2_bmax[2],cctki2_bmax[3], \ - cctki2_cctkGH->cctk_lsh[0], \ - cctki2_cctkGH->cctk_lsh[1], \ - cctki2_cctkGH->cctk_lsh[2], \ - cctki2_cctkGH->cctk_lsh[3], \ + cctki2_cctkGH->cctk_ash[0], \ + cctki2_cctkGH->cctk_ash[1], \ + cctki2_cctkGH->cctk_ash[2], \ + cctki2_cctkGH->cctk_ash[3], \ cctki2_istr1) { \ #define CCTK_ENDLOOP4STR_BOUNDARIES(name) \ @@ -2272,7 +2272,7 @@ int const cctki2_blo[] = { (iblo),(jblo),(kblo),(lblo) }; \ int const cctki2_bhi[] = { (ibhi),(jbhi),(kbhi),(lbhi) }; \ int const cctki2_bbox[] = { (ibboxlo), (ibboxhi),(jbboxlo), (jbboxhi),(kbboxlo), (kbboxhi),(lbboxlo), (lbboxhi) }; \ - int const cctki2_lssh[] = { cctki2_cctkGH->CCTK_LSSH(0,0),cctki2_cctkGH->CCTK_LSSH(0,1),cctki2_cctkGH->CCTK_LSSH(0,2),cctki2_cctkGH->CCTK_LSSH(0,3) }; \ + int const cctki2_lsh[] = { cctki2_cctkGH->cctk_lsh[0],cctki2_cctkGH->cctk_lsh[1],cctki2_cctkGH->cctk_lsh[2],cctki2_cctkGH->cctk_lsh[3] }; \ int const cctki2_istr1 CCTK_ATTRIBUTE_UNUSED = (istr); \ /* Loop over all faces, edges, and corners */ \ for (int cctki2_ldir=-1; cctki2_ldir<=+1; ++cctki2_ldir) { \ @@ -2291,16 +2291,16 @@ (cctki2_ldir==-1 ? cctki2_bbox[6] : 1) && (cctki2_ldir==+1 ? cctki2_bbox[7] : 1); \ if (cctki2_all_bbox && cctki2_any_bbox) { \ int const cctki2_bmin[] = { \ - cctki2_idir==-1 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lssh[0] - cctki2_bhi[0], \ - cctki2_jdir==-1 ? 0 : cctki2_jdir==0 ? cctki2_blo[1] : cctki2_lssh[1] - cctki2_bhi[1], \ - cctki2_kdir==-1 ? 0 : cctki2_kdir==0 ? cctki2_blo[2] : cctki2_lssh[2] - cctki2_bhi[2], \ - cctki2_ldir==-1 ? 0 : cctki2_ldir==0 ? cctki2_blo[3] : cctki2_lssh[3] - cctki2_bhi[3], \ + cctki2_idir==-1 ? 0 : cctki2_idir==0 ? cctki2_blo[0] : cctki2_lsh[0] - cctki2_bhi[0], \ + cctki2_jdir==-1 ? 0 : cctki2_jdir==0 ? cctki2_blo[1] : cctki2_lsh[1] - cctki2_bhi[1], \ + cctki2_kdir==-1 ? 0 : cctki2_kdir==0 ? cctki2_blo[2] : cctki2_lsh[2] - cctki2_bhi[2], \ + cctki2_ldir==-1 ? 0 : cctki2_ldir==0 ? cctki2_blo[3] : cctki2_lsh[3] - cctki2_bhi[3], \ }; \ int const cctki2_bmax[] = { \ - cctki2_idir==-1 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lssh[0] - cctki2_bhi[0] : cctki2_lssh[0], \ - cctki2_jdir==-1 ? cctki2_blo[1] : cctki2_jdir==0 ? cctki2_lssh[1] - cctki2_bhi[1] : cctki2_lssh[1], \ - cctki2_kdir==-1 ? cctki2_blo[2] : cctki2_kdir==0 ? cctki2_lssh[2] - cctki2_bhi[2] : cctki2_lssh[2], \ - cctki2_ldir==-1 ? cctki2_blo[3] : cctki2_ldir==0 ? cctki2_lssh[3] - cctki2_bhi[3] : cctki2_lssh[3], \ + cctki2_idir==-1 ? cctki2_blo[0] : cctki2_idir==0 ? cctki2_lsh[0] - cctki2_bhi[0] : cctki2_lsh[0], \ + cctki2_jdir==-1 ? cctki2_blo[1] : cctki2_jdir==0 ? cctki2_lsh[1] - cctki2_bhi[1] : cctki2_lsh[1], \ + cctki2_kdir==-1 ? cctki2_blo[2] : cctki2_kdir==0 ? cctki2_lsh[2] - cctki2_bhi[2] : cctki2_lsh[2], \ + cctki2_ldir==-1 ? cctki2_blo[3] : cctki2_ldir==0 ? cctki2_lsh[3] - cctki2_bhi[3] : cctki2_lsh[3], \ }; \ CCTK_LOOP4STR_NORMAL(name##_intboundaries, \ i,j,k,l, \ @@ -2308,10 +2308,10 @@ cctki2_idir,cctki2_jdir,cctki2_kdir,cctki2_ldir, \ cctki2_bmin[0],cctki2_bmin[1],cctki2_bmin[2],cctki2_bmin[3], \ cctki2_bmax[0],cctki2_bmax[1],cctki2_bmax[2],cctki2_bmax[3], \ - cctki2_cctkGH->cctk_lsh[0], \ - cctki2_cctkGH->cctk_lsh[1], \ - cctki2_cctkGH->cctk_lsh[2], \ - cctki2_cctkGH->cctk_lsh[3], \ + cctki2_cctkGH->cctk_ash[0], \ + cctki2_cctkGH->cctk_ash[1], \ + cctki2_cctkGH->cctk_ash[2], \ + cctki2_cctkGH->cctk_ash[3], \ cctki2_istr1) { \ #define CCTK_ENDLOOP4STR_INTBOUNDARIES(name) \ @@ -2351,14 +2351,14 @@ CCTK_LOOP4STR(name##_all, \ i,j,k,l, \ 0,0,0,0, \ - cctki3_cctkGH->CCTK_LSSH(0,0), \ - cctki3_cctkGH->CCTK_LSSH(0,1), \ - cctki3_cctkGH->CCTK_LSSH(0,2), \ - cctki3_cctkGH->CCTK_LSSH(0,3), \ cctki3_cctkGH->cctk_lsh[0], \ cctki3_cctkGH->cctk_lsh[1], \ cctki3_cctkGH->cctk_lsh[2], \ cctki3_cctkGH->cctk_lsh[3], \ + cctki3_cctkGH->cctk_ash[0], \ + cctki3_cctkGH->cctk_ash[1], \ + cctki3_cctkGH->cctk_ash[2], \ + cctki3_cctkGH->cctk_ash[3], \ (istr)) { \ #define CCTK_ENDLOOP4STR_ALL(name) \ @@ -2526,19 +2526,19 @@ i,j,k,l, \ imin,jmin,kmin,lmin, \ imax,jmax,kmax,lmax, \ - ilsh,jlsh,klsh,llsh) \ + iash,jash,kash,lash) \ CCTK_LOOP4STR(name, \ i,j,k,l, \ imin,jmin,kmin,lmin, \ imax,jmax,kmax,lmax, \ - ilsh,jlsh,klsh,llsh, \ + iash,jash,kash,lash, \ 1) \ #define CCTK_LOOP4STR(name, \ i,j,k,l, \ imin,jmin,kmin,lmin, \ imax,jmax,kmax,lmax, \ - ilsh,jlsh,klsh,llsh, \ + iash,jash,kash,lash, \ istr) \ && name/**/_imin = imin \ && name/**/_jmin = jmin \ @@ -2585,8 +2585,8 @@ CCTK_LOOP4STR(name, \ i,j,k,l, \ 1,1,1,1, \ - CCTK_LSSH(0,1),CCTK_LSSH(0,2),CCTK_LSSH(0,3),CCTK_LSSH(0,4), \ cctk_lsh(1),cctk_lsh(2),cctk_lsh(3),cctk_lsh(4), \ + cctk_ash(1),cctk_ash(2),cctk_ash(3),cctk_ash(4), \ istr) \ #define CCTK_ENDLOOP4_ALL(name) \ @@ -2623,11 +2623,11 @@ CCTK_LOOP4STR(name, \ i,j,k,l, \ (iblo),(jblo),(kblo),(lblo), \ - CCTK_LSSH(0,1)-(ibhi), \ - CCTK_LSSH(0,2)-(jbhi), \ - CCTK_LSSH(0,3)-(kbhi), \ - CCTK_LSSH(0,4)-(lbhi), \ - cctk_lsh(1),cctk_lsh(2),cctk_lsh(3),cctk_lsh(4), \ + cctk_lsh(1)-(ibhi), \ + cctk_lsh(2)-(jbhi), \ + cctk_lsh(3)-(kbhi), \ + cctk_lsh(4)-(lbhi), \ + cctk_ash(1),cctk_ash(2),cctk_ash(3),cctk_ash(4), \ istr) \ #define CCTK_ENDLOOP4_INTERIOR(name) \ @@ -2673,7 +2673,7 @@ && do lc_face=1,2 \ && do lc_d=1,4 \ && lc_bmin(lc_d) = 1 \ - && lc_bmax(lc_d) = CCTK_LSSH(0,lc_d) \ + && lc_bmax(lc_d) = cctk_lsh(lc_d) \ && if (lc_dCCTK_LSSH(0,[I])-([C]bhi),')), - (rpt (bsnl ' cctki2_cctkGH->cctk_lsh[[I]],')), + (rpt (bsnl ' cctki2_cctkGH->cctk_lsh[[I]]-([C]bhi),')), + (rpt (bsnl ' cctki2_cctkGH->cctk_ash[[I]],')), (bsnl ' (istr)) {'), (nl ''), (bsnl '#define CCTK_ENDLOOP[DIM]STR_INTERIOR(name)'), @@ -360,7 +360,7 @@ for $dim (1,2,3,4) { (bsnl ' int const cctki2_blo[] = { '.(crpt '([C]blo)').' };'), (bsnl ' int const cctki2_bhi[] = { '.(crpt '([C]bhi)').' };'), (bsnl ' int const cctki2_bbox[] = { '.(crpt '([C]bboxlo), ([C]bboxhi)').' };'), - (bsnl ' int const cctki2_lssh[] = { '.(crpt 'cctki2_cctkGH->CCTK_LSSH(0,[I])').' };'), + (bsnl ' int const cctki2_lsh[] = { '.(crpt 'cctki2_cctkGH->cctk_lsh[[I]]').' };'), (bsnl ' int const cctki2_istr1 CCTK_ATTRIBUTE_UNUSED = (istr);'), (bsnl ' /* Loop over all faces, edges, and corners */'), (reverse (rpt (bsnl ' for (int cctki2_[C]dir=-1; cctki2_[C]dir<=+1; ++cctki2_[C]dir) {'))), @@ -368,10 +368,10 @@ for $dim (1,2,3,4) { (bsnlsep [rpt ' (cctki2_[C]dir==-1 ? cctki2_bbox[[2*I]] : 0) || (cctki2_[C]dir==+1 ? cctki2_bbox[[2*I+1]] : 0)'], '||', ';'), (bsnl ' if (cctki2_any_bbox) {'), (bsnl ' int const cctki2_bmin[] = {'), - (rpt (bsnl ' cctki2_[C]dir==-1 ? 0 : cctki2_[C]dir==0 ? cctki2_blo[[I]] : cctki2_lssh[[I]] - cctki2_bhi[[I]],')), + (rpt (bsnl ' cctki2_[C]dir==-1 ? 0 : cctki2_[C]dir==0 ? cctki2_blo[[I]] : cctki2_lsh[[I]] - cctki2_bhi[[I]],')), (bsnl ' };'), (bsnl ' int const cctki2_bmax[] = {'), - (rpt (bsnl ' cctki2_[C]dir==-1 ? cctki2_blo[[I]] : cctki2_[C]dir==0 ? cctki2_lssh[[I]] - cctki2_bhi[[I]] : cctki2_lssh[[I]],')), + (rpt (bsnl ' cctki2_[C]dir==-1 ? cctki2_blo[[I]] : cctki2_[C]dir==0 ? cctki2_lsh[[I]] - cctki2_bhi[[I]] : cctki2_lsh[[I]],')), (bsnl ' };'), (bsnl ' CCTK_LOOP[DIM]STR_NORMAL(name##_boundaries,'), (bsnl ' '.(crpt '[C]').','), @@ -379,7 +379,7 @@ for $dim (1,2,3,4) { (bsnl ' '.(crpt 'cctki2_[C]dir').','), (bsnl ' '.(crpt 'cctki2_bmin[[I]]').','), (bsnl ' '.(crpt 'cctki2_bmax[[I]]').','), - (rpt (bsnl ' cctki2_cctkGH->cctk_lsh[[I]],')), + (rpt (bsnl ' cctki2_cctkGH->cctk_ash[[I]],')), (bsnl ' cctki2_istr1) {'), (nl ''), (bsnl '#define CCTK_ENDLOOP[DIM]STR_BOUNDARIES(name)'), @@ -431,7 +431,7 @@ for $dim (1,2,3,4) { (bsnl ' int const cctki2_blo[] = { '.(crpt '([C]blo)').' };'), (bsnl ' int const cctki2_bhi[] = { '.(crpt '([C]bhi)').' };'), (bsnl ' int const cctki2_bbox[] = { '.(crpt '([C]bboxlo), ([C]bboxhi)').' };'), - (bsnl ' int const cctki2_lssh[] = { '.(crpt 'cctki2_cctkGH->CCTK_LSSH(0,[I])').' };'), + (bsnl ' int const cctki2_lsh[] = { '.(crpt 'cctki2_cctkGH->cctk_lsh[[I]]').' };'), (bsnl ' int const cctki2_istr1 CCTK_ATTRIBUTE_UNUSED = (istr);'), (bsnl ' /* Loop over all faces, edges, and corners */'), (reverse (rpt (bsnl ' for (int cctki2_[C]dir=-1; cctki2_[C]dir<=+1; ++cctki2_[C]dir) {'))), @@ -441,10 +441,10 @@ for $dim (1,2,3,4) { (bsnlsep [rpt ' (cctki2_[C]dir==-1 ? cctki2_bbox[[2*I]] : 1) && (cctki2_[C]dir==+1 ? cctki2_bbox[[2*I+1]] : 1)'], '&&', ';'), (bsnl ' if (cctki2_all_bbox && cctki2_any_bbox) {'), (bsnl ' int const cctki2_bmin[] = {'), - (rpt (bsnl ' cctki2_[C]dir==-1 ? 0 : cctki2_[C]dir==0 ? cctki2_blo[[I]] : cctki2_lssh[[I]] - cctki2_bhi[[I]],')), + (rpt (bsnl ' cctki2_[C]dir==-1 ? 0 : cctki2_[C]dir==0 ? cctki2_blo[[I]] : cctki2_lsh[[I]] - cctki2_bhi[[I]],')), (bsnl ' };'), (bsnl ' int const cctki2_bmax[] = {'), - (rpt (bsnl ' cctki2_[C]dir==-1 ? cctki2_blo[[I]] : cctki2_[C]dir==0 ? cctki2_lssh[[I]] - cctki2_bhi[[I]] : cctki2_lssh[[I]],')), + (rpt (bsnl ' cctki2_[C]dir==-1 ? cctki2_blo[[I]] : cctki2_[C]dir==0 ? cctki2_lsh[[I]] - cctki2_bhi[[I]] : cctki2_lsh[[I]],')), (bsnl ' };'), (bsnl ' CCTK_LOOP[DIM]STR_NORMAL(name##_intboundaries,'), (bsnl ' '.(crpt '[C]').','), @@ -452,7 +452,7 @@ for $dim (1,2,3,4) { (bsnl ' '.(crpt 'cctki2_[C]dir').','), (bsnl ' '.(crpt 'cctki2_bmin[[I]]').','), (bsnl ' '.(crpt 'cctki2_bmax[[I]]').','), - (rpt (bsnl ' cctki2_cctkGH->cctk_lsh[[I]],')), + (rpt (bsnl ' cctki2_cctkGH->cctk_ash[[I]],')), (bsnl ' cctki2_istr1) {'), (nl ''), (bsnl '#define CCTK_ENDLOOP[DIM]STR_INTBOUNDARIES(name)'), @@ -489,8 +489,8 @@ for $dim (1,2,3,4) { (bsnl ' CCTK_LOOP[DIM]STR(name##_all,'), (bsnl ' '.(crpt '[C]').','), (bsnl ' '.(crpt '0').','), - (rpt (bsnl ' cctki3_cctkGH->CCTK_LSSH(0,[I]),')), (rpt (bsnl ' cctki3_cctkGH->cctk_lsh[[I]],')), + (rpt (bsnl ' cctki3_cctkGH->cctk_ash[[I]],')), (bsnl ' (istr)) {'), (nl ''), (bsnl '#define CCTK_ENDLOOP[DIM]STR_ALL(name)'), @@ -658,19 +658,19 @@ for $dim (1,2,3,4) { (bsnl ' '.(crpt '[C]').','), (bsnl ' '.(crpt '[C]min').','), (bsnl ' '.(crpt '[C]max').','), - (bsnl ' '.(crpt '[C]lsh').')'), + (bsnl ' '.(crpt '[C]ash').')'), (bsnl ' CCTK_LOOP[DIM]STR(name,'), (bsnl ' '.(crpt '[C]').','), (bsnl ' '.(crpt '[C]min').','), (bsnl ' '.(crpt '[C]max').','), - (bsnl ' '.(crpt '[C]lsh').','), + (bsnl ' '.(crpt '[C]ash').','), (bsnl ' 1)'), (nl ''), (bsnl '#define CCTK_LOOP[DIM]STR(name,'), (bsnl ' '.(crpt '[C]').','), (bsnl ' '.(crpt '[C]min').','), (bsnl ' '.(crpt '[C]max').','), - (bsnl ' '.(crpt '[C]lsh').','), + (bsnl ' '.(crpt '[C]ash').','), (bsnl ' istr)'), (rpt (bsnl ' && name/**/_[C]min = [C]min')), (rpt (bsnl ' && name/**/_[C]max = [C]max')), @@ -705,8 +705,8 @@ for $dim (1,2,3,4) { (bsnl ' CCTK_LOOP[DIM]STR(name,'), (bsnl ' '.(crpt '[C]').','), (bsnl ' '.(crpt '1').','), - (bsnl ' '.(crpt 'CCTK_LSSH(0,[I+1])').','), (bsnl ' '.(crpt 'cctk_lsh([I+1])').','), + (bsnl ' '.(crpt 'cctk_ash([I+1])').','), (bsnl ' istr)'), (nl ''), (bsnl '#define CCTK_ENDLOOP[DIM]_ALL(name)'), @@ -743,8 +743,8 @@ for $dim (1,2,3,4) { (bsnl ' CCTK_LOOP[DIM]STR(name,'), (bsnl ' '.(crpt '[C]').','), (bsnl ' '.(crpt '([C]blo)').','), - (rpt (bsnl ' CCTK_LSSH(0,[I+1])-([C]bhi),')), - (bsnl ' '.(crpt 'cctk_lsh([I+1])').','), + (rpt (bsnl ' cctk_lsh([I+1])-([C]bhi),')), + (bsnl ' '.(crpt 'cctk_ash([I+1])').','), (bsnl ' istr)'), (nl ''), (bsnl '#define CCTK_ENDLOOP[DIM]_INTERIOR(name)'), @@ -790,7 +790,7 @@ for $dim (1,2,3,4) { (bsnl ' && do lc_face=1,2'), (bsnl ' && do lc_d=1,[DIM]'), (bsnl ' && lc_bmin(lc_d) = 1'), - (bsnl ' && lc_bmax(lc_d) = CCTK_LSSH(0,lc_d)'), + (bsnl ' && lc_bmax(lc_d) = cctk_lsh(lc_d)'), (bsnl ' && if (lc_dcctk_lsh[0] * j; + return i + cctkGH->cctk_ash[0] * j; } static inline int CCTK_GFINDEX3D (const cGH *restrict cctkGH, int i, int j, int k) { - return (i + cctkGH->cctk_lsh[0] * - (j + cctkGH->cctk_lsh[1] * k)); + return (i + cctkGH->cctk_ash[0] * + (j + cctkGH->cctk_ash[1] * k)); } static inline int CCTK_GFINDEX4D (const cGH *restrict cctkGH, int i, int j, int k, int l) { - return (i + cctkGH->cctk_lsh[0] * - (j + cctkGH->cctk_lsh[1] * - (k + cctkGH->cctk_lsh[2] * l))); + return (i + cctkGH->cctk_ash[0] * + (j + cctkGH->cctk_ash[1] * + (k + cctkGH->cctk_ash[2] * l))); } static inline int CCTK_VECTGFINDEX0D (const cGH *restrict cctkGH, @@ -238,31 +233,31 @@ static inline int CCTK_VECTGFINDEX0D (const cGH *restrict cctkGH, static inline int CCTK_VECTGFINDEX1D (const cGH *restrict cctkGH, int i, int n) { - return i + cctkGH->cctk_lsh[0] * n; + return i + cctkGH->cctk_ash[0] * n; } static inline int CCTK_VECTGFINDEX2D (const cGH *restrict cctkGH, int i, int j, int n) { - return (i + cctkGH->cctk_lsh[0] * - (j + cctkGH->cctk_lsh[1] * n)); + return (i + cctkGH->cctk_ash[0] * + (j + cctkGH->cctk_ash[1] * n)); } static inline int CCTK_VECTGFINDEX3D (const cGH *restrict cctkGH, int i, int j, int k, int n) { - return (i + cctkGH->cctk_lsh[0] * - (j + cctkGH->cctk_lsh[1] * - (k + cctkGH->cctk_lsh[2] * n))); + return (i + cctkGH->cctk_ash[0] * + (j + cctkGH->cctk_ash[1] * + (k + cctkGH->cctk_ash[2] * n))); } static inline int CCTK_VECTGFINDEX4D (const cGH *restrict cctkGH, int i, int j, int k, int l, int n) { - return (i + cctkGH->cctk_lsh[0] * - (j + cctkGH->cctk_lsh[1] * - (k + cctkGH->cctk_lsh[2] * - (l + cctkGH->cctk_lsh[3] * n)))); + return (i + cctkGH->cctk_ash[0] * + (j + cctkGH->cctk_ash[1] * + (k + cctkGH->cctk_ash[2] * + (l + cctkGH->cctk_ash[3] * n)))); } #endif @@ -281,7 +276,7 @@ static inline int CCTK_VECTGFINDEX4D (const cGH *restrict cctkGH, CCTK_DECLARE_INIT(int const *restrict const,cctk_lsh,cctkGH->cctk_lsh);\ CCTK_DECLARE_INIT(int const *restrict const,cctk_lbnd,cctkGH->cctk_lbnd);\ CCTK_DECLARE_INIT(int const *restrict const,cctk_ubnd,cctkGH->cctk_ubnd);\ - CCTK_DECLARE_INIT(int const *restrict const,cctk_lssh,cctkGH->cctk_lssh);\ + CCTK_DECLARE_INIT(int const *restrict const,cctk_ash,cctkGH->cctk_ash);\ CCTK_DECLARE_INIT(int const *restrict const,cctk_from,cctkGH->cctk_from);\ CCTK_DECLARE_INIT(int const *restrict const,cctk_to,cctkGH->cctk_to);\ CCTK_DECLARE_INIT(int const *restrict const,cctk_bbox,cctkGH->cctk_bbox);\ @@ -303,7 +298,7 @@ static inline int CCTK_VECTGFINDEX4D (const cGH *restrict cctkGH, #define _PASS_CCTK_C2F(xGH) &((xGH)->cctk_dim),\ (xGH)->cctk_gsh,(xGH)->cctk_lsh,\ (xGH)->cctk_lbnd,(xGH)->cctk_ubnd,\ - (xGH)->cctk_lssh,\ + (xGH)->cctk_ash,\ (xGH)->cctk_from,(xGH)->cctk_to,\ (xGH)->cctk_bbox,\ &((xGH)->cctk_delta_time), &((xGH)->cctk_time),\ @@ -317,9 +312,9 @@ static inline int CCTK_VECTGFINDEX4D (const cGH *restrict cctkGH, (xGH)->cctk_nghostzones,\ &((xGH)->cctk_iteration),\ &(xGH),\ - &(xGH)->cctk_lsh[0],\ - &(xGH)->cctk_lsh[1],\ - &(xGH)->cctk_lsh[2] + &(xGH)->cctk_ash[0],\ + &(xGH)->cctk_ash[1],\ + &(xGH)->cctk_ash[2] #define _CCTK_C2F_PROTO int const *,\ int const *, int const *,\ int const *, int const *,\ @@ -348,10 +343,6 @@ static inline int CCTK_VECTGFINDEX4D (const cGH *restrict cctkGH, #define CCTK_ORIGIN_SPACE(x) (cctk_origin_space[x]+cctk_delta_space[x]/cctk_levfac[x]*cctk_levoff[x]/cctk_levoffdenom[x]) #define CCTK_DELTA_SPACE(x) (cctk_delta_space[x]/cctk_levfac[x]) #define CCTK_DELTA_TIME (cctk_delta_time/cctk_timefac) -/* The "stagger index" stag is zero-based (0,1,...), the direction dim - is zero-based in C (0,1,2,...) */ -#define CCTK_LSSH(stag,dim) cctk_lssh[CCTK_LSSH_IDX(stag,dim)] -#define CCTK_LSSH_IDX(stag,dim) ((stag)+CCTK_NSTAGGER*(dim)) #define CCTK_WARN(a,b) CCTK_Warn(a,__LINE__,__FILE__,CCTK_THORNSTRING,b) diff --git a/src/include/cctki_Groups.h b/src/include/cctki_Groups.h index a4b7d34b..ce6724cf 100644 --- a/src/include/cctki_Groups.h +++ b/src/include/cctki_Groups.h @@ -27,7 +27,6 @@ int CCTKi_CreateGroup(const char *gname, const char *gscope, int dimension, int ntimelevels, - const char *stype, const char *dtype, const char *size, const char *ghostsize, diff --git a/src/include/cctki_Stagger.h b/src/include/cctki_Stagger.h deleted file mode 100644 index 3c98e5bc..00000000 --- a/src/include/cctki_Stagger.h +++ /dev/null @@ -1,79 +0,0 @@ - /*@@ - @header cctki_Stagger.h - @date Thu Jan 20 2000 - @author Gerd Lanfermann - @desc - Prototypes and constants for stagger functions. - @enddesc - @version $Header$ - @@*/ - -#ifndef _CCTKI_STAGGER_H_ -#define _CCTKI_STAGGER_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - -int CCTKi_ParseStaggerString(int dim, - const char *imp, - const char *gname, - const char *stype); - -#ifdef __cplusplus -} -#endif - -/* number of implemented staggerings */ -#define CCTK_NUM_STAGGER 3 - -/* number of staggerings (3); stagger flags: yes/no, */ -#define CCTK_NSTAG 3 -#define CCTK_NO_STAGGER 0 -#define CCTK_STAGGER 1 - -/* stagger code in one direction */ -#define CCTK_STAG_M 0 -#define CCTK_STAG_C 1 -#define CCTK_STAG_P 2 - -/* stagger code of three directions */ -#define CCTK_STAG_MMM 0 -#define CCTK_STAG_CMM 1 -#define CCTK_STAG_PMM 2 - -#define CCTK_STAG_MCM 3 -#define CCTK_STAG_CCM 4 -#define CCTK_STAG_PCM 5 - -#define CCTK_STAG_MPM 6 -#define CCTK_STAG_CPM 7 -#define CCTK_STAG_PPM 8 - -#define CCTK_STAG_MMC 9 -#define CCTK_STAG_CMC 10 -#define CCTK_STAG_PMC 11 - -#define CCTK_STAG_MCC 12 -#define CCTK_STAG_CCC 13 -#define CCTK_STAG_PCC 14 - -#define CCTK_STAG_MPC 15 -#define CCTK_STAG_CPC 16 -#define CCTK_STAG_PPC 17 - -#define CCTK_STAG_MMP 18 -#define CCTK_STAG_CMP 19 -#define CCTK_STAG_PMP 20 - -#define CCTK_STAG_MCP 21 -#define CCTK_STAG_CCP 22 -#define CCTK_STAG_PCP 23 - -#define CCTK_STAG_MPP 24 -#define CCTK_STAG_CPP 25 -#define CCTK_STAG_PPP 26 - - -#endif /* _CCTKI_STAGGER_H_ */ diff --git a/src/main/DebugDefines.c b/src/main/DebugDefines.c index bc7a68eb..b7a1ea9c 100644 --- a/src/main/DebugDefines.c +++ b/src/main/DebugDefines.c @@ -79,7 +79,7 @@ int CCTK_GFIndex2D (const cGH *GH, int i, int j) i, j, GH->cctk_lsh[0], GH->cctk_lsh[1]); } #endif - return (i + GH->cctk_lsh[0]*j); + return (i + GH->cctk_ash[0]*j); } int CCTK_GFIndex3D (const cGH *GH, int i, int j, int k) @@ -95,7 +95,7 @@ int CCTK_GFIndex3D (const cGH *GH, int i, int j, int k) i, j, k, GH->cctk_lsh[0], GH->cctk_lsh[1], GH->cctk_lsh[2]); } #endif - return (i + GH->cctk_lsh[0]*(j + GH->cctk_lsh[1]*k)); + return (i + GH->cctk_ash[0]*(j + GH->cctk_ash[1]*k)); } int CCTK_GFIndex4D (const cGH *GH, int i, int j, int k, int l) @@ -112,7 +112,7 @@ int CCTK_GFIndex4D (const cGH *GH, int i, int j, int k, int l) i, j, k, l, GH->cctk_lsh[0], GH->cctk_lsh[1], GH->cctk_lsh[2], GH->cctk_lsh[3]); } #endif - return (i + GH->cctk_lsh[0]*(j + GH->cctk_lsh[1]*(k + GH->cctk_lsh[2] * l))); + return (i + GH->cctk_ash[0]*(j + GH->cctk_ash[1]*(k + GH->cctk_ash[2] * l))); } int CCTK_VectGFIndex0D (const cGH *GH, int n) @@ -147,7 +147,7 @@ int CCTK_VectGFIndex1D (const cGH *GH, int i, int n) n); } #endif - return (i + GH->cctk_lsh[0]*n); + return (i + GH->cctk_ash[0]*n); } int CCTK_VectGFIndex2D (const cGH *GH, int i, int j, int n) @@ -169,7 +169,7 @@ int CCTK_VectGFIndex2D (const cGH *GH, int i, int j, int n) n); } #endif - return (i + GH->cctk_lsh[0]*(j + GH->cctk_lsh[1]*n)); + return (i + GH->cctk_ash[0]*(j + GH->cctk_ash[1]*n)); } int CCTK_VectGFIndex3D (const cGH *GH, int i, int j, int k, int n) @@ -192,7 +192,7 @@ int CCTK_VectGFIndex3D (const cGH *GH, int i, int j, int k, int n) n); } #endif - return (i + GH->cctk_lsh[0]*(j + GH->cctk_lsh[1]*(k + GH->cctk_lsh[2]*n))); + return (i + GH->cctk_ash[0]*(j + GH->cctk_ash[1]*(k + GH->cctk_ash[2]*n))); } int CCTK_VectGFIndex4D (const cGH *GH, int i, int j, int k, int l, int n) @@ -216,6 +216,6 @@ int CCTK_VectGFIndex4D (const cGH *GH, int i, int j, int k, int l, int n) n); } #endif - return (i + GH->cctk_lsh[0]*(j + GH->cctk_lsh[1]*(k + GH->cctk_lsh[2]* - (l + GH->cctk_lsh[3]*n)))); + return (i + GH->cctk_ash[0]*(j + GH->cctk_ash[1]*(k + GH->cctk_ash[2]* + (l + GH->cctk_ash[3]*n)))); } diff --git a/src/main/Groups.c b/src/main/Groups.c index cf501a53..6716692f 100644 --- a/src/main/Groups.c +++ b/src/main/Groups.c @@ -24,7 +24,6 @@ #include "cctk_Types.h" #include "cctk_ActiveThorns.h" -#include "cctki_Stagger.h" #include "cctki_Groups.h" #include "util_Expression.h" @@ -159,8 +158,7 @@ typedef struct /* The types. */ int gtype, vtype, - dtype, - staggertype; + dtype; int gscope; @@ -209,15 +207,12 @@ static int *group_of_variable = NULL; static int maxdim = 0; static int gfdim = 0; -static int staggered = 0; - /******************************************************************** ******************** Internal Routines ************************ ********************************************************************/ static cGroupDefinition *CCTKi_SetupGroup (const char *implementation, const char *name, - int staggercode, int n_variables, int vectorlength); static CCTK_INT **CCTKi_ExtractSize (int dimension, @@ -227,24 +222,6 @@ static CCTK_INT **CCTKi_ExtractSize (int dimension, static int CCTKi_ParamExpressionToInt(const char *expression, const char *thorn); - /*@@ - @routine CCTK_StaggerVars - @date - @author Gerd Lanfermann - @desc - Checks if staggered group(s) exist - @enddesc - - @returntype int - @returndesc - 0 if no staggered group exists, non-zero otherwise - @endreturndesc -@@*/ -int CCTK_StaggerVars (void) -{ - return (staggered); -} - /*@@ @routine CCTK_GroupIndex @@ -1119,7 +1096,6 @@ int CCTK_GroupData (int group, cGroup *gp) gp->numvars = groups[group].n_variables; gp->vectorlength = groups[group].vectorlength; gp->numtimelevels = groups[group].n_timelevels; - gp->stagtype = groups[group].staggertype; gp->tagstable = groups[group].tags_table; if(groups[group].vararraysize) @@ -2340,11 +2316,10 @@ void CCTKi_PrintGroupInfo (void) for (group_num = 0; group_num < n_groups; group_num++) { - printf ("GROUP INFO: GrpNo./imp_name/name/stag %d >%s< >%s< %d\n", + printf ("GROUP INFO: GrpNo./imp_name/name %d >%s< >%s<\n", group_num, groups[group_num].implementation, - groups[group_num].name, - groups[group_num].staggertype); + groups[group_num].name); } } #endif @@ -2371,7 +2346,6 @@ int CCTKi_CreateGroup (const char *gname, const char *gscope, int dimension, int ntimelevels, - const char *stype, const char *dtype, const char *size, const char *ghostsize, @@ -2383,7 +2357,6 @@ int CCTKi_CreateGroup (const char *gname, { int retval; int groupscope; - int staggercode; int variable; int vectorlength; @@ -2404,9 +2377,6 @@ int CCTKi_CreateGroup (const char *gname, va_start (ap, n_basevars); - /* get the staggercode */ - staggercode = CCTKi_ParseStaggerString (dimension, imp, gname, stype); - if (vararraysize) { vararraysize = Util_Strdup(vararraysize); @@ -2426,12 +2396,12 @@ int CCTKi_CreateGroup (const char *gname, groupscope = CCTK_GroupScopeNumber (gscope); if (groupscope == CCTK_PUBLIC || groupscope == CCTK_PROTECTED) { - group = CCTKi_SetupGroup (imp, gname, staggercode, + group = CCTKi_SetupGroup (imp, gname, n_basevars * vectorlength, vectorlength); } else if (groupscope == CCTK_PRIVATE) { - group = CCTKi_SetupGroup (thorn, gname, staggercode, + group = CCTKi_SetupGroup (thorn, gname, n_basevars * vectorlength, vectorlength); } else @@ -2447,7 +2417,6 @@ int CCTKi_CreateGroup (const char *gname, group->gtype = CCTK_GroupTypeNumber (gtype); group->vtype = CCTK_VarTypeNumber (vtype); group->gscope = groupscope; - group->staggertype = staggercode; group->dtype = CCTK_GroupDistribNumber (dtype); group->n_timelevels = ntimelevels; group->tags_string = Util_Strdup(tags); @@ -2491,10 +2460,6 @@ int CCTKi_CreateGroup (const char *gname, { maxdim = dimension; } - if (staggercode > 0) - { - staggered = 1; - } group->size = CCTKi_ExtractSize (dimension, thorn, size, gname); group->ghostsize = CCTKi_ExtractSize (dimension, thorn, ghostsize, gname); @@ -2572,7 +2537,6 @@ const char *CCTK_GroupImplementationI(int group) @@*/ static cGroupDefinition *CCTKi_SetupGroup (const char *implementation, const char *name, - int staggercode, int n_variables, int vectorlength) { @@ -2625,7 +2589,6 @@ static cGroupDefinition *CCTKi_SetupGroup (const char *implementation, strcpy (groups[n_groups].name, name); groups[n_groups].number = n_groups; - groups[n_groups].staggertype = staggercode; groups[n_groups].n_variables = n_variables; groups[n_groups].vectorlength = vectorlength; diff --git a/src/main/GroupsOnGH.c b/src/main/GroupsOnGH.c index 5dc3dbd1..55a4f5da 100644 --- a/src/main/GroupsOnGH.c +++ b/src/main/GroupsOnGH.c @@ -109,29 +109,29 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshVN) const int *dim, int *lsh, ONE_FORTSTRING_ARG); -void CCTK_FCALL CCTK_FNAME (CCTK_GrouplsshGI) +void CCTK_FCALL CCTK_FNAME (CCTK_GroupashGI) (int *ierr, const cGH **cctkGH, const int *dim, - int *lssh, + int *ash, const int *groupindex); -void CCTK_FCALL CCTK_FNAME (CCTK_GrouplsshGN) +void CCTK_FCALL CCTK_FNAME (CCTK_GroupashGN) (int *ierr, const cGH **cctkGH, const int *dim, - int *lssh, + int *ash, ONE_FORTSTRING_ARG); -void CCTK_FCALL CCTK_FNAME (CCTK_GrouplsshVI) +void CCTK_FCALL CCTK_FNAME (CCTK_GroupashVI) (int *ierr, const cGH **cctkGH, const int *dim, - int *lssh, + int *ash, const int *varindex); -void CCTK_FCALL CCTK_FNAME (CCTK_GrouplsshVN) +void CCTK_FCALL CCTK_FNAME (CCTK_GroupashVN) (int *ierr, const cGH **cctkGH, const int *dim, - int *lssh, + int *ash, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GroupgshGI) (int *ierr, @@ -1226,21 +1226,21 @@ void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshVN) /******************************************************************** - ******************** Group local stagger shape *************** + ******************** Group local allocated shape ************* ********************************************************************/ /*@@ - @routine CCTK_GrouplsshGI + @routine CCTK_GroupashGI @date 2011-03-16 @author Erik Schnetter @desc - Returns the lssh for a variable group + Returns the ash for a variable group @enddesc @@*/ -int CCTK_GrouplsshGI(const cGH *cctkGH, - int size, - int *lssh, - int groupindex) +int CCTK_GroupashGI(const cGH *cctkGH, + int size, + int *ash, + int groupindex) { int retval = 0; int ierr; @@ -1250,144 +1250,144 @@ int CCTK_GrouplsshGI(const cGH *cctkGH, ierr = CCTK_GroupDynamicData(cctkGH,groupindex,&data); - if (ierr == 0 && (data.dim == 0 || data.lssh)) + if (ierr == 0 && (data.dim == 0 || data.ash)) { - if (CCTK_NSTAGGER*data.dim != size) + if (data.dim != size) { retval = -1; - usesize = (CCTK_NSTAGGER*data.dim < size) ? CCTK_NSTAGGER*data.dim : size; + usesize = (data.dim < size) ? data.dim : size; groupname = CCTK_GroupName (groupindex); CCTK_VWarn(1,__LINE__,__FILE__,"Cactus", - "CCTK_GrouplsshGI: Incorrect size %d supplied, " + "CCTK_GroupashGI: Incorrect size %d supplied, " "group '%s' has dimension %d, copying %d integers", size,groupname,data.dim,usesize); free (groupname); } - memcpy(lssh,(const int *)data.lssh,usesize*sizeof(int)); + memcpy(ash,(const int *)data.ash,usesize*sizeof(int)); } else { retval = -2; CCTK_VWarn(1,__LINE__,__FILE__,"Cactus", - "CCTK_GrouplsshGI: Data not available from driver thorn"); + "CCTK_GroupashGI: Data not available from driver thorn"); } return retval; } -void CCTK_FCALL CCTK_FNAME (CCTK_GrouplsshGI) +void CCTK_FCALL CCTK_FNAME (CCTK_GroupashGI) (int *ierr, const cGH **cctkGH, const int *size, - int *lssh, + int *ash, const int *groupindex) { - *ierr = CCTK_GrouplsshGI (*cctkGH, *size, lssh, *groupindex); + *ierr = CCTK_GroupashGI (*cctkGH, *size, ash, *groupindex); } -int CCTK_GrouplsshGN(const cGH *cctkGH, - int size, - int *lssh, - const char *groupname) +int CCTK_GroupashGN(const cGH *cctkGH, + int size, + int *ash, + const char *groupname) { int retval; int gindex = CCTK_GroupIndex(groupname); if (gindex > -1) { - retval = CCTK_GrouplsshGI(cctkGH,size,lssh,gindex); + retval = CCTK_GroupashGI(cctkGH,size,ash,gindex); } else { retval = -4; CCTK_VWarn(1,__LINE__,__FILE__,"Cactus", - "CCTK_GrouplsshGN: Group index not found for %s",groupname); + "CCTK_GroupashGN: Group index not found for %s",groupname); } return retval; } -void CCTK_FCALL CCTK_FNAME (CCTK_GrouplsshGN) +void CCTK_FCALL CCTK_FNAME (CCTK_GroupashGN) (int *ierr, const cGH **cctkGH, const int *size, - int *lssh, + int *ash, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (groupname) - *ierr = CCTK_GrouplsshGN (*cctkGH, *size, lssh, groupname); + *ierr = CCTK_GroupashGN (*cctkGH, *size, ash, groupname); free (groupname); } -int CCTK_GrouplsshVI(const cGH *cctkGH, - int size, - int *lssh, - int varindex) +int CCTK_GroupashVI(const cGH *cctkGH, + int size, + int *ash, + int varindex) { int retval; int gindex = CCTK_GroupIndexFromVarI(varindex); if (gindex > -1) { - retval = CCTK_GrouplsshGI(cctkGH,size,lssh,gindex); + retval = CCTK_GroupashGI(cctkGH,size,ash,gindex); } else { retval = -4; CCTK_VWarn(1,__LINE__,__FILE__,"Cactus", - "CCTK_GrouplsshVI: Group index not found for variable index %d", + "CCTK_GroupashVI: Group index not found for variable index %d", varindex); } return retval; } -void CCTK_FCALL CCTK_FNAME (CCTK_GrouplsshVI) +void CCTK_FCALL CCTK_FNAME (CCTK_GroupashVI) (int *ierr, const cGH **cctkGH, const int *size, - int *lssh, + int *ash, const int *varindex) { - *ierr = CCTK_GrouplsshVI (*cctkGH, *size, lssh, *varindex); + *ierr = CCTK_GroupashVI (*cctkGH, *size, ash, *varindex); } -int CCTK_GrouplsshVN(const cGH *cctkGH, - int size, - int *lssh, - const char *varname) +int CCTK_GroupashVN(const cGH *cctkGH, + int size, + int *ash, + const char *varname) { int retval; int gindex = CCTK_GroupIndexFromVar(varname); if (gindex > -1) { - retval = CCTK_GrouplsshGI(cctkGH,size,lssh,gindex); + retval = CCTK_GroupashGI(cctkGH,size,ash,gindex); } else { retval = -4; CCTK_VWarn(1,__LINE__,__FILE__,"Cactus", - "CCTK_GrouplsshVN: Group index not found for %s",varname); + "CCTK_GroupashVN: Group index not found for %s",varname); } return retval; } -void CCTK_FCALL CCTK_FNAME (CCTK_GrouplsshVN) +void CCTK_FCALL CCTK_FNAME (CCTK_GroupashVN) (int *ierr, const cGH **cctkGH, const int *size, - int *lssh, + int *ash, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (varname) - *ierr = CCTK_GrouplsshVN (*cctkGH, *size, lssh, varname); + *ierr = CCTK_GroupashVN (*cctkGH, *size, ash, varname); free (varname); } diff --git a/src/main/Stagger.c b/src/main/Stagger.c deleted file mode 100644 index 67aa8c0f..00000000 --- a/src/main/Stagger.c +++ /dev/null @@ -1,440 +0,0 @@ - /*@@ - @file Stagger.c - @date Thu Jan 27 15:32:28 2000 - @author Gerd Lanfermann - @desc - Stuff to deal with staggering. - @enddesc - @version $Header$ - @@*/ - -#include -#include -#include -#include - -#include "cctk_Flesh.h" -#include "cctk_FortranString.h" -#include "cctk_Groups.h" -#include "cctk_Types.h" -#include "cctk_WarnLevel.h" - -#include "cctk_Stagger.h" -#include "cctki_Stagger.h" - -static const char *rcsid = "$Header$"; - -CCTK_FILEVERSION(main_Stagger_c); - -/******************************************************************** - ********************* Fortran Wrappers *********************** - ********************************************************************/ -void CCTK_FCALL CCTK_FNAME (CCTK_GroupStaggerIndexGI) - (int *stagcode, int *gindex); -void CCTK_FCALL CCTK_FNAME (CCTK_GroupStaggerIndexGN) - (int *scode, ONE_FORTSTRING_ARG); -void CCTK_FCALL CCTK_FNAME (CCTK_StaggerIndex) - (int *scode, ONE_FORTSTRING_ARG); -void CCTK_FCALL CCTK_FNAME (CCTK_StaggerDirIndex) - (int *dsi, int *dir, int *gsi); -void CCTK_FCALL CCTK_FNAME (CCTK_GroupStaggerDirArray) - (int *ierr, int *dindex, int *dim, int *gsc); -void CCTK_FCALL CCTK_FNAME (CCTK_GroupStaggerDirArrayGI) - (int *ierr, int *dindex, int *dim, int *gi); -void CCTK_FCALL CCTK_FNAME (CCTK_StaggerDirName) - (int *dsc, int *dir, ONE_FORTSTRING_ARG); - -/******************************************************************** - ********************* External Routines ********************** - ********************************************************************/ - - - /*@@ - @routine CCTK_GroupStaggerIndexGI - @date - @author - @desc retuns the stagger code for a given group index - - @enddesc - @calls - @calledby - @history - - @endhistory - -@@*/ - -int CCTK_GroupStaggerIndexGI(int gindex) -{ - cGroup group; - int sc; - CCTK_GroupData(gindex, &group); - sc = group.stagtype; - return(sc); -} - -void CCTK_FCALL CCTK_FNAME (CCTK_GroupStaggerIndexGI) - (int *stagcode, int *gindex) -{ - *stagcode = CCTK_GroupStaggerIndexGI(*gindex); -} - - - /*@@ - @routine CCTK_GroupStaggerIndexGN - @date - @author Gerd Lanfermann - @desc returns the stagger index for a given group name - @enddesc - @calls - @calledby - @history - - @endhistory - -@@*/ - -int CCTK_GroupStaggerIndexGN(const char *gname) -{ - int gindex; - gindex = CCTK_GroupIndex(gname); - return(CCTK_GroupStaggerIndexGI(gindex)); -} - -void CCTK_FCALL CCTK_FNAME (CCTK_GroupStaggerIndexGN) - (int *scode, ONE_FORTSTRING_ARG) -{ - ONE_FORTSTRING_CREATE(gname) - int gindex; - gindex = CCTK_GroupIndex(gname); - *scode = CCTK_GroupStaggerIndexGI(gindex); - free(gname); -} - - - /*@@ - @routine CCTK_StaggerIndex - @date - @author Gerd Lanfermann - @desc returns the stagger index for a given stagger name - - @enddesc - @calls - @calledby - @history - - @endhistory - -@@*/ - -int CCTK_StaggerIndex(const char *stype) -{ - int i,scode,base,dim,m; - - base = 1; - scode= 0; - dim = strlen(stype); - - for (i=0;i - when given the staggerindex . - - @enddesc - @calls - @calledby - @history - - @endhistory - -@@*/ - -int CCTK_StaggerDirIndex(int dir, int si) -{ - int val,b,dsi=0; - static int hash[4],hashed=0; - - if (hashed==0) - { - hash[0]= 1; - hash[1]= 3; - hash[2]= 9; - hash[3]=27; - hashed = 1; - } - - for (b=CCTK_NSTAG;b>=0;b--) - { - val = (int)(si / hash[b]); - si = si % hash[b]; - if (dir==b) - { - dsi = val; - break; - } - } - return(dsi); -} - - - -void CCTK_FCALL CCTK_FNAME (CCTK_StaggerDirIndex) - (int *dsi, int *dir, int *gsi) -{ - /* accept fortran indexing [1..]: decrease the directional index - for the call to the C routine. */ - *dsi = CCTK_StaggerDirIndex((*dir)-1, *gsi); -} - - - -/*@@ - @routine CCTK_StaggerDirIndexArray - @date - @author Gerd Lanfermann - @desc returns the stagger index for all direction in - an array of size when given the staggerindex . - - @enddesc - @calls - @calledby - @history - - @endhistory - -@@*/ - -int CCTK_StaggerDirArray(int *dindex , int dim, int sindex) -{ - int val,b; - static int hash[4],hashed=0; - - if (hashed==0) - { - hash[0]= 1; - hash[1]= 3; - hash[2]= 9; - hash[3]=27; - hashed = 1; - } - - if (dim>4) - { - CCTK_VWarn(1,__LINE__,__FILE__,"Cactus", - "CCTK_StaggerDirArray: Dimension %d exceeds maximum of 4",dim); - return(-1); - } - - for (b=CCTK_NSTAG;b>=0;b--) - { - val = (int)(sindex / hash[b]); - sindex = sindex % hash[b]; - if (b of size when given the group - index - - @enddesc - @calls - @calledby - @history - - @endhistory - -@@*/ - -int CCTK_GroupStaggerDirArrayGI(int *dindex, int dim, int gi) -{ - int si,ierr; - si = CCTK_GroupStaggerIndexGI(gi); - ierr= CCTK_StaggerDirArray(dindex, dim, si); - return ierr; -} - -void CCTK_FCALL CCTK_FNAME (CCTK_GroupStaggerDirArrayGI) - (int *ierr, int *dindex, int *dim, int *gi) -{ - *ierr = CCTK_GroupStaggerDirArrayGI(dindex, *dim, *gi); -} - - - /*@@ - @routine CCTK_StaggerDirName - @date - @author Gerd Lanfermann - @desc returns the directional staggering in direction - for a given stagger name . - - @enddesc - @calls - @calledby - @history - - @endhistory - -@@*/ - -int CCTK_StaggerDirName(int dir, const char *stype) -{ - int scode; - char hs[7]="MMMMMM"; - - sprintf(hs,"%s",stype); - - if (dir> (int) strlen(hs)) - { - CCTK_VWarn(1,__LINE__,__FILE__,"Cactus", - "CCTK_StaggerDirName: Stagger name too short for direction %d", - dir); - } - - switch (toupper(hs[dir])) - { - case 'M': scode = 0; break; - case 'C': scode = 1; break; - case 'P': scode = 2; break; - default: - CCTK_VWarn(1,__LINE__,__FILE__,"Cactus", - "CCTK_StaggerDirName: Unknown stagger type %s",hs); - return(-1); - } - return(scode); -} - -void CCTK_FCALL CCTK_FNAME (CCTK_StaggerDirName) - (int *dsc, int *dir, ONE_FORTSTRING_ARG) -{ - ONE_FORTSTRING_CREATE(sname); - - *dsc = CCTK_StaggerDirName((*dir)-1,sname); - - free(sname); -} - - - - - - - /*@@ - @routine CCTKi_ParseStaggerString - @date - @author Gerd Lanfermann - @desc returns the stagger index for a string. Similar routines - as CCTK_StaggerIndexName, but does more error checking since - it is called during Group setup and if things go wrong, the used - has a better idea where he specified wrong settings. - - @enddesc - @calls - @calledby - @history - - @endhistory - -@@*/ - -int CCTKi_ParseStaggerString(int dim, - const char *imp, - const char *gname, - const char *stype) -{ - int i,m; - int base = 1; - int scode = 0; - char hs[11]; - - if (dim>10) - { - CCTK_VWarn(0,__LINE__,__FILE__,"Cactus", - "CCTKi_ParseStaggerString: Dimension %d exceeds maximum of 10", - dim); - } - - /* change possible SHORTCUTS into the official notation*/ - if (CCTK_Equals(stype,"NONE")) - { - sprintf(hs,"MMMMMMMMMM"); - } - else if (CCTK_Equals(stype,"CELL")) - { - sprintf(hs,"CCCCCCCCCC"); - } - else - { - if ((int) strlen(stype)!=dim) - { - CCTK_VWarn(1,__LINE__,__FILE__,"Cactus", - "CCTKi_ParseStaggerString: Staggering %s for %s unequal to group dimension %d", - stype,gname,dim); - } - - sprintf(hs,"%s",stype); - } - - for (i=0;i