aboutsummaryrefslogtreecommitdiff
path: root/src/common.h
blob: ef17b67e7dbc47db7abae8bc377987bd32881c8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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