aboutsummaryrefslogtreecommitdiff
path: root/src/ioFlexGH.h
diff options
context:
space:
mode:
authortradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>1999-06-25 11:40:06 +0000
committertradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>1999-06-25 11:40:06 +0000
commitde89a5c6b08b5ad9eb7044dc8b2c04a965b19982 (patch)
tree339e8646892a1638fc0d9b81c38cfed38acb238c /src/ioFlexGH.h
parentf9c5c1bc939250652e057dcd06f5ce9701b8a0bb (diff)
The hopefully final renaming of the FlexIO thorn.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@2 ebee0441-1374-4afa-a3b5-247f3ba15b9a
Diffstat (limited to 'src/ioFlexGH.h')
-rw-r--r--src/ioFlexGH.h85
1 files changed, 85 insertions, 0 deletions
diff --git a/src/ioFlexGH.h b/src/ioFlexGH.h
new file mode 100644
index 0000000..573acbf
--- /dev/null
+++ b/src/ioFlexGH.h
@@ -0,0 +1,85 @@
+ /*@@
+ @header IOFlexIOGH.h
+ @date Tue 9th Jan 1999
+ @author Gabrielle Allen
+ @desc
+ The extensions to the GH structure from IO.
+ @history
+ @hauthor Thomas Radke @hdate 16 Mar 1999
+ @hdesc Added parameters for 2D and 3D output
+ @hauthor Thomas Radke @hdate 17 Mar 1999
+ @hdesc Changed naming: IEEEIO -> IOFlexIO
+ @hauthor Thomas Radke @hdate 30 Mar 1999
+ @hdesc Undefined DI macro
+ @endhistory
+ @version $Header$
+ @@*/
+
+#include <string.h>
+
+#include "IEEEIO/IO.h"
+#include "IEEEIO/IEEEIO.h"
+
+
+/* define the IOFlexIO datatypes according to CCTK_??? datatypes */
+#define FLEXIO_REAL4 FLOAT32
+
+#ifdef CCTK_REAL_PRECISION_16
+#error "128-bit precision floating point types are not supported by IOFlexIO !"
+#elif CCTK_REAL_PRECISION_8
+#define FLEXIO_REAL FLOAT64
+#elif CCTK_REAL_PRECISION_4
+#define FLEXIO_REAL FLOAT32
+#endif
+
+#ifdef CCTK_INTEGER_PRECISION_8
+#define FLEXIO_INT INT64
+#elif CCTK_INTEGER_PRECISION_4
+#define FLEXIO_INT INT32
+#elif CCTK_INTEGER_PRECISION_2
+#define FLEXIO_INT INT16
+#endif
+
+#define FLEXIO_INT4 INT32
+#define FLEXIO_CHAR CHAR
+
+
+/* Check error flags from IOFlexIO */
+#define CACTUS_IEEEIO_ERROR(fn_call) \
+ do { \
+ \
+ int error_code = fn_call; \
+ \
+ if (error_code < 0) { \
+ char *msg = (char*) malloc(strlen(__FILE__) + strlen(#fn_call) + 160);\
+ \
+ sprintf (msg, \
+ "IEEEIO call %s returned error code %d, file %s, line %d\n", \
+ #fn_call, error_code, __FILE__, __LINE__); \
+ CCTK_WARN (1, msg); \
+ free (msg); \
+ } \
+ } while (0)
+
+
+typedef struct IOFlexIOGH {
+
+ /* The number of times output */
+ int *IO_2Dnum;
+ int *IO_3Dnum;
+
+ /* The last iteration output */
+ int *IO_2Dlast;
+ int *IO_3Dlast;
+
+ /* IEEEIO file pointers for 2D output (3 for each variable) */
+ IOFile **IEEEfile_2D;
+
+ /* IEEEIO file name and pointer for 3D output */
+ char **IEEEfname_3D;
+ IOFile *IEEEfile_3D;
+
+ /* reuse filehandles during IEEEIO */
+ int reuse_fh;
+
+} flexioGH;