ExodusII
5.15
|
00001 /* 00002 * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract 00003 * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement 00004 * retains certain rights in this software. 00005 * 00006 * Redistribution and use in source and binary forms, with or without 00007 * modification, are permitted provided that the following conditions are 00008 * met: 00009 * 00010 * * Redistributions of source code must retain the above copyright 00011 * notice, this list of conditions and the following disclaimer. 00012 * 00013 * * Redistributions in binary form must reproduce the above 00014 * copyright notice, this list of conditions and the following 00015 * disclaimer in the documentation and/or other materials provided 00016 * with the distribution. 00017 * 00018 * * Neither the name of Sandia Corporation nor the names of its 00019 * contributors may be used to endorse or promote products derived 00020 * from this software without specific prior written permission. 00021 * 00022 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00023 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00024 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00025 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00026 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00027 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00028 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00029 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00030 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00031 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00032 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00033 * 00034 */ 00035 /***************************************************************************** 00036 * 00037 * exodusII_int.h - ExodusII header file for internal Exodus call use only 00038 * 00039 */ 00040 00041 #ifndef EXODUS_II_INT_HDR 00042 #define EXODUS_II_INT_HDR 00043 00044 #include "netcdf.h" 00045 #include <inttypes.h> 00046 00047 #ifndef __APPLE__ 00048 #if defined __STDC__ || defined __cplusplus 00049 #include <stdlib.h> 00050 #endif 00051 #endif 00052 00053 #ifdef _MSC_VER 00054 # pragma warning ( disable : 4127 ) 00055 # pragma warning ( disable : 4706 ) 00056 # pragma warning ( disable : 4701 ) 00057 #endif 00058 00059 #if defined(__BORLANDC__) 00060 #pragma warn -8004 /* "assigned a value that is never used" */ 00061 #endif 00062 00063 00064 #include <stdio.h> 00065 00066 /* A format string for outputting size_t ... */ 00067 #if 0 00068 #if (defined(__STDC__) && defined(__STDC_VERSION__)) 00069 # if (__STDC__ && __STDC_VERSION__ >= 199901L) 00070 # define PRIoSIZE "zo" 00071 # define PRIuSIZE "zu" 00072 # define PRIxSIZE "zx" 00073 # define PRIXSIZE "zX" 00074 # endif 00075 #else 00076 /* ULLONG_MAX is defined in my wrapper if 64-bit integer extensions 00077 are detected, even if it's not a C99 compiler. */ 00078 # if defined(ULLONG_MAX) && (SIZE_MAX == ULLONG_MAX) 00079 # define PRIoSIZE "llo" 00080 # define PRIuSIZE "llu" 00081 # define PRIxSIZE "llx" 00082 # define PRIXSIZE "llX" 00083 # elif (SIZE_MAX == ULONG_MAX) 00084 # define PRIoSIZE "lo" 00085 # define PRIuSIZE "lu" 00086 # define PRIxSIZE "lx" 00087 # define PRIXSIZE "lX" 00088 # elif (SIZE_MAX == UINT_MAX) 00089 # define PRIoSIZE "o" 00090 # define PRIuSIZE "u" 00091 # define PRIxSIZE "x" 00092 # define PRIXSIZE "X" 00093 # elif (SIZE_MAX == USHRT_MAX) 00094 # define PRIoSIZE "ho" 00095 # define PRIuSIZE "hu" 00096 # define PRIxSIZE "hx" 00097 # define PRIXSIZE "hX" 00098 # else 00099 # error "Platform not supported" 00100 # endif 00101 #endif 00102 #endif 00103 00104 #define ST_ZU "lu" 00105 00106 #define MAX_VAR_NAME_LENGTH 32 /**< Internal use only */ 00107 00108 /* this should be defined in ANSI C and C++, but just in case ... */ 00109 #ifndef NULL 00110 #define NULL 0 00111 #endif 00112 00113 /* Default "filesize" for newly created files. 00114 * Set to 0 for normal filesize setting. 00115 * Set to 1 for EXODUS_LARGE_MODEL setting to be the default 00116 */ 00117 #define EXODUS_DEFAULT_SIZE 1 00118 00119 /* Exodus error return codes - function return values: */ 00120 #define EX_FATAL -1 /* fatal error flag def */ 00121 #define EX_NOERR 0 /* no error flag def */ 00122 #define EX_WARN 1 /* warning flag def */ 00123 00124 /* 00125 * This file contains defined constants that are used internally in the 00126 * EXODUS II API. 00127 * 00128 * The first group of constants refer to netCDF variables, attributes, or 00129 * dimensions in which the EXODUS II data are stored. Using the defined 00130 * constants will allow the names of the netCDF entities to be changed easily 00131 * in the future if needed. The first three letters of the constant identify 00132 * the netCDF entity as a variable (VAR), dimension (DIM), or attribute (ATT). 00133 * 00134 * NOTE: The entity name should not have any blanks in it. Blanks are 00135 * technically legal but some netcdf utilities (ncgen in particular) 00136 * fail when they encounter a blank in a name. 00137 * 00138 * DEFINED CONSTANT ENTITY NAME DATA STORED IN ENTITY 00139 */ 00140 #define ATT_FILE_TYPE "type" /* obsolete */ 00141 #define ATT_TITLE "title" /* the database title */ 00142 #define ATT_API_VERSION "api_version" /* the EXODUS II api vers # */ 00143 #define ATT_API_VERSION_BLANK "api version" /* the EXODUS II api vers # */ 00144 /* used for db version 2.01 */ 00145 /* and earlier */ 00146 #define ATT_VERSION "version" /* the EXODUS II file vers # */ 00147 #define ATT_FILESIZE "file_size" /* 1=large, 0=normal */ 00148 #define ATT_FLT_WORDSIZE "floating_point_word_size" 00149 /* word size of floating */ 00150 /* point numbers in file */ 00151 #define ATT_FLT_WORDSIZE_BLANK "floating point word size" 00152 /* word size of floating */ 00153 /* point numbers in file */ 00154 /* used for db version 2.01 */ 00155 /* and earlier */ 00156 #define ATT_MAX_NAME_LENGTH "maximum_name_length" 00157 #define ATT_INT64_STATUS "int64_status" 00158 00159 #define DIM_NUM_NODES "num_nodes" /* # of nodes */ 00160 #define DIM_NUM_DIM "num_dim" /* # of dimensions; 2- or 3-d*/ 00161 #define DIM_NUM_EDGE "num_edge" /* # of edges (over all blks)*/ 00162 #define DIM_NUM_FACE "num_face" /* # of faces (over all blks)*/ 00163 #define DIM_NUM_ELEM "num_elem" /* # of elements */ 00164 #define DIM_NUM_EL_BLK "num_el_blk" /* # of element blocks */ 00165 #define DIM_NUM_ED_BLK "num_ed_blk" /* # of edge blocks */ 00166 #define DIM_NUM_FA_BLK "num_fa_blk" /* # of face blocks */ 00167 #define VAR_COORD "coord" /* nodal coordinates */ 00168 #define VAR_COORD_X "coordx" /* X-dimension coordinate */ 00169 #define VAR_COORD_Y "coordy" /* Y-dimension coordinate */ 00170 #define VAR_COORD_Z "coordz" /* Z-dimension coordinate */ 00171 #define VAR_NAME_COOR "coor_names" /* names of coordinates */ 00172 #define VAR_NAME_EL_BLK "eb_names" /* names of element blocks */ 00173 #define VAR_NAME_NS "ns_names" /* names of node sets */ 00174 #define VAR_NAME_SS "ss_names" /* names of side sets */ 00175 #define VAR_NAME_EM "emap_names" /* names of element maps */ 00176 #define VAR_NAME_EDM "edmap_names" /* names of edge maps */ 00177 #define VAR_NAME_FAM "famap_names" /* names of face maps */ 00178 #define VAR_NAME_NM "nmap_names" /* names of node maps */ 00179 #define VAR_NAME_ED_BLK "ed_names" /* names of edge blocks */ 00180 #define VAR_NAME_FA_BLK "fa_names" /* names of face blocks */ 00181 #define VAR_NAME_ES "es_names" /* names of edge sets */ 00182 #define VAR_NAME_FS "fs_names" /* names of face sets */ 00183 #define VAR_NAME_ELS "els_names" /* names of element sets */ 00184 #define VAR_STAT_EL_BLK "eb_status" /* element block status */ 00185 #define VAR_STAT_ECONN "econn_status" /* element block edge status */ 00186 #define VAR_STAT_FCONN "fconn_status" /* element block face status */ 00187 #define VAR_STAT_ED_BLK "ed_status" /* edge block status */ 00188 #define VAR_STAT_FA_BLK "fa_status" /* face block status */ 00189 #define VAR_ID_EL_BLK "eb_prop1" /* element block ids props */ 00190 #define VAR_ID_ED_BLK "ed_prop1" /* edge block ids props */ 00191 #define VAR_ID_FA_BLK "fa_prop1" /* face block ids props */ 00192 #define ATT_NAME_ELB "elem_type" /* element type names for */ 00193 /* each element block */ 00194 #define DIM_NUM_EL_IN_BLK(num) ex_catstr("num_el_in_blk",num) 00195 /* # of elements in element */ 00196 /* block num */ 00197 #define DIM_NUM_NOD_PER_EL(num) ex_catstr("num_nod_per_el",num) 00198 /* # of nodes per element in */ 00199 /* element block num */ 00200 #define DIM_NUM_ATT_IN_BLK(num) ex_catstr("num_att_in_blk",num) 00201 /* # of attributes in element*/ 00202 /* block num */ 00203 #define DIM_NUM_ED_IN_EBLK(num) ex_catstr("num_ed_in_blk",num) 00204 /* # of edges in edge */ 00205 /* block num */ 00206 #define DIM_NUM_NOD_PER_ED(num) ex_catstr("num_nod_per_ed",num) 00207 /* # of nodes per edge in */ 00208 /* edge block num */ 00209 #define DIM_NUM_EDG_PER_EL(num) ex_catstr("num_edg_per_el",num) 00210 /* # of edges per element in */ 00211 /* element block num */ 00212 #define DIM_NUM_ATT_IN_EBLK(num) ex_catstr("num_att_in_eblk",num) 00213 /* # of attributes in edge */ 00214 /* block num */ 00215 #define DIM_NUM_FA_IN_FBLK(num) ex_catstr("num_fa_in_blk",num) 00216 /* # of faces in face */ 00217 /* block num */ 00218 #define DIM_NUM_NOD_PER_FA(num) ex_catstr("num_nod_per_fa",num) 00219 /* # of nodes per face in */ 00220 /* face block num */ 00221 #define DIM_NUM_FAC_PER_EL(num) ex_catstr("num_fac_per_el",num) 00222 /* # of faces per element in */ 00223 /* element block num */ 00224 #define DIM_NUM_ATT_IN_FBLK(num) ex_catstr("num_att_in_fblk",num) 00225 /* # of attributes in face */ 00226 /* block num */ 00227 #define DIM_NUM_ATT_IN_NBLK "num_att_in_nblk" 00228 00229 #define VAR_CONN(num) ex_catstr("connect",num) 00230 /* element connectivity for */ 00231 /* element block num */ 00232 #define VAR_EBEPEC(num) ex_catstr("ebepecnt",num) 00233 /* array containing number of entity per */ 00234 /* entity for n-sided face/element blocks */ 00235 #define VAR_ATTRIB(num) ex_catstr("attrib",num) 00236 /* list of attributes for */ 00237 /* element block num */ 00238 #define VAR_NAME_ATTRIB(num) ex_catstr("attrib_name",num) 00239 /* list of attribute names */ 00240 /* for element block num */ 00241 #define VAR_EB_PROP(num) ex_catstr("eb_prop",num) 00242 /* list of the numth property*/ 00243 /* for all element blocks */ 00244 #define VAR_ECONN(num) ex_catstr("edgconn",num) 00245 /* edge connectivity for */ 00246 /* element block num */ 00247 #define VAR_EBCONN(num) ex_catstr("ebconn",num) 00248 /* edge connectivity for */ 00249 /* edge block num */ 00250 #define VAR_EATTRIB(num) ex_catstr("eattrb",num) 00251 /* list of attributes for */ 00252 /* edge block num */ 00253 #define VAR_NAME_EATTRIB(num) ex_catstr("eattrib_name",num) 00254 /* list of attribute names */ 00255 /* for edge block num */ 00256 #define VAR_NATTRIB "nattrb" 00257 #define VAR_NAME_NATTRIB "nattrib_name" 00258 #define DIM_NUM_ATT_IN_NBLK "num_att_in_nblk" 00259 00260 #define VAR_NSATTRIB(num) ex_catstr("nsattrb",num) 00261 #define VAR_NAME_NSATTRIB(num) ex_catstr("nsattrib_name",num) 00262 #define DIM_NUM_ATT_IN_NS(num) ex_catstr("num_att_in_ns",num) 00263 00264 #define VAR_SSATTRIB(num) ex_catstr("ssattrb",num) 00265 #define VAR_NAME_SSATTRIB(num) ex_catstr("ssattrib_name",num) 00266 #define DIM_NUM_ATT_IN_SS(num) ex_catstr("num_att_in_ss",num) 00267 00268 #define VAR_ESATTRIB(num) ex_catstr("esattrb",num) 00269 #define VAR_NAME_ESATTRIB(num) ex_catstr("esattrib_name",num) 00270 #define DIM_NUM_ATT_IN_ES(num) ex_catstr("num_att_in_es",num) 00271 00272 #define VAR_FSATTRIB(num) ex_catstr("fsattrb",num) 00273 #define VAR_NAME_FSATTRIB(num) ex_catstr("fsattrib_name",num) 00274 #define DIM_NUM_ATT_IN_FS(num) ex_catstr("num_att_in_fs",num) 00275 00276 #define VAR_ELSATTRIB(num) ex_catstr("elsattrb",num) 00277 #define VAR_NAME_ELSATTRIB(num) ex_catstr("elsattrib_name",num) 00278 #define DIM_NUM_ATT_IN_ELS(num) ex_catstr("num_att_in_els",num) 00279 00280 #define VAR_ED_PROP(num) ex_catstr("ed_prop",num) 00281 /* list of the numth property*/ 00282 /* for all edge blocks */ 00283 #define VAR_FCONN(num) ex_catstr("facconn",num) 00284 /* face connectivity for */ 00285 /* element block num */ 00286 #define VAR_FBCONN(num) ex_catstr("fbconn",num) 00287 /* face connectivity for */ 00288 /* face block num */ 00289 #define VAR_FBEPEC(num) ex_catstr("fbepecnt",num) 00290 /* array containing number of entity per */ 00291 /* entity for n-sided face/element blocks */ 00292 #define VAR_FATTRIB(num) ex_catstr("fattrb",num) 00293 /* list of attributes for */ 00294 /* face block num */ 00295 #define VAR_NAME_FATTRIB(num) ex_catstr("fattrib_name",num) 00296 /* list of attribute names */ 00297 /* for face block num */ 00298 #define VAR_FA_PROP(num) ex_catstr("fa_prop",num) 00299 /* list of the numth property*/ 00300 /* for all face blocks */ 00301 #define ATT_PROP_NAME "name" /* name attached to element */ 00302 /* block, node set, side */ 00303 /* set, element map, or */ 00304 /* map properties */ 00305 #define VAR_MAP "elem_map" /* element order map */ 00306 /* obsolete, replaced by */ 00307 /* VAR_ELEM_MAP(num) */ 00308 #define DIM_NUM_SS "num_side_sets" /* # of side sets */ 00309 #define VAR_SS_STAT "ss_status" /* side set status */ 00310 #define VAR_SS_IDS "ss_prop1" /* side set id properties */ 00311 #define DIM_NUM_SIDE_SS(num) ex_catstr("num_side_ss",num) 00312 /* # of sides in side set num*/ 00313 #define DIM_NUM_DF_SS(num) ex_catstr("num_df_ss",num) 00314 /* # of distribution factors */ 00315 /* in side set num */ 00316 /*#define DIM_NUM_NOD_SS(num) ex_catstr("num_nod_ss",num) *** obsolete *** */ 00317 /* # of nodes in side set num*/ 00318 #define VAR_FACT_SS(num) ex_catstr("dist_fact_ss",num) 00319 /* the distribution factors */ 00320 /* for each node in side */ 00321 /* set num */ 00322 #define VAR_ELEM_SS(num) ex_catstr("elem_ss",num) 00323 /* list of elements in side */ 00324 /* set num */ 00325 #define VAR_SIDE_SS(num) ex_catstr("side_ss",num) 00326 /* list of sides in side set */ 00327 #define VAR_SS_PROP(num) ex_catstr("ss_prop",num) 00328 /* list of the numth property*/ 00329 /* for all side sets */ 00330 #define DIM_NUM_ES "num_edge_sets"/* # of edge sets */ 00331 #define VAR_ES_STAT "es_status" /* edge set status */ 00332 #define VAR_ES_IDS "es_prop1" /* edge set id properties */ 00333 #define DIM_NUM_EDGE_ES(num) ex_catstr("num_edge_es",num) 00334 /* # of edges in edge set num*/ 00335 #define DIM_NUM_DF_ES(num) ex_catstr("num_df_es",num) 00336 /* # of distribution factors */ 00337 /* in edge set num */ 00338 /*#define DIM_NUM_NOD_ES(num) ex_catstr("num_nod_es",num) *** obsolete *** */ 00339 /* # of nodes in edge set num*/ 00340 #define VAR_FACT_ES(num) ex_catstr("dist_fact_es",num) 00341 /* the distribution factors */ 00342 /* for each node in edge */ 00343 /* set num */ 00344 #define VAR_EDGE_ES(num) ex_catstr("edge_es",num) 00345 /* list of edges in edge */ 00346 /* set num */ 00347 #define VAR_ORNT_ES(num) ex_catstr("ornt_es",num) 00348 /* list of orientations in */ 00349 /* the edge set. */ 00350 #define VAR_ES_PROP(num) ex_catstr("es_prop",num) 00351 /* list of the numth property*/ 00352 /* for all edge sets */ 00353 #define DIM_NUM_FS "num_face_sets"/* # of face sets */ 00354 #define VAR_FS_STAT "fs_status" /* face set status */ 00355 #define VAR_FS_IDS "fs_prop1" /* face set id properties */ 00356 #define DIM_NUM_FACE_FS(num) ex_catstr("num_face_fs",num) 00357 /* # of faces in side set num*/ 00358 #define DIM_NUM_DF_FS(num) ex_catstr("num_df_fs",num) 00359 /* # of distribution factors */ 00360 /* in face set num */ 00361 /*#define DIM_NUM_NOD_FS(num) ex_catstr("num_nod_ss",num) *** obsolete *** */ 00362 /* # of nodes in face set num*/ 00363 #define VAR_FACT_FS(num) ex_catstr("dist_fact_fs",num) 00364 /* the distribution factors */ 00365 /* for each node in face */ 00366 /* set num */ 00367 #define VAR_FACE_FS(num) ex_catstr("face_fs",num) 00368 /* list of elements in face */ 00369 /* set num */ 00370 #define VAR_ORNT_FS(num) ex_catstr("ornt_fs",num) 00371 /* list of sides in side set */ 00372 #define VAR_FS_PROP(num) ex_catstr("fs_prop",num) 00373 /* list of the numth property*/ 00374 /* for all face sets */ 00375 #define DIM_NUM_ELS "num_elem_sets"/* # of elem sets */ 00376 #define DIM_NUM_ELE_ELS(num) ex_catstr("num_ele_els",num) 00377 /* # of elements in elem set */ 00378 /* num */ 00379 #define DIM_NUM_DF_ELS(num) ex_catstr("num_df_els",num) 00380 /* # of distribution factors */ 00381 /* in element set num */ 00382 #define VAR_ELS_STAT "els_status" /* elem set status */ 00383 #define VAR_ELS_IDS "els_prop1" /* elem set id properties */ 00384 #define VAR_ELEM_ELS(num) ex_catstr("elem_els",num) 00385 /* list of elements in elem */ 00386 /* set num */ 00387 #define VAR_FACT_ELS(num) ex_catstr("dist_fact_els",num) 00388 /* list of distribution */ 00389 /* factors in elem set num */ 00390 #define VAR_ELS_PROP(num) ex_catstr("els_prop",num) 00391 /* list of the numth property*/ 00392 /* for all elem sets */ 00393 #define DIM_NUM_NS "num_node_sets"/* # of node sets */ 00394 #define DIM_NUM_NOD_NS(num) ex_catstr("num_nod_ns",num) 00395 /* # of nodes in node set */ 00396 /* num */ 00397 #define DIM_NUM_DF_NS(num) ex_catstr("num_df_ns",num) 00398 /* # of distribution factors */ 00399 /* in node set num */ 00400 #define VAR_NS_STAT "ns_status" /* node set status */ 00401 #define VAR_NS_IDS "ns_prop1" /* node set id properties */ 00402 #define VAR_NODE_NS(num) ex_catstr("node_ns",num) 00403 /* list of nodes in node set */ 00404 /* num */ 00405 #define VAR_FACT_NS(num) ex_catstr("dist_fact_ns",num) 00406 /* list of distribution */ 00407 /* factors in node set num */ 00408 #define VAR_NS_PROP(num) ex_catstr("ns_prop",num) 00409 /* list of the numth property*/ 00410 /* for all node sets */ 00411 #define DIM_NUM_QA "num_qa_rec" /* # of QA records */ 00412 #define VAR_QA_TITLE "qa_records" /* QA records */ 00413 #define DIM_NUM_INFO "num_info" /* # of information records */ 00414 #define VAR_INFO "info_records" /* information records */ 00415 #define VAR_HIS_TIME "time_hist" /* obsolete */ 00416 #define VAR_WHOLE_TIME "time_whole" /* simulation times for whole*/ 00417 /* time steps */ 00418 #define VAR_ELEM_TAB "elem_var_tab" /* element variable truth */ 00419 /* table */ 00420 #define VAR_EBLK_TAB "edge_var_tab" /* edge variable truth table */ 00421 #define VAR_FBLK_TAB "face_var_tab" /* face variable truth table */ 00422 #define VAR_ELSET_TAB "elset_var_tab" /* elemset variable truth */ 00423 /* table */ 00424 #define VAR_SSET_TAB "sset_var_tab" /* sideset variable truth */ 00425 /* table */ 00426 #define VAR_FSET_TAB "fset_var_tab" /* faceset variable truth */ 00427 /* table */ 00428 #define VAR_ESET_TAB "eset_var_tab" /* edgeset variable truth */ 00429 /* table */ 00430 #define VAR_NSET_TAB "nset_var_tab" /* nodeset variable truth */ 00431 /* table */ 00432 #define DIM_NUM_GLO_VAR "num_glo_var" /* # of global variables */ 00433 #define VAR_NAME_GLO_VAR "name_glo_var" /* names of global variables */ 00434 #define VAR_GLO_VAR "vals_glo_var" /* values of global variables*/ 00435 #define DIM_NUM_NOD_VAR "num_nod_var" /* # of nodal variables */ 00436 #define VAR_NAME_NOD_VAR "name_nod_var" /* names of nodal variables */ 00437 #define VAR_NOD_VAR "vals_nod_var" /* values of nodal variables */ 00438 #define VAR_NOD_VAR_NEW(num) ex_catstr("vals_nod_var",num) 00439 /* values of nodal variables */ 00440 #define DIM_NUM_ELE_VAR "num_elem_var" /* # of element variables */ 00441 #define VAR_NAME_ELE_VAR "name_elem_var" /* names of element variables*/ 00442 #define VAR_ELEM_VAR(num1,num2) ex_catstr2("vals_elem_var",num1,"eb",num2) 00443 /* values of element variable*/ 00444 /* num1 in element block */ 00445 /* num2 */ 00446 #define DIM_NUM_EDG_VAR "num_edge_var" /* # of edge variables */ 00447 #define VAR_NAME_EDG_VAR "name_edge_var" /* names of edge variables */ 00448 #define VAR_EDGE_VAR(num1,num2) ex_catstr2("vals_edge_var",num1,"eb",num2) 00449 /* values of edge variable */ 00450 /* num1 in edge block num2 */ 00451 #define DIM_NUM_FAC_VAR "num_face_var" /* # of face variables */ 00452 #define VAR_NAME_FAC_VAR "name_face_var" /* names of face variables */ 00453 #define VAR_FACE_VAR(num1,num2) ex_catstr2("vals_face_var",num1,"fb",num2) 00454 /* values of face variable */ 00455 /* num1 in face block num2 */ 00456 00457 #define DIM_NUM_NSET_VAR "num_nset_var" /* # of nodeset variables */ 00458 #define VAR_NAME_NSET_VAR "name_nset_var" /* names of nodeset variables*/ 00459 #define VAR_NS_VAR(num1,num2) ex_catstr2("vals_nset_var",num1,"ns",num2) 00460 /* values of nodeset variable*/ 00461 /* num1 in nodeset num2 */ 00462 #define DIM_NUM_ESET_VAR "num_eset_var" /* # of edgeset variables */ 00463 #define VAR_NAME_ESET_VAR "name_eset_var" /* names of edgeset variables*/ 00464 #define VAR_ES_VAR(num1,num2) ex_catstr2("vals_eset_var",num1,"es",num2) 00465 /* values of edgeset variable*/ 00466 /* num1 in edgeset num2 */ 00467 #define DIM_NUM_FSET_VAR "num_fset_var" /* # of faceset variables */ 00468 #define VAR_NAME_FSET_VAR "name_fset_var" /* names of faceset variables*/ 00469 #define VAR_FS_VAR(num1,num2) ex_catstr2("vals_fset_var",num1,"fs",num2) 00470 /* values of faceset variable*/ 00471 /* num1 in faceset num2 */ 00472 #define DIM_NUM_SSET_VAR "num_sset_var" /* # of sideset variables */ 00473 #define VAR_NAME_SSET_VAR "name_sset_var" /* names of sideset variables*/ 00474 #define VAR_SS_VAR(num1,num2) ex_catstr2("vals_sset_var",num1,"ss",num2) 00475 /* values of sideset variable*/ 00476 /* num1 in sideset num2 */ 00477 #define DIM_NUM_ELSET_VAR "num_elset_var" /* # of element set variables*/ 00478 #define VAR_NAME_ELSET_VAR "name_elset_var"/* names of elemset variables*/ 00479 #define VAR_ELS_VAR(num1,num2) ex_catstr2("vals_elset_var",num1,"es",num2) 00480 /* values of elemset variable*/ 00481 /* num1 in elemset num2 */ 00482 00483 #define DIM_NUM_HIS_VAR "num_his_var" /* obsolete */ 00484 #define VAR_NAME_HIS_VAR "name_his_var" /* obsolete */ 00485 #define VAR_HIS_VAR "vals_his_var" /* obsolete */ 00486 #define DIM_STR "len_string" /* general dimension of */ 00487 /* length MAX_STR_LENGTH */ 00488 /* used for some string lengths */ 00489 #define DIM_STR_NAME "len_name" /* general dimension of */ 00490 /* length MAX_NAME_LENGTH */ 00491 /* used for name lengths */ 00492 #define DIM_LIN "len_line" /* general dimension of */ 00493 /* length MAX_LINE_LENGTH */ 00494 /* used for long strings */ 00495 #define DIM_N4 "four" /* general dimension of */ 00496 /* length 4 */ 00497 #define DIM_TIME "time_step" /* unlimited (expandable) */ 00498 /* dimension for time steps*/ 00499 #define DIM_HTIME "hist_time_step"/* obsolete */ 00500 #define VAR_ELEM_NUM_MAP "elem_num_map" /* element numbering map */ 00501 /* obsolete, replaced by */ 00502 /* VAR_ELEM_MAP(num) */ 00503 #define VAR_FACE_NUM_MAP "face_num_map" /* face numbering map */ 00504 /* obsolete, replaced by */ 00505 /* VAR_FACE_MAP(num) */ 00506 #define VAR_EDGE_NUM_MAP "edge_num_map" /* edge numbering map */ 00507 /* obsolete, replaced by */ 00508 /* VAR_EDGE_MAP(num) */ 00509 #define VAR_NODE_NUM_MAP "node_num_map" /* node numbering map */ 00510 /* obsolete, replaced by */ 00511 /* VAR_NODE_MAP(num) */ 00512 #define DIM_NUM_EM "num_elem_maps" /* # of element maps */ 00513 #define VAR_ELEM_MAP(num) ex_catstr("elem_map",num) 00514 /* the numth element map */ 00515 #define VAR_EM_PROP(num) ex_catstr("em_prop",num) 00516 /* list of the numth property*/ 00517 /* for all element maps */ 00518 #define DIM_NUM_EDM "num_edge_maps" /* # of edge maps */ 00519 #define VAR_EDGE_MAP(num) ex_catstr("edge_map",num) 00520 /* the numth edge map */ 00521 #define VAR_EDM_PROP(num) ex_catstr("edm_prop",num) 00522 /* list of the numth property*/ 00523 /* for all edge maps */ 00524 #define DIM_NUM_FAM "num_face_maps" /* # of face maps */ 00525 #define VAR_FACE_MAP(num) ex_catstr("face_map",num) 00526 /* the numth face map */ 00527 #define VAR_FAM_PROP(num) ex_catstr("fam_prop",num) 00528 /* list of the numth property*/ 00529 /* for all face maps */ 00530 #define DIM_NUM_NM "num_node_maps" /* # of node maps */ 00531 #define VAR_NODE_MAP(num) ex_catstr("node_map",num) 00532 /* the numth node map */ 00533 #define VAR_NM_PROP(num) ex_catstr("nm_prop",num) 00534 /* list of the numth property*/ 00535 /* for all node maps */ 00536 00537 #define DIM_NUM_CFRAMES "num_cframes" 00538 #define DIM_NUM_CFRAME9 "num_cframes_9" 00539 #define VAR_FRAME_COORDS "frame_coordinates" 00540 #define VAR_FRAME_IDS "frame_ids" 00541 #define VAR_FRAME_TAGS "frame_tags" 00542 00543 #define VAR_ELBLK_IDS_GLOBAL "el_blk_ids_global" 00544 #define VAR_ELBLK_CNT_GLOBAL "el_blk_cnt_global" 00545 #define VAR_NS_IDS_GLOBAL "ns_ids_global" 00546 #define VAR_NS_NODE_CNT_GLOBAL "ns_node_cnt_global" 00547 #define VAR_NS_DF_CNT_GLOBAL "ns_df_cnt_global" 00548 #define VAR_SS_IDS_GLOBAL "ss_ids_global" 00549 #define VAR_SS_SIDE_CNT_GLOBAL "ss_side_cnt_global" 00550 #define VAR_SS_DF_CNT_GLOBAL "ss_df_cnt_global" 00551 #define VAR_FILE_TYPE "nem_ftype" 00552 #define VAR_COMM_MAP "comm_map" 00553 #define VAR_NODE_MAP_INT "node_mapi" 00554 #define VAR_NODE_MAP_INT_IDX "node_mapi_idx" 00555 #define VAR_NODE_MAP_BOR "node_mapb" 00556 #define VAR_NODE_MAP_BOR_IDX "node_mapb_idx" 00557 #define VAR_NODE_MAP_EXT "node_mape" 00558 #define VAR_NODE_MAP_EXT_IDX "node_mape_idx" 00559 #define VAR_ELEM_MAP_INT "elem_mapi" 00560 #define VAR_ELEM_MAP_INT_IDX "elem_mapi_idx" 00561 #define VAR_ELEM_MAP_BOR "elem_mapb" 00562 #define VAR_ELEM_MAP_BOR_IDX "elem_mapb_idx" 00563 #define VAR_INT_N_STAT "int_n_stat" 00564 #define VAR_BOR_N_STAT "bor_n_stat" 00565 #define VAR_EXT_N_STAT "ext_n_stat" 00566 #define VAR_INT_E_STAT "int_e_stat" 00567 #define VAR_BOR_E_STAT "bor_e_stat" 00568 #define VAR_N_COMM_IDS "n_comm_ids" 00569 #define VAR_N_COMM_STAT "n_comm_stat" 00570 #define VAR_N_COMM_INFO_IDX "n_comm_info_idx" 00571 #define VAR_E_COMM_IDS "e_comm_ids" 00572 #define VAR_E_COMM_STAT "e_comm_stat" 00573 #define VAR_E_COMM_INFO_IDX "e_comm_info_idx" 00574 #define VAR_N_COMM_NIDS "n_comm_nids" 00575 #define VAR_N_COMM_PROC "n_comm_proc" 00576 #define VAR_N_COMM_DATA_IDX "n_comm_data_idx" 00577 #define VAR_E_COMM_EIDS "e_comm_eids" 00578 #define VAR_E_COMM_SIDS "e_comm_sids" 00579 #define VAR_E_COMM_PROC "e_comm_proc" 00580 #define VAR_E_COMM_DATA_IDX "e_comm_data_idx" 00581 00582 #define DIM_NUM_INT_NODES "num_int_node" 00583 #define DIM_NUM_BOR_NODES "num_bor_node" 00584 #define DIM_NUM_EXT_NODES "num_ext_node" 00585 #define DIM_NUM_INT_ELEMS "num_int_elem" 00586 #define DIM_NUM_BOR_ELEMS "num_bor_elem" 00587 #define DIM_NUM_PROCS "num_processors" 00588 #define DIM_NUM_PROCS_F "num_procs_file" 00589 #define DIM_NUM_NODES_GLOBAL "num_nodes_global" 00590 #define DIM_NUM_ELEMS_GLOBAL "num_elems_global" 00591 #define DIM_NUM_NS_GLOBAL "num_ns_global" 00592 #define DIM_NUM_SS_GLOBAL "num_ss_global" 00593 #define DIM_NUM_ELBLK_GLOBAL "num_el_blk_global" 00594 #define DIM_NUM_N_CMAPS "num_n_cmaps" 00595 #define DIM_NUM_E_CMAPS "num_e_cmaps" 00596 #define DIM_NCNT_CMAP "ncnt_cmap" 00597 #define DIM_ECNT_CMAP "ecnt_cmap" 00598 00599 enum ex_element_type { 00600 EX_EL_UNK = -1, /**< unknown entity */ 00601 EX_EL_NULL_ELEMENT= 0, 00602 EX_EL_TRIANGLE = 1, /**< Triangle entity */ 00603 EX_EL_QUAD = 2, /**< Quad entity */ 00604 EX_EL_HEX = 3, /**< Hex entity */ 00605 EX_EL_WEDGE = 4, /**< Wedge entity */ 00606 EX_EL_TETRA = 5, /**< Tetra entity */ 00607 EX_EL_TRUSS = 6, /**< Truss entity */ 00608 EX_EL_BEAM = 7, /**< Beam entity */ 00609 EX_EL_SHELL = 8, /**< Shell entity */ 00610 EX_EL_SPHERE = 9, /**< Sphere entity */ 00611 EX_EL_CIRCLE = 10, /**< Circle entity */ 00612 EX_EL_TRISHELL = 11, /**< Triangular Shell entity */ 00613 EX_EL_PYRAMID = 12 /**< Pyramid entity */ 00614 }; 00615 typedef enum ex_element_type ex_element_type; 00616 00617 enum ex_coordinate_frame_type { 00618 EX_CF_RECTANGULAR = 1, 00619 EX_CF_CYLINDRICAL = 2, 00620 EX_CF_SPHERICAL = 3 00621 }; 00622 typedef enum ex_coordinate_frame_type ex_coordinate_frame_type; 00623 00624 /* Internal structure declarations */ 00625 00626 struct file_item { 00627 int file_id; 00628 nc_type netcdf_type_code; 00629 int int64_status; 00630 int maximum_name_length; 00631 unsigned int compression_level:4; /* 0 (disabled) to 9 (maximum) compression level; netcdf-4 only */ 00632 unsigned int user_compute_wordsize:1; /* 0 for 4 byte or 1 for 8 byte reals */ 00633 unsigned int shuffle:1; /* 1 true, 0 false */ 00634 unsigned int file_type:2; /* 0 - classic, 1 -- 64 bit classic, 2 --netcdf4, 3 --netcdf4 classic */ 00635 00636 struct file_item* next; 00637 }; 00638 00639 struct elem_blk_parm 00640 { 00641 char elem_type[33]; 00642 int64_t elem_blk_id; 00643 int64_t num_elem_in_blk; 00644 int num_nodes_per_elem; 00645 int num_sides; 00646 int num_nodes_per_side[6]; 00647 int num_attr; 00648 int64_t elem_ctr; 00649 ex_element_type elem_type_val; 00650 }; 00651 00652 struct list_item { /* for use with ex_get_file_item */ 00653 int exo_id; 00654 int value; 00655 struct list_item* next; 00656 }; 00657 00658 struct obj_stats { 00659 int64_t *id_vals; 00660 int *stat_vals; 00661 long num; 00662 int exoid; 00663 int valid_ids; 00664 int valid_stat; 00665 struct obj_stats *next; 00666 }; 00667 00668 void ex_iqsort(int v[], int iv[], int count ); 00669 void ex_iqsort64(int64_t v[], int64_t iv[], int64_t count ); 00670 00671 char* ex_catstr(const char*, int); 00672 char* ex_catstr2(const char*, int, const char*, int); 00673 char* ex_dim_num_entries_in_object(ex_entity_type, int); 00674 char* ex_dim_num_objects(ex_entity_type obj_type); 00675 char* ex_name_var_of_object( ex_entity_type, int, int ); 00676 char* ex_name_of_map( ex_entity_type, int ); 00677 00678 int ex_conv_ini (int exoid, int* comp_wordsize, int* io_wordsize, int file_wordsize, int int64_status); 00679 void ex_conv_exit (int exoid); 00680 00681 nc_type nc_flt_code (int exoid); 00682 int ex_comp_ws (int exoid); 00683 int ex_get_cpu_ws(void); 00684 00685 struct list_item** ex_get_counter_list(ex_entity_type obj_type); 00686 int ex_get_file_item (int, struct list_item**); 00687 int ex_inc_file_item (int, struct list_item**); 00688 void ex_rm_file_item (int, struct list_item**); 00689 00690 extern struct obj_stats* exoII_eb; 00691 extern struct obj_stats* exoII_ed; 00692 extern struct obj_stats* exoII_fa; 00693 extern struct obj_stats* exoII_ns; 00694 extern struct obj_stats* exoII_es; 00695 extern struct obj_stats* exoII_fs; 00696 extern struct obj_stats* exoII_ss; 00697 extern struct obj_stats* exoII_els; 00698 extern struct obj_stats* exoII_em; 00699 extern struct obj_stats* exoII_edm; 00700 extern struct obj_stats* exoII_fam; 00701 extern struct obj_stats* exoII_nm; 00702 00703 00704 struct file_item* ex_find_file_item(int exoid); 00705 struct obj_stats *ex_get_stat_ptr ( int exoid, struct obj_stats** obj_ptr); 00706 00707 void ex_rm_stat_ptr (int exoid, struct obj_stats** obj_ptr); 00708 00709 void ex_compress_variable(int exoid, int varid, int type); 00710 int ex_id_lkup (int exoid, ex_entity_type id_type, ex_entity_id num); 00711 int ex_check_file_type(const char *path, int *type); 00712 int ex_get_dimension(int exoid, const char *dimtype, const char *label, 00713 size_t *count, int *dimid, const char *routine); 00714 00715 int ex_get_name_internal(int exoid, int varid, size_t index, char *name, int name_size, 00716 ex_entity_type type, const char *routine); 00717 int ex_get_names_internal(int exoid, int varid, size_t count, char**names, 00718 ex_entity_type type, const char *routine); 00719 int ex_put_name_internal(int exoid, int varid, size_t index, const char *name, 00720 ex_entity_type type, const char *subtype, const char *routine); 00721 int ex_put_names_internal(int exoid, int varid, size_t count, char**names, 00722 ex_entity_type type, const char *subtype, const char *routine); 00723 void ex_trim_internal(char *name); 00724 void ex_update_max_name_length(int exoid, int length); 00725 int ex_leavedef(int neid, /* NemesisI file ID */ 00726 const char *func_name /* Name of calling function */ 00727 ); 00728 00729 int ex_get_file_type(int neid, /* NetCDF/Exodus file ID */ 00730 char *ftype /* Nemesis file type */ 00731 ); 00732 00733 int ex_put_nemesis_version(int neid); /* NetCDF/Exodus file ID */ 00734 00735 int ne_check_file_version(int neid /* NetCDF/Exodus file ID */ 00736 ); 00737 00738 char *ex_catstrn12(char *name, int num1, int num2); 00739 00740 int ne_id_lkup(int neid, /* NetCDF/Exodus file ID */ 00741 const char *var_name, /* Nemesis variable name */ 00742 int64_t *idx, /* index variable for variable, length 2 */ 00743 ex_entity_id ne_var_id /* NetCDF variable ID */ 00744 ); 00745 00746 /** 00747 * For output databases, the maximum length of any entity, variable, 00748 * property, attribute, or coordinate name to be written (not 00749 * including the NULL terminator). If a name is longer than this 00750 * value, a warning message will be output to stderr and the name 00751 * will be truncated. Must be set (via call to 00752 * 'ex_set_max_name_length(exoid, int len)' prior to calling ex_create. 00753 * 00754 * For input databases, the size of the name arrays that the client 00755 * code will be passing to API routines that retrieve names (not 00756 * including the NULL terminator). This defaults to 32 for 00757 * compatibility with older clients. The value used at the time of 00758 * creation of the database can be queried by ex_inquire with the 00759 * EX_INQ_DB_MAX_NAME_LENGTH argument. The current value for this 00760 * variable can be queried with EX_INQ_CUR_MAX_NAME_LENGTH argument. 00761 * 00762 * Note that this is a global setting for all databases. If you are 00763 * accessing multiple databases, they will all use the same value. 00764 */ 00765 extern int ex_default_max_name_length; 00766 00767 #endif