ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / applications / utilities / postProcessing / graphics / ensightFoamReader / global_extern.h
blobe67fd4197ef9a98e0d1f5edb38052ea880429ca3
1 /*--------------------------------------------------------------*/
2 /* Header file for EnSight External Reader DSO Library Routines */
3 /*--------------------------------------------------------------*/
4 /* *************************************************************
5 * Copyright 1998 Computational Engineering International, Inc.
6 * All Rights Reserved.
8 * Restricted Rights Legend
10 * Use, duplication, or disclosure of this
11 * software and its documentation by the
12 * Government is subject to restrictions as
13 * set forth in subdivision [(b)(3)(ii)] of
14 * the Rights in Technical Data and Computer
15 * Software clause at 52.227-7013.
16 * *************************************************************
18 #ifndef GLOBAL_EXTERN_H
19 #define GLOBAL_EXTERN_H
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
25 /*--------------------------------
26 * Set the reader version define
27 * (only one can be set at a time)
28 *--------------------------------*/
29 #if 0
30 #define USERD_API_100
31 #define USERD_API_200
32 #define USERD_API_201
33 #define USERD_API_202
34 #define USERD_API_203
35 #define USERD_API_204
36 #define USERD_API_205
37 #define USERD_API_206
38 #define USERD_API_207
39 #define USERD_API_208
40 #define USERD_API_209
41 #define USERD_API_210
42 #endif
44 /*---------------------------------------*/
45 /* True/False and Error conditions, etc. */
46 /*---------------------------------------*/
47 #define Z_ERR (-1) /*Error return value.*/
48 #define Z_OK (1) /*Success return value.*/
49 #define Z_UNDEF (2) /*Undefined return value.*/
51 #define Z_NOT_IMPLEMENTED (3) /*Routine not implemented*/
52 /*(currently only checked for */
53 /* get_var_value_at_specific */
54 /* routine)*/
55 #ifndef TRUE
56 # define TRUE (1)
57 # define FALSE (0)
58 #endif
60 #define Z_BUFL (80) /* Typical string length */
62 #define Z_COMPX (0) /* x component */
63 #define Z_COMPY (1) /* y component */
64 #define Z_COMPZ (2) /* z component */
66 #define Z_STATIC (0) /* static geometry */
67 #define Z_CHANGE_COORDS (1) /* coordinate changing only */
68 #define Z_CHANGE_CONN (2) /* conectivity changing */
70 #define Z_GEOM (0) /* Geometry type */
71 #define Z_VARI (1) /* Variable type */
73 #define Z_SAVE_ARCHIVE (0) /* Save archive */
74 #define Z_REST_ARCHIVE (1) /* Restore archive */
76 #define Z_MAX_USERD_NAME (20) /* max length of reader name */
78 #define Z_PER_NODE (4) /* At Nodes Variable classif. */
79 #define Z_PER_ELEM (1) /* At Elements Variable classif.*/
81 #define Z_MAX_SETS (300)
83 #define Z_MX_MATERIALS (60)
85 #define Z_MXVARIABLEDESC 20 /*Interface Variables Max Name.*/
87 /* Useful macros for handling IEEE floats */
88 #define FLT_SGN_MASK 0x80000000U
89 #define FLT_EXP_MASK 0x7F800000U
90 #define FLT_MAN_MASK 0x007FFFFFU
91 #define FLT_EXP_BIAS 127
92 #define FLT_EXP_SHIFT 23
94 #define FLT_IS_FINITE(v) \
95 (((*((unsigned int*)&(v))) & FLT_EXP_MASK) != FLT_EXP_MASK)
97 #define FLT_IS_NAN(v) \
98 ((((*((unsigned int*)&(v))) & FLT_EXP_MASK) == FLT_EXP_MASK) && \
99 ((((*((unsigned int*)&(v))) & FLT_MAN_MASK) != 0U)
101 #define FLT_IS_INF(v) \
102 ((((*((unsigned int*)&(v))) & FLT_EXP_MASK) == FLT_EXP_MASK) && \
103 ((((*((unsigned int*)&(v))) & FLT_MAN_MASK) == 0U)
105 #ifndef GLOBALDEFS_H
106 /*-----------------------------------*/
107 /* Unstructured coordinate structure */
108 /*-----------------------------------*/
109 typedef struct {
110 float xyz[3];
111 }CRD;
112 /*-----------------------------------*/
113 /* Unstructured double coordinate structure */
114 /*-----------------------------------*/
115 typedef struct {
116 double xyz[3];
117 }DBLCRD;
118 #endif
120 /*----------------*/
121 /* Variable Types */
122 /*----------------*/
123 enum z_var_type
125 Z_CONSTANT,
126 Z_SCALAR,
127 Z_VECTOR,
128 Z_TENSOR,
129 Z_TENSOR9,
130 MAX_Z_VAR_TYPES
133 /*-------------------
134 * Vector Glyph enums
135 *-------------------*/
136 enum vg_time {
137 VG_STATIC,
138 VG_TRANSIENT,
139 VG_UNDEF,
140 VG_NEAREST,
141 VG_INTERPOLATE
144 enum vg_type {
145 VG_FORCE,
146 VG_MOMENT
150 /*---------------
151 * Element Types
152 *---------------
153 * If you mess with these, you must also
154 * change the get_z_maxtype
155 * to_z_elem_type
156 * to_int_elem_type routines
157 * in userd_read.c
158 *----------------------------------------*/
159 #if (defined USERD_API_100 || defined USERD_API_200)
160 enum z_elem_types {
161 Z_POINT, /* 00: 1 node point element */
162 Z_BAR02, /* 01: 2 node bar */
163 Z_BAR03, /* 02: 3 node bar */
164 Z_TRI03, /* 03: 3 node triangle */
165 Z_TRI06, /* 04: 6 node triangle */
166 Z_QUA04, /* 05: 4 node quad */
167 Z_QUA08, /* 06: 8 node quad */
168 Z_TET04, /* 07: 4 node tetrahedron */
169 Z_TET10, /* 08: 10 node tetrahedron */
170 Z_PYR05, /* 09: 5 node pyramid */
171 Z_PYR13, /* 10: 13 node pyramid */
172 Z_PEN06, /* 11: 6 node pentahedron */
173 Z_PEN15, /* 12: 15 node pentahedron */
174 Z_HEX08, /* 13: 8 node hexahedron */
175 Z_HEX20, /* 14: 20 node hexahedron */
176 Z_MAXTYPE
179 #elif defined USERD_API_201
180 enum z_elem_types {
181 Z_POINT, /* 00: 1 node point element */
182 Z_G_POINT, /* 01: 1 node point element (ghost call) */
183 Z_BAR02, /* 02: 2 node bar */
184 Z_G_BAR02, /* 03: 2 node bar (ghost cell) */
185 Z_BAR03, /* 04: 3 node bar */
186 Z_G_BAR03, /* 05: 3 node bar (ghost cell) */
187 Z_TRI03, /* 06: 3 node triangle */
188 Z_G_TRI03, /* 07: 3 node triangle (ghost cell) */
189 Z_TRI06, /* 08: 6 node triangle */
190 Z_G_TRI06, /* 09: 6 node triangle (ghost cell) */
191 Z_QUA04, /* 10: 4 node quad */
192 Z_G_QUA04, /* 11: 4 node quad (ghost cell) */
193 Z_QUA08, /* 12: 8 node quad */
194 Z_G_QUA08, /* 13: 8 node quad (ghost cell) */
195 Z_TET04, /* 14: 4 node tetrahedron */
196 Z_G_TET04, /* 15: 4 node tetrahedron (ghost cell) */
197 Z_TET10, /* 16: 10 node tetrahedron */
198 Z_G_TET10, /* 17: 10 node tetrahedron (ghost cell) */
199 Z_PYR05, /* 18: 5 node pyramid */
200 Z_G_PYR05, /* 19: 5 node pyramid (ghost cell) */
201 Z_PYR13, /* 20: 13 node pyramid */
202 Z_G_PYR13, /* 21: 13 node pyramid (ghost cell) */
203 Z_PEN06, /* 22: 6 node pentahedron */
204 Z_G_PEN06, /* 23: 6 node pentahedron (ghost cell) */
205 Z_PEN15, /* 24: 15 node pentahedron */
206 Z_G_PEN15, /* 25: 15 node pentahedron (ghost cell) */
207 Z_HEX08, /* 26: 8 node hexahedron */
208 Z_G_HEX08, /* 27: 8 node hexahedron (ghost cell) */
209 Z_HEX20, /* 28: 20 node hexahedron */
210 Z_G_HEX20, /* 29: 20 node hexahedron (ghost cell) */
211 Z_MAXTYPE
214 #else
215 enum z_elem_types {
216 Z_POINT, /* 00: 1 node point element */
217 Z_G_POINT, /* 01: 1 node point element (ghost call) */
218 Z_BAR02, /* 02: 2 node bar */
219 Z_G_BAR02, /* 03: 2 node bar (ghost cell) */
220 Z_BAR03, /* 04: 3 node bar */
221 Z_G_BAR03, /* 05: 3 node bar (ghost cell) */
222 Z_TRI03, /* 06: 3 node triangle */
223 Z_G_TRI03, /* 07: 3 node triangle (ghost cell) */
224 Z_TRI06, /* 08: 6 node triangle */
225 Z_G_TRI06, /* 09: 6 node triangle (ghost cell) */
226 Z_QUA04, /* 10: 4 node quad */
227 Z_G_QUA04, /* 11: 4 node quad (ghost cell) */
228 Z_QUA08, /* 12: 8 node quad */
229 Z_G_QUA08, /* 13: 8 node quad (ghost cell) */
230 Z_TET04, /* 14: 4 node tetrahedron */
231 Z_G_TET04, /* 15: 4 node tetrahedron (ghost cell) */
232 Z_TET10, /* 16: 10 node tetrahedron */
233 Z_G_TET10, /* 17: 10 node tetrahedron (ghost cell) */
234 Z_PYR05, /* 18: 5 node pyramid */
235 Z_G_PYR05, /* 19: 5 node pyramid (ghost cell) */
236 Z_PYR13, /* 20: 13 node pyramid */
237 Z_G_PYR13, /* 21: 13 node pyramid (ghost cell) */
238 Z_PEN06, /* 22: 6 node pentahedron */
239 Z_G_PEN06, /* 23: 6 node pentahedron (ghost cell) */
240 Z_PEN15, /* 24: 15 node pentahedron */
241 Z_G_PEN15, /* 25: 15 node pentahedron (ghost cell) */
242 Z_HEX08, /* 26: 8 node hexahedron */
243 Z_G_HEX08, /* 27: 8 node hexahedron (ghost cell) */
244 Z_HEX20, /* 28: 20 node hexahedron */
245 Z_G_HEX20, /* 29: 20 node hexahedron (ghost cell) */
246 Z_NSIDED, /* 30: n node polygon */
247 Z_G_NSIDED, /* 31: n node polygon (ghost cell) */
248 Z_NFACED, /* 32: n faced polyhedron */
249 Z_G_NFACED, /* 33: n faced polyhedron (ghost cell) */
250 Z_MAXTYPE
253 #endif
255 enum z_node_ids_opt
257 Z_NO_NODE_IDS,
258 Z_ASSIGN_NODE_IDS,
259 Z_GIVEN_NODE_IDS
262 enum z_element_ids_opt
264 Z_NO_ELEMENT_IDS,
265 Z_ASSIGN_ELEMENT_IDS,
266 Z_GIVEN_ELEMENT_IDS
270 /*-------------------------------*/
271 /* Unstructured/Structured types */
272 /*-------------------------------*/
273 enum z_structured_defs
275 Z_UNSTRUCTURED, /* for unstructured part */
276 Z_STRUCTURED, /* for structured (non-iblanked) part */
277 Z_IBLANKED, /* for structured iblanked part */
278 Z_MAXMESHTYPES
281 /*----------------------------*/
282 /* Structured Iblanking types */
283 /*----------------------------*/
284 enum z_iblank_domain
286 Z_EXT, /* Exterior */
287 Z_INT, /* Interior */
288 Z_BND, /* Boundary */
289 Z_INTBND, /* Internal boundary/baffle */
290 Z_SYM, /* Symmetry surface */
291 Z_NO_OF_IBLANK_DOMAIN_ITEMS
295 /*-----------------------------------*/
296 /* Dataset Query file info Structure */
297 /*-----------------------------------*/
298 #define Z_MAXFILENP 255 /* Max file name and path.*/
299 #define Z_MAXTIMLEN 40 /* Max time str length */
300 #define Z_BUFLEN 82 /* Allocated length of the f_desc strings */
301 typedef struct {
302 char name[Z_MAXFILENP];
303 long sizeb;
304 char timemod[Z_MAXTIMLEN];
305 int num_d_lines;
306 char **f_desc;
307 } Z_QFILES;
309 /*-------------------------------------------
310 * Mixed Material enum
312 * (Must be comparable to material_file_index
313 * in mat_defs.h of EnSight server)
314 *--------------------------------------------*/
315 enum z_material_file_index
317 Z_MAT_INDEX,
318 Z_MIX_INDEX,
319 Z_MIX_VALUE,
320 Z_SPE_VALUE,
321 Z_NUM_MAT_FILES
324 /*-------------------------------------------
325 * Material type enum
327 * (Must be comparable to matset_via_file_type
328 * in mat_defs.h of EnSight server)
329 *--------------------------------------------*/
330 enum z_matset_via_file_type
332 Z_MISET_VIA_SPARSE_MIX, /* Original method prior to 07Feb07:mel*/
333 Z_MISET_VIA_ESCAL_VARS, /* Materials via element scalar variables*/
334 Z_MISET_VIA_MAX_FTYPES
338 /* ---------------------------------------
339 * Extra GUI size stuff
340 * _EGS
341 * This is the maximum number of
342 * Extra GUI items that you are
343 * allowed of each type.
345 * Don't change these values!
346 * ------------------------------------- */
347 #define Z_MAX_NUM_GUI_PULL_ITEMS 20 /* max num GUI pulldowns */
348 #define Z_LEN_GUI_PULL_STR 80 /* max length of GUI pulldown string */
349 #define Z_LEN_GUI_FIELD_STR 256 /* max length of field string */
350 #define Z_LEN_GUI_TITLE_STR 40 /* max length of title string */
352 /* ---------------------------------------
353 * Extra data function defines (for "target")
355 * Don't change these values!
356 * ------------------------------------- */
357 #define DATA_TARGET_NONE 0
358 #define DATA_TARGET_SERVER 1
359 #define DATA_TARGET_SOS 2
360 #define DATA_TARGET_CLIENT 3
361 #define DATA_TARGET_PYTHON 0x10000000
362 #define DATA_TARGET_CMDLANG 0x20000000
363 #define DATA_TARGET_UNDEF_VAL 0x40000000
364 #define DATA_TARGET_OTHER 0x00000000
365 #define DATA_TARGET_MASK 0x0000000f
367 /* ---------------------------------------
368 * Failed elemenet enums
369 * --------------------------------------- */
371 enum z_element_failure_criteria
373 Z_ELE_FAILED_NONE,
374 Z_ELE_FAILED_GREATER,
375 Z_ELE_FAILED_LESS,
376 Z_ELE_FAILED_EQUAL,
377 Z_ELE_FAILED_NOT_EQUAL,
378 Z_ELE_FAILED_MANY
382 enum z_element_failure_logic
384 Z_ELE_FAILED_LOGIC_NONE,
385 Z_ELE_FAILED_LOGIC_AND,
386 Z_ELE_FAILED_LOGIC_OR,
387 Z_ELE_FAILED_LOGIC_MANY
390 /*----------------------------------------------------------
391 * We include the prototype header file
392 *----------------------------------------------------------*/
393 #include "global_extern_proto.h"
395 /* ---------------------
396 * export the file pointer if windows
397 * because windows can't open a file in the
398 * server and pass the FILE * pointer properly.
399 * --------------------- */
400 #ifdef WIN32
401 typedef struct _USERD_globals_struct {
402 char arch_filename[256];
403 unsigned long arch_fileptr;
404 } _USERD_globals;
405 #endif
407 #ifdef __cplusplus
409 #endif
411 /*--------------------------------------------------------------------*/
412 #endif /*GLOBAL_EXTERN_H*/