| 1 |
/* |
| 2 |
|
| 3 |
* Copyright(C) 1999-2020, 2022, 2023, 2024 National Technology & Engineering Solutions |
| 4 |
* of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with |
| 5 |
* NTESS, the U.S. Government retains certain rights in this software. |
| 6 |
* |
| 7 |
* See packages/seacas/LICENSE for details |
| 8 |
*/ |
| 9 |
/***************************************************************************** |
| 10 |
* |
| 11 |
* exodusII_int.h - ExodusII header file for internal Exodus call use only |
| 12 |
* |
| 13 |
*/ |
| 14 |
#pragma once |
| 15 |
|
| 16 |
#include <stdbool.h> |
| 17 |
|
| 18 |
#include "exodus_config.h" |
| 19 |
|
| 20 |
#if defined(EXODUS_THREADSAFE) |
| 21 |
#include <pthread.h> |
| 22 |
#endif |
| 23 |
|
| 24 |
#include "netcdf.h" |
| 25 |
#if defined(NC_HAVE_META_H) |
| 26 |
#include "netcdf_meta.h" |
| 27 |
#endif |
| 28 |
|
| 29 |
#if NC_HAS_ZSTD == 1 || NC_HAS_BZ2 |
| 30 |
#include "netcdf_filter.h" |
| 31 |
#endif |
| 32 |
|
| 33 |
#if !defined NC_FillValue |
| 34 |
#if defined _FillValue |
| 35 |
#define NC_FillValue _FillValue |
| 36 |
#else |
| 37 |
#define NC_FillValue "_FillValue" |
| 38 |
#endif |
| 39 |
#endif |
| 40 |
|
| 41 |
#if defined(_WIN32) && defined(_MSC_VER) && _MSC_VER < 1900 |
| 42 |
#define PRId64 "I64d" |
| 43 |
#else |
| 44 |
#include <inttypes.h> |
| 45 |
#endif |
| 46 |
|
| 47 |
#include <assert.h> |
| 48 |
#include <ctype.h> |
| 49 |
#include <string.h> |
| 50 |
|
| 51 |
#ifndef __APPLE__ |
| 52 |
#if defined __STDC__ || defined __cplusplus |
| 53 |
#include <stdlib.h> |
| 54 |
#endif |
| 55 |
#endif |
| 56 |
|
| 57 |
#ifdef _MSC_VER |
| 58 |
#pragma warning(disable : 4127) |
| 59 |
#pragma warning(disable : 4706) |
| 60 |
#pragma warning(disable : 4701) |
| 61 |
#endif |
| 62 |
|
| 63 |
#if defined(__BORLANDC__) |
| 64 |
#pragma warn - 8004 /* "assigned a value that is never used" */ |
| 65 |
#endif |
| 66 |
|
| 67 |
#include <stdio.h> |
| 68 |
|
| 69 |
#if defined(_MSC_VER) && _MSC_VER < 1900 |
| 70 |
#define __func__ __FUNCTION__ |
| 71 |
#define snprintf _snprintf |
| 72 |
#endif |
| 73 |
|
| 74 |
#define snprintf_nowarn(...) (snprintf(__VA_ARGS__) < 0 ? abort() : (void)0) |
| 75 |
|
| 76 |
#ifdef __cplusplus |
| 77 |
extern "C" { |
| 78 |
#endif |
| 79 |
|
| 80 |
#if NC_VERSION_MAJOR > 4 || (NC_VERSION_MAJOR == 4 && NC_VERSION_MINOR >= 6) || NC_HAS_HDF5 |
| 81 |
#define EX_CAN_USE_NC_DEF_VAR_FILL 1 |
| 82 |
#endif |
| 83 |
|
| 84 |
/** |
| 85 |
* \defgroup Internal Internal Functions and Defines |
| 86 |
* \internal |
| 87 |
* |
| 88 |
* Variables and functions used internally in the library |
| 89 |
*@{ |
| 90 |
*/ |
| 91 |
#define MAX_VAR_NAME_LENGTH 32 /**< Internal use only */ |
| 92 |
|
| 93 |
/* Default "filesize" for newly created files. |
| 94 |
* Set to 0 for normal filesize setting. |
| 95 |
* Set to 1 for EXODUS_LARGE_MODEL setting to be the default |
| 96 |
*/ |
| 97 |
#define EXODUS_DEFAULT_SIZE 1 |
| 98 |
|
| 99 |
/* Used to map between root (file id) and group ids when using groups */ |
| 100 |
#define EX_FILE_ID_MASK (0xffff0000) /**< Must match FILE_ID_MASK in NetCDF nc4internal.h */ |
| 101 |
#define EX_GRP_ID_MASK (0x0000ffff) /**< Must match GRP_ID_MASK in NetCDF nc4internal.h */ |
| 102 |
|
| 103 |
/* Utility function to find variable to store entity attribute on */ |
| 104 |
int exi_get_varid(int exoid, ex_entity_type obj_type, ex_entity_id id); |
| 105 |
|
| 106 |
EXODUS_EXPORT void exi_reset_error_status(void); |
| 107 |
|
| 108 |
#if defined(EXODUS_THREADSAFE) |
| 109 |
#if !defined(exerrval) |
| 110 |
/* In both exodusII.h and exodusII_int.h */ |
| 111 |
typedef struct EX_errval |
| 112 |
{ |
| 113 |
int errval; |
| 114 |
char last_pname[MAX_ERR_LENGTH]; |
| 115 |
char last_errmsg[MAX_ERR_LENGTH]; |
| 116 |
int last_err_num; |
| 117 |
} EX_errval_t; |
| 118 |
|
| 119 |
EXODUS_EXPORT EX_errval_t *ex_errval; |
| 120 |
#define exerrval ex_errval->errval |
| 121 |
#endif |
| 122 |
|
| 123 |
extern pthread_once_t EX_first_init_g; |
| 124 |
|
| 125 |
typedef struct EX_mutex_struct |
| 126 |
{ |
| 127 |
pthread_mutex_t atomic_lock; /**< lock for atomicity of new mechanism */ |
| 128 |
pthread_mutexattr_t attribute; |
| 129 |
} EX_mutex_t; |
| 130 |
|
| 131 |
extern EX_mutex_t EX_g; |
| 132 |
extern int exi_mutex_lock(EX_mutex_t *mutex); |
| 133 |
extern int exi_mutex_unlock(EX_mutex_t *mutex, const char *func, int line); |
| 134 |
extern void exi_pthread_first_thread_init(void); |
| 135 |
extern EX_errval_t *exerrval_get(void); |
| 136 |
|
| 137 |
#define EX_FUNC_ENTER() \ |
| 138 |
do { \ |
| 139 |
/* Initialize the thread-safe code */ \ |
| 140 |
pthread_once(&EX_first_init_g, exi_pthread_first_thread_init); \ |
| 141 |
\ |
| 142 |
/* Grab the mutex for the library */ \ |
| 143 |
exi_mutex_lock(&EX_g); \ |
| 144 |
ex_errval = exerrval_get(); \ |
| 145 |
exerrval = 0; \ |
| 146 |
ex_errval->last_err_num = 0; \ |
| 147 |
} while (0) |
| 148 |
|
| 149 |
#define EX_FUNC_ENTER_INT() \ |
| 150 |
do { \ |
| 151 |
/* Initialize the thread-safe code */ \ |
| 152 |
pthread_once(&EX_first_init_g, exi_pthread_first_thread_init); \ |
| 153 |
\ |
| 154 |
/* Grab the mutex for the library */ \ |
| 155 |
exi_mutex_lock(&EX_g); \ |
| 156 |
ex_errval = exerrval_get(); \ |
| 157 |
} while (0) |
| 158 |
|
| 159 |
#define EX_FUNC_LEAVE(error) \ |
| 160 |
do { \ |
| 161 |
exi_mutex_unlock(&EX_g, __func__, __LINE__); \ |
| 162 |
return error; \ |
| 163 |
} while (0) |
| 164 |
|
| 165 |
#define EX_FUNC_VOID() \ |
| 166 |
do { \ |
| 167 |
exi_mutex_unlock(&EX_g, __func__, __LINE__); \ |
| 168 |
return; \ |
| 169 |
} while (0) |
| 170 |
|
| 171 |
#define EX_FUNC_UNLOCK() \ |
| 172 |
do { \ |
| 173 |
exi_mutex_unlock(&EX_g, __func__, __LINE__); \ |
| 174 |
} while (0) |
| 175 |
|
| 176 |
#else |
| 177 |
|
| 178 |
/* Enable this to output tracing information from the API functions */ |
| 179 |
#if 0 |
| 180 |
EXODUS_EXPORT int indent; |
| 181 |
#define EX_FUNC_ENTER() \ |
| 182 |
do { \ |
| 183 |
exi_reset_error_status(); \ |
| 184 |
fprintf(stderr, "%d Enter: %s\n", indent, __func__); \ |
| 185 |
indent++; \ |
| 186 |
} while (0) |
| 187 |
#define EX_FUNC_ENTER_INT() \ |
| 188 |
do { \ |
| 189 |
fprintf(stderr, "%d Enter: %s\n", indent, __func__); \ |
| 190 |
indent++; \ |
| 191 |
} while (0) |
| 192 |
#define EX_FUNC_LEAVE(error) \ |
| 193 |
do { \ |
| 194 |
indent--; \ |
| 195 |
fprintf(stderr, "%d Leave: %s\n", indent, __func__); \ |
| 196 |
return error; \ |
| 197 |
} while (0) |
| 198 |
#define EX_FUNC_VOID() \ |
| 199 |
do { \ |
| 200 |
indent--; \ |
| 201 |
fprintf(stderr, "%d Leave: %s\n", indent, __func__); \ |
| 202 |
return; \ |
| 203 |
} while (0) |
| 204 |
#define EX_FUNC_UNLOCK() \ |
| 205 |
do { \ |
| 206 |
indent--; \ |
| 207 |
fprintf(stderr, "%d Unlock: %s\n", indent, __func__); \ |
| 208 |
} while (0) |
| 209 |
#else |
| 210 |
#define EX_FUNC_ENTER() \ |
| 211 |
do { \ |
| 212 |
exi_reset_error_status(); \ |
| 213 |
} while (0) |
| 214 |
#define EX_FUNC_ENTER_INT() |
| 215 |
#define EX_FUNC_LEAVE(error) return error |
| 216 |
#define EX_FUNC_VOID() return |
| 217 |
#define EX_FUNC_UNLOCK() |
| 218 |
#endif |
| 219 |
#endif |
| 220 |
|
| 221 |
#define EX_UNUSED(A) \ |
| 222 |
do { \ |
| 223 |
(void)(A); \ |
| 224 |
} while (0) |
| 225 |
|
| 226 |
/* |
| 227 |
* This file contains defined constants that are used internally in the |
| 228 |
* EXODUS API. |
| 229 |
* |
| 230 |
* The first group of constants refer to NetCDF variables, attributes, or |
| 231 |
* dimensions in which the EXODUS data are stored. Using the defined |
| 232 |
* constants will allow the names of the NetCDF entities to be changed easily |
| 233 |
* in the future if needed. The first three letters of the constant identify |
| 234 |
* the NetCDF entity as a variable (VAR), dimension (DIM), or attribute (ATT). |
| 235 |
* |
| 236 |
* NOTE: The entity name should not have any blanks in it. Blanks are |
| 237 |
* technically legal but some NetCDF utilities (ncgen in particular) |
| 238 |
* fail when they encounter a blank in a name. |
| 239 |
* |
| 240 |
*/ |
| 241 |
#define ATT_TITLE "title" /**< the database title */ |
| 242 |
#define ATT_API_VERSION "api_version" /**< the EXODUS api vers number */ |
| 243 |
/*! the EXODUS api vers # used for db version 2.01 and earlier */ |
| 244 |
#define ATT_API_VERSION_BLANK "api version" |
| 245 |
#define ATT_VERSION "version" /**< the EXODUS file vers number */ |
| 246 |
#define ATT_FILESIZE "file_size" /**< 1=large, 0=normal */ |
| 247 |
/*! word size of floating point numbers in file */ |
| 248 |
#define ATT_FLT_WORDSIZE "floating_point_word_size" |
| 249 |
/*! word size of floating point numbers in file used for db version |
| 250 |
2.01 and earlier */ |
| 251 |
#define ATT_FLT_WORDSIZE_BLANK "floating point word size" |
| 252 |
#define ATT_MAX_NAME_LENGTH "maximum_name_length" |
| 253 |
#define ATT_INT64_STATUS "int64_status" |
| 254 |
#define ATT_NEM_API_VERSION "nemesis_api_version" |
| 255 |
#define ATT_NEM_FILE_VERSION "nemesis_file_version" |
| 256 |
#define ATT_PROCESSOR_INFO "processor_info" |
| 257 |
#define ATT_LAST_WRITTEN_TIME "last_written_time" |
| 258 |
|
| 259 |
#define DIM_NUM_ASSEMBLY "num_assembly" /**< number of assemblies */ |
| 260 |
#define DIM_NUM_BLOB "num_blob" /**< number of blobs */ |
| 261 |
#define DIM_NUM_NODES "num_nodes" /**< number of nodes */ |
| 262 |
#define DIM_NUM_DIM "num_dim" /**< number of dimensions; 2- or 3-d*/ |
| 263 |
#define DIM_NUM_EDGE "num_edge" /**< number of edges (over all blks)*/ |
| 264 |
#define DIM_NUM_FACE "num_face" /**< number of faces (over all blks)*/ |
| 265 |
#define DIM_NUM_ELEM "num_elem" /**< number of elements */ |
| 266 |
#define DIM_NUM_EL_BLK "num_el_blk" /**< number of element blocks */ |
| 267 |
#define DIM_NUM_ED_BLK "num_ed_blk" /**< number of edge blocks */ |
| 268 |
#define DIM_NUM_FA_BLK "num_fa_blk" /**< number of face blocks */ |
| 269 |
#define VAR_COORD "coord" /**< nodal coordinates */ |
| 270 |
#define VAR_COORD_X "coordx" /**< X-dimension coordinate */ |
| 271 |
#define VAR_COORD_Y "coordy" /**< Y-dimension coordinate */ |
| 272 |
#define VAR_COORD_Z "coordz" /**< Z-dimension coordinate */ |
| 273 |
#define VAR_NAME_COOR "coor_names" /**< names of coordinates */ |
| 274 |
#define VAR_NAME_EL_BLK "eb_names" /**< names of element blocks */ |
| 275 |
#define VAR_NAME_NS "ns_names" /**< names of node sets */ |
| 276 |
#define VAR_NAME_SS "ss_names" /**< names of side sets */ |
| 277 |
#define VAR_NAME_EM "emap_names" /**< names of element maps */ |
| 278 |
#define VAR_NAME_EDM "edmap_names" /**< names of edge maps */ |
| 279 |
#define VAR_NAME_FAM "famap_names" /**< names of face maps */ |
| 280 |
#define VAR_NAME_NM "nmap_names" /**< names of node maps */ |
| 281 |
#define VAR_NAME_ED_BLK "ed_names" /**< names of edge blocks */ |
| 282 |
#define VAR_NAME_FA_BLK "fa_names" /**< names of face blocks */ |
| 283 |
#define VAR_NAME_ES "es_names" /**< names of edge sets */ |
| 284 |
#define VAR_NAME_FS "fs_names" /**< names of face sets */ |
| 285 |
#define VAR_NAME_ELS "els_names" /**< names of element sets */ |
| 286 |
#define VAR_STAT_EL_BLK "eb_status" /**< element block status */ |
| 287 |
#define VAR_STAT_ECONN "econn_status" /**< element block edge status */ |
| 288 |
#define VAR_STAT_FCONN "fconn_status" /**< element block face status */ |
| 289 |
#define VAR_STAT_ED_BLK "ed_status" /**< edge block status */ |
| 290 |
#define VAR_STAT_FA_BLK "fa_status" /**< face block status */ |
| 291 |
#define VAR_ID_EL_BLK "eb_prop1" /**< element block ids props */ |
| 292 |
#define VAR_ID_ED_BLK "ed_prop1" /**< edge block ids props */ |
| 293 |
#define VAR_ID_FA_BLK "fa_prop1" /**< face block ids props */ |
| 294 |
#define DIM_NUM_ENTITY_ASSEMBLY(num) exi_catstr("num_entity_assembly", num) |
| 295 |
#define VAR_ENTITY_ASSEMBLY(num) exi_catstr("assembly_entity", num) |
| 296 |
#define DIM_NUM_VALUES_BLOB(num) exi_catstr("num_values_blob", num) |
| 297 |
#define VAR_ENTITY_BLOB(num) exi_catstr("blob_entity", num) |
| 298 |
#define EX_ATTRIBUTE_TYPE "_type" |
| 299 |
#define EX_ATTRIBUTE_TYPENAME "_typename" |
| 300 |
#define EX_ATTRIBUTE_NAME "_name" |
| 301 |
#define EX_ATTRIBUTE_ID "_id" |
| 302 |
|
| 303 |
/*! element type names for each element block */ |
| 304 |
#define ATT_NAME_ELB "elem_type" |
| 305 |
/*! number of elements in element block num */ |
| 306 |
#define DIM_NUM_EL_IN_BLK(num) exi_catstr("num_el_in_blk", num) |
| 307 |
/*! number of nodes per element in element block num */ |
| 308 |
#define DIM_NUM_NOD_PER_EL(num) exi_catstr("num_nod_per_el", num) |
| 309 |
/*! number of attributes in element block num */ |
| 310 |
#define DIM_NUM_ATT_IN_BLK(num) exi_catstr("num_att_in_blk", num) |
| 311 |
/*! number of edges in edge block num */ |
| 312 |
#define DIM_NUM_ED_IN_EBLK(num) exi_catstr("num_ed_in_blk", num) |
| 313 |
/*! number of nodes per edge in edge block num */ |
| 314 |
#define DIM_NUM_NOD_PER_ED(num) exi_catstr("num_nod_per_ed", num) |
| 315 |
/*! number of edges per element in element block num */ |
| 316 |
#define DIM_NUM_EDG_PER_EL(num) exi_catstr("num_edg_per_el", num) |
| 317 |
/*! number of attributes in edge block num */ |
| 318 |
#define DIM_NUM_ATT_IN_EBLK(num) exi_catstr("num_att_in_eblk", num) |
| 319 |
/*! number of faces in face block num */ |
| 320 |
#define DIM_NUM_FA_IN_FBLK(num) exi_catstr("num_fa_in_blk", num) |
| 321 |
/*! number of nodes per face in face block num */ |
| 322 |
#define DIM_NUM_NOD_PER_FA(num) exi_catstr("num_nod_per_fa", num) |
| 323 |
/*! number of faces per element in element block num */ |
| 324 |
#define DIM_NUM_FAC_PER_EL(num) exi_catstr("num_fac_per_el", num) |
| 325 |
/*! number of attributes in face block num */ |
| 326 |
#define DIM_NUM_ATT_IN_FBLK(num) exi_catstr("num_att_in_fblk", num) |
| 327 |
/*! element connectivity for element block num */ |
| 328 |
#define VAR_CONN(num) exi_catstr("connect", num) |
| 329 |
/*! array containing number of entity per */ |
| 330 |
/* entity for n-sided face/element blocks */ |
| 331 |
#define VAR_EBEPEC(num) exi_catstr("ebepecnt", num) |
| 332 |
/*! list of attributes for element block num */ |
| 333 |
#define VAR_ATTRIB(num) exi_catstr("attrib", num) |
| 334 |
/*! list of attribute names for element block num */ |
| 335 |
#define VAR_NAME_ATTRIB(num) exi_catstr("attrib_name", num) |
| 336 |
/*! list of the numth property for all element blocks */ |
| 337 |
#define VAR_EB_PROP(num) exi_catstr("eb_prop", num) |
| 338 |
/*! edge connectivity for element block num */ |
| 339 |
#define VAR_ECONN(num) exi_catstr("edgconn", num) |
| 340 |
/*! edge connectivity for edge block num */ |
| 341 |
#define VAR_EBCONN(num) exi_catstr("ebconn", num) |
| 342 |
/*! list of attributes for edge block num */ |
| 343 |
#define VAR_EATTRIB(num) exi_catstr("eattrb", num) |
| 344 |
/*! list of attribute names for edge block num */ |
| 345 |
#define VAR_NAME_EATTRIB(num) exi_catstr("eattrib_name", num) |
| 346 |
#define VAR_NATTRIB "nattrb" |
| 347 |
#define VAR_NAME_NATTRIB "nattrib_name" |
| 348 |
#define DIM_NUM_ATT_IN_NBLK "num_att_in_nblk" |
| 349 |
|
| 350 |
#define VAR_NSATTRIB(num) exi_catstr("nsattrb", num) |
| 351 |
#define VAR_NAME_NSATTRIB(num) exi_catstr("nsattrib_name", num) |
| 352 |
#define DIM_NUM_ATT_IN_NS(num) exi_catstr("num_att_in_ns", num) |
| 353 |
|
| 354 |
#define VAR_SSATTRIB(num) exi_catstr("ssattrb", num) |
| 355 |
#define VAR_NAME_SSATTRIB(num) exi_catstr("ssattrib_name", num) |
| 356 |
#define DIM_NUM_ATT_IN_SS(num) exi_catstr("num_att_in_ss", num) |
| 357 |
|
| 358 |
#define VAR_ESATTRIB(num) exi_catstr("esattrb", num) |
| 359 |
#define VAR_NAME_ESATTRIB(num) exi_catstr("esattrib_name", num) |
| 360 |
#define DIM_NUM_ATT_IN_ES(num) exi_catstr("num_att_in_es", num) |
| 361 |
|
| 362 |
#define VAR_FSATTRIB(num) exi_catstr("fsattrb", num) |
| 363 |
#define VAR_NAME_FSATTRIB(num) exi_catstr("fsattrib_name", num) |
| 364 |
#define DIM_NUM_ATT_IN_FS(num) exi_catstr("num_att_in_fs", num) |
| 365 |
|
| 366 |
#define VAR_ELSATTRIB(num) exi_catstr("elsattrb", num) |
| 367 |
#define VAR_NAME_ELSATTRIB(num) exi_catstr("elsattrib_name", num) |
| 368 |
#define DIM_NUM_ATT_IN_ELS(num) exi_catstr("num_att_in_els", num) |
| 369 |
|
| 370 |
/*! list of the numth property for all edge blocks */ |
| 371 |
#define VAR_ED_PROP(num) exi_catstr("ed_prop", num) |
| 372 |
/*! face connectivity for element block num */ |
| 373 |
#define VAR_FCONN(num) exi_catstr("facconn", num) |
| 374 |
/*! face connectivity for face block num */ |
| 375 |
#define VAR_FBCONN(num) exi_catstr("fbconn", num) |
| 376 |
/*! array containing number of entity per entity for n-sided face/element blocks */ |
| 377 |
#define VAR_FBEPEC(num) exi_catstr("fbepecnt", num) |
| 378 |
/*! list of attributes for face block num */ |
| 379 |
#define VAR_FATTRIB(num) exi_catstr("fattrb", num) |
| 380 |
/*! list of attribute names for face block num */ |
| 381 |
#define VAR_NAME_FATTRIB(num) exi_catstr("fattrib_name", num) |
| 382 |
/*! list of the numth property for all face blocks */ |
| 383 |
#define VAR_FA_PROP(num) exi_catstr("fa_prop", num) |
| 384 |
/*! name attached to element block, node set, side set, element map, |
| 385 |
or map properties */ |
| 386 |
#define ATT_PROP_NAME "name" |
| 387 |
#define VAR_MAP "elem_map" /**< element order map */ |
| 388 |
#define DIM_NUM_SS "num_side_sets" /**< number of side sets */ |
| 389 |
#define VAR_SS_STAT "ss_status" /**< side set status */ |
| 390 |
#define VAR_SS_IDS "ss_prop1" /**< side set id properties */ |
| 391 |
/*! number of sides in side set num*/ |
| 392 |
#define DIM_NUM_SIDE_SS(num) exi_catstr("num_side_ss", num) |
| 393 |
/*! number of distribution factors in side set num */ |
| 394 |
#define DIM_NUM_DF_SS(num) exi_catstr("num_df_ss", num) |
| 395 |
/*! the distribution factors for each node in side set num */ |
| 396 |
#define VAR_FACT_SS(num) exi_catstr("dist_fact_ss", num) |
| 397 |
/*! list of elements in side set num */ |
| 398 |
#define VAR_ELEM_SS(num) exi_catstr("elem_ss", num) |
| 399 |
/*! list of sides in side set */ |
| 400 |
#define VAR_SIDE_SS(num) exi_catstr("side_ss", num) |
| 401 |
/*! list of the numth property for all side sets */ |
| 402 |
#define VAR_SS_PROP(num) exi_catstr("ss_prop", num) |
| 403 |
#define DIM_NUM_ES "num_edge_sets" /**< number of edge sets */ |
| 404 |
#define VAR_ES_STAT "es_status" /**< edge set status */ |
| 405 |
#define VAR_ES_IDS "es_prop1" /**< edge set id properties */ |
| 406 |
/*! number of edges in edge set num*/ |
| 407 |
#define DIM_NUM_EDGE_ES(num) exi_catstr("num_edge_es", num) |
| 408 |
/*! number of distribution factors in edge set num */ |
| 409 |
#define DIM_NUM_DF_ES(num) exi_catstr("num_df_es", num) |
| 410 |
/*! the distribution factors for each node in edge set num */ |
| 411 |
#define VAR_FACT_ES(num) exi_catstr("dist_fact_es", num) |
| 412 |
/*! list of edges in edge set num */ |
| 413 |
#define VAR_EDGE_ES(num) exi_catstr("edge_es", num) |
| 414 |
/*! list of orientations in the edge set. */ |
| 415 |
#define VAR_ORNT_ES(num) exi_catstr("ornt_es", num) |
| 416 |
/*! list of the numth property for all edge sets */ |
| 417 |
#define VAR_ES_PROP(num) exi_catstr("es_prop", num) |
| 418 |
#define DIM_NUM_FS "num_face_sets" /**< number of face sets */ |
| 419 |
#define VAR_FS_STAT "fs_status" /**< face set status */ |
| 420 |
#define VAR_FS_IDS "fs_prop1" /**< face set id properties */ |
| 421 |
/*! number of faces in side set num*/ |
| 422 |
#define DIM_NUM_FACE_FS(num) exi_catstr("num_face_fs", num) |
| 423 |
/*! number of distribution factors in face set num */ |
| 424 |
#define DIM_NUM_DF_FS(num) exi_catstr("num_df_fs", num) |
| 425 |
/*! the distribution factors for each node in face set num */ |
| 426 |
#define VAR_FACT_FS(num) exi_catstr("dist_fact_fs", num) |
| 427 |
/*! list of elements in face set num */ |
| 428 |
#define VAR_FACE_FS(num) exi_catstr("face_fs", num) |
| 429 |
/*! list of sides in side set */ |
| 430 |
#define VAR_ORNT_FS(num) exi_catstr("ornt_fs", num) |
| 431 |
/*! list of the numth property for all face sets */ |
| 432 |
#define VAR_FS_PROP(num) exi_catstr("fs_prop", num) |
| 433 |
#define DIM_NUM_ELS "num_elem_sets" /**< number of elem sets */ |
| 434 |
/*! number of elements in elem set num */ |
| 435 |
#define DIM_NUM_ELE_ELS(num) exi_catstr("num_ele_els", num) |
| 436 |
/*! number of distribution factors in element set num */ |
| 437 |
#define DIM_NUM_DF_ELS(num) exi_catstr("num_df_els", num) |
| 438 |
#define VAR_ELS_STAT "els_status" /**< elem set status */ |
| 439 |
#define VAR_ELS_IDS "els_prop1" /**< elem set id properties */ |
| 440 |
/*! list of elements in elem set num */ |
| 441 |
#define VAR_ELEM_ELS(num) exi_catstr("elem_els", num) |
| 442 |
/*! list of distribution factors in elem set num */ |
| 443 |
#define VAR_FACT_ELS(num) exi_catstr("dist_fact_els", num) |
| 444 |
/*! list of the numth property for all elem sets */ |
| 445 |
#define VAR_ELS_PROP(num) exi_catstr("els_prop", num) |
| 446 |
#define DIM_NUM_NS "num_node_sets" /**< number of node sets */ |
| 447 |
/*! number of nodes in node set num */ |
| 448 |
#define DIM_NUM_NOD_NS(num) exi_catstr("num_nod_ns", num) |
| 449 |
/*! number of distribution factors in node set num */ |
| 450 |
#define DIM_NUM_DF_NS(num) exi_catstr("num_df_ns", num) |
| 451 |
#define VAR_NS_STAT "ns_status" /**< node set status */ |
| 452 |
#define VAR_NS_IDS "ns_prop1" /**< node set id properties */ |
| 453 |
/*! list of nodes in node set num */ |
| 454 |
#define VAR_NODE_NS(num) exi_catstr("node_ns", num) |
| 455 |
/*! list of distribution factors in node set num */ |
| 456 |
#define VAR_FACT_NS(num) exi_catstr("dist_fact_ns", num) |
| 457 |
/*! list of the numth property for all node sets */ |
| 458 |
#define VAR_NS_PROP(num) exi_catstr("ns_prop", num) |
| 459 |
#define DIM_NUM_QA "num_qa_rec" /**< number of QA records */ |
| 460 |
#define VAR_QA_TITLE "qa_records" /**< QA records */ |
| 461 |
#define DIM_NUM_INFO "num_info" /**< number of information records */ |
| 462 |
#define VAR_INFO "info_records" /**< information records */ |
| 463 |
#define VAR_WHOLE_TIME "time_whole" /**< simulation times for whole time steps */ |
| 464 |
#define VAR_ASSEMBLY_TAB "assembly_var_tab" /**< assembly variable truth table */ |
| 465 |
#define VAR_BLOB_TAB "blob_var_tab" /**< blob variable truth table */ |
| 466 |
#define VAR_ELEM_TAB "elem_var_tab" /**< element variable truth table */ |
| 467 |
#define VAR_EBLK_TAB "edge_var_tab" /**< edge variable truth table */ |
| 468 |
#define VAR_FBLK_TAB "face_var_tab" /**< face variable truth table */ |
| 469 |
#define VAR_ELSET_TAB "elset_var_tab" /**< elemset variable truth table */ |
| 470 |
#define VAR_SSET_TAB "sset_var_tab" /**< sideset variable truth table */ |
| 471 |
#define VAR_FSET_TAB "fset_var_tab" /**< faceset variable truth table */ |
| 472 |
#define VAR_ESET_TAB "eset_var_tab" /**< edgeset variable truth table */ |
| 473 |
#define VAR_NSET_TAB "nset_var_tab" /**< nodeset variable truth table */ |
| 474 |
#define DIM_NUM_GLO_VAR "num_glo_var" /**< number of global variables */ |
| 475 |
#define VAR_NAME_GLO_VAR "name_glo_var" /**< names of global variables */ |
| 476 |
#define VAR_GLO_VAR "vals_glo_var" /**< values of global variables*/ |
| 477 |
#define DIM_NUM_NOD_VAR "num_nod_var" /**< number of nodal variables */ |
| 478 |
#define VAR_NAME_NOD_VAR "name_nod_var" /**< names of nodal variables */ |
| 479 |
#define VAR_NOD_VAR "vals_nod_var" /**< values of nodal variables \deprecated */ |
| 480 |
/*! values of nodal variables */ |
| 481 |
#define VAR_NOD_VAR_NEW(num) exi_catstr("vals_nod_var", num) |
| 482 |
|
| 483 |
#define DIM_NUM_ASSEMBLY_VAR "num_assembly_var" /**< number of assembly variables */ |
| 484 |
#define VAR_NAME_ASSEMBLY_VAR "name_assembly_var" /**< names of assembly variables*/ |
| 485 |
#define VAR_ASSEMBLY_VAR(num1, num2) exi_catstr2("vals_assembly_var", num1, "assembly", num2) |
| 486 |
|
| 487 |
#define DIM_NUM_BLOB_VAR "num_blob_var" /**< number of blob variables */ |
| 488 |
#define VAR_NAME_BLOB_VAR "name_blob_var" /**< names of blob variables*/ |
| 489 |
#define VAR_BLOB_VAR(num1, num2) exi_catstr2("vals_blob_var", num1, "blob", num2) |
| 490 |
|
| 491 |
#define DIM_NUM_ELE_VAR "num_elem_var" /**< number of element variables */ |
| 492 |
#define VAR_NAME_ELE_VAR "name_elem_var" /**< names of element variables*/ |
| 493 |
/*! values of element variable num1 in element block num2 */ |
| 494 |
#define VAR_ELEM_VAR(num1, num2) exi_catstr2("vals_elem_var", num1, "eb", num2) |
| 495 |
#define DIM_NUM_EDG_VAR "num_edge_var" /**< number of edge variables */ |
| 496 |
#define VAR_NAME_EDG_VAR "name_edge_var" /**< names of edge variables */ |
| 497 |
/*! values of edge variable num1 in edge block num2 */ |
| 498 |
#define VAR_EDGE_VAR(num1, num2) exi_catstr2("vals_edge_var", num1, "eb", num2) |
| 499 |
#define DIM_NUM_FAC_VAR "num_face_var" /**< number of face variables */ |
| 500 |
#define VAR_NAME_FAC_VAR "name_face_var" /**< names of face variables */ |
| 501 |
/*! values of face variable num1 in face block num2 */ |
| 502 |
#define VAR_FACE_VAR(num1, num2) exi_catstr2("vals_face_var", num1, "fb", num2) |
| 503 |
|
| 504 |
#define DIM_NUM_NSET_VAR "num_nset_var" /**< number of nodeset variables */ |
| 505 |
#define VAR_NAME_NSET_VAR "name_nset_var" /**< names of nodeset variables*/ |
| 506 |
/*! values of nodeset variable num1 in nodeset num2 */ |
| 507 |
#define VAR_NS_VAR(num1, num2) exi_catstr2("vals_nset_var", num1, "ns", num2) |
| 508 |
#define DIM_NUM_ESET_VAR "num_eset_var" /**< number of edgeset variables */ |
| 509 |
/*! values of edgeset variable num1 in edgeset num2 */ |
| 510 |
#define VAR_NAME_ESET_VAR "name_eset_var" /**< names of edgeset variables*/ |
| 511 |
#define VAR_ES_VAR(num1, num2) exi_catstr2("vals_eset_var", num1, "es", num2) |
| 512 |
#define DIM_NUM_FSET_VAR "num_fset_var" /**< number of faceset variables */ |
| 513 |
#define VAR_NAME_FSET_VAR "name_fset_var" /**< names of faceset variables*/ |
| 514 |
/*! values of faceset variable num1 in faceset num2 */ |
| 515 |
#define VAR_FS_VAR(num1, num2) exi_catstr2("vals_fset_var", num1, "fs", num2) |
| 516 |
#define DIM_NUM_SSET_VAR "num_sset_var" /**< number of sideset variables */ |
| 517 |
#define VAR_NAME_SSET_VAR "name_sset_var" /**< names of sideset variables*/ |
| 518 |
/*! values of sideset variable num1 in sideset num2 */ |
| 519 |
#define VAR_SS_VAR(num1, num2) exi_catstr2("vals_sset_var", num1, "ss", num2) |
| 520 |
#define DIM_NUM_ELSET_VAR "num_elset_var" /**< number of element set variables*/ |
| 521 |
#define VAR_NAME_ELSET_VAR "name_elset_var" /**< names of elemset variables*/ |
| 522 |
/*! values of elemset variable num1 in elemset num2 */ |
| 523 |
#define VAR_ELS_VAR(num1, num2) exi_catstr2("vals_elset_var", num1, "es", num2) |
| 524 |
|
| 525 |
/** |
| 526 |
* \defgroup ReductionVariables Variables controlling storage of reduction variables |
| 527 |
*@{ |
| 528 |
*/ |
| 529 |
#define DIM_NUM_ASSEMBLY_RED_VAR "num_assembly_red_var" /**< number of assembly variables */ |
| 530 |
#define VAR_NAME_ASSEMBLY_RED_VAR "name_assembly_red_var" /**< names of assembly variables*/ |
| 531 |
#define VAR_ASSEMBLY_RED_VAR(num) exi_catstr("vals_red_var_assembly", num) |
| 532 |
|
| 533 |
#define DIM_NUM_BLOB_RED_VAR "num_blob_red_var" /**< number of blob variables */ |
| 534 |
#define VAR_NAME_BLOB_RED_VAR "name_blob_red_var" /**< names of blob variables*/ |
| 535 |
#define VAR_BLOB_RED_VAR(num) exi_catstr("vals_red_var_blob", num) |
| 536 |
|
| 537 |
#define DIM_NUM_ELE_RED_VAR "num_elem_red_var" /**< number of element variables */ |
| 538 |
#define VAR_NAME_ELE_RED_VAR "name_elem_red_var" /**< names of element variables*/ |
| 539 |
/*! values of element variable num in element block num */ |
| 540 |
#define VAR_ELEM_RED_VAR(num) exi_catstr("vals_red_var_eb", num) |
| 541 |
|
| 542 |
#define DIM_NUM_EDG_RED_VAR "num_edge_red_var" /**< number of edge variables */ |
| 543 |
#define VAR_NAME_EDG_RED_VAR "name_edge_red_var" /**< names of edge variables */ |
| 544 |
/*! values of edge variable num in edge block num */ |
| 545 |
#define VAR_EDGE_RED_VAR(num) exi_catstr("vals_red_var_edb", num) |
| 546 |
|
| 547 |
#define DIM_NUM_FAC_RED_VAR "num_face_red_var" /**< number of face variables */ |
| 548 |
#define VAR_NAME_FAC_RED_VAR "name_face_red_var" /**< names of face variables */ |
| 549 |
/*! values of face variable num in face block num */ |
| 550 |
#define VAR_FACE_RED_VAR(num) exi_catstr("vals_red_var_fb", num) |
| 551 |
|
| 552 |
#define DIM_NUM_NSET_RED_VAR "num_nset_red_var" /**< number of nodeset variables */ |
| 553 |
#define VAR_NAME_NSET_RED_VAR "name_nset_red_var" /**< names of nodeset variables*/ |
| 554 |
/*! values of nodeset variable num in nodeset num */ |
| 555 |
#define VAR_NS_RED_VAR(num) exi_catstr("vals_red_var_nset", num) |
| 556 |
|
| 557 |
#define DIM_NUM_ESET_RED_VAR "num_eset_red_var" /**< number of edgeset variables */ |
| 558 |
/*! values of edgeset variable num in edgeset num */ |
| 559 |
#define VAR_NAME_ESET_RED_VAR "name_eset_red_var" /**< names of edgeset variables*/ |
| 560 |
#define VAR_ES_RED_VAR(num) exi_catstr("vals_red_var_eset", num) |
| 561 |
|
| 562 |
#define DIM_NUM_FSET_RED_VAR "num_fset_red_var" /**< number of faceset variables */ |
| 563 |
#define VAR_NAME_FSET_RED_VAR "name_fset_red_var" /**< names of faceset variables*/ |
| 564 |
/*! values of faceset variable num in faceset num */ |
| 565 |
#define VAR_FS_RED_VAR(num) exi_catstr("vals_red_var_fset", num) |
| 566 |
|
| 567 |
#define DIM_NUM_SSET_RED_VAR "num_sset_red_var" /**< number of sideset variables */ |
| 568 |
#define VAR_NAME_SSET_RED_VAR "name_sset_red_var" /**< names of sideset variables*/ |
| 569 |
/*! values of sideset variable num in sideset num */ |
| 570 |
#define VAR_SS_RED_VAR(num) exi_catstr("vals_red_var_sset", num) |
| 571 |
|
| 572 |
#define DIM_NUM_ELSET_RED_VAR "num_elset_red_var" /**< number of element set variables*/ |
| 573 |
#define VAR_NAME_ELSET_RED_VAR "name_elset_red_var" /**< names of elemset variables*/ |
| 574 |
/*! values of elemset variable num in elemset num */ |
| 575 |
#define VAR_ELS_RED_VAR(num) exi_catstr("vals_red_var_elset", num) |
| 576 |
/** @}*/ |
| 577 |
|
| 578 |
/*! general dimension of length MAX_STR_LENGTH used for some string lengths */ |
| 579 |
#define DIM_STR "len_string" |
| 580 |
/*! general dimension of length MAX_NAME_LENGTH used for name lengths */ |
| 581 |
#define DIM_STR_NAME "len_name" |
| 582 |
/*! general dimension of length MAX_LINE_LENGTH used for long strings */ |
| 583 |
#define DIM_LIN "len_line" |
| 584 |
#define DIM_N4 "four" |
| 585 |
#define DIM_N1 "blob_entity" |
| 586 |
/*! unlimited (expandable) dimension for time steps*/ |
| 587 |
#define DIM_TIME "time_step" |
| 588 |
#define VAR_ELEM_NUM_MAP "elem_num_map" /**< element numbering map */ |
| 589 |
#define VAR_FACE_NUM_MAP "face_num_map" /**< face numbering map */ |
| 590 |
#define VAR_EDGE_NUM_MAP "edge_num_map" /**< edge numbering map */ |
| 591 |
#define VAR_NODE_NUM_MAP "node_num_map" /**< node numbering map */ |
| 592 |
#define DIM_NUM_EM "num_elem_maps" /**< number of element maps */ |
| 593 |
/*! the numth element map */ |
| 594 |
#define VAR_ELEM_MAP(num) exi_catstr("elem_map", num) |
| 595 |
/*! list of the numth property for all element maps */ |
| 596 |
#define VAR_EM_PROP(num) exi_catstr("em_prop", num) |
| 597 |
#define DIM_NUM_EDM "num_edge_maps" /**< number of edge maps */ |
| 598 |
/*! the numth edge map */ |
| 599 |
#define VAR_EDGE_MAP(num) exi_catstr("edge_map", num) |
| 600 |
/* list of the numth property for all edge maps */ |
| 601 |
#define VAR_EDM_PROP(num) exi_catstr("edm_prop", num) |
| 602 |
#define DIM_NUM_FAM "num_face_maps" /**< number of face maps */ |
| 603 |
/*! the numth face map */ |
| 604 |
#define VAR_FACE_MAP(num) exi_catstr("face_map", num) |
| 605 |
/*! list of the numth property for all face maps */ |
| 606 |
#define VAR_FAM_PROP(num) exi_catstr("fam_prop", num) |
| 607 |
#define DIM_NUM_NM "num_node_maps" /**< number of node maps */ |
| 608 |
/*! the numth node map */ |
| 609 |
#define VAR_NODE_MAP(num) exi_catstr("node_map", num) |
| 610 |
/*! list of the numth property for all node maps */ |
| 611 |
#define VAR_NM_PROP(num) exi_catstr("nm_prop", num) |
| 612 |
/*! list of the numth property for all assemblies */ |
| 613 |
#define VAR_ASSEMBLY_PROP(num) exi_catstr("assembly_prop", num) |
| 614 |
#define VAR_BLOB_PROP(num) exi_catstr("blob_prop", num) |
| 615 |
|
| 616 |
#define DIM_NUM_CFRAMES "num_cframes" |
| 617 |
#define DIM_NUM_CFRAME9 "num_cframes_9" |
| 618 |
#define VAR_FRAME_COORDS "frame_coordinates" |
| 619 |
#define VAR_FRAME_IDS "frame_ids" |
| 620 |
#define VAR_FRAME_TAGS "frame_tags" |
| 621 |
|
| 622 |
#define VAR_ELBLK_IDS_GLOBAL "el_blk_ids_global" |
| 623 |
#define VAR_ELBLK_CNT_GLOBAL "el_blk_cnt_global" |
| 624 |
#define VAR_NS_IDS_GLOBAL "ns_ids_global" |
| 625 |
#define VAR_NS_NODE_CNT_GLOBAL "ns_node_cnt_global" |
| 626 |
#define VAR_NS_DF_CNT_GLOBAL "ns_df_cnt_global" |
| 627 |
#define VAR_SS_IDS_GLOBAL "ss_ids_global" |
| 628 |
#define VAR_SS_SIDE_CNT_GLOBAL "ss_side_cnt_global" |
| 629 |
#define VAR_SS_DF_CNT_GLOBAL "ss_df_cnt_global" |
| 630 |
#define VAR_FILE_TYPE "nem_ftype" |
| 631 |
#define VAR_COMM_MAP "comm_map" |
| 632 |
#define VAR_NODE_MAP_INT "node_mapi" |
| 633 |
#define VAR_NODE_MAP_INT_IDX "node_mapi_idx" |
| 634 |
#define VAR_NODE_MAP_BOR "node_mapb" |
| 635 |
#define VAR_NODE_MAP_BOR_IDX "node_mapb_idx" |
| 636 |
#define VAR_NODE_MAP_EXT "node_mape" |
| 637 |
#define VAR_NODE_MAP_EXT_IDX "node_mape_idx" |
| 638 |
#define VAR_ELEM_MAP_INT "elem_mapi" |
| 639 |
#define VAR_ELEM_MAP_INT_IDX "elem_mapi_idx" |
| 640 |
#define VAR_ELEM_MAP_BOR "elem_mapb" |
| 641 |
#define VAR_ELEM_MAP_BOR_IDX "elem_mapb_idx" |
| 642 |
#define VAR_INT_N_STAT "int_n_stat" |
| 643 |
#define VAR_BOR_N_STAT "bor_n_stat" |
| 644 |
#define VAR_EXT_N_STAT "ext_n_stat" |
| 645 |
#define VAR_INT_E_STAT "int_e_stat" |
| 646 |
#define VAR_BOR_E_STAT "bor_e_stat" |
| 647 |
#define VAR_N_COMM_IDS "n_comm_ids" |
| 648 |
#define VAR_N_COMM_STAT "n_comm_stat" |
| 649 |
#define VAR_N_COMM_INFO_IDX "n_comm_info_idx" |
| 650 |
#define VAR_E_COMM_IDS "e_comm_ids" |
| 651 |
#define VAR_E_COMM_STAT "e_comm_stat" |
| 652 |
#define VAR_E_COMM_INFO_IDX "e_comm_info_idx" |
| 653 |
#define VAR_N_COMM_NIDS "n_comm_nids" |
| 654 |
#define VAR_N_COMM_PROC "n_comm_proc" |
| 655 |
#define VAR_N_COMM_DATA_IDX "n_comm_data_idx" |
| 656 |
#define VAR_E_COMM_EIDS "e_comm_eids" |
| 657 |
#define VAR_E_COMM_SIDS "e_comm_sids" |
| 658 |
#define VAR_E_COMM_PROC "e_comm_proc" |
| 659 |
#define VAR_E_COMM_DATA_IDX "e_comm_data_idx" |
| 660 |
|
| 661 |
#define DIM_NUM_INT_NODES "num_int_node" |
| 662 |
#define DIM_NUM_BOR_NODES "num_bor_node" |
| 663 |
#define DIM_NUM_EXT_NODES "num_ext_node" |
| 664 |
#define DIM_NUM_INT_ELEMS "num_int_elem" |
| 665 |
#define DIM_NUM_BOR_ELEMS "num_bor_elem" |
| 666 |
#define DIM_NUM_PROCS "num_processors" |
| 667 |
#define DIM_NUM_PROCS_F "num_procs_file" |
| 668 |
#define DIM_NUM_NODES_GLOBAL "num_nodes_global" |
| 669 |
#define DIM_NUM_ELEMS_GLOBAL "num_elems_global" |
| 670 |
#define DIM_NUM_NS_GLOBAL "num_ns_global" |
| 671 |
#define DIM_NUM_SS_GLOBAL "num_ss_global" |
| 672 |
#define DIM_NUM_ELBLK_GLOBAL "num_el_blk_global" |
| 673 |
#define DIM_NUM_N_CMAPS "num_n_cmaps" |
| 674 |
#define DIM_NUM_E_CMAPS "num_e_cmaps" |
| 675 |
#define DIM_NCNT_CMAP "ncnt_cmap" |
| 676 |
#define DIM_ECNT_CMAP "ecnt_cmap" |
| 677 |
|
| 678 |
enum exi_element_type { |
| 679 |
EX_EL_UNK = -1, /**< unknown entity */ |
| 680 |
EX_EL_NULL_ELEMENT = 0, |
| 681 |
EX_EL_TRIANGLE = 1, /**< Triangle entity */ |
| 682 |
EX_EL_QUAD = 2, /**< Quad entity */ |
| 683 |
EX_EL_HEX = 3, /**< Hex entity */ |
| 684 |
EX_EL_WEDGE = 4, /**< Wedge entity */ |
| 685 |
EX_EL_TETRA = 5, /**< Tetra entity */ |
| 686 |
EX_EL_TRUSS = 6, /**< Truss entity */ |
| 687 |
EX_EL_BEAM = 7, /**< Beam entity */ |
| 688 |
EX_EL_SHELL = 8, /**< Shell entity */ |
| 689 |
EX_EL_SPHERE = 9, /**< Sphere entity */ |
| 690 |
EX_EL_CIRCLE = 10, /**< Circle entity */ |
| 691 |
EX_EL_TRISHELL = 11, /**< Triangular Shell entity */ |
| 692 |
EX_EL_PYRAMID = 12 /**< Pyramid entity */ |
| 693 |
}; |
| 694 |
typedef enum exi_element_type exi_element_type; |
| 695 |
|
| 696 |
/* Internal structure declarations */ |
| 697 |
|
| 698 |
struct exi_file_item |
| 699 |
{ |
| 700 |
int file_id; |
| 701 |
nc_type netcdf_type_code; |
| 702 |
int int64_status; |
| 703 |
int maximum_name_length; |
| 704 |
int time_varid; /* Store to avoid lookup each timestep */ |
| 705 |
int compression_level; /**< 0 (disabled) to 9 (maximum) compression level for |
| 706 |
gzip, 4..32 and even for szip; -131072..22 for zstd, NetCDF-4 only */ |
| 707 |
unsigned int assembly_count; |
| 708 |
unsigned int blob_count; |
| 709 |
|
| 710 |
unsigned int persist_define_mode : 10; /**< Stay in define mode until exi_persist_leavedef is |
| 711 |
called. Set by exi_persist_redef... */ |
| 712 |
unsigned int |
| 713 |
compression_algorithm : 4; /**< GZIP/ZLIB, SZIP, more may be supported by NetCDF soon */ |
| 714 |
unsigned int quantize_nsd : 4; /**< 0 (disabled) to 15 (maximum) number of significant digits |
| 715 |
retained for lossy quanitzation compression */ |
| 716 |
unsigned int shuffle : 1; /**< 1 true, 0 false */ |
| 717 |
unsigned int user_compute_wordsize : 1; /**< 0 for 4 byte or 1 for 8 byte reals */ |
| 718 |
unsigned int |
| 719 |
file_type : 2; /**< 0 - classic, 1 -- 64 bit classic, 2 --NetCDF4, 3 --NetCDF4 classic */ |
| 720 |
unsigned int is_write : 1; /**< for output or append */ |
| 721 |
unsigned int is_parallel : 1; /**< 1 true, 0 false */ |
| 722 |
unsigned int is_hdf5 : 1; /**< 1 true, 0 false */ |
| 723 |
unsigned int is_pnetcdf : 1; /**< 1 true, 0 false */ |
| 724 |
unsigned int has_nodes : 1; /**< for input only at this time */ |
| 725 |
unsigned int has_edges : 1; /**< for input only at this time */ |
| 726 |
unsigned int has_faces : 1; /**< for input only at this time */ |
| 727 |
unsigned int has_elems : 1; /**< for input only at this time */ |
| 728 |
unsigned int in_define_mode : 1; /**< Is the file in nc define mode... */ |
| 729 |
struct exi_file_item *next; |
| 730 |
}; |
| 731 |
|
| 732 |
struct exi_elem_blk_parm |
| 733 |
{ |
| 734 |
char elem_type[33]; |
| 735 |
int64_t elem_blk_id; |
| 736 |
int64_t num_elem_in_blk; |
| 737 |
int num_nodes_per_elem; |
| 738 |
int num_sides; |
| 739 |
int num_nodes_per_side[6]; |
| 740 |
int num_attr; |
| 741 |
int64_t elem_ctr; |
| 742 |
exi_element_type elem_type_val; |
| 743 |
}; |
| 744 |
|
| 745 |
/* Used in exo_jack.c for fortran interface */ |
| 746 |
enum exi_coordinate_frame_type { |
| 747 |
EX_CF_RECTANGULAR = 1, |
| 748 |
EX_CF_CYLINDRICAL = 2, |
| 749 |
EX_CF_SPHERICAL = 3 |
| 750 |
}; |
| 751 |
typedef enum exi_coordinate_frame_type exi_coordinate_frame_type; |
| 752 |
|
| 753 |
struct exi_list_item |
| 754 |
{ /* for use with ex_get_file_item */ |
| 755 |
int exo_id; |
| 756 |
int value; |
| 757 |
struct exi_list_item *next; |
| 758 |
}; |
| 759 |
|
| 760 |
struct exi_obj_stats |
| 761 |
{ |
| 762 |
int64_t *id_vals; |
| 763 |
int *stat_vals; |
| 764 |
size_t num; |
| 765 |
int exoid; |
| 766 |
char valid_ids; |
| 767 |
char valid_stat; |
| 768 |
char sequential; |
| 769 |
struct exi_obj_stats *next; |
| 770 |
}; |
| 771 |
|
| 772 |
#ifndef EXODUS_EXPORT |
| 773 |
#define EXODUS_EXPORT extern |
| 774 |
#endif /* EXODUS_EXPORT */ |
| 775 |
|
| 776 |
EXODUS_EXPORT void exi_iqsort(int v[], int iv[], size_t N); |
| 777 |
EXODUS_EXPORT void exi_iqsort64(int64_t v[], int64_t iv[], int64_t N); |
| 778 |
|
| 779 |
EXODUS_EXPORT char *exi_catstr(const char * /*string*/, int /*num*/); |
| 780 |
EXODUS_EXPORT char *exi_catstr2(const char * /*string1*/, int /*num1*/, const char * /*string2*/, |
| 781 |
int /*num2*/); |
| 782 |
EXODUS_EXPORT char *exi_dim_num_entries_in_object(ex_entity_type /*obj_type*/, int /*idx*/); |
| 783 |
EXODUS_EXPORT char *exi_dim_num_objects(ex_entity_type obj_type); |
| 784 |
EXODUS_EXPORT char *exi_name_var_of_object(ex_entity_type /*obj_type*/, int /*i*/, int /*j*/); |
| 785 |
EXODUS_EXPORT char *exi_name_red_var_of_object(ex_entity_type /*obj_type*/, int /*indx*/); |
| 786 |
EXODUS_EXPORT char *exi_name_of_map(ex_entity_type /*map_type*/, int /*map_index*/); |
| 787 |
|
| 788 |
EXODUS_EXPORT int exi_conv_init(int exoid, int *comp_wordsize, int *io_wordsize, int file_wordsize, |
| 789 |
int int64_status, bool is_parallel, bool is_hdf5, bool is_pnetcdf, |
| 790 |
bool is_write); |
| 791 |
|
| 792 |
EXODUS_EXPORT void exi_conv_exit(int exoid); |
| 793 |
|
| 794 |
EXODUS_EXPORT nc_type nc_flt_code(int exoid); |
| 795 |
EXODUS_EXPORT int exi_comp_ws(int exoid); |
| 796 |
EXODUS_EXPORT int exi_get_cpu_ws(void); |
| 797 |
EXODUS_EXPORT int exi_is_parallel(int exoid); |
| 798 |
|
| 799 |
EXODUS_EXPORT struct exi_list_item **exi_get_counter_list(ex_entity_type obj_type); |
| 800 |
EXODUS_EXPORT int exi_get_file_item(int /*exoid*/, struct exi_list_item **/*list_ptr*/); |
| 801 |
EXODUS_EXPORT int exi_inc_file_item(int /*exoid*/, struct exi_list_item **/*list_ptr*/); |
| 802 |
EXODUS_EXPORT void exi_rm_file_item(int /*exoid*/, struct exi_list_item ** /*list_ptr*/); |
| 803 |
|
| 804 |
extern struct exi_obj_stats *exoII_eb; |
| 805 |
extern struct exi_obj_stats *exoII_ed; |
| 806 |
extern struct exi_obj_stats *exoII_fa; |
| 807 |
extern struct exi_obj_stats *exoII_ns; |
| 808 |
extern struct exi_obj_stats *exoII_es; |
| 809 |
extern struct exi_obj_stats *exoII_fs; |
| 810 |
extern struct exi_obj_stats *exoII_ss; |
| 811 |
extern struct exi_obj_stats *exoII_els; |
| 812 |
extern struct exi_obj_stats *exoII_em; |
| 813 |
extern struct exi_obj_stats *exoII_edm; |
| 814 |
extern struct exi_obj_stats *exoII_fam; |
| 815 |
extern struct exi_obj_stats *exoII_nm; |
| 816 |
|
| 817 |
EXODUS_EXPORT struct exi_file_item *exi_find_file_item(int exoid); |
| 818 |
struct exi_file_item *exi_add_file_item(int exoid); |
| 819 |
struct exi_obj_stats *exi_get_stat_ptr(int exoid, struct exi_obj_stats **obj_ptr); |
| 820 |
|
| 821 |
EXODUS_EXPORT void exi_rm_stat_ptr(int exoid, struct exi_obj_stats **obj_ptr); |
| 822 |
|
| 823 |
EXODUS_EXPORT void exi_set_compact_storage(int exoid, int varid); |
| 824 |
EXODUS_EXPORT void exi_compress_variable(int exoid, int varid, int type); |
| 825 |
EXODUS_EXPORT int exi_id_lkup(int exoid, ex_entity_type id_type, ex_entity_id num); |
| 826 |
EXODUS_EXPORT int exi_check_valid_file_id( |
| 827 |
int exoid, const char *func); /** Return fatal error if exoid does not refer to valid file */ |
| 828 |
EXODUS_EXPORT int exi_check_multiple_open(const char *path, int mode, const char *func); |
| 829 |
EXODUS_EXPORT int exi_check_file_type(const char *path, int *type); |
| 830 |
EXODUS_EXPORT char *exi_canonicalize_filename(const char *path); |
| 831 |
EXODUS_EXPORT int exi_get_dimension(int exoid, const char *DIMENSION, const char *label, |
| 832 |
size_t *count, int *dimid, const char *routine); |
| 833 |
|
| 834 |
EXODUS_EXPORT int exi_get_nodal_var_time(int exoid, int nodal_var_index, int64_t node_number, |
| 835 |
int beg_time_step, int end_time_step, |
| 836 |
void *nodal_var_vals); |
| 837 |
|
| 838 |
EXODUS_EXPORT int exi_put_nodal_var_multi_time(int exoid, int nodal_var_index, int64_t num_nodes, |
| 839 |
int beg_time_step, int end_time_step, |
| 840 |
const void *nodal_var_vals); |
| 841 |
|
| 842 |
EXODUS_EXPORT int exi_get_nodal_var_multi_time(int exoid, int nodal_var_index, int64_t node_number, |
| 843 |
int beg_time_step, int end_time_step, |
| 844 |
void *nodal_var_vals); |
| 845 |
|
| 846 |
EXODUS_EXPORT int exi_put_nodal_var_time(int exoid, int nodal_var_index, int64_t num_nodes, |
| 847 |
int beg_time_step, int end_time_step, |
| 848 |
const void *nodal_var_vals); |
| 849 |
|
| 850 |
EXODUS_EXPORT int exi_get_partial_nodal_var(int exoid, int time_step, int nodal_var_index, |
| 851 |
int64_t start_node, int64_t num_nodes, void *var_vals); |
| 852 |
|
| 853 |
EXODUS_EXPORT int exi_put_partial_nodal_var(int exoid, int time_step, int nodal_var_index, |
| 854 |
int64_t start_node, int64_t num_nodes, |
| 855 |
const void *nodal_var_vals); |
| 856 |
EXODUS_EXPORT int exi_get_glob_vars(int exoid, int time_step, int num_glob_vars, |
| 857 |
void *glob_var_vals); |
| 858 |
|
| 859 |
EXODUS_EXPORT int exi_get_glob_vars_multi_time(int exoid, int num_glob_vars, int beg_time_step, |
| 860 |
int end_time_step, void *glob_var_vals); |
| 861 |
|
| 862 |
EXODUS_EXPORT int exi_get_glob_var_time(int exoid, int glob_var_index, int beg_time_step, |
| 863 |
int end_time_step, void *glob_var_vals); |
| 864 |
|
| 865 |
EXODUS_EXPORT int exi_get_name(int exoid, int varid, size_t index, char *name, int name_size, |
| 866 |
ex_entity_type obj_type, const char *routine); |
| 867 |
EXODUS_EXPORT int exi_get_names(int exoid, int varid, size_t num_entity, char **names, |
| 868 |
ex_entity_type obj_type, const char *routine); |
| 869 |
EXODUS_EXPORT int exi_put_name(int exoid, int varid, size_t index, const char *name, |
| 870 |
ex_entity_type obj_type, const char *subtype, const char *routine); |
| 871 |
EXODUS_EXPORT int exi_put_names(int exoid, int varid, size_t num_entity, char *const *names, |
| 872 |
ex_entity_type obj_type, const char *subtype, const char *routine); |
| 873 |
EXODUS_EXPORT void exi_trim(char *name); |
| 874 |
EXODUS_EXPORT void exi_update_max_name_length(int exoid, int length); |
| 875 |
EXODUS_EXPORT int exi_redef(int exoid, const char *call_func); |
| 876 |
EXODUS_EXPORT int exi_persist_redef(int exoid, const char *call_func); |
| 877 |
EXODUS_EXPORT int exi_leavedef(int exoid, /* NemesisI file ID */ |
| 878 |
const char *call_rout /* Name of calling function */ |
| 879 |
); |
| 880 |
EXODUS_EXPORT int exi_persist_leavedef(int exoid, /* NemesisI file ID */ |
| 881 |
const char *call_rout /* Name of calling function */ |
| 882 |
); |
| 883 |
|
| 884 |
EXODUS_EXPORT int exi_check_version(int run_version); |
| 885 |
EXODUS_EXPORT int exi_handle_mode(unsigned int my_mode, int is_parallel, int run_version); |
| 886 |
EXODUS_EXPORT int exi_populate_header(int exoid, const char *path, int my_mode, int is_parallel, |
| 887 |
int *comp_ws, int *io_ws); |
| 888 |
|
| 889 |
EXODUS_EXPORT int exi_get_block_param(int exoid, ex_entity_id id, int ndim, |
| 890 |
struct exi_elem_blk_parm *elem_blk_parm); |
| 891 |
|
| 892 |
EXODUS_EXPORT int exi_get_file_type(int exoid, char *ftype); |
| 893 |
|
| 894 |
EXODUS_EXPORT int exi_put_nemesis_version(int exoid); |
| 895 |
|
| 896 |
EXODUS_EXPORT int exi_put_homogenous_block_params(int exoid, size_t block_count, |
| 897 |
const struct ex_block *blocks); |
| 898 |
|
| 899 |
EXODUS_EXPORT int nei_check_file_version(int exoid); |
| 900 |
|
| 901 |
EXODUS_EXPORT int nei_id_lkup(int exoid, /* NetCDF/Exodus file ID */ |
| 902 |
const char *ne_var_name, /* Nemesis variable name */ |
| 903 |
int64_t *idx, /* index variable for variable, length 2 */ |
| 904 |
ex_entity_id ne_var_id /* NetCDF variable ID */ |
| 905 |
); |
| 906 |
|
| 907 |
/** |
| 908 |
* For output databases, the maximum length of any entity, variable, |
| 909 |
* property, attribute, or coordinate name to be written (not |
| 910 |
* including the NULL terminator). If a name is longer than this |
| 911 |
* value, a warning message will be output to stderr and the name |
| 912 |
* will be truncated. Must be set (via call to |
| 913 |
* ex_set_max_name_length()(exoid, int len) prior to calling ex_create(). |
| 914 |
* |
| 915 |
* For input databases, the size of the name arrays that the client |
| 916 |
* code will be passing to API routines that retrieve names (not |
| 917 |
* including the NULL terminator). This defaults to 32 for |
| 918 |
* compatibility with older clients. The value used at the time of |
| 919 |
* creation of the database can be queried by ex_inquire with the |
| 920 |
* #EX_INQ_DB_MAX_ALLOWED_NAME_LENGTH argument. The current value for this |
| 921 |
* variable can be queried with #EX_INQ_MAX_READ_NAME_LENGTH argument. |
| 922 |
* |
| 923 |
* Note that this is a global setting for all databases. If you are |
| 924 |
* accessing multiple databases, they will all use the same value. |
| 925 |
*/ |
| 926 |
EXODUS_EXPORT int exi_default_max_name_length; |
| 927 |
/*! @} */ |
| 928 |
|
| 929 |
#ifdef __cplusplus |
| 930 |
} |
| 931 |
#endif |