| 1 |
// @HEADER |
| 2 |
// ***************************************************************************** |
| 3 |
// Pamgen Package |
| 4 |
// |
| 5 |
// Copyright 2004 NTESS and the Pamgen contributors. |
| 6 |
// SPDX-License-Identifier: LGPL-2.1-or-later |
| 7 |
// ***************************************************************************** |
| 8 |
// @HEADER |
| 9 |
|
| 10 |
/***************************************************************************** |
| 11 |
* |
| 12 |
* exodusII.h - Exodus II include file, for general use |
| 13 |
* |
| 14 |
* author - Sandia National Laboratories |
| 15 |
* |
| 16 |
* environment - UNIX |
| 17 |
* |
| 18 |
* exit conditions - |
| 19 |
* |
| 20 |
* revision history - |
| 21 |
* |
| 22 |
*****************************************************************************/ |
| 23 |
|
| 24 |
|
| 25 |
#ifndef TRUE |
| 26 |
#define TRUE -1 |
| 27 |
#endif |
| 28 |
|
| 29 |
#ifndef FALSE |
| 30 |
#define FALSE 0 |
| 31 |
#endif |
| 32 |
|
| 33 |
#ifndef IM_EXODUS_II_HDR |
| 34 |
#define IM_EXODUS_II_HDR |
| 35 |
|
| 36 |
/* |
| 37 |
* need following extern if this include file is used in a C++ program, to |
| 38 |
* keep the C++ compiler from mangling the function names. |
| 39 |
*/ |
| 40 |
#ifdef __cplusplus |
| 41 |
extern "C" { |
| 42 |
#endif |
| 43 |
|
| 44 |
/* |
| 45 |
* The following are miscellaneous constants used in the EXODUS II API. |
| 46 |
*/ |
| 47 |
|
| 48 |
#define IM_EX_NOCLOBBER 0 /* Don't overwrite existing database, default */ |
| 49 |
#define IM_EX_CLOBBER 1 |
| 50 |
#define IM_EX_NORMAL_MODEL 2 /* disable mods that permit storage of larger models */ |
| 51 |
#define IM_EX_LARGE_MODEL 4 /* enable mods that permit storage of larger models */ |
| 52 |
#define IM_EX_NETCDF4 8 /* use the hdf5-based netcdf4 output */ |
| 53 |
#define IM_EX_NOSHARE 16 /* Do not open netcdf file in "share" mode */ |
| 54 |
#define IM_EX_SHARE 32 /* Do open netcdf file in "share" mode */ |
| 55 |
|
| 56 |
#define IM_EX_READ 0 |
| 57 |
#define IM_EX_WRITE 1 |
| 58 |
|
| 59 |
#define IM_EX_INQ_FILE_TYPE 1 /* inquire EXODUS II file type*/ |
| 60 |
#define IM_EX_INQ_API_VERS 2 /* inquire API version number */ |
| 61 |
#define IM_EX_INQ_DB_VERS 3 /* inquire database version */ |
| 62 |
/* number */ |
| 63 |
#define IM_EX_INQ_TITLE 4 /* inquire database title */ |
| 64 |
#define IM_EX_INQ_DIM 5 /* inquire number of */ |
| 65 |
/* dimensions */ |
| 66 |
#define IM_EX_INQ_NODES 6 /* inquire number of nodes */ |
| 67 |
#define IM_EX_INQ_ELEM 7 /* inquire number of elements */ |
| 68 |
#define IM_EX_INQ_ELEM_BLK 8 /* inquire number of element */ |
| 69 |
/* blocks */ |
| 70 |
#define IM_EX_INQ_NODE_SETS 9 /* inquire number of node sets*/ |
| 71 |
#define IM_EX_INQ_NS_NODE_LEN 10 /* inquire length of node set */ |
| 72 |
/* node list */ |
| 73 |
#define IM_EX_INQ_SIDE_SETS 11 /* inquire number of side sets*/ |
| 74 |
#define IM_EX_INQ_SS_NODE_LEN 12 /* inquire length of side set */ |
| 75 |
/* node list */ |
| 76 |
#define IM_EX_INQ_SS_ELEM_LEN 13 /* inquire length of side set */ |
| 77 |
/* element list */ |
| 78 |
#define IM_EX_INQ_QA 14 /* inquire number of QA */ |
| 79 |
/* records */ |
| 80 |
#define IM_EX_INQ_INFO 15 /* inquire number of info */ |
| 81 |
/* records */ |
| 82 |
#define IM_EX_INQ_TIME 16 /* inquire number of time */ |
| 83 |
/* steps in the database */ |
| 84 |
#define IM_EX_INQ_EB_PROP 17 /* inquire number of element */ |
| 85 |
/* block properties */ |
| 86 |
#define IM_EX_INQ_NS_PROP 18 /* inquire number of node set */ |
| 87 |
/* properties */ |
| 88 |
#define IM_EX_INQ_SS_PROP 19 /* inquire number of side set */ |
| 89 |
#define IM_EX_INQ_NS_DF_LEN 20 /* inquire length of node set */ |
| 90 |
/* distribution factor list*/ |
| 91 |
#define IM_EX_INQ_SS_DF_LEN 21 /* inquire length of node set */ |
| 92 |
/* distribution factor list*/ |
| 93 |
#define IM_EX_INQ_LIB_VERS 22 /* inquire API Lib vers number*/ |
| 94 |
#define IM_EX_INQ_EM_PROP 23 /* inquire number of element */ |
| 95 |
/* map properties */ |
| 96 |
#define IM_EX_INQ_NM_PROP 24 /* inquire number of node */ |
| 97 |
/* map properties */ |
| 98 |
#define IM_EX_INQ_ELEM_MAP 25 /* inquire number of element */ |
| 99 |
/* maps */ |
| 100 |
#define IM_EX_INQ_NODE_MAP 26 /* inquire number of node */ |
| 101 |
/* maps */ |
| 102 |
|
| 103 |
/* properties */ |
| 104 |
#define IM_EX_ELEM_BLOCK 1 /* element block property code*/ |
| 105 |
#define IM_EX_NODE_SET 2 /* node set property code */ |
| 106 |
#define IM_EX_SIDE_SET 3 /* side set property code */ |
| 107 |
#define IM_EX_ELEM_MAP 4 /* element map property code */ |
| 108 |
#define IM_EX_NODE_MAP 5 /* node map property code */ |
| 109 |
|
| 110 |
/* max string lengths; constants that are used as netcdf dimensions must be |
| 111 |
of type long */ |
| 112 |
#define MAX_STR_LENGTH 32L |
| 113 |
#define MAX_VAR_NAME_LENGTH 20 |
| 114 |
#define MAX_LINE_LENGTH 80L |
| 115 |
#define MAX_ERR_LENGTH 256 |
| 116 |
|
| 117 |
/* for netCDF 3.4, we estimate the size of the header; |
| 118 |
if estimate is larger than this max, set the estimate to this max; |
| 119 |
I've never measured a header larger than 20K */ |
| 120 |
#define MAX_HEADER_SIZE 30000 |
| 121 |
|
| 122 |
/* routines for file initialization i/o */ |
| 123 |
|
| 124 |
|
| 125 |
extern int im_ex_get_coord_names (int exoid, |
| 126 |
char **coord_names); |
| 127 |
extern int im_ex_get_coord (int exoid, |
| 128 |
void *x_coor, |
| 129 |
void *y_coor, |
| 130 |
void *z_coor); |
| 131 |
|
| 132 |
extern int im_ex_get_ids (int exoid, int obj_type, int *ids); |
| 133 |
extern int im_ex_get_elem_blk_ids (int exoid, int *ids); |
| 134 |
extern int im_ex_get_elem_blk_parent_mesh(int exoid, int *ids); |
| 135 |
extern int im_ex_get_ns_parent_mesh(int exoid, int *ids); |
| 136 |
extern int im_ex_get_ss_parent_mesh(int exoid, int *ids); |
| 137 |
extern int im_ex_get_elem_block (int exoid, |
| 138 |
int elem_blk_id, |
| 139 |
char *elem_type, |
| 140 |
int *num_elem_this_blk, |
| 141 |
int *num_nodes_per_elem, |
| 142 |
int *num_attr); |
| 143 |
|
| 144 |
extern int im_ex_get_elem_conn (int exoid, |
| 145 |
int elem_blk_id, |
| 146 |
int *connect); |
| 147 |
|
| 148 |
|
| 149 |
extern int im_ex_get_elem_num_map (int exoid,int *elem_map); |
| 150 |
|
| 151 |
extern int im_ex_get_info (int exoid, char **info); |
| 152 |
|
| 153 |
extern int im_ex_get_init (int exoid, |
| 154 |
char *title, |
| 155 |
int *num_dim, |
| 156 |
int *num_nodes, |
| 157 |
int *num_elem, |
| 158 |
int *num_elem_blk, |
| 159 |
int *num_node_sets, |
| 160 |
int *num_side_sets); |
| 161 |
|
| 162 |
extern int im_ex_get_map (int exoid, int *elem_map); |
| 163 |
|
| 164 |
|
| 165 |
extern int im_ex_get_node_map (int exoid, |
| 166 |
int map_id, |
| 167 |
int *node_map); |
| 168 |
|
| 169 |
extern int im_ex_get_node_num_map (int exoid, |
| 170 |
int *node_map); |
| 171 |
|
| 172 |
extern int im_ex_get_node_set_param (int exoid, |
| 173 |
int node_set_id, |
| 174 |
int *num_nodes_in_set, |
| 175 |
int *num_df_in_set); |
| 176 |
|
| 177 |
extern int im_ex_get_node_set (int exoid, |
| 178 |
int node_set_id, |
| 179 |
int *node_set_node_list); |
| 180 |
|
| 181 |
extern int im_ex_get_node_set_ids (int exoid, |
| 182 |
int *ids); |
| 183 |
|
| 184 |
|
| 185 |
extern int im_ex_get_qa (int exoid, |
| 186 |
char *qa_record[][4]); |
| 187 |
|
| 188 |
extern int im_ex_get_side_set_param (int exoid, |
| 189 |
int side_set_id, |
| 190 |
int *num_side_in_set, |
| 191 |
int *num_dist_fact_in_set); |
| 192 |
extern int im_ex_get_side_set (int exoid, |
| 193 |
int side_set_id, |
| 194 |
int *side_set_elem_list, |
| 195 |
int *side_set_side_list); |
| 196 |
|
| 197 |
extern int im_ex_get_side_set_node_list(int exoid, |
| 198 |
int side_set_id, |
| 199 |
int *side_set_node_cnt_list, |
| 200 |
int *side_set_node_list); |
| 201 |
|
| 202 |
extern int im_ex_get_side_set_ids (int exoid, |
| 203 |
int *ids); |
| 204 |
extern int im_ex_inquire(int, int, int*, float*, char*); |
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
/* ERROR CODE DEFINITIONS AND STORAGE */ |
| 209 |
extern int exerrval; /* shared error return value */ |
| 210 |
extern int exoptval; /* error reporting flag (default is quiet) */ |
| 211 |
|
| 212 |
#ifdef __cplusplus |
| 213 |
} /* close brackets on extern "C" declaration */ |
| 214 |
#endif |
| 215 |
|
| 216 |
#endif |
| 217 |
|
| 218 |
/* im_ex_opts function codes - codes are OR'ed into exopts */ |
| 219 |
#define IM_EX_VERBOSE 1 /* verbose mode message flag */ |
| 220 |
#define IM_EX_DEBUG 2 /* debug mode def */ |
| 221 |
#define IM_EX_ABORT 4 /* abort mode flag def */ |
| 222 |
|
| 223 |
/* Exodus error return codes - exerrval return values: */ |
| 224 |
#define IM_EX_MEMFAIL 1000 /* memory allocation failure flag def */ |
| 225 |
#define IM_EX_BADFILEMODE 1001 /* bad file mode def */ |
| 226 |
#define IM_EX_BADFILEID 1002 /* bad file id def */ |
| 227 |
#define IM_EX_WRONGFILETYPE 1003 /* wrong file type for function */ |
| 228 |
#define IM_EX_LOOKUPFAIL 1004 /* id table lookup failed */ |
| 229 |
#define IM_EX_BADPARAM 1005 /* bad parameter passed */ |
| 230 |
#define IM_EX_NULLENTITY -1006 /* null entity found */ |
| 231 |
#define IM_EX_MSG -1000 /* message print code - no error implied */ |
| 232 |
#define IM_EX_PRTLASTMSG -1001 /* print last error message msg code */ |
| 233 |
|
| 234 |
#include "pamgen_im_exodusII_ext.h" |