From 063155fe1d7944f9d4e0b5027eacd2ba4c280840 Mon Sep 17 00:00:00 2001 From: tradke Date: Mon, 17 Dec 2001 12:07:03 +0000 Subject: Fixed ordering in 2D plane center setup. Closes PR CactusBase-865. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOUtil/trunk@140 b32723a9-ab3a-4a60-88e2-2e5d99d7c17a --- src/Utils.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/Utils.c') diff --git a/src/Utils.c b/src/Utils.c index ef3ceff..c17a8f1 100644 --- a/src/Utils.c +++ b/src/Utils.c @@ -257,12 +257,12 @@ int IOUtil_2DPlanes (const cGH *GH, for (dir = 0; dir < num_dims; dir++) { if (CCTK_CoordRange (GH, &lower_range[dir], &upper_range[dir], - dir + 1, NULL, coord_system_name) < 0) + num_dims - dir, NULL, coord_system_name) < 0) { CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, "IOUtil_2DPlanes: Could not get ranges for %c-direction " "of coordinate system '%s'", - 'x' + dir, coord_system_name); + 'x' + (num_dims - dir - 1), coord_system_name); } } @@ -280,23 +280,24 @@ int IOUtil_2DPlanes (const cGH *GH, CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, "IOUtil_2DPlanes: %c-coordinate for slice center of 2D " "planes (%f) is out of grid coordinates range (%f, %f)", - 'x' + dir, (double) origin_phys[dir], + 'x' + (num_dims - dir - 1), (double) origin_phys[dir], (double) lower_range[dir], (double) upper_range[dir]); CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, "IOUtil_2DPlanes: no 2D planes in %c-direction will be " "written for %dD variables with this slice center default", - 'x' + dir, num_dims); + 'x' + (num_dims - dir - 1), num_dims); slice_center[dir] = 0; } else { /* Find index for first point above the chosen coordinate */ slice_center[dir] = ceil ((origin_phys[dir] - lower_range[dir]) / - GH->cctk_delta_space[dir] - 1e-6); + GH->cctk_delta_space[(num_dims - dir - 1)] - + 1e-6); #ifdef DEBUG_IOUTIL printf("sp2xyz for planes perpendicular to %d-direction is %d\n", - dir, (CCTK_INT) slice_center[dir]); + (num_dims - dir - 1), (CCTK_INT) slice_center[dir]); #endif } } -- cgit v1.2.3