File: CNcube.h

package info (click to toggle)
plotmtv 1.4.1-4
  • links: PTS
  • area: main
  • in suites: slink
  • size: 4,024 kB
  • ctags: 5,006
  • sloc: ansic: 51,179; makefile: 1,976; fortran: 1,277; sh: 510; csh: 439
file content (106 lines) | stat: -rw-r--r-- 3,891 bytes parent folder | download | duplicates (6)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
 * CNcube.c - definitions for a cube
 */

#ifndef CNcube_defined 
#define CNcube_defined

/*
 * The cube's makeup is reflected in these bits (cube.pcode)
 */
#define CN_XPRISM     (1L << 0)      /* prism parallel to x   */
#define CN_YPRISM     (1L << 1)      /* prism parallel to y   */
#define CN_ZPRISM     (1L << 2)      /* prism parallel to z   */
#define CN_CUTONMIN   (1L << 3)      /* cutline touches min   */

#define CN_XMINELECT  (1L << 4)      /* electrode on xmin     */
#define CN_YMINELECT  (1L << 5)      /* electrode on ymin     */
#define CN_ZMINELECT  (1L << 6)      /* electrode on zmin     */

#define CN_XMAXELECT  (1L << 8)      /* electrode on xmax     */
#define CN_YMAXELECT  (1L << 9)      /* electrode on ymax     */
#define CN_ZMAXELECT  (1L << 10)     /* electrode on zmax     */

#define CN_DIAGELECT  (1L << 12)     /* electrode on diagonal */
#define CN_MAT1ONMIN  (1L << 13)     /* mat1    touches min   */

/* 
 * A cube is used to represent a geometrical block structure.
 * Internally, the cube could be divided into 2 prisms where 
 * the cut is parallel to the x, y, or z axis.
 */
/* Cube */
typedef struct CNcube_strct {
   short  ID;
   short  mat1;        /* Material of 1st prism         */
   short  mat2;        /* Material of 2nd prism         */
   int    pcode;       /* Prism encoding                */
   double x0, x1;      /* x-boundaries                  */
   double y0, y1;      /* y-boundaries                  */
   double z0, z1;      /* z-boundaries                  */
   double x0_o, x1_o;  /* original x-boundaries         */
   double y0_o, y1_o;  /* original y-boundaries         */
   double z0_o, z1_o;  /* original z-boundaries         */
   double zave;        /* Used for sorting              */
   struct CNcube_strct *next;
   struct CNcube_strct *prev;
} CNcube;
typedef struct CNcube_strct *CNcubeptr;


/* 
 * A block is used to represent 4D data, that is, values in 3D space
 * on each of the vertices of the cube.  Internally, the block could
 * be divided into 2 prisms where the cut is parallel to the x, y, or z axis.
 * The block refers to the cube for its geometry.
 * Multiple blocks could point to the same cube.
 * Thus the block-cube relation is analogous to the node-point relationship.
 */
/* Block */
typedef struct CNblock_strct {
   short  ID;
   double t000;        /* t-val at x=xmin y=ymin z=zmin */
   double t001;        /* t-val at x=xmin y=ymin z=zmax */
   double t010;        /* t-val at x=xmin y=ymax z=zmin */
   double t011;        /* t-val at x=xmin y=ymax z=zmax */
   double t100;        /* t-val at x=xmax y=ymin z=zmin */
   double t101;        /* t-val at x=xmax y=ymin z=zmax */
   double t110;        /* t-val at x=xmax y=ymax z=zmin */
   double t111;        /* t-val at x=xmax y=ymax z=zmax */
   double zave;        /* Used for sorting */
   struct CNcube_strct  *cube;  /* The actual geometry  */
   struct CNblock_strct *next;
   struct CNblock_strct *prev;
} CNblock;
typedef struct CNblock_strct *CNblockptr;


/*
 * Extern declarations
 */
extern void CNfind_exposed_faces_of_cube();
extern int  CNcube_is_divided();
extern int  CNcube_xmin_is_electrode();
extern int  CNcube_xmax_is_electrode();
extern int  CNcube_ymin_is_electrode();
extern int  CNcube_ymax_is_electrode();
extern int  CNcube_zmin_is_electrode();
extern int  CNcube_zmax_is_electrode();
extern int  CNcube_diag_is_electrode();

extern CNcubeptr  CNmake_cube();
extern CNcubeptr  CNinsert_cube();
extern void       CNdelete_cube();
extern void       CNdelete_cube_list();
extern void       CNprint_cube_list();
extern int        CNcount_cubes();

extern CNblockptr CNmake_block();
extern CNblockptr CNinsert_block();
extern void       CNdelete_block();
extern void       CNdelete_block_list();
extern void       CNprint_block_list();
extern int        CNcount_blocks();

#endif /* CNcube_defined */