From 58c62068f65f29cf701a4d1b17e690abb25022ca Mon Sep 17 00:00:00 2001 From: allen Date: Tue, 19 Oct 1999 09:55:58 +0000 Subject: Changing the DI macro to DATINDEX from Pugh, so that we can now just have one macro in PUGH to calculate the data index git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@52 ebee0441-1374-4afa-a3b5-247f3ba15b9a --- src/DumpVar.c | 8 ++++---- src/Write2D.c | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/DumpVar.c b/src/DumpVar.c index 7ad342f..96561fd 100644 --- a/src/DumpVar.c +++ b/src/DumpVar.c @@ -802,7 +802,7 @@ void IOFlexIO_getDumpData (cGH *GH, int index, int timelevel, void **outme, for (k = start [2]; k <= end [2]; k += ioUtilGH->downsample_z) for (j = start [1]; j <= end [1]; j += ioUtilGH->downsample_y) for (i = start [0]; i <= end [0]; i += ioUtilGH->downsample_x) - char_ptr [l++] = ((CCTK_CHAR *) data) [DI (pughGH, i, j, k)]; + char_ptr [l++] = ((CCTK_CHAR *) data) [DATINDEX (pughGH, i, j, k)]; break; case CCTK_VARIABLE_INT: @@ -810,7 +810,7 @@ void IOFlexIO_getDumpData (cGH *GH, int index, int timelevel, void **outme, for (k = start [2]; k <= end [2]; k += ioUtilGH->downsample_z) for (j = start [1]; j <= end [1]; j += ioUtilGH->downsample_y) for (i = start [0]; i <= end [0]; i += ioUtilGH->downsample_x) - int_ptr [l++] = ((CCTK_INT *) data) [DI (pughGH, i, j, k)]; + int_ptr [l++] = ((CCTK_INT *) data) [DATINDEX (pughGH, i, j, k)]; break; case CCTK_VARIABLE_REAL: @@ -823,9 +823,9 @@ void IOFlexIO_getDumpData (cGH *GH, int index, int timelevel, void **outme, for (i = start [0]; i <= end [0]; i += ioUtilGH->downsample_x) if (ioUtilGH->out_single) single_ptr [l++] = (CCTK_REAL4) - (((CCTK_REAL *) data) [DI (pughGH, i, j, k)]); + (((CCTK_REAL *) data) [DATINDEX (pughGH, i, j, k)]); else - real_ptr [l++] = ((CCTK_REAL *) data) [DI (pughGH, i, j, k)]; + real_ptr [l++] = ((CCTK_REAL *) data) [DATINDEX (pughGH, i, j, k)]; break; default: diff --git a/src/Write2D.c b/src/Write2D.c index 6cdac5f..fcd9251 100644 --- a/src/Write2D.c +++ b/src/Write2D.c @@ -314,9 +314,9 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias) for (k = locbnd [2]; k < locbnd [3]; k++) for (j = locbnd [0]; j < locbnd [1]; j++) { int pt = 0; - if (dir==0) pt = DI (pughGH, pughGH->sp2dxyz [dir], j, k); - if (dir==1) pt = DI (pughGH, j, pughGH->sp2dxyz [dir], k); - if (dir==2) pt = DI (pughGH, j, k, pughGH->sp2dxyz [dir]); + if (dir==0) pt = DATINDEX (pughGH, pughGH->sp2dxyz [dir], j, k); + if (dir==1) pt = DATINDEX (pughGH, j, pughGH->sp2dxyz [dir], k); + if (dir==2) pt = DATINDEX (pughGH, j, k, pughGH->sp2dxyz [dir]); assert (l <= npoints && pt <= pughGH->npoints); char_locdat [l++] = ((CCTK_CHAR *) data) [pt]; } @@ -326,9 +326,9 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias) for (k = locbnd [2]; k < locbnd [3]; k++) for (j = locbnd [0]; j < locbnd [1]; j++) { int pt = 0; - if (dir==0) pt = DI (pughGH, pughGH->sp2dxyz [dir], j, k); - if (dir==1) pt = DI (pughGH, j, pughGH->sp2dxyz [dir], k); - if (dir==2) pt = DI (pughGH, j, k, pughGH->sp2dxyz [dir]); + if (dir==0) pt = DATINDEX (pughGH, pughGH->sp2dxyz [dir], j, k); + if (dir==1) pt = DATINDEX (pughGH, j, pughGH->sp2dxyz [dir], k); + if (dir==2) pt = DATINDEX (pughGH, j, k, pughGH->sp2dxyz [dir]); assert (l <= npoints && pt <= pughGH->npoints); int_locdat [l++] = ((CCTK_INT *) data) [pt]; } @@ -339,9 +339,9 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias) for (k = locbnd [2]; k < locbnd [3]; k++) for (j = locbnd [0]; j < locbnd [1]; j++) { int pt = 0; - if (dir==0) pt = DI (pughGH, pughGH->sp2dxyz [dir], j, k); - if (dir==1) pt = DI (pughGH, j, pughGH->sp2dxyz [dir], k); - if (dir==2) pt = DI (pughGH, j, k, pughGH->sp2dxyz [dir]); + if (dir==0) pt = DATINDEX (pughGH, pughGH->sp2dxyz [dir], j, k); + if (dir==1) pt = DATINDEX (pughGH, j, pughGH->sp2dxyz [dir], k); + if (dir==2) pt = DATINDEX (pughGH, j, k, pughGH->sp2dxyz [dir]); assert (l <= npoints && pt <= pughGH->npoints); if (ioUtilGH->out_single) real4_locdat [l++] = (CCTK_REAL4) (((CCTK_REAL *) data) [pt]); -- cgit v1.2.3