aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c16
-rw-r--r--Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h2
-rw-r--r--Tools/CodeGen/CodeGenCactus.m40
-rw-r--r--Tools/CodeGen/Thorn.m2
4 files changed, 30 insertions, 30 deletions
diff --git a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c
index 023e6e8..b93a616 100644
--- a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c
+++ b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c
@@ -111,8 +111,8 @@ int GenericFD_GetBoundaryWidth(cGH const * restrict const cctkGH)
boundaries are treated as interprocessor boundaries.
*/
void GenericFD_GetBoundaryInfo(cGH const * restrict const cctkGH,
+ int const * restrict const cctk_ash,
int const * restrict const cctk_lsh,
- int const * restrict const cctk_lssh,
int const * restrict const cctk_bbox,
int const * restrict const cctk_nghostzones,
int * restrict const imin,
@@ -211,7 +211,7 @@ void GenericFD_GetBoundaryInfo(cGH const * restrict const cctkGH,
imin[dir] = npoints;
break;
case 1: /* Upper boundary */
- imax[dir] = CCTK_LSSH(0,dir) - npoints;
+ imax[dir] = cctk_lsh[dir] - npoints;
break;
default:
CCTK_WARN(0, "internal error");
@@ -231,7 +231,7 @@ void GenericFD_LoopOverEverything(cGH const * restrict const cctkGH, Kranc_Calcu
CCTK_REAL tangentA[] = {0,0,0};
CCTK_REAL tangentB[] = {0,0,0};
int bmin[] = {0,0,0};
- int bmax[] = {CCTK_LSSH(0,0),CCTK_LSSH(0,1),CCTK_LSSH(0,2)};
+ int bmax[] = {cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]};
calc(cctkGH, dir, face, normal, tangentA, tangentB, bmin, bmax, 0, NULL);
return;
@@ -258,7 +258,7 @@ void GenericFD_LoopOverBoundary(cGH const * restrict const cctkGH, Kranc_Calcula
int old_dir = 0;
int old_face = 0;
- GenericFD_GetBoundaryInfo(cctkGH, cctk_lsh, cctk_lssh, cctk_bbox,
+ GenericFD_GetBoundaryInfo(cctkGH, cctk_ash, cctk_lsh, cctk_bbox,
cctk_nghostzones,
imin, imax, is_symbnd, is_physbnd, is_ipbnd);
@@ -293,7 +293,7 @@ void GenericFD_LoopOverBoundary(cGH const * restrict const cctkGH, Kranc_Calcula
break;
case +1:
bmin[d] = imax[d];
- bmax[d] = CCTK_LSSH(0,d);
+ bmax[d] = cctk_lsh[d];
have_bnd = 1;
all_physbnd = all_physbnd && is_physbnd[2*d+1];
break;
@@ -351,7 +351,7 @@ void GenericFD_LoopOverBoundaryWithGhosts(cGH const * restrict const cctkGH, Kra
int old_dir = 0;
int old_face = 0;
- GenericFD_GetBoundaryInfo(cctkGH, cctk_lsh, cctk_lssh, cctk_bbox,
+ GenericFD_GetBoundaryInfo(cctkGH, cctk_ash, cctk_lsh, cctk_bbox,
cctk_nghostzones,
imin, imax, is_symbnd, is_physbnd, is_ipbnd);
@@ -386,7 +386,7 @@ void GenericFD_LoopOverBoundaryWithGhosts(cGH const * restrict const cctkGH, Kra
break;
case +1:
bmin[d] = imax[d];
- bmax[d] = CCTK_LSSH(0,d);
+ bmax[d] = cctk_lsh[d];
have_bnd = 1;
have_physbnd = have_physbnd || is_physbnd[2*d+1];
break;
@@ -437,7 +437,7 @@ void GenericFD_LoopOverInterior(cGH const * restrict const cctkGH, Kranc_Calcula
int dir = 0;
int face = 0;
- GenericFD_GetBoundaryInfo(cctkGH, cctk_lsh, cctk_lssh, cctk_bbox,
+ GenericFD_GetBoundaryInfo(cctkGH, cctk_ash, cctk_lsh, cctk_bbox,
cctk_nghostzones,
imin, imax, is_symbnd, is_physbnd, is_ipbnd);
diff --git a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h
index 5032f6a..cc8849c 100644
--- a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h
+++ b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.h
@@ -66,8 +66,8 @@ KRANC_WHERE static inline CCTK_REAL sgn(CCTK_REAL x)
int GenericFD_GetBoundaryWidth(cGH const * restrict const cctkGH);
void GenericFD_GetBoundaryInfo(cGH const * restrict cctkGH,
+ int const * restrict cctk_ash,
int const * restrict cctk_lsh,
- int const * restrict cctk_lssh,
int const * restrict cctk_bbox,
int const * restrict cctk_nghostzones,
int * restrict imin,
diff --git a/Tools/CodeGen/CodeGenCactus.m b/Tools/CodeGen/CodeGenCactus.m
index d56be11..5598f4e 100644
--- a/Tools/CodeGen/CodeGenCactus.m
+++ b/Tools/CodeGen/CodeGenCactus.m
@@ -138,7 +138,7 @@ DefFn[
" CCTK_VInfo(CCTK_THORNSTRING, \"ipos: %d %d %d\", i, j, k);\n",
" CCTK_VInfo(CCTK_THORNSTRING, \"lbnd: %d %d %d\", cctk_lbnd[0], cctk_lbnd[1], cctk_lbnd[2]);\n",
" CCTK_VInfo(CCTK_THORNSTRING, \"lsh: %d %d %d\", cctk_lsh[0], cctk_lsh[1], cctk_lsh[2]);\n",
- " CCTK_VInfo(CCTK_THORNSTRING, \"LSSH: %d %d %d\", CCTK_LSSH(0,0), CCTK_LSSH(0,1), CCTK_LSSH(0,2));\n",
+ " CCTK_VInfo(CCTK_THORNSTRING, \"ash: %d %d %d\", cctk_ash[0], cctk_ash[1], cctk_ash[2]);\n",
" CCTK_VInfo(CCTK_THORNSTRING, \"", expr, ": %.17g\", (double)", expr, ");\n",
"}\n"}];
@@ -294,17 +294,17 @@ DefFn[
AssignVariable["jstart", arrayIndex["index_offset_y"]],
AssignVariable["kstart", arrayIndex["index_offset_z"]],
"\n",
- AssignVariable["iend", {"CCTK_LSSH(0,0) - index_offset_x"}],
- AssignVariable["jend", {"CCTK_LSSH(0,1) - index_offset_y"}],
- AssignVariable["kend", {"CCTK_LSSH(0,2) - index_offset_z"}]},
+ AssignVariable["iend", {"cctk_lsh[0] - index_offset_x"}],
+ AssignVariable["jend", {"cctk_lsh[1] - index_offset_y"}],
+ AssignVariable["kend", {"cctk_lsh[2] - index_offset_z"}]},
(* else *)
{AssignVariable["istart", arrayIndex[0]],
AssignVariable["jstart", arrayIndex[0]],
AssignVariable["kstart", arrayIndex[0]],
"\n",
- AssignVariable["iend", "CCTK_LSSH(0,0)"],
- AssignVariable["jend", "CCTK_LSSH(0,1)"],
- AssignVariable["kend", "CCTK_LSSH(0,2)"]}]]];
+ AssignVariable["iend", "cctk_lsh[0]"],
+ AssignVariable["jend", "cctk_lsh[1]"],
+ AssignVariable["kend", "cctk_lsh[2]"]}]]];
DefFn[
ConditionalOnParameter[name_String, value_String, block:CodeGenBlock] :=
@@ -346,7 +346,7 @@ GridLoop[block_] :=
"#pragma omp parallel\n",
"LC_LOOP3 (unnamed,\n",
" i,j,k, istart,jstart,kstart, iend,jend,kend,\n",
- " cctk_lsh[0],cctk_lsh[1],cctk_lsh[2])\n",
+ " cctk_ash[0],cctk_ash[1],cctk_ash[2])\n",
"{\n",
IndentBlock[
{
@@ -364,7 +364,7 @@ GridLoop[block_] :=
"#pragma omp parallel\n",
"LC_LOOP3 (unnamed,\n",
" i,j,k, istart,jstart,kstart, iend,jend,kend,\n",
- " cctk_lsh(1),cctk_lsh(2),cctk_lsh(3))\n",
+ " cctk_ash(1),cctk_ash(2),cctk_ash(3))\n",
IndentBlock[block],
"LC_ENDLOOP3 (unnamed)\n"
}
@@ -388,7 +388,7 @@ DefFn[
If[vectorise, "LC_LOOP3VEC", "CCTK_LOOP3"],
"(", functionName, ",\n",
" i,j,k, imin[0],imin[1],imin[2], imax[0],imax[1],imax[2],\n",
- " cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]",
+ " cctk_ash[0],cctk_ash[1],cctk_ash[2]",
If[vectorise, {",\n", " CCTK_REAL_VEC_SIZE"}, ""],
")\n",
"{\n",
@@ -404,16 +404,16 @@ DefFn[
DefFn[
BoundaryLoop[block:CodeGenBlock] :=
{
- "\nGenericFD_GetBoundaryInfo(cctkGH, cctk_lsh, cctk_lssh, cctk_bbox, cctk_nghostzones, imin, imax, is_symbnd, is_physbnd, is_ipbnd);\n",
+ "\nGenericFD_GetBoundaryInfo(cctkGH, cctk_ash, cctk_lsh, cctk_bbox, cctk_nghostzones, imin, imax, is_symbnd, is_physbnd, is_ipbnd);\n",
CommentedBlock[
"Start by looping over the whole grid, minus the NON-PHYSICAL boundary points, which are set by synchronization. ", {
AssignVariable[arrayElement["bmin", 0], "is_physbnd[0*2+0] ? 0 : imin[0]"],
AssignVariable[arrayElement["bmin", 1], "is_physbnd[1*2+0] ? 0 : imin[1]"],
AssignVariable[arrayElement["bmin", 2], "is_physbnd[2*2+0] ? 0 : imin[2]"],
- AssignVariable[arrayElement["bmax", 0], "is_physbnd[0*2+1] ? CCTK_LSSH(0,0) : imax[0]"],
- AssignVariable[arrayElement["bmax", 1], "is_physbnd[1*2+1] ? CCTK_LSSH(0,1) : imax[1]"],
- AssignVariable[arrayElement["bmax", 2], "is_physbnd[2*2+1] ? CCTK_LSSH(0,2) : imax[2]"]}],
+ AssignVariable[arrayElement["bmax", 0], "is_physbnd[0*2+1] ? cctk_lsh[0] : imax[0]"],
+ AssignVariable[arrayElement["bmax", 1], "is_physbnd[1*2+1] ? cctk_lsh[1] : imax[1]"],
+ AssignVariable[arrayElement["bmax", 2], "is_physbnd[2*2+1] ? cctk_lsh[2] : imax[2]"]}],
CommentedBlock[
"Loop over all faces",
@@ -428,7 +428,7 @@ DefFn[
{0, {AssignVariable[arrayElement["bmax", "dir"], {arrayElement["imin", "dir"], ""}],
AssignVariable[arrayElement["bmin", "dir"], {0, ""}]}},
{1, {AssignVariable[arrayElement["bmin", "dir"], {arrayElement["imax", "dir"], "" }],
- AssignVariable[arrayElement["bmax", "dir"], {"CCTK_LSSH(0,dir)", ""}]}}]],
+ AssignVariable[arrayElement["bmax", "dir"], {"cctk_lsh[dir]", ""}]}}]],
conditional[
arrayElement["is_physbnd", "dir * 2 + face"],
loopOverInteger[
@@ -443,16 +443,16 @@ DefFn[
DefFn[
BoundaryWithGhostsLoop[block:CodeGenBlock] :=
{
- "\nGenericFD_GetBoundaryInfo(cctkGH, cctk_lsh, cctk_lssh, cctk_bbox, cctk_nghostzones, imin, imax, is_symbnd, is_physbnd, is_ipbnd);\n",
+ "\nGenericFD_GetBoundaryInfo(cctkGH, cctk_ash, cctk_lsh, cctk_bbox, cctk_nghostzones, imin, imax, is_symbnd, is_physbnd, is_ipbnd);\n",
CommentedBlock[
"Start by looping over the whole grid, including the NON-PHYSICAL boundary points. ", {
AssignVariable[arrayElement["bmin", 0], "0"],
AssignVariable[arrayElement["bmin", 1], "0"],
AssignVariable[arrayElement["bmin", 2], "0"],
- AssignVariable[arrayElement["bmax", 0], "CCTK_LSSH(0,0)"],
- AssignVariable[arrayElement["bmax", 1], "CCTK_LSSH(0,1)"],
- AssignVariable[arrayElement["bmax", 2], "CCTK_LSSH(0,2)"]}],
+ AssignVariable[arrayElement["bmax", 0], "cctk_lsh[0]"],
+ AssignVariable[arrayElement["bmax", 1], "cctk_lsh[1]"],
+ AssignVariable[arrayElement["bmax", 2], "cctk_lsh[2]"]}],
CommentedBlock[
"Loop over all faces",
@@ -468,7 +468,7 @@ DefFn[
{0, {AssignVariable[arrayElement["bmax", "dir"], {arrayElement["imin", "dir"], ""}],
AssignVariable[arrayElement["bmin", "dir"], {0, ""}]}},
{1, {AssignVariable[arrayElement["bmin", "dir"], {arrayElement["imax", "dir"], "" }],
- AssignVariable[arrayElement["bmax", "dir"], {"CCTK_LSSH(0,dir)]", ""}]}}]],
+ AssignVariable[arrayElement["bmax", "dir"], {"cctk_lsh[dir]", ""}]}}]],
conditional[arrayElement["is_physbnd", "dir * 2 + face"],
loopOverInteger[
"k", arrayElement["bmin",2], arrayElement["bmax",2],
diff --git a/Tools/CodeGen/Thorn.m b/Tools/CodeGen/Thorn.m
index ca81f73..47c50eb 100644
--- a/Tools/CodeGen/Thorn.m
+++ b/Tools/CodeGen/Thorn.m
@@ -1241,7 +1241,7 @@ headerComment2,
" assert (len);\n\n",
" for (d = 0; d < 3; ++d) {\n",
-" assert (off[d] >= 0 && len[d] >= 0 && off[d] + len[d] <= CCTK_LSSH(0,d));\n",
+" assert (off[d] >= 0 && len[d] >= 0 && off[d] + len[d] <= cctk_lsh[d]);\n",
" }\n\n",
" assert (modes);\n",