1 /**************************************************************************/ 2 /* Copyright Notice */ 3 /* */ 4 /* For Scientific and Technical Information Only */ 5 /* Copyright 2006 Los Alamos National Security, LLC All rights reserved */ 6 /* */ 7 /* For All Information Unless otherwise indicated, this information has */ 8 /* been authored by an employee or employees of the Los Alamos National */ 9 /* Security, LLC (LANS), operator of the Los Alamos National Laboratory */ 10 /* under Contract No. DE-AC52-06NA25396 with the U.S. Department of */ 11 /* Energy. The U.S. Government has rights to use, reproduce, and */ 12 /* distribute this information. The public may copy and use this */ 13 /* information without charge, provided that this Notice and any */ 14 /* statement of authorship are reproduced on all copies. Neither the */ 15 /* Government nor LANS makes any warranty, express or implied, or assumes */ 16 /* any liability or responsibility for the use of this information. */ 17 /* */ 18 /* Author: Frank A. Ortega fao[at]lanl.gov */ 19 /**************************************************************************/ 20 21 #ifndef _GMVREADH_ 22 #define _GMVREADH_ 23 24 #ifndef RDATA_INIT 25 #define EXTERN extern 26 #else 27 #define EXTERN /**/ 28 #endif 29 30 /* Keyword types. */ 31 #define NODES 1 32 #define CELLS 2 33 #define FACES 3 34 #define VFACES 4 35 #define XFACES 5 36 #define MATERIAL 6 37 #define VELOCITY 7 38 #define VARIABLE 8 39 #define FLAGS 9 40 #define POLYGONS 10 41 #define TRACERS 11 42 #define PROBTIME 12 43 #define CYCLENO 13 44 #define NODEIDS 14 45 #define CELLIDS 15 46 #define SURFACE 16 47 #define SURFMATS 17 48 #define SURFVEL 18 49 #define SURFVARS 19 50 #define SURFFLAG 20 51 #define UNITS 21 52 #define VINFO 22 53 #define TRACEIDS 23 54 #define GROUPS 24 55 #define FACEIDS 25 56 #define SURFIDS 26 57 #define CELLPES 27 58 #define SUBVARS 28 59 #define GHOSTS 29 60 #define VECTORS 30 61 #define CODENAME 48 62 #define CODEVER 49 63 #define SIMDATE 50 64 #define GMVEND 51 65 #define INVALIDKEYWORD 52 66 #define GMVERROR 53 67 68 69 /* Data types for Nodes: */ 70 #define UNSTRUCT 100 71 #define STRUCT 101 72 #define LOGICALLY_STRUCT 102 73 #define AMR 103 74 #define VFACES2D 104 75 #define VFACES3D 105 76 #define NODE_V 106 77 78 /* Data types for Cells: */ 79 #define GENERAL 110 80 #define REGULAR 111 81 #define VFACE2D 112 82 #define VFACE3D 113 83 84 /* Data types for vectors, variables, materials, flags, tracers, groups: */ 85 #define NODE 200 86 #define CELL 201 87 #define FACE 202 88 #define SURF 203 89 #define XYZ 204 90 #define TRACERDATA 205 91 #define VEL 206 92 #define ENDKEYWORD 207 93 #define FROMFILE 208 94 95 96 EXTERN struct 97 { 98 int keyword; /* See above for definitions. */ 99 int datatype; /* See above for definitions. */ 100 char name1[33]; /* hex, tri, etc, flag name, field name. */ 101 long num; /* nnodes, ncells, nsurf, ntracers. */ 102 long num2; /* no. of faces, number of vertices. */ 103 104 long ndoubledata1; 105 double *doubledata1; 106 long ndoubledata2; 107 double *doubledata2; 108 long ndoubledata3; 109 double *doubledata3; 110 111 long nlongdata1; 112 long *longdata1; 113 long nlongdata2; 114 long *longdata2; 115 116 int nchardata1; /* Number of 33 character string. */ 117 char *chardata1; /* Array of 33 character strings. */ 118 int nchardata2; /* Number of 33 character string. */ 119 char *chardata2; /* Array of 33 character strings. */ 120 } 121 gmv_data; 122 123 124 EXTERN struct 125 { 126 long nnodes; 127 long ncells; 128 long nfaces; 129 long totfaces; 130 long totverts; 131 int intype; /* CELLS, FACES, STRUCT, LOGICALLY_STRUCT, AMR. */ 132 int nxv; /* nxv, nyv, nzv for STRUCT, */ 133 int nyv; /* LOGICALLY_STRUC and AMR. */ 134 int nzv; 135 136 double *x; /* Node x,y,zs, nnodes long. */ 137 double *y; 138 double *z; 139 140 long *celltoface; /* Cell to face pointer, ncells+1 long. */ 141 long *cellfaces; /* Faces in cells, totfaces+1 long. */ 142 long *facetoverts; /* Face to verts pointer, nfaces+1 long.*/ 143 long *faceverts; /* Verts per face, totverts long. */ 144 long *facecell1; /* First cell face attaches to. */ 145 long *facecell2; /* Second cell, nfaces long. */ 146 long *vfacepe; /* Vface pe no. */ 147 long *vfaceoppface; /* Vface opposite face no. */ 148 long *vfaceoppfacepe; /* Vface opposite face pe no. */ 149 long *cellnnode; /* No. of nodes per cell (regular cells). */ 150 long *cellnodes; /* Node list per cell (regular cells). */ 151 } 152 gmv_meshdata; 153 154 /* C, C++ prototypes. */ 155 156 int gmvread_checkfile(char *filnam); 157 158 int gmvread_open(char *filnam); 159 160 int gmvread_open_fromfileskip(char *filnam); 161 162 void gmvread_close(void); 163 164 void gmvread_data(void); 165 166 void gmvread_mesh(void); 167 168 void gmvread_printon(); 169 170 void gmvread_printoff(); 171 172 void struct2face(void); 173 174 void struct2vface(void); 175 176 #endif 177