diff options
Diffstat (limited to 'Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c')
-rw-r--r-- | Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c index 3477909..3958dce 100644 --- a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c +++ b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c @@ -71,6 +71,7 @@ CCTK_INT sgn(CCTK_REAL x) */ void GenericFD_GetBoundaryInfo(cGH const * restrict const cctkGH, CCTK_INT const * restrict const cctk_lsh, + CCTK_INT const * restrict const cctk_lssh, CCTK_INT const * restrict const cctk_bbox, CCTK_INT const * restrict const cctk_nghostzones, CCTK_INT * restrict const imin, @@ -169,7 +170,7 @@ void GenericFD_GetBoundaryInfo(cGH const * restrict const cctkGH, imin[dir] = npoints; break; case 1: /* Upper boundary */ - imax[dir] = cctk_lsh[dir] - npoints; + imax[dir] = cctk_lssh[CCTK_LSSH_IDX(0, dir)] - npoints; break; default: CCTK_WARN(0, "internal error"); @@ -189,7 +190,9 @@ void GenericFD_LoopOverEverything(cGH *cctkGH, Kranc_Calculation calc) CCTK_REAL tangentA[] = {0,0,0}; CCTK_REAL tangentB[] = {0,0,0}; CCTK_INT bmin[] = {0,0,0}; - CCTK_INT bmax[] = {cctk_lsh[0], cctk_lsh[1], cctk_lsh[2]}; + CCTK_INT bmax[] = {cctk_lssh[CCTK_LSSH_IDX(0,0)], + cctk_lssh[CCTK_LSSH_IDX(0,1)], + cctk_lssh[CCTK_LSSH_IDX(0,2)]}; calc(cctkGH, dir, face, normal, tangentA, tangentB, bmin, bmax, 0, NULL); return; @@ -216,7 +219,8 @@ void GenericFD_LoopOverBoundary(cGH *cctkGH, Kranc_Calculation calc) int old_dir = 0; int old_face = 0; - GenericFD_GetBoundaryInfo(cctkGH, cctk_lsh, cctk_bbox, cctk_nghostzones, + GenericFD_GetBoundaryInfo(cctkGH, cctk_lsh, cctk_lssh, cctk_bbox, + cctk_nghostzones, imin, imax, is_symbnd, is_physbnd, is_ipbnd); /* Loop over all faces */ @@ -250,7 +254,7 @@ void GenericFD_LoopOverBoundary(cGH *cctkGH, Kranc_Calculation calc) break; case +1: bmin[d] = imax[d]; - bmax[d] = cctk_lsh[d]; + bmax[d] = cctk_lssh[CCTK_LSSH_IDX(0,d)]; have_bnd = 1; all_physbnd = all_physbnd && is_physbnd[2*d+1]; break; @@ -308,7 +312,8 @@ void GenericFD_LoopOverBoundaryWithGhosts(cGH *cctkGH, Kranc_Calculation calc) int old_dir = 0; int old_face = 0; - GenericFD_GetBoundaryInfo(cctkGH, cctk_lsh, cctk_bbox, cctk_nghostzones, + GenericFD_GetBoundaryInfo(cctkGH, cctk_lsh, cctk_lssh, cctk_bbox, + cctk_nghostzones, imin, imax, is_symbnd, is_physbnd, is_ipbnd); /* Loop over all faces */ @@ -342,7 +347,7 @@ void GenericFD_LoopOverBoundaryWithGhosts(cGH *cctkGH, Kranc_Calculation calc) break; case +1: bmin[d] = imax[d]; - bmax[d] = cctk_lsh[d]; + bmax[d] = cctk_lssh[CCTK_LSSH_IDX(0,d)]; have_bnd = 1; have_physbnd = have_physbnd || is_physbnd[2*d+1]; break; @@ -393,7 +398,8 @@ void GenericFD_LoopOverInterior(cGH *cctkGH, Kranc_Calculation calc) int dir = 0; int face = 0; - GenericFD_GetBoundaryInfo(cctkGH, cctk_lsh, cctk_bbox, cctk_nghostzones, + GenericFD_GetBoundaryInfo(cctkGH, cctk_lsh, cctk_lssh, cctk_bbox, + cctk_nghostzones, imin, imax, is_symbnd, is_physbnd, is_ipbnd); calc(cctkGH, dir, face, normal, tangentA, tangentB, imin, imax, 0, NULL); @@ -407,6 +413,7 @@ void GenericFD_PenaltyPrim2Char(cGH *cctkGH, CCTK_INT const dir, CCTK_REAL const * restrict const base, CCTK_INT const * restrict const lbnd, CCTK_INT const * restrict const lsh, + CCTK_INT const * restrict const lssh, CCTK_INT const rhs_flag, CCTK_INT const num_modes, CCTK_POINTER const * restrict const modes, @@ -419,7 +426,9 @@ void GenericFD_PenaltyPrim2Char(cGH *cctkGH, CCTK_INT const dir, CCTK_REAL tangentA[] = {0,0,0}; CCTK_REAL tangentB[] = {0,0,0}; CCTK_INT bmin[] = {0,0,0}; - CCTK_INT bmax[] = {cctk_lsh[0], cctk_lsh[1], cctk_lsh[2]}; + CCTK_INT bmax[] = {cctk_lssh[CCTK_LSSH_IDX(0,0)], + cctk_lssh[CCTK_LSSH_IDX(0,1)], + cctk_lssh[CCTK_LSSH_IDX(0,2)]}; CCTK_REAL **all_vars; int i = 0; |