aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@94b1c47f-dcfd-45ef-a468-0854c0e9e350>2004-04-01 15:45:21 +0000
committertradke <tradke@94b1c47f-dcfd-45ef-a468-0854c0e9e350>2004-04-01 15:45:21 +0000
commit8c64046163a65a744030580e7222f6b9cf03d8af (patch)
treedd570b0a0d794660a0462a6fe5b805ac50096e43
parenta1fa5a627db38528b65af736929afd4953b1e307 (diff)
Another fix for 2D output of complex arrays.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOASCII/trunk@163 94b1c47f-dcfd-45ef-a468-0854c0e9e350
-rw-r--r--src/Write2D.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/Write2D.c b/src/Write2D.c
index 87922cd..f064c69 100644
--- a/src/Write2D.c
+++ b/src/Write2D.c
@@ -35,8 +35,7 @@ CCTK_FILEVERSION(CactusBase_IOASCII_Write2D_c)
int _i, _j; \
const cctk_type *_hdata = hdata[0]; \
const CCTK_REAL *_coord[2]; \
- const int _dic = hsize[0]; \
- const int _did = hsize[0] * (is_complex ? 2 : 1); \
+ const int _di = is_complex ? 2 : 1; \
\
\
_coord[0] = (const CCTK_REAL *) hdata[1]; \
@@ -47,26 +46,28 @@ CCTK_FILEVERSION(CactusBase_IOASCII_Write2D_c)
{ \
if (_coord[0]) \
{ \
- fprintf (file, fmt, (double) _coord[0][_i+_dic*_j], \
- (double) _coord[1][_i+_dic*_j], \
- (c_type) _hdata[_i+_did*_j]); \
+ fprintf (file, fmt, (double) _coord[0][_i+hsize[0]*_j], \
+ (double) _coord[1][_i+hsize[0]*_j], \
+ (c_type) _hdata[_di*(_i+hsize[0]*_j)]); \
} \
else \
{ \
- fprintf (file, fmt, _i, _j, (c_type) _hdata[_i+_did*_j]); \
+ fprintf (file, fmt, _i, _j, \
+ (c_type) _hdata[_di*(_i+hsize[0]*_j)]); \
} \
\
if (is_complex) \
{ \
- fprintf (file, format[2], (c_type) _hdata[_i+1+_did*_j]); \
+ fprintf (file, format[2], \
+ (c_type) _hdata[_di*(_i+hsize[0]*_j)+1]); \
} \
fputc ('\n', file); \
} \
fputc ('\n', file); \
} \
- _coord[0] += _dic*_j; \
- _coord[1] += _dic*_j; \
- _hdata += _did*_j; \
+ _coord[0] += hsize[0]*_j; \
+ _coord[1] += hsize[0]*_j; \
+ _hdata += _di*hsize[0]*_j; \
}