aboutsummaryrefslogtreecommitdiff
path: root/src/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h
new file mode 100644
index 0000000..ef17b67
--- /dev/null
+++ b/src/common.h
@@ -0,0 +1,58 @@
+#ifndef _COMMON_H
+#define _COMMON_H
+
+#include "cctk.h"
+
+#define X 0
+#define Y 1
+#define Z 2
+#define V 3
+
+#define NEW(n,what) ((what*)malloc((n)*sizeof(what)))
+/*
+#define REALLOC(object,n,what) \
+ (object) = (what*)realloc((void *)(object), (n)*sizeof(what)); \
+ if((object) == NULL) printf("IsoSurfacer: realloc failed!\n")
+ */
+#define REALLOC(object,n,what) \
+ if((object) != NULL) free(object); \
+ (object) = NEW(n,what); \
+ if((object) == NULL) printf("IsoSurfacer: REALLOC failed!\n")
+
+#define ABS(x) ((x) < 0 ? (-(x)) : (x))
+
+typedef CCTK_REAL4 isofl;
+typedef double extfl;
+
+typedef int machint;
+
+#define BIN 1
+#define ASCII 2
+#define UCD 4
+
+typedef struct
+{
+ isofl *verts;
+ CCTK_INT4 nverts;
+ CCTK_INT4 *polys;
+ CCTK_INT4 npolys;
+} polypatch;
+
+
+typedef struct
+{
+ isofl isovalue;
+ char *outfname;
+ CCTK_INT4 outtype;
+ CCTK_INT4 step;
+ CCTK_INT4 doRemoveDuplicateVertices;
+ CCTK_INT4 useTree;
+ CCTK_INT4 doEliminateSmallTriangles;
+
+// CCTK_INT4 timestep; timestep information is really not required here!
+ isofl minval;
+ isofl maxval;
+} par_st;
+
+
+#endif