[exodus] 18/48: v5.24
Alastair McKinstry
mckinstry at moszumanska.debian.org
Wed Jul 15 11:35:57 UTC 2015
This is an automated email from the git hooks/post-receive script.
mckinstry pushed a commit to branch debian/master
in repository exodus.
commit 165a765791f4922c426f403afb3bad85e4607564
Author: Alastair McKinstry <mckinstry at debian.org>
Date: Sun Jun 16 12:32:02 2013 +0100
v5.24
---
exodus/CMakeLists.txt | 42 +-
exodus/Doxyfile | 2 +-
exodus/Imakefile | 2 +-
exodus/Makefile.standalone | 88 +-
exodus/README | 15 +-
exodus/cbind/CMakeLists.txt | 464 ++--
exodus/cbind/include/Imakefile | 7 +-
exodus/cbind/include/doxygen.h | 152 +-
exodus/cbind/include/exodusII.h | 2001 +++++++++++++----
exodus/cbind/include/exodusII_cfg.h | 25 +
exodus/cbind/include/exodusII_ext.h | 238 --
exodus/cbind/include/exodusII_int.h | 176 +-
exodus/cbind/include/exodusII_par.h | 84 +
.../parallel/Imakefile} | 56 +-
.../{src/excre.c => parallel/ex_create_par.c} | 103 +-
exodus/cbind/parallel/ex_open_par.c | 318 +++
exodus/cbind/src/Imakefile | 314 ++-
exodus/cbind/src/Makefile.standalone | 427 ++--
exodus/cbind/src/{exclos.c => ex_close.c} | 0
exodus/cbind/src/ex_conv.c | 208 +-
exodus/cbind/src/{excopy.c => ex_copy.c} | 38 +-
exodus/cbind/src/{excre.c => ex_create.c} | 72 +-
exodus/cbind/src/{excre.c => ex_create_par.c} | 145 +-
exodus/cbind/src/ex_cvt_nodes_to_sides.c | 1041 +++++++++
exodus/cbind/src/{exerr.c => ex_err.c} | 0
exodus/cbind/src/{exgatm.c => ex_get_all_times.c} | 0
exodus/cbind/src/{exgatt.c => ex_get_attr.c} | 10 +-
exodus/cbind/src/{exgatn.c => ex_get_attr_names.c} | 10 +-
.../cbind/src/{exgattp.c => ex_get_attr_param.c} | 6 +-
exodus/cbind/src/ex_get_block.c | 113 +
exodus/cbind/src/ex_get_block_param.c | 277 +++
.../cbind/src/ex_get_cmap_params.c | 162 +-
.../src/{exgcns.c => ex_get_concat_node_sets.c} | 12 +-
.../cbind/src/{exgcset.c => ex_get_concat_sets.c} | 165 +-
...gcssc.c => ex_get_concat_side_set_node_count.c} | 254 ++-
.../src/{exgcss.c => ex_get_concat_side_sets.c} | 14 +-
exodus/cbind/src/{exgnconn.c => ex_get_conn.c} | 166 +-
exodus/cbind/src/{exgcor.c => ex_get_coord.c} | 0
.../cbind/src/{exgcon.c => ex_get_coord_names.c} | 0
.../src/{exgfrm.c => ex_get_coordinate_frames.c} | 26 +-
.../cbind/src/ex_get_eb_info_global.c | 39 +-
exodus/cbind/src/{exgeat.c => ex_get_elem_attr.c} | 2 +-
.../src/{exgean.c => ex_get_elem_attr_names.c} | 2 +-
.../cbind/src/{exgebi.c => ex_get_elem_blk_ids.c} | 2 +-
exodus/cbind/src/{exgelb.c => ex_get_elem_block.c} | 8 +-
.../cbind/src/ex_get_elem_cmap.c | 77 +-
exodus/cbind/src/{exgelc.c => ex_get_elem_conn.c} | 4 +-
exodus/cbind/src/{exgem.c => ex_get_elem_map.c} | 4 +-
.../cbind/src/{exgenm.c => ex_get_elem_num_map.c} | 2 +-
.../cbind/src/ex_get_elem_type.c | 33 +-
exodus/cbind/src/{exgev.c => ex_get_elem_var.c} | 4 +-
.../cbind/src/{exgvtt.c => ex_get_elem_var_tab.c} | 0
.../cbind/src/{exgevt.c => ex_get_elem_var_time.c} | 2 +-
...gecpp.c => ex_get_entity_count_per_polyhedra.c} | 10 +-
.../cbind/src/{exggvt.c => ex_get_glob_var_time.c} | 41 +-
exodus/cbind/src/{exggv.c => ex_get_glob_vars.c} | 0
exodus/cbind/src/{exgidm.c => ex_get_id_map.c} | 20 +-
exodus/cbind/src/{exgids.c => ex_get_ids.c} | 8 +-
exodus/cbind/src/{exginf.c => ex_get_info.c} | 0
exodus/cbind/src/{exgini.c => ex_get_init.c} | 56 +-
exodus/cbind/src/{exginix.c => ex_get_init_ext.c} | 29 +-
.../cbind/src/ex_get_init_global.c | 84 +-
.../cbind/src/ex_get_init_info.c | 31 +-
.../cbind/src/ex_get_loadbal_param.c | 250 ++-
exodus/cbind/src/{exgmap.c => ex_get_map.c} | 25 +-
exodus/cbind/src/{exgmp.c => ex_get_map_param.c} | 0
exodus/cbind/src/{exgnm.c => ex_get_n_attr.c} | 42 +-
exodus/cbind/src/{exgevid.c => ex_get_n_conn.c} | 32 +-
exodus/cbind/src/{exgssd.c => ex_get_n_coord.c} | 41 +-
exodus/cbind/src/{exgsp.c => ex_get_n_elem_attr.c} | 55 +-
exodus/cbind/src/{exgsp.c => ex_get_n_elem_conn.c} | 55 +-
.../src/{exgssvid.c => ex_get_n_elem_num_map.c} | 25 +-
.../cbind/src/{exgevid.c => ex_get_n_elem_var.c} | 35 +-
.../cbind/src/{exgevid.c => ex_get_n_nodal_var.c} | 32 +-
.../src/{exgnsvid.c => ex_get_n_node_num_map.c} | 29 +-
exodus/cbind/src/{exgsp.c => ex_get_n_node_set.c} | 52 +-
.../src/{exgevid.c => ex_get_n_node_set_df.c} | 30 +-
exodus/cbind/src/{exgnm.c => ex_get_n_one_attr.c} | 44 +-
.../cbind/src/{exgevid.c => ex_get_n_side_set.c} | 31 +-
.../cbind/src/{exgsp.c => ex_get_n_side_set_df.c} | 58 +-
exodus/cbind/src/{expoea.c => ex_get_n_var.c} | 59 +-
exodus/cbind/src/{exgnam.c => ex_get_name.c} | 5 +-
exodus/cbind/src/{exgnams.c => ex_get_names.c} | 0
exodus/cbind/src/{exgnv.c => ex_get_nodal_var.c} | 2 +-
.../src/{exgnvt.c => ex_get_nodal_var_time.c} | 25 +-
.../cbind/src/ex_get_node_cmap.c | 63 +-
exodus/cbind/src/{exgnm.c => ex_get_node_map.c} | 4 +-
.../cbind/src/{exgnnm.c => ex_get_node_num_map.c} | 2 +-
exodus/cbind/src/{exgns.c => ex_get_node_set.c} | 4 +-
.../src/{exgnsd.c => ex_get_node_set_dist_fact.c} | 2 +-
.../cbind/src/{exgnsi.c => ex_get_node_set_ids.c} | 2 +-
.../cbind/src/{exgnp.c => ex_get_node_set_param.c} | 6 +-
.../cbind/src/ex_get_ns_param_global.c | 53 +-
exodus/cbind/src/{exgnsv.c => ex_get_nset_var.c} | 4 +-
.../cbind/src/{exgnstt.c => ex_get_nset_var_tab.c} | 0
exodus/cbind/src/{exgnmap.c => ex_get_num_map.c} | 14 +-
.../src/{exgotv.c => ex_get_object_truth_vector.c} | 4 +-
exodus/cbind/src/{exgoatt.c => ex_get_one_attr.c} | 12 +-
.../cbind/src/{exgoea.c => ex_get_one_elem_attr.c} | 2 +-
.../src/{exgnoatt.c => ex_get_partial_attr.c} | 70 +-
.../src/{exgnconn.c => ex_get_partial_conn.c} | 141 +-
.../src/{exgncor.c => ex_get_partial_coord.c} | 37 +-
.../cbind/src/ex_get_partial_elem_attr.c | 85 +-
.../src/{exgsp.c => ex_get_partial_elem_conn.c} | 55 +-
.../src/{exgevid.c => ex_get_partial_elem_map.c} | 32 +-
.../cbind/src/ex_get_partial_elem_num_map.c | 68 +-
.../cbind/src/ex_get_partial_elem_var.c | 81 +-
.../src/{exgidm.c => ex_get_partial_id_map.c} | 49 +-
.../cbind/src/ex_get_partial_nodal_var.c | 59 +-
.../cbind/src/ex_get_partial_node_num_map.c | 67 +-
.../cbind/src/ex_get_partial_node_set.c | 77 +-
.../cbind/src/ex_get_partial_node_set_df.c | 76 +-
.../src/{exgpem.c => ex_get_partial_num_map.c} | 97 +-
.../src/{exgnoatt.c => ex_get_partial_one_attr.c} | 46 +-
.../{exgsetd.c => ex_get_partial_set_dist_fact.c} | 56 +-
.../cbind/src/ex_get_partial_side_set.c | 105 +-
.../cbind/src/ex_get_partial_side_set_df.c | 77 +-
.../cbind/src/{exgnvar.c => ex_get_partial_var.c} | 57 +-
.../cbind/src/ex_get_processor_elem_maps.c | 87 +-
.../cbind/src/ex_get_processor_node_maps.c | 121 +-
exodus/cbind/src/{exgp.c => ex_get_prop.c} | 29 +-
exodus/cbind/src/{exgpa.c => ex_get_prop_array.c} | 8 +-
exodus/cbind/src/{exgpn.c => ex_get_prop_names.c} | 3 +-
exodus/cbind/src/{exgqa.c => ex_get_qa.c} | 0
exodus/cbind/src/{exgset.c => ex_get_set.c} | 42 +-
.../src/{exgsetd.c => ex_get_set_dist_fact.c} | 12 +-
exodus/cbind/src/{exgsetp.c => ex_get_set_param.c} | 54 +-
exodus/cbind/src/{exgtt.c => ex_get_sets.c} | 62 +-
exodus/cbind/src/{exgss.c => ex_get_side_set.c} | 6 +-
.../src/{exgssd.c => ex_get_side_set_dist_fact.c} | 2 +-
.../cbind/src/{exgssi.c => ex_get_side_set_ids.c} | 2 +-
exodus/cbind/src/ex_get_side_set_node_count.c | 623 ++++++
exodus/cbind/src/ex_get_side_set_node_list.c | 1037 +++++++++
.../{exgsnl.c => ex_get_side_set_node_list_len.c} | 377 ++--
.../cbind/src/{exgsp.c => ex_get_side_set_param.c} | 6 +-
.../cbind/src/ex_get_ss_param_global.c | 53 +-
exodus/cbind/src/{exgssv.c => ex_get_sset_var.c} | 4 +-
.../cbind/src/{exgsstt.c => ex_get_sset_var_tab.c} | 0
exodus/cbind/src/{exgtim.c => ex_get_time.c} | 0
.../src/{exgvartab.c => ex_get_truth_table.c} | 0
exodus/cbind/src/{exgvar.c => ex_get_var.c} | 12 +-
exodus/cbind/src/{exgvnm.c => ex_get_var_name.c} | 0
exodus/cbind/src/{exgvan.c => ex_get_var_names.c} | 0
exodus/cbind/src/{exgvp.c => ex_get_var_param.c} | 0
exodus/cbind/src/{exgtt.c => ex_get_var_tab.c} | 0
exodus/cbind/src/{exgvart.c => ex_get_var_time.c} | 65 +-
.../src/{exgvarnam.c => ex_get_variable_name.c} | 3 +-
.../src/{exgvarnams.c => ex_get_variable_names.c} | 0
.../src/{exgvarparam.c => ex_get_variable_param.c} | 0
exodus/cbind/src/{exinq.c => ex_inquire.c} | 269 ++-
nemesis/ne_util.c => exodus/cbind/src/ex_ne_util.c | 266 +--
exodus/cbind/src/{exopen.c => ex_open.c} | 282 +--
exodus/cbind/src/ex_open_par.c | 318 +++
exodus/cbind/src/{exopts.c => ex_opts.c} | 2 +-
.../cbind/src/{expvpa.c => ex_put_all_var_param.c} | 0
.../src/{expvpax.c => ex_put_all_var_param_ext.c} | 98 +-
exodus/cbind/src/{expatt.c => ex_put_attr.c} | 10 +-
exodus/cbind/src/{expatn.c => ex_put_attr_names.c} | 12 +-
.../cbind/src/{expattp.c => ex_put_attr_param.c} | 13 +-
exodus/cbind/src/ex_put_block.c | 95 +
.../cbind/src/{expblk.c => ex_put_block_param.c} | 209 +-
.../cbind/src/ex_put_cmap_params.c | 212 +-
.../cbind/src/ex_put_cmap_params_cc.c | 260 ++-
.../src/{expcab.c => ex_put_concat_all_blocks.c} | 154 +-
.../src/{expclb.c => ex_put_concat_elem_block.c} | 110 +-
.../src/{expcns.c => ex_put_concat_node_sets.c} | 12 +-
.../cbind/src/{expcset.c => ex_put_concat_sets.c} | 259 ++-
.../src/{expcss.c => ex_put_concat_side_sets.c} | 14 +-
.../src/{expvpc.c => ex_put_concat_var_param.c} | 0
exodus/cbind/src/{expconn.c => ex_put_conn.c} | 43 +-
exodus/cbind/src/{expcor.c => ex_put_coord.c} | 0
.../cbind/src/{expcon.c => ex_put_coord_names.c} | 0
.../src/{expfrm.c => ex_put_coordinate_frames.c} | 34 +-
.../cbind/src/ex_put_eb_info_global.c | 39 +-
exodus/cbind/src/{expeat.c => ex_put_elem_attr.c} | 2 +-
.../src/{expean.c => ex_put_elem_attr_names.c} | 2 +-
exodus/cbind/src/{expelb.c => ex_put_elem_block.c} | 8 +-
.../cbind/src/ex_put_elem_cmap.c | 83 +-
exodus/cbind/src/{expelc.c => ex_put_elem_conn.c} | 4 +-
exodus/cbind/src/{expem.c => ex_put_elem_map.c} | 4 +-
.../cbind/src/{expenm.c => ex_put_elem_num_map.c} | 2 +-
exodus/cbind/src/{expev.c => ex_put_elem_var.c} | 4 +-
.../cbind/src/ex_put_elem_var_slab.c | 133 +-
.../cbind/src/{expvtt.c => ex_put_elem_var_tab.c} | 0
...pecpp.c => ex_put_entity_count_per_polyhedra.c} | 10 +-
exodus/cbind/src/{expgv.c => ex_put_glob_vars.c} | 0
exodus/cbind/src/{expidm.c => ex_put_id_map.c} | 18 +-
exodus/cbind/src/{expinf.c => ex_put_info.c} | 169 +-
exodus/cbind/src/{expini.c => ex_put_init.c} | 12 +-
exodus/cbind/src/{expinix.c => ex_put_init_ext.c} | 42 +-
.../cbind/src/ex_put_init_global.c | 149 +-
.../cbind/src/ex_put_init_info.c | 51 +-
.../cbind/src/ex_put_loadbal_param.c | 270 +--
.../cbind/src/ex_put_loadbal_param_cc.c | 454 ++--
exodus/cbind/src/{expmap.c => ex_put_map.c} | 67 +-
exodus/cbind/src/ex_put_map_param.c | 320 +++
exodus/cbind/src/{exgoea.c => ex_put_n_attr.c} | 28 +-
exodus/cbind/src/{exgssd.c => ex_put_n_coord.c} | 33 +-
exodus/cbind/src/{exgsp.c => ex_put_n_elem_attr.c} | 56 +-
exodus/cbind/src/{exgsp.c => ex_put_n_elem_conn.c} | 53 +-
.../cbind/src/{exgns.c => ex_put_n_elem_num_map.c} | 31 +-
.../cbind/src/{expnnv.c => ex_put_n_nodal_var.c} | 63 +-
.../cbind/src/{exgnm.c => ex_put_n_node_num_map.c} | 28 +-
exodus/cbind/src/{exgsp.c => ex_put_n_node_set.c} | 54 +-
.../cbind/src/{exgsp.c => ex_put_n_node_set_df.c} | 56 +-
exodus/cbind/src/{expoea.c => ex_put_n_one_attr.c} | 37 +-
exodus/cbind/src/{exgsp.c => ex_put_n_side_set.c} | 58 +-
.../cbind/src/{exgsp.c => ex_put_n_side_set_df.c} | 55 +-
exodus/cbind/src/{expssv.c => ex_put_n_var.c} | 50 +-
exodus/cbind/src/{expnam.c => ex_put_name.c} | 15 +-
exodus/cbind/src/{expnams.c => ex_put_names.c} | 0
exodus/cbind/src/{expnv.c => ex_put_nodal_var.c} | 2 +-
.../cbind/src/ex_put_nodal_var_slab.c | 37 +-
.../cbind/src/ex_put_node_cmap.c | 71 +-
exodus/cbind/src/{expnm.c => ex_put_node_map.c} | 4 +-
.../cbind/src/{expnnm.c => ex_put_node_num_map.c} | 2 +-
exodus/cbind/src/{expns.c => ex_put_node_set.c} | 4 +-
.../src/{expnsd.c => ex_put_node_set_dist_fact.c} | 2 +-
.../cbind/src/{expnp.c => ex_put_node_set_param.c} | 6 +-
.../cbind/src/ex_put_ns_param_global.c | 53 +-
exodus/cbind/src/{expnsv.c => ex_put_nset_var.c} | 4 +-
.../cbind/src/{expnstt.c => ex_put_nset_var_tab.c} | 0
exodus/cbind/src/ex_put_num_map.c | 287 +++
exodus/cbind/src/{expoatt.c => ex_put_one_attr.c} | 12 +-
.../cbind/src/{expoea.c => ex_put_one_elem_attr.c} | 2 +-
.../cbind/src/{expatt.c => ex_put_partial_attr.c} | 96 +-
.../src/{expncor.c => ex_put_partial_coord.c} | 56 +-
.../cbind/src/ex_put_partial_elem_attr.c | 94 +-
.../cbind/src/ex_put_partial_elem_conn.c | 90 +-
.../src/{expem.c => ex_put_partial_elem_map.c} | 23 +-
.../src/{exgns.c => ex_put_partial_elem_num_map.c} | 31 +-
.../src/{exppidm.c => ex_put_partial_id_map.c} | 58 +-
.../src/{expnnv.c => ex_put_partial_nodal_var.c} | 16 +-
.../src/{exgnm.c => ex_put_partial_node_num_map.c} | 28 +-
.../cbind/src/ex_put_partial_node_set.c | 77 +-
.../cbind/src/ex_put_partial_node_set_df.c | 85 +-
exodus/cbind/src/ex_put_partial_num_map.c | 300 +++
.../src/{expnoatt.c => ex_put_partial_one_attr.c} | 49 +-
.../cbind/src/{expset.c => ex_put_partial_set.c} | 48 +-
.../{exppsetd.c => ex_put_partial_set_dist_fact.c} | 19 +-
.../cbind/src/ex_put_partial_side_set.c | 108 +-
.../cbind/src/ex_put_partial_side_set_df.c | 89 +-
.../cbind/src/{expnvar.c => ex_put_partial_var.c} | 86 +-
.../cbind/src/ex_put_processor_elem_maps.c | 87 +-
.../cbind/src/ex_put_processor_node_maps.c | 119 +-
exodus/cbind/src/{expp.c => ex_put_prop.c} | 32 +-
exodus/cbind/src/{exppa.c => ex_put_prop_array.c} | 19 +-
exodus/cbind/src/{exppn.c => ex_put_prop_names.c} | 11 +-
exodus/cbind/src/{expqa.c => ex_put_qa.c} | 163 +-
exodus/cbind/src/{expset.c => ex_put_set.c} | 34 +-
.../src/{expsetd.c => ex_put_set_dist_fact.c} | 12 +-
exodus/cbind/src/{expsp.c => ex_put_set_param.c} | 41 +-
exodus/cbind/src/ex_put_sets.c | 385 ++++
exodus/cbind/src/{expss.c => ex_put_side_set.c} | 6 +-
.../src/{expssd.c => ex_put_side_set_dist_fact.c} | 2 +-
.../cbind/src/{expsp.c => ex_put_side_set_param.c} | 6 +-
.../cbind/src/ex_put_ss_param_global.c | 53 +-
exodus/cbind/src/{expssv.c => ex_put_sset_var.c} | 4 +-
.../cbind/src/{expsstt.c => ex_put_sset_var_tab.c} | 0
exodus/cbind/src/{exptim.c => ex_put_time.c} | 0
.../src/{expvartab.c => ex_put_truth_table.c} | 46 +-
exodus/cbind/src/ex_put_var.c | 340 +++
exodus/cbind/src/{expvnm.c => ex_put_var_name.c} | 0
exodus/cbind/src/{expvan.c => ex_put_var_names.c} | 0
exodus/cbind/src/{expvp.c => ex_put_var_param.c} | 0
exodus/cbind/src/{exptt.c => ex_put_var_tab.c} | 0
.../src/{expvarnam.c => ex_put_variable_name.c} | 0
.../src/{expvarnams.c => ex_put_variable_names.c} | 0
.../src/{expvarparam.c => ex_put_variable_param.c} | 9 +-
exodus/cbind/src/{exupda.c => ex_update.c} | 0
exodus/cbind/src/ex_utils.c | 291 +--
exodus/cbind/src/excn2s.c | 1025 ---------
exodus/cbind/src/exgblk.c | 306 ---
exodus/cbind/src/exgconn.c | 269 ---
exodus/cbind/src/exgnnv.c | 139 --
exodus/cbind/src/exgnvid.c | 122 --
exodus/cbind/src/exgnvv.c | 111 -
exodus/cbind/src/exgssc.c | 607 -----
exodus/cbind/src/exgssn.c | 1113 ----------
exodus/cbind/src/exgvid.c | 155 --
exodus/cbind/src/exgvv.c | 102 -
exodus/cbind/src/expmp.c | 313 ---
exodus/cbind/src/expnmap.c | 278 ---
exodus/cbind/src/expnvv.c | 115 -
exodus/cbind/src/exppem.c | 234 --
exodus/cbind/src/expsetp.c | 410 ----
exodus/cbind/src/expvar.c | 328 ---
exodus/cbind/src/expvv.c | 103 -
exodus/cbind/test/CMakeLists.txt | 3 +-
exodus/cbind/test/CreateEdgeFace.c | 344 ++-
exodus/cbind/test/Imakefile | 16 +-
exodus/cbind/test/MakeTestData.c | 929 ++++++++
exodus/cbind/test/Makefile.standalone | 119 +-
exodus/cbind/test/ReadEdgeFace.c | 57 +-
exodus/cbind/test/create_mesh.c | 364 ++-
exodus/cbind/test/exodus_unit_tests.gold | 1 -
exodus/cbind/test/oned.c | 426 ++++
exodus/cbind/test/rd_wt_mesh.c | 4 +-
exodus/cbind/test/test.dmp | 5 +-
exodus/cbind/test/test1.dmp | 5 +-
exodus/cbind/test/test2-1.dmp | 5 +-
exodus/cbind/test/test2-2.dmp | 5 +-
exodus/cbind/test/test2.dmp | 5 +-
exodus/cbind/test/test_clb.dmp | 5 +-
.../ne_test.c => exodus/cbind/test/test_nemesis.c | 59 +-
exodus/cbind/test/test_nemesis.dmp | 30 +
exodus/cbind/test/testall.in | 74 +-
exodus/cbind/test/testall.in1 | 73 +-
.../cbind/test/{testall.in1 => testall.standalone} | 80 +-
exodus/cbind/test/testcp_dd.dmp | 5 +-
exodus/cbind/test/testcp_ds.dmp | 5 +-
exodus/cbind/test/testcp_ln.dmp | 5 +-
exodus/cbind/test/testcp_nl.dmp | 5 +-
exodus/cbind/test/testcp_sd.dmp | 5 +-
exodus/cbind/test/testcp_ss.dmp | 5 +-
exodus/cbind/test/testd.dmp | 5 +-
exodus/cbind/test/testrd-long-name.c | 55 +-
exodus/cbind/test/testrd-long-name.dmp | 41 +-
exodus/cbind/test/testrd-nfaced.c | 20 +-
exodus/cbind/test/testrd-nfaced.dmp | 16 +-
exodus/cbind/test/testrd-nm32.dmp | 39 +-
exodus/cbind/test/testrd-nsided.c | 44 +-
exodus/cbind/test/testrd-nsided.dmp | 38 +-
exodus/cbind/test/testrd.c | 30 +-
exodus/cbind/test/testrd.dmp | 39 +-
exodus/cbind/test/testrd1.c | 10 +-
exodus/cbind/test/testrd1.dmp | 32 +-
exodus/cbind/test/testrd_nc.c | 8 +-
exodus/cbind/test/testrd_nc.dmp | 38 +-
.../cbind/test/{testrd-partial.c => testrd_par.c} | 74 +-
exodus/cbind/test/testrd_ss.c | 4 +-
exodus/cbind/test/testrd_zeroe.dmp | 36 +-
exodus/cbind/test/testrd_zeron.dmp | 77 +-
exodus/cbind/test/testrdd.c | 5 +-
exodus/cbind/test/testrdd.dmp | 32 +-
exodus/cbind/test/testrdv.c | 930 --------
exodus/cbind/test/testrdv.dmp | 929 --------
exodus/cbind/test/testwt-long-name.c | 8 +-
exodus/cbind/test/testwt-long-name.dmp | 5 +-
exodus/cbind/test/testwt-nface-nside.c | 27 -
exodus/cbind/test/testwt-nfaced.dmp | 1 +
exodus/cbind/test/testwt-nsided.c | 6 +-
exodus/cbind/test/testwt-nsided.dmp | 5 +-
exodus/cbind/test/testwt-partial.c | 6 +-
exodus/cbind/test/testwt-zeroe.c | 6 +-
exodus/cbind/test/testwt-zeroe.dmp | 5 +-
exodus/cbind/test/testwt-zeron.c | 183 +-
exodus/cbind/test/testwt-zeron.dmp | 25 +-
exodus/cbind/test/testwt.c | 6 +-
exodus/cbind/test/testwt1.c | 72 +-
exodus/cbind/test/testwt2.c | 55 +-
exodus/cbind/test/testwt_clb.c | 8 +-
exodus/cbind/test/testwt_nc.c | 6 +-
exodus/cbind/test/testwt_nossnsdf.c | 16 +-
exodus/cbind/test/testwt_ss.c | 2 +-
exodus/cbind/test/testwt_ss.dmp | 1 +
exodus/cbind/test/testwtbig.c | 12 +-
exodus/cbind/test/testwtd.c | 6 +-
exodus/cbind/test/testwtm.c | 25 +-
exodus/cbind/test/twod.c | 378 ++++
exodus/cbind/test/{testall => update_all_tests} | 110 +-
exodus/cmake/Dependencies.cmake | 8 +
exodus/doc/exodus-face-edge.pdf | Bin 0 -> 720533 bytes
exodus/doc/exodus.pdf | Bin 0 -> 3842894 bytes
exodus/doc/nemesis.pdf | Bin 0 -> 376501 bytes
exodus/forbind/CMakeLists.txt | 81 +-
exodus/forbind/include/exodusII.inc | 258 ++-
exodus/forbind/src/Makefile.standalone | 44 +-
exodus/forbind/src/addrwrap.F | 2315 ++++++++++++--------
exodus/forbind/test/CMakeLists.txt | 74 +-
exodus/forbind/test/Imakefile | 3 +-
exodus/forbind/test/Makefile.standalone | 91 +-
exodus/forbind/test/makedmp | 104 -
exodus/forbind/test/t.f.tmp | 924 --------
exodus/forbind/test/test-nsided.dmp | 1 +
exodus/forbind/test/test.dmp | 1 +
exodus/forbind/test/test.exo_f | 1 -
exodus/forbind/test/test1.dmp | 1 +
exodus/forbind/test/test2-1.dmp | 1 +
exodus/forbind/test/test2-2.dmp | 1 +
exodus/forbind/test/test_nem.dmp | 54 +
.../ne_test.F => exodus/forbind/test/test_nem.f | 168 +-
exodus/forbind/test/test_nem.inc | 66 +
exodus/forbind/test/testall.in | 6 +-
exodus/forbind/test/testall.in1 | 4 +
.../forbind/test/{testall => testall.standalone} | 57 +-
exodus/forbind/test/testcp.f | 2 +-
exodus/forbind/test/testcp_dd.dmp | 139 --
exodus/forbind/test/testcp_ds.dmp | 181 +-
exodus/forbind/test/testcp_sd.dmp | 201 --
exodus/forbind/test/testcp_ss.dmp | 1 +
exodus/forbind/test/testcpln.dmp | 100 +-
exodus/forbind/test/testcpln.f | 4 +-
exodus/forbind/test/testcpnl.dmp | 1 +
exodus/forbind/test/testd.dmp | 1 +
exodus/forbind/test/testrd.f | 2 -
exodus/forbind/test/testrd1.f | 3 -
exodus/forbind/test/testrd_nsid.f | 25 +-
exodus/forbind/test/testrdd.f | 2 -
exodus/forbind/test/testwt1.f | 3 +-
exodus/forbind/test/testwt_nsid.f | 17 +-
nemesis/CMakeLists.txt | 70 +-
nemesis/Imakefile | 35 +-
nemesis/Makefile.standalone | 9 +-
nemesis/forbind/Makefile | 585 +++++
nemesis/forbind/addrwrpn.F | 1193 +---------
nemesis/forbind/{ne_test.F => ne_ftest.F} | 2 -
nemesis/forbind/ne_jack.src | 1498 -------------
nemesis/forbind/ne_test.inc | 66 +
nemesis/{ne_test.c => ne_ctest_wrap.c} | 0
nemesis/ne_gncor.c | 216 --
nemesis/ne_gnelc.c | 176 --
nemesis/ne_nemesisI.h | 369 ++--
nemesis/ne_nemesisI_int.h | 157 +-
nemesis/ne_pennm.c | 181 --
nemesis/ne_pncor.c | 225 --
nemesis/ne_pnnnm.c | 176 --
nemesis/nemesis_cfg.h.in | 25 +
nemesis/nemesis_wrapper.c | 596 +++++
419 files changed, 21336 insertions(+), 22397 deletions(-)
diff --git a/exodus/CMakeLists.txt b/exodus/CMakeLists.txt
index 3556579..935da5a 100644
--- a/exodus/CMakeLists.txt
+++ b/exodus/CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.6)
-PROJECT(ExodusII)
+PROJECT(ExodusII C CXX Fortran)
SET(EXODUSII_VERSION_MAJOR "5")
SET(EXODUSII_VERSION_MINOR "14")
@@ -9,4 +9,42 @@ SET(EXODUSII_VERSION_FULL "${EXODUSII_VERSION}.${EXODUSII_VERSION_PATCH}")
SET(EXODUSII_BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS}")
-SUBDIRS(cbind)
+SUBDIRS(cbind forbind)
+
+find_path( NETCDF_INCLUDE_DIR netcdf.h
+ $ENV{ACCESS}/inc
+ $ENV{NETCDF_DIR}/inc
+ $ENV{NETCDF_DIR}/include
+ $ENV{NETCDF_DIR}/libsrc
+)
+
+find_library( NETCDF_LIBRARY
+ NAMES netcdf
+ PATHS "$ENV{ACCESS}/lib"
+ "$ENV{NETCDF_DIR}/lib"
+ "$ENV{NETCDF_DIR}/libsrc/.libs"
+)
+
+find_program (NETCDF_NCDUMP ncdump
+ $ENV{ACCESS}/bin
+ $ENV{NETCDF_DIR}/bin
+ $ENV{NETCDF_DIR}/ncdump
+)
+
+# Hack for HDF5
+find_library( HDF5_LIBRARY hdf5
+ $ENV{ACCESS}/lib/shared
+ $ENV{ACCESS}/lib
+ $ENV{NETCDF_DIR}/lib
+ $ENV{NETCDF_DIR}/libsrc/.libs
+ /usr/local/hdf5/lib
+ )
+find_library( HDF5HL_LIBRARY hdf5_hl
+ $ENV{ACCESS}/lib/shared
+ $ENV{ACCESS}/lib
+ $ENV{NETCDF_DIR}/lib
+ $ENV{NETCDF_DIR}/libsrc/.libs
+ /usr/local/hdf5/lib
+ )
+
+
diff --git a/exodus/Doxyfile b/exodus/Doxyfile
index 150c85f..abc6409 100644
--- a/exodus/Doxyfile
+++ b/exodus/Doxyfile
@@ -31,7 +31,7 @@ PROJECT_NAME = ExodusII
# This could be handy for archiving the generated documentation or
# if some version control system is used.
-PROJECT_NUMBER = 4.99
+PROJECT_NUMBER = 5.15
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer
diff --git a/exodus/Imakefile b/exodus/Imakefile
index e0b3eab..62d67cc 100644
--- a/exodus/Imakefile
+++ b/exodus/Imakefile
@@ -61,7 +61,7 @@ F77OPTIONS = ParallelF77Options
LIBDIR = $(PLIBDIR)
#endif
-INCLIST1 = exodusII.h exodusII_int.h exodusII_ext.h
+INCLIST1 = exodusII.h exodusII_int.h
INCLIST2 = exodusII_int.inc exodusII.inc
SUBDIRS = cbind/include cbind/src forbind/include forbind/src cbind/test forbind/test
diff --git a/exodus/Makefile.standalone b/exodus/Makefile.standalone
index a8e2207..646ee85 100644
--- a/exodus/Makefile.standalone
+++ b/exodus/Makefile.standalone
@@ -34,12 +34,10 @@
#========================================================================
# A platform must define:
#
-# BITS either 32 or 64 depending on a 32-bit or 64-bit build
# CC == the C compiler
# FC == the Fortran compiler
# CCOPTIONS == non-optimization related flags for C compiling on this platform
# F77OPTIONS == non-optimization related flags for Fortran compiling on this platform
-# OS_TYPE == See listing in forbind/src/Imakefile
# RANLIB == ranlib or 'true' if no ranlib
# AR == command to build an archive library.
#
@@ -47,6 +45,40 @@
SYSTEM := $(shell uname)
+# Set this to yes if your netcdf is compiled with the netcdf4 extensions
+# which require linking with hdf5. It is assumed that the netcdf and hdf5
+# library and include paths are the same.
+
+#========================================================================
+# Netcdf
+#========================================================================
+USING_NETCDF4 = "YES"
+
+NETCDF = /Users/gdsjaar/src/seacas-nopar
+NETCDF_INC = -I$(NETCDF)/include
+NETCDF_LIB = -L$(NETCDF)/lib -lnetcdf
+
+ifeq ($(USING_NETCDF4), "YES")
+LDFLAGS = -L$(NETCDF)/lib -lnetcdf -lhdf5_hl -lhdf5 -lm -lz
+else
+NETCDF_YES_NO = -DNOT_NETCDF4
+LDFLAGS = -L$(NETCDF)/lib -lnetcdf
+endif
+
+#========================================================================
+# Darwin (Apple OSX)
+#========================================================================
+ifeq ($(SYSTEM),Darwin)
+RANLIB = ranlib
+
+AR = ar -crsv
+CC = gcc
+FC = gfortran
+CCOPTIONS = -DADDC_
+F77OPTIONS =
+endif
+#========================================================================
+
#========================================================================
# Linux
#========================================================================
@@ -55,9 +87,7 @@ ifeq ($(SYSTEM),Linux)
# Default Compiler:
COMPILER = GNU
-BITS = 32
RANLIB = ranlib
-OS_TYPE = linux
AR = ar -rcv
@@ -70,6 +100,7 @@ endif
ifeq ($(COMPILER),Intel)
CC = icc
+FC = ifort
CCOPTIONS = -Xc
endif
@@ -87,17 +118,14 @@ endif
#========================================================================
ifeq ($(SYSTEM),SunOS)
RANLIB = ranlib
-OS_TYPE = sunos
AR = CC -xar -o
ifeq ($(COMPILER),GNU)
-BITS = 32
CC = gcc
FC = gfortran
CCOPTIONS = -Wall
else
-BITS = 32
CC = cc
FC = f77
CCOPTIONS = -xtarget=ultra2 -xarch=v9 -g -ftrap=common -Xc
@@ -109,9 +137,7 @@ endif
# SGI
#========================================================================
ifeq ($(SYSTEM),IRIX64)
-BITS = 64
RANLIB = true
-OS_TYPE = irix
AR = ar -rcv
CC = cc
@@ -125,9 +151,7 @@ endif
# IBM
#========================================================================
ifeq ($(SYSTEM),AIX)
-BITS = 64
RANLIB = ranlib
-OS_TYPE = aix
AR = ar -rcv -X64
CC = xlc
@@ -144,9 +168,7 @@ endif
# TFLOP
#========================================================================
ifeq ($(SYSTEM),TFLOP)
-BITS = 32
RANLIB = ranlib
-OS_TYPE = osf
AR = xar -rcv
CC = icc
@@ -161,9 +183,7 @@ endif
# OSF (DEC Alpha)
#========================================================================
ifeq ($(SYSTEM),OSF1)
-BITS = 32
RANLIB = ranlib
-OS_TYPE = osf
AR = ar -crsv
CC = cc
@@ -172,40 +192,22 @@ CCOPTIONS = -std
endif
#========================================================================
-#========================================================================
-# Darwin (Apple OSX)
-#========================================================================
-ifeq ($(SYSTEM),Darwin)
-BITS = 64
-RANLIB = ranlib
-OS_TYPE = darwin
-
-AR = ar -crsv
-CC = gcc
-FC = gfortran
-CCOPTIONS =
-F77OPTIONS = -fcray-pointer -fdefault-real-8 -fdefault-integer-8
-endif
-#========================================================================
OPTIMIZE_FLAG = -O2
-STD_DEFINES =
+STD_DEFINES = -DVERBOSE
-CFLAGS = $(OPTIMIZE_FLAG) $(CCOPTIONS) $(STD_DEFINES) $(LOC_EXOII_INC) $(NETCDF_INC)
-FFLAGS = $(OPTIMIZE_FLAG) $(F77OPTIONS) $(LOC_EXOII_INC) $(F77PREC) -DADDC_
-# Use include files locates in exodus/cbind/include
-LOC_EXOII_INC = -I../../cbind/include -I../../forbind/include
+CFLAGS = $(OPTIMIZE_FLAG) $(CCOPTIONS) $(STD_DEFINES) $(LOC_EXOII_INC) $(NETCDF_INC) $(NETCDF_YES_NO)
+FFLAGS = $(OPTIMIZE_FLAG) $(F77OPTIONS) $(LOC_EXOII_INC) $(F77PREC)
-NETCDF_INC = -I/Users/gdsjaar/src/SEACAS.git/include
+# Use include files locates in exodusii/cbind/include
+LOC_EXOII_INC = -I../../cbind/include -I../../forbind/include
-NETCDF_LIB_DIR = /Users/gdsjaar/src/SEACAS.git/lib
-NETCDF_LIB = -L$(NETCDF_LIB_DIR) -lnetcdf
SUBDIRS = cbind/src forbind/src cbind/test forbind/test
-all:: libexodus.a libexoIIv2for.a
+all:: libexodus.a libexoIIv2for.a
libexodus.a::
echo "making exodus in cbind/src"
@@ -215,20 +217,20 @@ libexodus.a::
libexoIIv2for.a::
echo "making exoIIv2for in forbind/src"
- (cd forbind/src && $(MAKE) $(MFLAGS) -f Makefile.standalone "BITS=$(BITS)" "AR=$(AR)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "FC=$(FC)" "FFLAGS=$(FFLAGS)" "RANLIB=$(RANLIB)" "SYSTEM=$(SYSTEM)" "OS_TYPE=$(OS_TYPE)" libexoIIv2for.a)
+ (cd forbind/src && $(MAKE) $(MFLAGS) -f Makefile.standalone "AR=$(AR)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "FC=$(FC)" "FFLAGS=$(FFLAGS)" "RANLIB=$(RANLIB)" "SYSTEM=$(SYSTEM)" libexoIIv2for.a)
cp forbind/src/libexoIIv2for.a .
$(RANLIB) libexoIIv2for.a
check: test
-test:: libexodus.a libexoIIv2for.a
+test:: libexodus.a libexoIIv2for.a
test::
echo "making test in cbind/test"
- (cd cbind/test && $(MAKE) $(MFLAGS) -f Makefile.standalone "AR=$(AR)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "LDFLAGS=$(LDFLAGS)" "RANLIB=$(RANLIB)" "NETCDF_LIB=$(NETCDF_LIB)" all)
+ (cd cbind/test && $(MAKE) $(MFLAGS) -f Makefile.standalone "AR=$(AR)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "LDFLAGS=$(LDFLAGS)" "RANLIB=$(RANLIB)" all)
test::
echo "making test in forbind/test"
- (cd forbind/test && $(MAKE) $(MFLAGS) -f Makefile.standalone "BITS=$(BITS)" "AR=$(AR)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "FC=$(FC)" "FFLAGS=$(FFLAGS)" "LDFLAGS=$(LDFLAGS)" "RANLIB=$(RANLIB)" "NETCDF_LIB=$(NETCDF_LIB)" "SYSTEM=$(SYSTEM)" all)
+ (cd forbind/test && $(MAKE) $(MFLAGS) -f Makefile.standalone "AR=$(AR)" "CC=$(CC)" "CFLAGS=$(CFLAGS)" "FC=$(FC)" "FFLAGS=$(FFLAGS)" "LDFLAGS=$(LDFLAGS)" "RANLIB=$(RANLIB)" all)
clean::
@for flag in $(MAKEFLAGS) ''; do \
diff --git a/exodus/README b/exodus/README
index 60777d9..e31158d 100644
--- a/exodus/README
+++ b/exodus/README
@@ -85,13 +85,24 @@ netcdf-4.1.2 or later:
#define NC_MAX_VARS 524288 /* max variables per file */
#define NC_MAX_VAR_DIMS 8 /* max per variable dimensions */
-
If these changes are not made, the exodus library will still function
for "normal" size models, but it will fail for "large" models. The
error message from exodus/netcdf should be somewhat clear when this
happens...
-2. When running the netcdf tests, you may have to do "unlimit
+2. I typically configure netcdf as follows:
+
+./configure --enable-netcdf-4 --disable-f77 --disable-f90 --disable-fsync --disable-dap --disable-cdmremote
+
+Replace "--enable-netcdf-4" with "--disable-netcdf-4" to not use the
+netcdf4 extensions. They are not necessarily needed for exodus, but
+will provide compression, larger model sizes, and may be faster in
+some cases.
+
+The --disable-f77 --disable-f90 are not needed for netcdf-4.2 or
+later.
+
+3. When running the netcdf tests, you may have to do "unlimit
stacksize" (csh/tcsh) to avoid some failures due to the increased define sizes
above.
diff --git a/exodus/cbind/CMakeLists.txt b/exodus/cbind/CMakeLists.txt
index 48adf0b..d556f01 100644
--- a/exodus/cbind/CMakeLists.txt
+++ b/exodus/cbind/CMakeLists.txt
@@ -1,41 +1,4 @@
-find_path( NETCDF_INCLUDE_DIR netcdf.h
- $ENV{ACCESS}/inc
- $ENV{NETCDF_DIR}/inc
- $ENV{NETCDF_DIR}/include
- $ENV{NETCDF_DIR}/libsrc
- )
-
-find_library( NETCDF_LIBRARY netcdf
- $ENV{ACCESS}/lib/shared
- $ENV{ACCESS}/lib
- $ENV{NETCDF_DIR}/lib
- $ENV{NETCDF_DIR}/libsrc/.libs
- )
-
-find_program (NETCDF_NCDUMP ncdump
- $ENV{ACCESS}/bin
- $ENV{NETCDF_DIR}/bin
- $ENV{NETCDF_DIR}/ncdump
- )
-
-# Hack for HDF5
-find_library( HDF5_LIBRARY hdf5
- $ENV{ACCESS}/lib/shared
- $ENV{ACCESS}/lib
- $ENV{NETCDF_DIR}/lib
- $ENV{NETCDF_DIR}/libsrc/.libs
- /usr/local/hdf5/lib
- )
-find_library( HDF5HL_LIBRARY hdf5_hl
- $ENV{ACCESS}/lib/shared
- $ENV{ACCESS}/lib
- $ENV{NETCDF_DIR}/lib
- $ENV{NETCDF_DIR}/libsrc/.libs
- /usr/local/hdf5/lib
- )
-
-
INCLUDE(CheckIncludeFile)
CHECK_INCLUDE_FILE( malloc.h EX_HAVE_MALLOC_H )
@@ -51,186 +14,261 @@ INCLUDE_DIRECTORIES(
)
SET(cbind_SRCS
-src/ex_conv.c
-src/ex_utils.c
-src/exclos.c
-src/excn2s.c
-src/excopy.c
-src/excre.c
-src/exerr.c
-src/exgatm.c
-src/exgatn.c
-src/exgatt.c
-src/exgattp.c
-src/exgblk.c
-src/exgcns.c
-src/exgcon.c
-src/exgconn.c
-src/exgcor.c
-src/exgcset.c
-src/exgcss.c
-src/exgcssc.c
-src/exgean.c
-src/exgeat.c
-src/exgebi.c
-src/exgecpp.c
-src/exgelb.c
-src/exgelc.c
-src/exgem.c
-src/exgenm.c
-src/exgev.c
-src/exgevid.c
-src/exgevt.c
-src/exgfrm.c
-src/exggv.c
-src/exggvt.c
-src/exgidm.c
-src/exgids.c
-src/exginf.c
-src/exgini.c
-src/exginix.c
-src/exgmap.c
-src/exgmp.c
-src/exgnam.c
-src/exgnams.c
-src/exgnconn.c
-src/exgncor.c
-src/exgnm.c
-src/exgnmap.c
-src/exgnnm.c
-src/exgnnv.c
-src/exgnoatt.c
-src/exgnp.c
-src/exgns.c
-src/exgnsd.c
-src/exgnsi.c
-src/exgnstt.c
-src/exgnsv.c
-src/exgnsvid.c
-src/exgnv.c
-src/exgnvar.c
-src/exgnvid.c
-src/exgnvt.c
-src/exgnvv.c
-src/exgoatt.c
-src/exgoea.c
-src/exgotv.c
-src/exgp.c
-src/exgpa.c
-src/exgpem.c
-src/exgpn.c
-src/exgqa.c
-src/exgset.c
-src/exgsetd.c
-src/exgsetp.c
-src/exgsnl.c
-src/exgsp.c
-src/exgss.c
-src/exgssc.c
-src/exgssd.c
-src/exgssi.c
-src/exgssn.c
-src/exgsstt.c
-src/exgssv.c
-src/exgssvid.c
-src/exgtim.c
-src/exgtt.c
-src/exgvan.c
-src/exgvar.c
-src/exgvarnam.c
-src/exgvarnams.c
-src/exgvarparam.c
-src/exgvart.c
-src/exgvartab.c
-src/exgvid.c
-src/exgvnm.c
-src/exgvp.c
-src/exgvtt.c
-src/exgvv.c
-src/exinq.c
-src/exopen.c
-src/exopts.c
-src/expatn.c
-src/expatt.c
-src/expattp.c
-src/expblk.c
-src/expcab.c
-src/expclb.c
-src/expcns.c
-src/expcon.c
-src/expconn.c
-src/expcor.c
-src/expcset.c
-src/expcss.c
-src/expean.c
-src/expeat.c
-src/expecpp.c
-src/expelb.c
-src/expelc.c
-src/expem.c
-src/expenm.c
-src/expev.c
-src/expfrm.c
-src/expgv.c
-src/expidm.c
-src/expinf.c
-src/expini.c
-src/expinix.c
-src/expmap.c
-src/expmp.c
-src/expnam.c
-src/expnams.c
-src/expncor.c
-src/expnm.c
-src/expnmap.c
-src/expnnm.c
-src/expnnv.c
-src/expnoatt.c
-src/expnp.c
-src/expns.c
-src/expnsd.c
-src/expnstt.c
-src/expnsv.c
-src/expnv.c
-src/expnvar.c
-src/expnvv.c
-src/expoatt.c
-src/expoea.c
-src/expp.c
-src/exppa.c
-src/exppem.c
-src/exppn.c
-src/exppsetd.c
-src/expqa.c
-src/expset.c
-src/expsetd.c
-src/expsetp.c
-src/expsp.c
-src/expss.c
-src/expssd.c
-src/expsstt.c
-src/expssv.c
-src/exptim.c
-src/exptt.c
-src/expvan.c
-src/expvar.c
-src/expvarnam.c
-src/expvarnams.c
-src/expvarparam.c
-src/expvartab.c
-src/expvnm.c
-src/expvp.c
-src/expvpa.c
-src/expvpax.c
-src/expvpc.c
-src/expvtt.c
-src/expvv.c
-src/exupda.c
+ src/ex_close.c
+ src/ex_conv.c
+ src/ex_copy.c
+ src/ex_create.c
+ src/ex_cvt_nodes_to_sides.c
+ src/ex_err.c
+ src/ex_get_all_times.c
+ src/ex_get_attr.c
+ src/ex_get_attr_names.c
+ src/ex_get_attr_param.c
+ src/ex_get_block.c
+ src/ex_get_block_param.c
+ src/ex_get_cmap_params.c
+ src/ex_get_concat_node_sets.c
+ src/ex_get_concat_sets.c
+ src/ex_get_concat_side_set_node_count.c
+ src/ex_get_concat_side_sets.c
+ src/ex_get_conn.c
+ src/ex_get_coord.c
+ src/ex_get_coord_names.c
+ src/ex_get_coordinate_frames.c
+ src/ex_get_eb_info_global.c
+ src/ex_get_elem_attr.c
+ src/ex_get_elem_attr_names.c
+ src/ex_get_elem_blk_ids.c
+ src/ex_get_elem_block.c
+ src/ex_get_elem_cmap.c
+ src/ex_get_elem_conn.c
+ src/ex_get_elem_map.c
+ src/ex_get_elem_num_map.c
+ src/ex_get_elem_type.c
+ src/ex_get_elem_var.c
+ src/ex_get_elem_var_tab.c
+ src/ex_get_elem_var_time.c
+ src/ex_get_entity_count_per_polyhedra.c
+ src/ex_get_glob_var_time.c
+ src/ex_get_glob_vars.c
+ src/ex_get_id_map.c
+ src/ex_get_ids.c
+ src/ex_get_info.c
+ src/ex_get_init.c
+ src/ex_get_init_ext.c
+ src/ex_get_init_global.c
+ src/ex_get_init_info.c
+ src/ex_get_loadbal_param.c
+ src/ex_get_map.c
+ src/ex_get_map_param.c
+ src/ex_get_n_attr.c
+ src/ex_get_n_conn.c
+ src/ex_get_n_coord.c
+ src/ex_get_n_elem_attr.c
+ src/ex_get_n_elem_conn.c
+ src/ex_get_n_elem_num_map.c
+ src/ex_get_n_elem_var.c
+ src/ex_get_n_nodal_var.c
+ src/ex_get_n_node_num_map.c
+ src/ex_get_n_node_set.c
+ src/ex_get_n_node_set_df.c
+ src/ex_get_n_one_attr.c
+ src/ex_get_n_side_set.c
+ src/ex_get_n_side_set_df.c
+ src/ex_get_n_var.c
+ src/ex_get_name.c
+ src/ex_get_names.c
+ src/ex_get_nodal_var.c
+ src/ex_get_nodal_var_time.c
+ src/ex_get_node_cmap.c
+ src/ex_get_node_map.c
+ src/ex_get_node_num_map.c
+ src/ex_get_node_set.c
+ src/ex_get_node_set_dist_fact.c
+ src/ex_get_node_set_ids.c
+ src/ex_get_node_set_param.c
+ src/ex_get_ns_param_global.c
+ src/ex_get_nset_var.c
+ src/ex_get_nset_var_tab.c
+ src/ex_get_num_map.c
+ src/ex_get_object_truth_vector.c
+ src/ex_get_one_attr.c
+ src/ex_get_one_elem_attr.c
+ src/ex_get_partial_attr.c
+ src/ex_get_partial_conn.c
+ src/ex_get_partial_coord.c
+ src/ex_get_partial_elem_attr.c
+ src/ex_get_partial_elem_conn.c
+ src/ex_get_partial_elem_map.c
+ src/ex_get_partial_elem_num_map.c
+ src/ex_get_partial_elem_var.c
+ src/ex_get_partial_id_map.c
+ src/ex_get_partial_nodal_var.c
+ src/ex_get_partial_node_num_map.c
+ src/ex_get_partial_node_set.c
+ src/ex_get_partial_node_set_df.c
+ src/ex_get_partial_num_map.c
+ src/ex_get_partial_one_attr.c
+ src/ex_get_partial_set_dist_fact.c
+ src/ex_get_partial_side_set.c
+ src/ex_get_partial_side_set_df.c
+ src/ex_get_partial_var.c
+ src/ex_get_processor_elem_maps.c
+ src/ex_get_processor_node_maps.c
+ src/ex_get_prop.c
+ src/ex_get_prop_array.c
+ src/ex_get_prop_names.c
+ src/ex_get_qa.c
+ src/ex_get_set.c
+ src/ex_get_set_dist_fact.c
+ src/ex_get_set_param.c
+ src/ex_get_sets.c
+ src/ex_get_side_set.c
+ src/ex_get_side_set_dist_fact.c
+ src/ex_get_side_set_ids.c
+ src/ex_get_side_set_node_count.c
+ src/ex_get_side_set_node_list.c
+ src/ex_get_side_set_node_list_len.c
+ src/ex_get_side_set_param.c
+ src/ex_get_ss_param_global.c
+ src/ex_get_sset_var.c
+ src/ex_get_sset_var_tab.c
+ src/ex_get_time.c
+ src/ex_get_truth_table.c
+ src/ex_get_var.c
+ src/ex_get_var_name.c
+ src/ex_get_var_names.c
+ src/ex_get_var_param.c
+ src/ex_get_var_tab.c
+ src/ex_get_var_time.c
+ src/ex_get_variable_name.c
+ src/ex_get_variable_names.c
+ src/ex_get_variable_param.c
+ src/ex_inquire.c
+ src/ex_ne_util.c
+ src/ex_open.c
+ src/ex_opts.c
+ src/ex_put_all_var_param.c
+ src/ex_put_all_var_param_ext.c
+ src/ex_put_attr.c
+ src/ex_put_attr_names.c
+ src/ex_put_attr_param.c
+ src/ex_put_block.c
+ src/ex_put_block_param.c
+ src/ex_put_cmap_params.c
+ src/ex_put_cmap_params_cc.c
+ src/ex_put_concat_all_blocks.c
+ src/ex_put_concat_elem_block.c
+ src/ex_put_concat_node_sets.c
+ src/ex_put_concat_sets.c
+ src/ex_put_concat_side_sets.c
+ src/ex_put_concat_var_param.c
+ src/ex_put_conn.c
+ src/ex_put_coord.c
+ src/ex_put_coord_names.c
+ src/ex_put_coordinate_frames.c
+ src/ex_put_eb_info_global.c
+ src/ex_put_elem_attr.c
+ src/ex_put_elem_attr_names.c
+ src/ex_put_elem_block.c
+ src/ex_put_elem_cmap.c
+ src/ex_put_elem_conn.c
+ src/ex_put_elem_map.c
+ src/ex_put_elem_num_map.c
+ src/ex_put_elem_var.c
+ src/ex_put_elem_var_slab.c
+ src/ex_put_elem_var_tab.c
+ src/ex_put_entity_count_per_polyhedra.c
+ src/ex_put_glob_vars.c
+ src/ex_put_id_map.c
+ src/ex_put_info.c
+ src/ex_put_init.c
+ src/ex_put_init_ext.c
+ src/ex_put_init_global.c
+ src/ex_put_init_info.c
+ src/ex_put_loadbal_param.c
+ src/ex_put_loadbal_param_cc.c
+ src/ex_put_map.c
+ src/ex_put_map_param.c
+ src/ex_put_n_attr.c
+ src/ex_put_n_coord.c
+ src/ex_put_n_elem_attr.c
+ src/ex_put_n_elem_conn.c
+ src/ex_put_n_elem_num_map.c
+ src/ex_put_n_nodal_var.c
+ src/ex_put_n_node_num_map.c
+ src/ex_put_n_node_set.c
+ src/ex_put_n_node_set_df.c
+ src/ex_put_n_one_attr.c
+ src/ex_put_n_side_set.c
+ src/ex_put_n_side_set_df.c
+ src/ex_put_n_var.c
+ src/ex_put_name.c
+ src/ex_put_names.c
+ src/ex_put_nodal_var.c
+ src/ex_put_nodal_var_slab.c
+ src/ex_put_node_cmap.c
+ src/ex_put_node_map.c
+ src/ex_put_node_num_map.c
+ src/ex_put_node_set.c
+ src/ex_put_node_set_dist_fact.c
+ src/ex_put_node_set_param.c
+ src/ex_put_ns_param_global.c
+ src/ex_put_nset_var.c
+ src/ex_put_nset_var_tab.c
+ src/ex_put_num_map.c
+ src/ex_put_one_attr.c
+ src/ex_put_one_elem_attr.c
+ src/ex_put_partial_attr.c
+ src/ex_put_partial_coord.c
+ src/ex_put_partial_elem_attr.c
+ src/ex_put_partial_elem_conn.c
+ src/ex_put_partial_elem_map.c
+ src/ex_put_partial_elem_num_map.c
+ src/ex_put_partial_id_map.c
+ src/ex_put_partial_nodal_var.c
+ src/ex_put_partial_node_num_map.c
+ src/ex_put_partial_node_set.c
+ src/ex_put_partial_node_set_df.c
+ src/ex_put_partial_num_map.c
+ src/ex_put_partial_one_attr.c
+ src/ex_put_partial_set.c
+ src/ex_put_partial_set_dist_fact.c
+ src/ex_put_partial_side_set.c
+ src/ex_put_partial_side_set_df.c
+ src/ex_put_partial_var.c
+ src/ex_put_processor_elem_maps.c
+ src/ex_put_processor_node_maps.c
+ src/ex_put_prop.c
+ src/ex_put_prop_array.c
+ src/ex_put_prop_names.c
+ src/ex_put_qa.c
+ src/ex_put_set.c
+ src/ex_put_set_dist_fact.c
+ src/ex_put_set_param.c
+ src/ex_put_sets.c
+ src/ex_put_side_set.c
+ src/ex_put_side_set_dist_fact.c
+ src/ex_put_side_set_param.c
+ src/ex_put_ss_param_global.c
+ src/ex_put_sset_var.c
+ src/ex_put_sset_var_tab.c
+ src/ex_put_time.c
+ src/ex_put_truth_table.c
+ src/ex_put_var.c
+ src/ex_put_var_name.c
+ src/ex_put_var_names.c
+ src/ex_put_var_param.c
+ src/ex_put_var_tab.c
+ src/ex_put_variable_name.c
+ src/ex_put_variable_names.c
+ src/ex_put_variable_param.c
+ src/ex_update.c
+ src/ex_utils.c
)
SET(cbind_HEADERS
include/exodusII.h
- include/exodusII_ext.h
include/exodusII_int.h
)
diff --git a/exodus/cbind/include/Imakefile b/exodus/cbind/include/Imakefile
index 01b49eb..656d053 100644
--- a/exodus/cbind/include/Imakefile
+++ b/exodus/cbind/include/Imakefile
@@ -1,5 +1,8 @@
-INCLIST=exodusII.h exodusII_int.h exodusII_ext.h
-
+INCLIST=exodusII.h exodusII_int.h
InstallIncludeList(install,$(INCLIST),$(INCDIR))
+#if defined(BuildParallelAwareExodus)
+INCLISTP=exodusII_par.h
+InstallIncludeList(install,$(INCLISTP),$(INCDIR))
+#endif
diff --git a/exodus/cbind/include/doxygen.h b/exodus/cbind/include/doxygen.h
index 4030fb6..0098837 100644
--- a/exodus/cbind/include/doxygen.h
+++ b/exodus/cbind/include/doxygen.h
@@ -2,22 +2,22 @@
\section intro Introduction
-EXODUS II is the successor of the widely used finite element (FE) data file format EXODUS
+EXODUS is the successor of the widely used finite element (FE) data file format EXODUS
(henceforth referred to as EXODUS I) developed by Mills-Curran and Flanagan. It
continues the concept of a common database for multiple application codes (mesh generators,
analysis codes, visualization software, etc.) rather than code-specific utilities, affording
flexibility and robustness for both the application code developer and application code user.
-By using the EXODUS II data model, a user inherits the flexibility of using a large array of
+By using the EXODUS data model, a user inherits the flexibility of using a large array of
application codes (including vendor-supplied codes) which access this common data file
directly or via translators.
-The uses of the EXODUS II data model include the following:
+The uses of the EXODUS data model include the following:
- Problem definition -- mesh generation, specification of locations of boundary conditions and load application, specification of material types.
- Simulation -- model input and results output.
- Visualization -- model verification, results postprocessing, data interrogation, and analysis tracking.
\section avail License and Availability
-The EXODUS II library is licensed under the BSD open source license.
+The EXODUS library is licensed under the BSD open source license.
Copyright (c) 2005 Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000
with Sandia Corporation, the U.S. Government retains certain rights in this software.
@@ -52,10 +52,10 @@ For bug reports, documentation errors, and enhancement suggestions, contact:
- PHONE: (505) 844-2701
- EMAIL: gdsjaar at sandia.gov
-\section devel Development of EXODUS II
+\section devel Development of EXODUS
The evolution of the EXODUS data model has been steered by FE application code developers
-who desire the advantages of a common data format. The EXODUS II model has been
+who desire the advantages of a common data format. The EXODUS model has been
designed to overcome deficiencies in the EXODUS I file format and meet the following
functional requirements as specified by these developers:
- Random read/write access.
@@ -73,12 +73,12 @@ interacts with the data model using the vocabulary of an FE analyst
(element connectivity, nodal coordinates, etc.) and is relieved of the
details of the data access mechanism.
-Because an EXODUS II file is a netCDF file, an application program can
-access data via the EXODUS II API or the netCDF API directly. Although
+Because an EXODUS file is a netCDF file, an application program can
+access data via the EXODUS API or the netCDF API directly. Although
accessing the data directly via the netCDF API requires more in-depth
understanding of netCDF, this capability is a powerful feature that
allows the development of auxiliary libraries of special purpose
-functions not offered in the standard EXODUS II library. For example,
+functions not offered in the standard EXODUS library. For example,
if an application required access to the coordinates of a single node
(the standard library function returns the coordinates for all of the
nodes in the model), a simple function could be written that calls
@@ -86,7 +86,7 @@ netCDF routines directly to read the data of interest.
\section descrip Description of Data Objects
-The data in EXODUS II files can be divided into three primary
+The data in EXODUS files can be divided into three primary
categories: initialization data, model, and results.
Initialization data includes sizing parameters (number of nodes,
@@ -123,12 +123,140 @@ A few conventions and limitations must be cited:
increase monotonically.
- To output results at different frequencies (i.e., variable A at
every simulation time step, variable B at every other time step)
- multiple EXODUS II files must be used.
+ multiple EXODUS files must be used.
- There are no limits to the number of each type of results, but once
declared, the number cannot change.
- If the mesh geometry or topology changes in time (i.e., number of
nodes increases, connectivity changes), then the new geometrymust be
- output to a new EXODUS II file.
+ output to a new EXODUS file.
+
+\section int64 Integer Bulkdata Storage Details
+
+The EXODUS database can store integer bulk data, entity map data, and
+mesh entity (block/set) ids in either 32-bit or 64-bit integer format. The data
+considered "bulk data" are:
+
+ - element, face, and edge connectivity lists,
+ - element, face, edge, and node set entity lists,
+
+The entity map data is any data stored in one of the 'map' objects on
+the exodus file. This includes:
+ - id maps
+ - number maps
+ - order maps
+ - processor node maps
+ - processor element maps.
+
+A mesh entity id is the id of any block (element block, edge block,
+...); set (node set, face set, ...), coordinate frame, and
+communication map.
+
+When an EXODUS file is created via the ex_create() function, the
+'mode' argument provides the mechanism for specifying how integer data
+will be passed as arguments to the API functions and also how the
+integer data will be stored on the database. The ex_open() function
+also provides a mechanism for specifying how integer data will be
+passed as arguments.
+
+The method uses the 'mode' argument to the ex_open() and
+ex_create() functions. The mode is a 32-bit integer in which certain
+bits are turned on by or'ing certain predefined constants.
+
+exoid = ex_create( EX_TEST_FILENAME,
+ EX_CLOBBER|EX_MAPS_INT64_DB|EX_MAPS_INT64_API,
+ &appWordSize, &diskWordSize );
+
+The constants related to the integer size (32-bit or 64-bit)
+specification are:
+
+- EX_MAPS_INT64_DB -- entity map data
+- EX_IDS_INT64_DB -- mesh entity ids
+- EX_BULK_INT64_DB -- bulk data
+- EX_ALL_INT64_DB -- (the above 3 or'd together)
+- EX_MAPS_INT64_API -- entity map data
+- EX_IDS_INT64_API -- mesh entity ids
+- EX_BULK_INT64_API -- bulk data
+- EX_ALL_INT64_API -- (the above 3 or'd together)
+
+The constants that end with "_DB" specify that that particular integer
+data is stored on the database as 64-bit integers; the constants that
+end with "_API" specify that that particular integer data is passed
+to/from API functions as 64-bit integers.
+
+If the range of the data being transmitted is larger than the
+permitted integer range (for example, if the data is stored on the
+database as 64-bit ints and the application specifies passing data as
+32-bit ints), the api function will return an error.
+
+The three types of integer data whose storage can be specified are
+- maps (EX_MAPS_INT64_),
+- "bulk data" including connectivity lists and entity lists (EX_BULK_INT64_), and
+- entity ids which are the ids of element, face, edge, and node sets
+ and blocks; and map ids (EX_IDS_INT64_)
+
+The function ex_int64_status(exoid) is used to determine the integer
+storage types being used for the EXODUS database 'exoid'. It returns
+an integer which can be and'ed with the above flags to determine
+either the storage type or function parameter type.
+
+For example, if
+(EX_MAPS_INT64_DB \& ex_int64_status(exoid)) is true, then map data is
+being stored as 64-bit integers for that database.
+
+It is not possible to determine the integer data size on a database
+without opening the database via an ex_open() call. However, the
+integer size specification for API functions can be changed at any
+time via the ex_set_int64_status(exoid, mode) function. The mode is
+one or more of EX_MAPS_INT64_API, EX_IDS_INT64_API, or
+EX_BULK_INT64_API, or'd together. Any exodus function calls after
+that point will use the specified integer size. Note that a call to
+ex_set_int64_status(exoid, mode) overrides any previous setting for
+the integer sizes used in the API. The ex_create() function is the
+only way to specify the integer sizes specification for database
+integers.
+
+\subsection int64_fortran_api Fortran API
+The fortran api is uses the same mechanism as was described above for
+the C API. If using the "8-byte real and 8-byte int" fortran mode
+typically used by the SEACAS applications (the compiler automatically
+promotes all integers and reals to 8-byte quantities), then the
+fortran exodus library will automatically enable the *_API
+options; the client still needs to specify the *_DB options.
+
+\subsection int64_fortran_imp Fortran Implementation
+
+The new capability to pass 64-bit integer data through the fortran and
+C API functions simplifies the implementation of the "8-byte real
+8-byte int" usage of the exodus library. Previously, the wrapper
+routines in addrwrap.F were required to convert the 8-byte integer
+data on the client side to/from 4-byte integers on the library
+side. This required extra memory allocation and complications that are
+now handled at the lowest level in the netcdf library. The
+map-related functions in the fortran api have all been converted to
+pass 64-bit integers down to the C API which has removed some code and
+simplified those functions.
+
+
+\section Database Options (Compression, Name Length, File Type)
+
+The ex_set_option() function call is used to set various options on the
+database. Valid values for 'option' are:
+
+| Option Name | Option Values
+-------------------------|---------------
+| EX_OPT_MAX_NAME_LENGTH | Maximum length of names that will be returned/passed via api call.
+| EX_OPT_COMPRESSION_TYPE | Not currently used; default is gzip
+| EX_OPT_COMPRESSION_LEVEL | In the range [0..9]. A value of 0 indicates no compression
+| EX_OPT_COMPRESSION_SHUFFLE | 1 if enabled, 0 if disabled
+| EX_OPT_INTEGER_SIZE_API | 4 or 8 indicating byte size of integers used in api functions.
+| EX_OPT_INTEGER_SIZE_DB | Query only, returns 4 or 8 indicating byte size of integers stored on database.
+
+The compression-related options are only available on netcdf-4 files
+since the underlying hdf5 compression functionality is used for the
+implementation. The compression level indicates how much effort should
+be expended in the compression and the computational expense increases
+with higher levels; in many cases, a compression level of 1 is
+sufficient.
\defgroup ResultsData Results Data
@{
diff --git a/exodus/cbind/include/exodusII.h b/exodus/cbind/include/exodusII.h
index 4fe237d..6560aa0 100644
--- a/exodus/cbind/include/exodusII.h
+++ b/exodus/cbind/include/exodusII.h
@@ -44,13 +44,26 @@
#define EXODUS_II_HDR
#include "netcdf.h"
-#include "stddef.h"
+
+#if defined(PARALLEL_AWARE_EXODUS)
+#include "netcdf_par.h"
+#endif
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdint.h>
+
+#ifndef NC_INT64
+#error "NetCDF version 4.1.2 or later is required."
+#endif
/* EXODUS II version number */
-#define EX_API_VERS 5.14f
-#define EX_API_VERS_NODOT 514
+#define EX_API_VERS 5.24f
+#define EX_API_VERS_NODOT 524
#define EX_VERS EX_API_VERS
-
+#define NEMESIS_API_VERSION EX_API_VERS
+#define NEMESIS_API_VERSION_NODOT EX_API_VERS_NODOT
+#define NEMESIS_FILE_VERSION 2.6
/*
* need following extern if this include file is used in a C++
@@ -77,17 +90,38 @@ extern "C" {
* \defgroup FileVars Variables controlling the file creation mode.
*@{
*/
-#define EX_NOCLOBBER 0 /**< Don't overwrite existing database, default */
-#define EX_CLOBBER 1 /**< Overwrite existing database if it exists */
-#define EX_NORMAL_MODEL 2 /**< disable mods that permit storage of larger models */
-#define EX_LARGE_MODEL 4 /**< enable mods that permit storage of larger models */
-#define EX_NETCDF4 8 /**< use the hdf5-based netcdf4 output */
-#define EX_NOSHARE 16 /**< Do not open netcdf file in "share" mode */
-#define EX_SHARE 32 /**< Do open netcdf file in "share" mode */
-#define EX_NOCLASSIC 64 /**< Do not force netcdf to classic mode in netcdf4 mode */
-
-#define EX_READ 0
-#define EX_WRITE 1
+ /* Modes for ex_open */
+#define EX_READ 0x0000 /**< ex_open(): open file for reading (default) */
+#define EX_WRITE 0x0001 /**< ex_open(): open existing file for appending. */
+
+#define EX_NOCLOBBER 0x0004 /**< Don't overwrite existing database, default */
+#define EX_CLOBBER 0x0008 /**< Overwrite existing database if it exists */
+#define EX_NORMAL_MODEL 0x0010 /**< disable mods that permit storage of larger models */
+#define EX_LARGE_MODEL 0x0020 /**< enable mods that permit storage of larger models */
+#define EX_NETCDF4 0x0040 /**< use the hdf5-based netcdf4 output */
+#define EX_NOSHARE 0x0080 /**< Do not open netcdf file in "share" mode */
+#define EX_SHARE 0x0100 /**< Do open netcdf file in "share" mode */
+#define EX_NOCLASSIC 0x0200 /**< Do not force netcdf to classic mode in netcdf4 mode */
+
+ /* Need to distinguish between storage on database (DB in name) and
+ passed through the API functions (API in name).
+ */
+#define EX_MAPS_INT64_DB 0x0400 /**< All maps (id, order, ...) store int64_t values */
+#define EX_IDS_INT64_DB 0x0800 /**< All entity ids (sets, blocks, maps) are int64_t values */
+#define EX_BULK_INT64_DB 0x1000 /**< All integer bulk data (local indices, counts, maps); not ids */
+#define EX_ALL_INT64_DB (EX_MAPS_INT64_DB|EX_IDS_INT64_DB|EX_BULK_INT64_DB) /**< All of the above... */
+
+#define EX_MAPS_INT64_API 0x2000 /**< All maps (id, order, ...) store int64_t values */
+#define EX_IDS_INT64_API 0x4000 /**< All entity ids (sets, blocks, maps) are int64_t values */
+#define EX_BULK_INT64_API 0x8000 /**< All integer bulk data (local indices, counts, maps); not ids */
+#define EX_INQ_INT64_API 0x10000 /**< Integers passed to/from ex_inquire are int64_t */
+#define EX_ALL_INT64_API (EX_MAPS_INT64_API|EX_IDS_INT64_API|EX_BULK_INT64_API|EX_INQ_INT64_API) /**< All of the above... */
+
+ /* Parallel IO mode flags... */
+#define EX_MPIIO 0x20000
+#define EX_MPIPOSIX 0x40000
+#define EX_PNETCDF 0x80000
+
/*@}*/
/*! \sa ex_inquire() */
@@ -146,7 +180,24 @@ extern "C" {
typedef enum ex_inquiry ex_inquiry;
- /* properties */
+ /* Options */
+ /**
+ * \defgroup FileOptions Variables controlling the compression, name size, and integer size.
+ *@{
+ */
+ /* Modes for ex_open */
+ /*! \sa ex_set_option() */
+ enum ex_option_type {
+ EX_OPT_MAX_NAME_LENGTH = 1,
+ EX_OPT_COMPRESSION_TYPE, /* Currently not used. GZip by default */
+ EX_OPT_COMPRESSION_LEVEL, /* 0 (disabled/fastest) ... 9 (best/slowest) */
+ EX_OPT_COMPRESSION_SHUFFLE, /* 0 (disabled); 1 (enabled) */
+ EX_OPT_INTEGER_SIZE_API, /* See *_INT64_* values above */
+ EX_OPT_INTEGER_SIZE_DB /* (query only) */
+ };
+ typedef enum ex_option_type ex_option_type;
+ /*@}*/
+
enum ex_entity_type {
EX_NODAL = 14, /**< nodal "block" for variables*/
EX_NODE_BLOCK = 14, /**< alias for EX_NODAL */
@@ -202,89 +253,164 @@ extern "C" {
#define MAX_ERR_LENGTH 256
/* @} */
+ /** Specifies that this argument is the id of an entity: element block, nodeset, sideset, ... */
+ typedef int64_t ex_entity_id;
+
+ /** The mechanism for passing double/float and int/int64_t both use a
+ void*; to avoid some confusion as to whether a function takes an
+ integer or a float/double, the following typedef is used for the
+ integer argument
+ */
+ typedef void void_int;
+
+ /**
+ * \defgroup APIStructs Structures used by external API functions.
+ * @{
+ */
+ typedef struct ex_init_params {
+ char title[MAX_LINE_LENGTH + 1];
+ int64_t num_dim;
+ int64_t num_nodes;
+ int64_t num_edge;
+ int64_t num_edge_blk;
+ int64_t num_face;
+ int64_t num_face_blk;
+ int64_t num_elem;
+ int64_t num_elem_blk;
+ int64_t num_node_sets;
+ int64_t num_edge_sets;
+ int64_t num_face_sets;
+ int64_t num_side_sets;
+ int64_t num_elem_sets;
+ int64_t num_node_maps;
+ int64_t num_edge_maps;
+ int64_t num_face_maps;
+ int64_t num_elem_maps;
+ } ex_init_params;
+
+ typedef struct ex_block {
+ int64_t id;
+ ex_entity_type type;
+ char topology[MAX_STR_LENGTH+1];
+ int64_t num_entry;
+ int64_t num_nodes_per_entry;
+ int64_t num_edges_per_entry;
+ int64_t num_faces_per_entry;
+ int64_t num_attribute;
+ } ex_block;
+
+ typedef struct ex_set {
+ int64_t id;
+ ex_entity_type type;
+ int64_t num_entry;
+ int64_t num_distribution_factor;
+ void_int* entry_list;
+ void_int* extra_list;
+ void* distribution_factor_list;
+ } ex_set;
+
+ typedef struct ex_block_params {
+ void_int* edge_blk_id;
+ char** edge_type;
+ int* num_edge_this_blk;
+ int* num_nodes_per_edge;
+ int* num_attr_edge;
+ void_int* face_blk_id;
+ char** face_type;
+ int* num_face_this_blk;
+ int* num_nodes_per_face;
+ int* num_attr_face;
+ void_int* elem_blk_id;
+ char** elem_type;
+ int* num_elem_this_blk;
+ int* num_nodes_per_elem;
+ int* num_edges_per_elem;
+ int* num_faces_per_elem;
+ int* num_attr_elem;
+ int define_maps;
+ } ex_block_params;
+
+ typedef struct ex_set_specs {
+ void_int* sets_ids;
+ void_int* num_entries_per_set;
+ void_int* num_dist_per_set;
+ void_int* sets_entry_index;
+ void_int* sets_dist_index;
+ void_int* sets_entry_list;
+ void_int* sets_extra_list;
+ void* sets_dist_fact;
+ } ex_set_specs;
+
+ typedef struct ex_var_params {
+ int num_glob;
+ int num_node;
+ int num_edge;
+ int* edge_var_tab;
+ int num_face;
+ int* face_var_tab;
+ int num_elem;
+ int* elem_var_tab;
+ int num_nset;
+ int* nset_var_tab;
+ int num_eset;
+ int* eset_var_tab;
+ int num_fset;
+ int* fset_var_tab;
+ int num_sset;
+ int* sset_var_tab;
+ int num_elset;
+ int* elset_var_tab;
+ } ex_var_params;
+ /* @} */
+
#ifndef EXODUS_EXPORT
#define EXODUS_EXPORT extern
#endif /* EXODUS_EXPORT */
/* routines for file initialization i/o */
EXODUS_EXPORT int ex_close (int exoid);
- EXODUS_EXPORT int ex_cvt_nodes_to_sides(int exoid, int *num_elem_per_set,
- int *num_nodes_per_set, int *side_sets_elem_index,
- int *side_sets_node_index, int *side_sets_elem_list,
- int *side_sets_node_list, int *side_sets_side_list);
+
EXODUS_EXPORT int ex_copy (int in_exoid, int out_exoid);
+
#define ex_create(path, mode, comp_ws, io_ws) ex_create_int(path, mode, comp_ws, io_ws, EX_API_VERS_NODOT)
+
EXODUS_EXPORT int ex_create_int (const char *path, int cmode, int *comp_ws, int *io_ws, int my_version);
- EXODUS_EXPORT int ex_get_all_times (int exoid, void *time_values);
- EXODUS_EXPORT int ex_get_concat_node_sets (int exoid,
- int *node_set_ids,
- int *num_nodes_per_set,
- int *num_df_per_set,
- int *node_sets_node_index,
- int *node_sets_df_index,
- int *node_sets_node_list,
- void *node_sets_dist_fact);
+
+
+ EXODUS_EXPORT int ex_get_all_times (int exoid,
+ void *time_values);
+
EXODUS_EXPORT int ex_get_coord_names (int exoid,
char **coord_names);
+
EXODUS_EXPORT int ex_get_coord (int exoid,
void *x_coor,
void *y_coor,
void *z_coor);
+
EXODUS_EXPORT int ex_get_n_coord (int exoid,
- int start_node_num,
- int num_nodes,
+ int64_t start_node_num,
+ int64_t num_nodes,
void *x_coor,
void *y_coor,
void *z_coor);
- EXODUS_EXPORT int ex_get_concat_side_sets (int exoid,
- int *side_set_ids,
- int *num_elem_per_set,
- int *num_dist_per_set,
- int *side_sets_elem_index,
- int *side_sets_dist_index,
- int *side_sets_elem_list,
- int *side_sets_side_list,
- void *side_sets_dist_fact);
- EXODUS_EXPORT int ex_get_elem_attr_names (int exoid,
- int elem_blk_id,
- char **names);
- EXODUS_EXPORT int ex_get_elem_attr (int exoid,
- int elem_blk_id,
- void *attrib);
- EXODUS_EXPORT int ex_get_ids (int exoid, ex_entity_type obj_type, int *ids);
- EXODUS_EXPORT int ex_get_elem_blk_ids (int exoid, int *ids);
- EXODUS_EXPORT int ex_get_elem_block (int exoid,
- int elem_blk_id,
- char *elem_type,
- int *num_elem_this_blk,
- int *num_nodes_per_elem,
- int *num_attr);
- EXODUS_EXPORT int ex_get_elem_conn (int exoid,
- int elem_blk_id,
- int *connect);
+ EXODUS_EXPORT int ex_get_partial_coord (int exoid,
+ int64_t start_node_num,
+ int64_t num_nodes,
+ void *x_coor,
+ void *y_coor,
+ void *z_coor);
- EXODUS_EXPORT int ex_get_elem_map (int exoid,
- int map_id,
- int *elem_map);
- EXODUS_EXPORT int ex_get_elem_num_map (int exoid,
- int *elem_map);
- EXODUS_EXPORT int ex_get_elem_var (int exoid,
- int time_step,
- int elem_var_index,
- int elem_blk_id,
- int num_elem_this_blk,
- void *elem_var_vals);
- EXODUS_EXPORT int ex_get_elem_varid (int exoid,
- int *varid);
- EXODUS_EXPORT int ex_get_elem_var_time (int exoid,
- int elem_var_index,
- int elem_number,
- int beg_time_step,
- int end_time_step,
- void *elem_var_vals);
- EXODUS_EXPORT int ex_get_coordinate_frames(int exoid, int *nframes, int *cf_ids,
- void* pt_coordinates, char* tags);
+ EXODUS_EXPORT int ex_get_ids (int exoid,
+ ex_entity_type obj_type,
+ void_int *ids);
+
+ EXODUS_EXPORT int ex_get_coordinate_frames(int exoid,
+ int *nframes,
+ void_int *cf_ids,
+ void* pt_coordinates,
+ char* tags);
EXODUS_EXPORT int ex_get_glob_vars (int exoid,
int time_step,
@@ -299,16 +425,27 @@ extern "C" {
EXODUS_EXPORT int ex_get_info (int exoid, char **info);
+ EXODUS_EXPORT int ex_put_init_ext (int exoid, const ex_init_params *param);
+
+ EXODUS_EXPORT int ex_get_init_ext (int exoid, ex_init_params *param);
+
EXODUS_EXPORT int ex_get_init (int exoid,
char *title,
- int *num_dim,
- int *num_nodes,
- int *num_elem,
- int *num_elem_blk,
- int *num_node_sets,
- int *num_side_sets);
+ void_int *num_dim,
+ void_int *num_nodes,
+ void_int *num_elem,
+ void_int *num_elem_blk,
+ void_int *num_node_sets,
+ void_int *num_side_sets);
- EXODUS_EXPORT int ex_get_map (int exoid, int *elem_map);
+ EXODUS_EXPORT int ex_put_init (int exoid,
+ const char *title,
+ int64_t num_dim,
+ int64_t num_nodes,
+ int64_t num_elem,
+ int64_t num_elem_blk,
+ int64_t num_node_sets,
+ int64_t num_side_sets);
EXODUS_EXPORT int ex_get_map_param (int exoid,
int *num_node_maps,
@@ -316,196 +453,89 @@ extern "C" {
EXODUS_EXPORT int ex_get_name (int exoid,
ex_entity_type obj_type,
- int entity_id,
+ ex_entity_id entity_id,
char *name);
EXODUS_EXPORT int ex_get_names (int exoid,
ex_entity_type obj_type,
char **names);
- EXODUS_EXPORT int ex_get_node_map (int exoid,
- int map_id,
- int *node_map);
-
- EXODUS_EXPORT int ex_get_node_num_map (int exoid,
- int *node_map);
-
- EXODUS_EXPORT int ex_get_node_set_param (int exoid,
- int node_set_id,
- int *num_nodes_in_set,
- int *num_df_in_set);
-
- EXODUS_EXPORT int ex_get_node_set (int exoid,
- int node_set_id,
- int *node_set_node_list);
-
- EXODUS_EXPORT int ex_get_node_set_dist_fact (int exoid,
- int node_set_id,
- void *node_set_dist_fact);
-
- EXODUS_EXPORT int ex_get_node_set_ids (int exoid,
- int *ids);
-
EXODUS_EXPORT int ex_get_nset_var_tab (int exoid,
int num_nodesets,
int num_nset_var,
int *nset_var_tab);
- EXODUS_EXPORT int ex_get_nset_var (int exoid,
- int time_step,
- int nset_var_index,
- int nset_id,
- int num_node_this_nset,
- void *nset_var_vals);
-
- EXODUS_EXPORT int ex_get_nset_varid (int exoid,
- int *varid);
-
- EXODUS_EXPORT int ex_get_nodal_var (int exoid,
- int time_step,
- int nodal_var_index,
- int num_nodes,
- void *nodal_var_vals);
-
EXODUS_EXPORT int ex_get_n_nodal_var (int exoid,
int time_step,
int nodal_var_index,
- int start_node,
- int num_nodes,
+ int64_t start_node,
+ int64_t num_nodes,
void *nodal_var_vals);
- EXODUS_EXPORT int ex_get_nodal_varid(int exoid, int *varid);
-
- EXODUS_EXPORT int ex_get_nodal_var_time (int exoid,
- int nodal_var_index,
- int node_number,
- int beg_time_step,
- int end_time_step,
- void *nodal_var_vals);
-
- EXODUS_EXPORT int ex_get_nodal_varid_var(int exoid,
- int time_step,
- int nodal_var_index,
- int num_nodes,
- int varid,
- void *nodal_var_vals);
+ EXODUS_EXPORT int ex_get_partial_nodal_var (int exoid,
+ int time_step,
+ int nodal_var_index,
+ int64_t start_node,
+ int64_t num_nodes,
+ void *nodal_var_vals);
- EXODUS_EXPORT int ex_get_one_elem_attr (int exoid,
- int elem_blk_id,
- int attrib_index,
- void *attrib);
EXODUS_EXPORT int ex_get_prop_array (int exoid,
ex_entity_type obj_type,
const char *prop_name,
- int *values);
+ void_int *values);
EXODUS_EXPORT int ex_get_prop (int exoid,
ex_entity_type obj_type,
- int obj_id,
+ ex_entity_id obj_id,
const char *prop_name,
- int *value);
-
- EXODUS_EXPORT int ex_get_partial_elem_map (int exoid,
- int map_id,
- int ent_start,
- int ent_count,
- int *elem_map);
-
+ void_int *value);
+
+ EXODUS_EXPORT int ex_get_partial_num_map (int exoid,
+ ex_entity_type map_type,
+ ex_entity_id map_id,
+ int64_t ent_start,
+ int64_t ent_count,
+ void_int *elem_map);
+
EXODUS_EXPORT int ex_get_prop_names (int exoid,
ex_entity_type obj_type,
char **prop_names);
EXODUS_EXPORT int ex_get_qa (int exoid,
char *qa_record[][4]);
- EXODUS_EXPORT int ex_get_side_set_node_list_len(int exoid,
- int side_set_id,
- int *side_set_node_list_len);
- EXODUS_EXPORT int ex_get_side_set_param (int exoid,
- int side_set_id,
- int *num_side_in_set,
- int *num_dist_fact_in_set);
- EXODUS_EXPORT int ex_get_side_set (int exoid,
- int side_set_id,
- int *side_set_elem_list,
- int *side_set_side_list);
- EXODUS_EXPORT int ex_get_side_set_node_count(int exoid,
- int side_set_id,
- int *side_set_node_cnt_list);
- EXODUS_EXPORT int ex_get_concat_side_set_node_count(int exoid,
- int *side_set_node_cnt_list);
- EXODUS_EXPORT int ex_get_side_set_dist_fact (int exoid,
- int side_set_id,
- void *side_set_dist_fact);
- EXODUS_EXPORT int ex_get_side_set_ids (int exoid,
- int *ids);
- EXODUS_EXPORT int ex_get_side_set_node_list(int exoid,
- int side_set_id,
- int *side_set_node_cnt_list,
- int *side_set_node_list);
- EXODUS_EXPORT int ex_get_sset_var (int exoid,
- int time_step,
- int sset_var_index,
- int sset_id,
- int num_side_this_sset,
- void *sset_var_vals);
- EXODUS_EXPORT int ex_get_sset_var_tab (int exoid,
- int num_sidesets,
- int num_sset_var,
- int *sset_var_tab);
- EXODUS_EXPORT int ex_get_sset_varid (int exoid,
- int *varid);
EXODUS_EXPORT int ex_get_time (int exoid,
int time_step,
void *time_value);
+
EXODUS_EXPORT int ex_get_variable_names (int exoid,
ex_entity_type obj_type,
int num_vars,
char *var_names[]);
- EXODUS_EXPORT int ex_get_var_names (int exoid,
- const char *var_type,
- int num_vars,
- char *var_names[]);
- EXODUS_EXPORT int ex_get_varid (int exoid, ex_entity_type obj_type,
- int *varid_arr);
EXODUS_EXPORT int ex_get_variable_name (int exoid,
ex_entity_type obj_type,
int var_num,
char *var_name);
- EXODUS_EXPORT int ex_get_var_name (int exoid,
- const char *var_type,
- int var_num,
- char *var_name);
- EXODUS_EXPORT int ex_get_var_param (int exoid,
- const char *var_type,
- int *num_vars);
+
EXODUS_EXPORT int ex_get_variable_param (int exoid,
ex_entity_type obj_type,
int *num_vars);
EXODUS_EXPORT int ex_get_object_truth_vector (int exoid,
ex_entity_type var_type,
- int object_id,
+ ex_entity_id object_id,
int num_var,
int *var_vector);
+
EXODUS_EXPORT int ex_get_truth_table (int exoid,
ex_entity_type obj_type,
int num_blk,
int num_var,
int *var_tab);
- EXODUS_EXPORT int ex_get_var_tab (int exoid,
- const char *var_type,
- int num_blk,
- int num_var,
- int *var_tab);
- EXODUS_EXPORT int ex_get_elem_var_tab (int exoid,
- int num_elem_blk,
- int num_elem_var,
- int *elem_var_tab);
-
#define ex_open(path, mode, comp_ws, io_ws, version) ex_open_int(path, mode, comp_ws, io_ws, version, EX_API_VERS_NODOT)
+
EXODUS_EXPORT int ex_open_int (const char *path,
int mode,
int *comp_ws,
@@ -514,12 +544,12 @@ extern "C" {
EXODUS_EXPORT int ex_put_attr_param (int exoid,
ex_entity_type obj_type,
- int obj_id,
+ ex_entity_id obj_id,
int num_attrs);
EXODUS_EXPORT int ex_get_attr_param (int exoid,
ex_entity_type obj_type,
- int obj_id,
+ ex_entity_id obj_id,
int *num_attrs);
EXODUS_EXPORT int ex_put_all_var_param (int exoid,
@@ -529,286 +559,170 @@ extern "C" {
int num_s, int *sset_var_tab);
EXODUS_EXPORT int ex_put_concat_elem_block (int exoid,
- const int* elem_blk_id,
+ const void_int* elem_blk_id,
char *elem_type[],
- const int* num_elem_this_blk,
- const int* num_nodes_per_elem,
- const int* num_attr,
+ const void_int* num_elem_this_blk,
+ const void_int* num_nodes_per_elem,
+ const void_int* num_attr,
int define_maps);
- EXODUS_EXPORT int ex_put_concat_node_sets (int exoid,
- int *node_set_ids,
- int *num_nodes_per_set,
- int *num_dist_per_set,
- int *node_sets_node_index,
- int *node_sets_df_index,
- int *node_sets_node_list,
- void *node_sets_dist_fact);
-
- EXODUS_EXPORT int ex_put_concat_side_sets (int exoid,
- int *side_set_ids,
- int *num_elem_per_set,
- int *num_dist_per_set,
- int *side_sets_elem_index,
- int *side_sets_dist_index,
- int *side_sets_elem_list,
- int *side_sets_side_list,
- void *side_sets_dist_fact);
-
- EXODUS_EXPORT int ex_put_concat_var_param (int exoid, int num_g, int num_n,
- int num_e, int num_elem_blk, int *elem_var_tab);
-
EXODUS_EXPORT int ex_put_coord_names (int exoid,
char *coord_names[]);
+
EXODUS_EXPORT int ex_put_coord (int exoid,
const void *x_coor,
const void *y_coor,
const void *z_coor);
+
EXODUS_EXPORT int ex_put_n_coord (int exoid,
- int start_node_num,
- int num_nodes,
+ int64_t start_node_num,
+ int64_t num_nodes,
+ const void *x_coor,
+ const void *y_coor,
+ const void *z_coor);
+
+ EXODUS_EXPORT int ex_put_partial_coord (int exoid,
+ int64_t start_node_num,
+ int64_t num_nodes,
const void *x_coor,
const void *y_coor,
const void *z_coor);
- EXODUS_EXPORT int ex_put_elem_attr_names(int exoid,
- int elem_blk_id,
- char *names[]);
- EXODUS_EXPORT int ex_put_elem_attr (int exoid,
- int elem_blk_id,
- const void *attrib);
- EXODUS_EXPORT int ex_put_elem_block (int exoid,
- int elem_blk_id,
- const char *elem_type,
- int num_elem_this_blk,
- int num_nodes_per_elem,
- int num_attr);
- EXODUS_EXPORT int ex_put_elem_conn (int exoid,
- int elem_blk_id,
- const int *connect);
- EXODUS_EXPORT int ex_put_elem_map (int exoid,
- int map_id,
- const int *elem_map);
EXODUS_EXPORT int ex_put_id_map(int exoid,
ex_entity_type obj_type,
- const int *map);
+ const void_int *map);
EXODUS_EXPORT int ex_put_partial_id_map(int exoid,
ex_entity_type obj_type,
- int start_entity_num,
- int num_entities,
- const int *map);
+ int64_t start_entity_num,
+ int64_t num_entities,
+ const void_int *map);
+ EXODUS_EXPORT int ex_put_n_elem_num_map (int exoid,
+ int64_t start_ent,
+ int64_t num_ents,
+ const void_int *map);
+
+ EXODUS_EXPORT int ex_put_n_node_num_map (int exoid,
+ int64_t start_ent,
+ int64_t num_ents,
+ const void_int *map);
+
+ EXODUS_EXPORT int ex_put_partial_elem_num_map (int exoid,
+ int64_t start_ent,
+ int64_t num_ents,
+ const void_int *map);
+
+ EXODUS_EXPORT int ex_put_partial_node_num_map (int exoid,
+ int64_t start_ent,
+ int64_t num_ents,
+ const void_int *map);
+
EXODUS_EXPORT int ex_get_id_map(int exoid,
ex_entity_type obj_type,
- int *map);
+ void_int *map);
- EXODUS_EXPORT int ex_put_elem_num_map (int exoid,
- const int *elem_map);
- EXODUS_EXPORT int ex_put_elem_var (int exoid,
- int time_step,
- int elem_var_index,
- int elem_blk_id,
- int num_elem_this_blk,
- const void *elem_var_vals);
+ EXODUS_EXPORT int ex_get_partial_id_map (int exoid,
+ ex_entity_type map_type,
+ int64_t start_entity_num,
+ int64_t num_entities,
+ void_int* map);
+
+ EXODUS_EXPORT int ex_put_coordinate_frames(int exoid,
+ int nframes,
+ const void_int *cf_ids,
+ void* pt_coordinates,
+ const char* tags);
- EXODUS_EXPORT int ex_put_coordinate_frames(int exoid, int nframes, const int cf_ids[],
- void* pt_coordinates, const char* tags);
- EXODUS_EXPORT int ex_put_glob_vars (int exoid,
- int time_step,
- int num_glob_vars,
- const void *glob_var_vals);
EXODUS_EXPORT int ex_put_info (int exoid,
int num_info,
char *info[]);
- EXODUS_EXPORT int ex_put_init (int exoid,
- const char *title,
- int num_dim,
- int num_nodes,
- int num_elem,
- int num_elem_blk,
- int num_node_sets,
- int num_side_sets);
- EXODUS_EXPORT int ex_put_map (int exoid,
- const int *elem_map);
EXODUS_EXPORT int ex_put_map_param (int exoid,
int num_node_maps,
int num_elem_maps);
+
EXODUS_EXPORT int ex_put_name (int exoid,
ex_entity_type obj_type,
- int entity_id,
+ ex_entity_id entity_id,
const char *name);
+
EXODUS_EXPORT int ex_put_names (int exoid,
ex_entity_type obj_type,
char *names[]);
- EXODUS_EXPORT int ex_put_nodal_var (int exoid,
- int time_step,
- int nodal_var_index,
- int num_nodes,
- const void *nodal_var_vals);
-
- EXODUS_EXPORT int ex_put_n_nodal_var (int exoid,
- int time_step,
- int nodal_var_index,
- int start_node,
- int num_nodes,
- const void *nodal_var_vals);
-
- EXODUS_EXPORT int ex_put_nodal_varid_var(int exoid,
- int time_step,
- int nodal_var_index,
- int num_nodes,
- int varid,
- const void *nodal_var_vals);
-
- EXODUS_EXPORT int ex_put_node_map (int exoid,
- int map_id,
- const int *node_map);
- EXODUS_EXPORT int ex_put_node_num_map (int exoid,
- const int *node_map);
- EXODUS_EXPORT int ex_put_node_set_param (int exoid,
- int node_set_id,
- int num_nodes_in_set,
- int num_dist_in_set);
- EXODUS_EXPORT int ex_put_node_set (int exoid,
- int node_set_id,
- const int *node_set_node_list);
- EXODUS_EXPORT int ex_put_node_set_dist_fact (int exoid,
- int node_set_id,
- const void *node_set_dist_fact);
- EXODUS_EXPORT int ex_put_nset_var (int exoid,
- int time_step,
- int nset_var_index,
- int nset_id,
- int num_nodes_this_nset,
- const void *nset_var_vals);
-
- EXODUS_EXPORT int ex_put_nset_var_tab (int exoid,
- int num_nset,
- int num_nset_var,
- int *nset_var_tab);
- EXODUS_EXPORT int ex_put_one_elem_attr (int exoid,
- int elem_blk_id,
- int attrib_index,
- const void *attrib);
EXODUS_EXPORT int ex_put_n_one_attr( int exoid,
ex_entity_type obj_type,
- int obj_id,
- int start_num,
- int num_ent,
+ ex_entity_id obj_id,
+ int64_t start_num,
+ int64_t num_ent,
int attrib_index,
const void *attrib );
- EXODUS_EXPORT int ex_put_partial_elem_map (int exoid,
- int map_id,
- int ent_start,
- int ent_count,
- const int *elem_map);
-
- EXODUS_EXPORT int ex_put_partial_set_dist_fact (int exoid,
- ex_entity_type set_type,
- int set_id,
- int offset,
- int num_to_put,
- const void *set_dist_fact);
+ EXODUS_EXPORT int ex_put_partial_one_attr( int exoid,
+ ex_entity_type obj_type,
+ ex_entity_id obj_id,
+ int64_t start_num,
+ int64_t num_ent,
+ int attrib_index,
+ const void *attrib );
EXODUS_EXPORT int ex_put_prop (int exoid,
ex_entity_type obj_type,
- int obj_id,
+ ex_entity_id obj_id,
const char *prop_name,
- int value);
+ ex_entity_id value);
EXODUS_EXPORT int ex_put_prop_array (int exoid,
ex_entity_type obj_type,
const char *prop_name,
- const int *values);
+ const void_int *values);
+
EXODUS_EXPORT int ex_put_prop_names (int exoid,
ex_entity_type obj_type,
int num_props,
char **prop_names);
+
EXODUS_EXPORT int ex_put_qa (int exoid,
int num_qa_records,
char* qa_record[][4]);
- EXODUS_EXPORT int ex_put_side_set_param (int exoid,
- int side_set_id,
- int num_side_in_set,
- int num_dist_fact_in_set);
- EXODUS_EXPORT int ex_put_side_set (int exoid,
- int side_set_id,
- const int *side_set_elem_list,
- const int *side_set_side_list);
- EXODUS_EXPORT int ex_put_side_set_dist_fact (int exoid,
- int side_set_id,
- const void *side_set_dist_fact);
- EXODUS_EXPORT int ex_put_sset_var (int exoid,
- int time_step,
- int sset_var_index,
- int sset_id,
- int num_faces_this_sset,
- const void *sset_var_vals);
- EXODUS_EXPORT int ex_put_sset_var_tab (int exoid,
- int num_sset,
- int num_sset_var,
- int *sset_var_tab);
EXODUS_EXPORT int ex_put_time (int exoid,
int time_step,
const void *time_value);
- EXODUS_EXPORT int ex_put_varid_var(int exoid,
- int time_step,
- int varid,
- int num_entity,
- const void *var_vals);
- EXODUS_EXPORT int ex_put_var_names (int exoid,
- const char *var_type,
- int num_vars,
- char *var_names[]);
- EXODUS_EXPORT int ex_put_var_name (int exoid,
- const char *var_type,
- int var_num,
- const char *var_name);
- EXODUS_EXPORT int ex_put_var_param (int exoid,
- const char *var_type,
- int num_vars);
- EXODUS_EXPORT int ex_put_variable_names (int exoid,
- ex_entity_type obj_type,
- int num_vars,
- char* var_names[]);
EXODUS_EXPORT int ex_put_variable_name (int exoid,
ex_entity_type obj_type,
int var_num,
const char *var_name);
- EXODUS_EXPORT int ex_put_variable_param (int exoid,
+
+ EXODUS_EXPORT int ex_put_variable_names (int exoid,
ex_entity_type obj_type,
- int num_vars);
- EXODUS_EXPORT int ex_put_truth_table (int exoid,
+ int num_vars,
+ char* var_names[]);
+
+ EXODUS_EXPORT int ex_put_variable_param (int exoid,
+ ex_entity_type obj_type,
+ int num_vars);
+
+ EXODUS_EXPORT int ex_put_truth_table (int exoid,
ex_entity_type obj_type,
int num_blk,
int num_var,
int *var_tab);
- EXODUS_EXPORT int ex_put_var_tab (int exoid,
- const char *var_type,
- int num_blk,
- int num_var,
- int *var_tab);
-
- EXODUS_EXPORT int ex_put_elem_var_tab (int exoid,
- int num_elem_blk,
- int num_elem_var,
- int *elem_var_tab);
+
EXODUS_EXPORT int ex_update (int exoid);
EXODUS_EXPORT int ex_get_num_props (int exoid, ex_entity_type obj_type);
EXODUS_EXPORT int ex_large_model(int exoid);
EXODUS_EXPORT size_t ex_header_size(int exoid);
- EXODUS_EXPORT void ex_err(const char*, const char*, int);
+ EXODUS_EXPORT void ex_err(const char *module_name, const char *message, int err_num);
EXODUS_EXPORT void ex_get_err(const char** msg, const char** func, int* errcode);
EXODUS_EXPORT void ex_opts(int options);
- EXODUS_EXPORT int ex_inquire(int exoid, int inquiry, int*, void*, char*);
- EXODUS_EXPORT int ex_inquire_int(int exoid, int inquiry);
+ EXODUS_EXPORT int ex_inquire(int exoid, int inquiry, void_int*, float*, char*);
+ EXODUS_EXPORT int64_t ex_inquire_int(int exoid, int inquiry);
+ EXODUS_EXPORT int ex_int64_status(int exoid);
+ EXODUS_EXPORT int ex_set_int64_status(int exoid, int mode);
/** Note that the max name length setting is global at this time; not specific
* to a particular database; however, the exoid option is passed to give
@@ -816,40 +730,1236 @@ extern "C" {
*/
EXODUS_EXPORT int ex_set_max_name_length(int exoid, int length);
- EXODUS_EXPORT int ex_get_varid_var(int exoid,
+ EXODUS_EXPORT int ex_set_option(int exoid, ex_option_type option, int option_value);
+
+ /* Write Node Edge Face or Element Number Map */
+ EXODUS_EXPORT int ex_put_num_map(int exoid,
+ ex_entity_type map_type,
+ ex_entity_id map_id,
+ const void_int *map);
+
+ /* Read Number Map */
+ EXODUS_EXPORT int ex_get_num_map(int exoid,
+ ex_entity_type map_type,
+ ex_entity_id map_id,
+ void_int *map);
+
+ /* Write Edge Face or Element Block Parameters */
+ EXODUS_EXPORT int ex_put_block(int exoid,
+ ex_entity_type blk_type,
+ ex_entity_id blk_id,
+ const char *entry_descrip,
+ int64_t num_entries_this_blk,
+ int64_t num_nodes_per_entry,
+ int64_t num_edges_per_entry,
+ int64_t num_faces_per_entry,
+ int64_t num_attr_per_entry);
+
+
+ /*! \deprecated Use ex_get_block_param() */
+ EXODUS_EXPORT int ex_get_block(int exoid,
+ ex_entity_type blk_type,
+ ex_entity_id blk_id,
+ char *elem_type,
+ void_int *num_entries_this_blk,
+ void_int *num_nodes_per_entry,
+ void_int *num_edges_per_entry,
+ void_int *num_faces_per_entry,
+ void_int *num_attr_per_entry);
+
+ /* Read Edge Face or Element Block Parameters */
+ EXODUS_EXPORT int ex_get_block_param(int exoid,
+ ex_block *block);
+
+ EXODUS_EXPORT int ex_put_block_param(int exoid,
+ const ex_block block);
+
+ /* Write All Edge Face and Element Block Parameters */
+ EXODUS_EXPORT int ex_put_concat_all_blocks(int exoid,
+ const ex_block_params *param);
+
+ EXODUS_EXPORT int ex_put_entity_count_per_polyhedra(int exoid,
+ ex_entity_type blk_type,
+ ex_entity_id blk_id,
+ const int *entity_counts);
+
+ EXODUS_EXPORT int ex_get_entity_count_per_polyhedra(int exoid,
+ ex_entity_type blk_type,
+ ex_entity_id blk_id,
+ int *entity_counts);
+
+ /* Write Edge Face or Element Block Connectivity */
+ EXODUS_EXPORT int ex_put_conn(int exoid,
+ ex_entity_type blk_type,
+ ex_entity_id blk_id,
+ const void_int *node_conn,
+ const void_int *elem_edge_conn,
+ const void_int *elem_face_conn);
+
+ /* Read Edge Face or Element Block Connectivity */
+ EXODUS_EXPORT int ex_get_conn(int exoid,
+ ex_entity_type blk_type,
+ ex_entity_id blk_id,
+ void_int *nodeconn,
+ void_int *edgeconn,
+ void_int *faceconn);
+
+ /* Read Partial Edge Face or Element Block Connectivity */
+ EXODUS_EXPORT int ex_get_n_conn(int exoid,
+ ex_entity_type blk_type,
+ ex_entity_id blk_id,
+ int64_t start_num,
+ int64_t num_ent,
+ void_int *nodeconn,
+ void_int *edgeconn,
+ void_int *faceconn);
+
+ EXODUS_EXPORT int ex_get_partial_conn(int exoid,
+ ex_entity_type blk_type,
+ ex_entity_id blk_id,
+ int64_t start_num,
+ int64_t num_ent,
+ void_int *nodeconn,
+ void_int *edgeconn,
+ void_int *faceconn);
+
+ /* Write Edge Face or Element Block Attributes */
+ EXODUS_EXPORT int ex_put_attr(int exoid,
+ ex_entity_type blk_type,
+ ex_entity_id blk_id,
+ const void *attrib);
+
+ EXODUS_EXPORT int ex_put_partial_attr (int exoid,
+ ex_entity_type blk_type,
+ ex_entity_id blk_id,
+ int64_t start_entity,
+ int64_t num_entity,
+ const void *attrib);
+
+ /* Read Edge Face or Element Block Attributes */
+ EXODUS_EXPORT int ex_get_attr(int exoid,
+ ex_entity_type obj_type,
+ ex_entity_id obj_id,
+ void *attrib);
+
+ EXODUS_EXPORT int ex_get_n_attr(int exoid,
+ ex_entity_type obj_type,
+ ex_entity_id obj_id,
+ int64_t start_num,
+ int64_t num_ent,
+ void *attrib);
+
+ EXODUS_EXPORT int ex_get_partial_attr(int exoid,
+ ex_entity_type obj_type,
+ ex_entity_id obj_id,
+ int64_t start_num,
+ int64_t num_ent,
+ void *attrib);
+
+ /* Write One Edge Face or Element Block Attribute */
+ EXODUS_EXPORT int ex_put_one_attr(int exoid,
+ ex_entity_type obj_type,
+ ex_entity_id obj_id,
+ int attrib_index,
+ const void *attrib);
+
+ /* Read One Edge Face or Element Block Attribute */
+ EXODUS_EXPORT int ex_get_one_attr(int exoid,
+ ex_entity_type obj_type,
+ ex_entity_id obj_id,
+ int attrib_index,
+ void *attrib);
+
+ /* Read One Edge Face or Element Block Attribute */
+ EXODUS_EXPORT int ex_get_n_one_attr(int exoid,
+ ex_entity_type obj_type,
+ ex_entity_id obj_id,
+ int64_t start_num,
+ int64_t num_ent,
+ int attrib_index,
+ void *attrib);
+
+ EXODUS_EXPORT int ex_get_partial_one_attr(int exoid,
+ ex_entity_type obj_type,
+ ex_entity_id obj_id,
+ int64_t start_num,
+ int64_t num_ent,
+ int attrib_index,
+ void *attrib);
+
+ /* Write Edge Face or Element Block Attribute Names */
+ EXODUS_EXPORT int ex_put_attr_names(int exoid,
+ ex_entity_type blk_type,
+ ex_entity_id blk_id,
+ char **names);
+
+ /* Read Edge Face or Element Block Attribute Names */
+ EXODUS_EXPORT int ex_get_attr_names(int exoid,
+ ex_entity_type obj_type,
+ ex_entity_id obj_id,
+ char **names);
+
+ /* Write Node Edge Face or Side Set Parameters */
+ EXODUS_EXPORT int ex_put_set_param(int exoid,
+ ex_entity_type set_type,
+ ex_entity_id set_id,
+ int64_t num_entries_in_set,
+ int64_t num_dist_fact_in_set);
+
+ /* Read Node Edge Face or Side Set Parameters */
+ EXODUS_EXPORT int ex_get_set_param(int exoid,
+ ex_entity_type set_type,
+ ex_entity_id set_id,
+ void_int *num_entry_in_set,
+ void_int *num_dist_fact_in_set);
+
+ /* Write a Node Edge Face or Side Set */
+ EXODUS_EXPORT int ex_put_set(int exoid,
+ ex_entity_type set_type,
+ ex_entity_id set_id,
+ const void_int *set_entry_list,
+ const void_int *set_extra_list);
+
+ EXODUS_EXPORT int ex_put_partial_set(int exoid,
+ ex_entity_type set_type,
+ ex_entity_id set_id,
+ int64_t offset,
+ int64_t count,
+ const void_int *set_entry_list,
+ const void_int *set_extra_list);
+
+ /* Read a Node Edge Face or Side Set */
+ EXODUS_EXPORT int ex_get_set(int exoid,
+ ex_entity_type set_type,
+ ex_entity_id set_id,
+ void_int *set_entry_list,
+ void_int *set_extra_list);
+
+ /* Write Node Edge Face or Side Set Distribution Factors */
+ EXODUS_EXPORT int ex_put_set_dist_fact(int exoid,
+ ex_entity_type set_type,
+ ex_entity_id set_id,
+ const void *set_dist_fact);
+
+ /* Read Node Edge Face or Side Set Distribution Factors */
+ EXODUS_EXPORT int ex_get_set_dist_fact(int exoid,
+ ex_entity_type set_type,
+ ex_entity_id set_id,
+ void *set_dist_fact);
+
+ EXODUS_EXPORT int ex_get_partial_set_dist_fact (int exoid,
+ ex_entity_type set_type,
+ ex_entity_id set_id,
+ int64_t offset,
+ int64_t num_to_put,
+ void *set_dist_fact);
+
+ /* Write Concatenated Node Edge Face or Side Sets */
+ EXODUS_EXPORT int ex_put_concat_sets(int exoid,
+ ex_entity_type set_type,
+ const struct ex_set_specs *set_specs);
+
+ /* Read Concatenated Node Edge Face or Side Sets */
+ EXODUS_EXPORT int ex_get_concat_sets(int exoid,
+ ex_entity_type set_type,
+ struct ex_set_specs *set_specs);
+
+ /* Write Concatenated Node Edge Face or Side Sets */
+ EXODUS_EXPORT int ex_put_sets(int exoid,
+ size_t set_count,
+ const struct ex_set *sets);
+
+ /* Read Concatenated Node Edge Face or Side Sets */
+ EXODUS_EXPORT int ex_get_sets(int exoid,
+ size_t set_count,
+ struct ex_set *sets);
+
+ /* (MODIFIED) Write All Results Variables Parameters */
+ EXODUS_EXPORT int ex_put_all_var_param_ext(int exoid,
+ const ex_var_params *vp);
+
+ /* Write Edge Face or Element Variable Values on Blocks or Sets at a Time Step */
+ EXODUS_EXPORT int ex_put_var(int exoid,
+ int time_step,
+ ex_entity_type var_type,
+ int var_index,
+ ex_entity_id obj_id,
+ int64_t num_entries_this_obj,
+ const void *var_vals);
+
+ /* Write Partial Edge Face or Element Variable Values on Blocks or Sets at a Time Step */
+ EXODUS_EXPORT int ex_put_n_var(int exoid,
+ int time_step,
+ ex_entity_type var_type,
+ int var_index,
+ ex_entity_id obj_id,
+ int64_t start_index,
+ int64_t num_entities,
+ const void *var_vals);
+
+ EXODUS_EXPORT int ex_put_partial_var(int exoid,
+ int time_step,
+ ex_entity_type var_type,
+ int var_index,
+ ex_entity_id obj_id,
+ int64_t start_index,
+ int64_t num_entities,
+ const void *var_vals);
+
+ /* Read Edge Face or Element Variable Values Defined On Blocks or Sets at a Time Step */
+ EXODUS_EXPORT int ex_get_var(int exoid,
+ int time_step,
+ ex_entity_type var_type,
+ int var_index,
+ ex_entity_id obj_id,
+ int64_t num_entry_this_obj,
+ void *var_vals);
+
+ /* Read Partial Edge Face or Element Variable Values on Blocks or Sets at a Time Step */
+ EXODUS_EXPORT int ex_get_n_var(int exoid,
+ int time_step,
+ ex_entity_type var_type,
+ int var_index,
+ ex_entity_id obj_id,
+ int64_t start_index,
+ int64_t num_entities,
+ void *var_vals);
+
+ EXODUS_EXPORT int ex_get_n_elem_var (int exoid,
+ int time_step,
+ int elem_var_index,
+ ex_entity_id elem_blk_id,
+ int64_t num_elem_this_blk,
+ int64_t start_elem_num,
+ int64_t num_elem,
+ void *elem_var_vals);
+
+ EXODUS_EXPORT int ex_get_partial_var(int exoid,
+ int time_step,
+ ex_entity_type var_type,
+ int var_index,
+ ex_entity_id obj_id,
+ int64_t start_index,
+ int64_t num_entities,
+ void *var_vals);
+
+ EXODUS_EXPORT int ex_get_partial_elem_var (int exoid,
+ int time_step,
+ int elem_var_index,
+ ex_entity_id elem_blk_id,
+ int64_t num_elem_this_blk,
+ int64_t start_elem_num,
+ int64_t num_elem,
+ void *elem_var_vals);
+
+ /* Read Edge Face or Element Variable Values Defined On Blocks or Sets Through Time */
+ EXODUS_EXPORT int ex_get_var_time(int exoid,
+ ex_entity_type var_type,
+ int var_index,
+ int64_t id,
+ int beg_time_step,
+ int end_time_step,
+ void *var_vals);
+
+ EXODUS_EXPORT int ex_cvt_nodes_to_sides(int exoid,
+ void_int *num_elem_per_set,
+ void_int *num_nodes_per_set,
+ void_int *side_sets_elem_index,
+ void_int *side_sets_node_index,
+ void_int *side_sets_elem_list,
+ void_int *side_sets_node_list,
+ void_int *side_sets_side_list);
+
+ /* Can be replaced by ex_put_var ... */
+ EXODUS_EXPORT int ex_put_nodal_var (int exoid,
+ int time_step,
+ int nodal_var_index,
+ int64_t num_nodes,
+ const void *nodal_var_vals);
+
+ EXODUS_EXPORT int ex_put_n_nodal_var (int exoid,
+ int time_step,
+ int nodal_var_index,
+ int64_t start_node,
+ int64_t num_nodes,
+ const void *nodal_var_vals);
+
+ EXODUS_EXPORT int ex_put_partial_nodal_var (int exoid,
+ int time_step,
+ int nodal_var_index,
+ int64_t start_node,
+ int64_t num_nodes,
+ const void *nodal_var_vals);
+
+ EXODUS_EXPORT int ex_get_partial_elem_map (int exoid,
+ ex_entity_id map_id,
+ int64_t ent_start,
+ int64_t ent_count,
+ void_int *elem_map);
+
+ EXODUS_EXPORT int ex_put_partial_elem_map (int exoid,
+ ex_entity_id map_id,
+ int64_t ent_start,
+ int64_t ent_count,
+ const void_int *elem_map);
+
+ EXODUS_EXPORT int ex_put_partial_num_map (int exoid,
+ ex_entity_type map_type,
+ ex_entity_id map_id,
+ int64_t ent_start,
+ int64_t ent_count,
+ const void_int *map);
+
+ EXODUS_EXPORT int ex_put_partial_set_dist_fact (int exoid,
+ ex_entity_type set_type,
+ ex_entity_id set_id,
+ int64_t offset,
+ int64_t num_to_put,
+ const void *set_dist_fact);
+
+ /* TODO */
+ EXODUS_EXPORT int ex_get_concat_side_set_node_count(int exoid,
+ int *side_set_node_cnt_list);
+
+ /* TODO */
+ EXODUS_EXPORT int ex_get_side_set_node_list_len(int exoid,
+ ex_entity_id side_set_id,
+ void_int *side_set_node_list_len);
+
+ /* TODO */
+ EXODUS_EXPORT int ex_get_side_set_node_count(int exoid,
+ ex_entity_id side_set_id,
+ int *side_set_node_cnt_list);
+
+ /* TODO */
+ EXODUS_EXPORT int ex_get_side_set_node_list(int exoid,
+ ex_entity_id side_set_id,
+ void_int *side_set_node_cnt_list,
+ void_int *side_set_node_list);
+
+ /* ========================================================================
+ Functions pulled from nemesis library and incorporated into exodus...
+ */
+/*=============================================================================
+ * Initial Information Routines
+ *===========================================================================*/
+EXODUS_EXPORT int
+ex_get_init_info(int exoid, /* NemesisI file ID */
+ int *num_proc, /* Number of processors */
+ int *num_proc_in_f, /* Number of procs in this file */
+ char *ftype
+ );
+
+EXODUS_EXPORT int
+ex_put_init_info(int exoid, /* NemesisI file ID */
+ int num_proc, /* Number of processors */
+ int num_proc_in_f, /* Number of procs in this file */
+ char *ftype
+ );
+
+EXODUS_EXPORT int
+ex_get_init_global(int exoid, /* NemesisI file ID */
+ void_int *num_nodes_g, /* Number of global FEM nodes */
+ void_int *num_elems_g, /* Number of global FEM elements */
+ void_int *num_elem_blks_g, /* Number of global elem blocks */
+ void_int *num_node_sets_g, /* Number of global node sets */
+ void_int *num_side_sets_g /* Number of global side sets */
+ );
+EXODUS_EXPORT int
+ex_put_init_global(int exoid, /* NemesisI file ID */
+ int64_t num_nodes_g, /* Number of global FEM nodes */
+ int64_t num_elems_g, /* Number of global FEM elements */
+ int64_t num_elem_blks_g, /* Number of global elem blocks */
+ int64_t num_node_sets_g, /* Number of global node sets */
+ int64_t num_side_sets_g /* Number of global side sets */
+ );
+
+/*=============================================================================
+ * Loadbalance Parameter Routines
+ *===========================================================================*/
+EXODUS_EXPORT int
+ex_get_loadbal_param(int exoid, /* NetCDF/Exodus file ID */
+ void_int *num_int_nodes, /* Number of internal FEM nodes */
+ void_int *num_bor_nodes, /* Number of border FEM nodes */
+ void_int *num_ext_nodes, /* Number of external FEM nodes */
+ void_int *num_int_elems, /* Number of internal FEM elems */
+ void_int *num_bor_elems, /* Number of border FEM elems */
+ void_int *num_node_cmaps, /* Number of nodal comm maps */
+ void_int *num_elem_cmaps, /* Number of elemental comm maps */
+ int processor /* Processor ID */
+ );
+
+EXODUS_EXPORT int
+ex_put_loadbal_param(int exoid, /* NemesisI file ID */
+ int64_t num_int_nodes, /* Number of internal FEM nodes */
+ int64_t num_bor_nodes, /* Number of border FEM nodes */
+ int64_t num_ext_nodes, /* Number of external FEM nodes */
+ int64_t num_int_elems, /* Number of internal FEM elems */
+ int64_t num_bor_elems, /* Number of border FEM elems */
+ int64_t num_node_cmaps,/* Number of nodal comm maps */
+ int64_t num_elem_cmaps,/* Number of elemental comm maps */
+ int processor /* Processor ID */
+ );
+
+EXODUS_EXPORT int
+ex_put_loadbal_param_cc(int exoid, /* NetCDF/Exodus file ID */
+ void_int *num_int_nodes, /* Number of internal node IDs */
+ void_int *num_bor_nodes, /* Number of border node IDs */
+ void_int *num_ext_nodes, /* Number of external node IDs */
+ void_int *num_int_elems, /* Number of internal elem IDs */
+ void_int *num_bor_elems, /* Number of border elem IDs */
+ void_int *num_node_cmaps, /* Number of nodal comm maps */
+ void_int *num_elem_cmaps /* Number of elem comm maps */
+ );
+
+/*=============================================================================
+ * NS, SS & EB Global Parameter Routines
+ *===========================================================================*/
+EXODUS_EXPORT int
+ex_get_ns_param_global(int exoid, /* NetCDF/Exodus file ID */
+ void_int *ns_ids_glob, /* Global IDs of node sets */
+ void_int *ns_n_cnt_glob, /* Count of nodes in node sets */
+ void_int *ns_df_cnt_glob /* Count of dist. factors in ns */
+ );
+
+EXODUS_EXPORT int
+ex_put_ns_param_global(int exoid, /* NemesisI file ID */
+ void_int *global_ids, /* Vector of global node-set IDs */
+ void_int *global_n_cnts, /* Vector of node counts in node-sets */
+ void_int *global_df_cnts /* Vector of dist factor counts in node-sets */
+ );
+
+EXODUS_EXPORT int
+ex_get_ss_param_global(int exoid, /* NetCDF/Exodus file ID */
+ void_int *ss_ids_glob, /* Global side-set IDs */
+ void_int *ss_s_cnt_glob, /* Global side count */
+ void_int *ss_df_cnt_glob /* Global dist. factor count */
+ );
+
+EXODUS_EXPORT int
+ex_put_ss_param_global(int exoid, /* NemesisI file ID */
+ void_int *global_ids, /* Vector of global side-set IDs */
+ void_int *global_el_cnts, /* Vector of element/side */
+ /* counts in each side set */
+ void_int *global_df_cnts /* Vector of dist. factor */
+ /* counts in each side set */
+ );
+
+EXODUS_EXPORT int
+ex_get_eb_info_global(int exoid, /* NemesisI file ID */
+ void_int *el_blk_ids, /* Vector of global element IDs */
+ void_int *el_blk_cnts /* Vector of global element counts */
+ );
+
+EXODUS_EXPORT int
+ex_put_eb_info_global(int exoid, /* NemesisI file ID */
+ void_int *el_blk_ids, /* Vector of global element IDs */
+ void_int *el_blk_cnts /* Vector of global element counts */
+ );
+
+/*=============================================================================
+ * NS, SS & EB Subset Routines
+ *===========================================================================*/
+EXODUS_EXPORT int
+ex_get_n_side_set(int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id side_set_id, /* Side-set ID to read */
+ int64_t start_side_num, /* Starting element number */
+ int64_t num_sides, /* Number of sides to read */
+ void_int *side_set_elem_list, /* List of element IDs */
+ void_int *side_set_side_list /* List of side IDs */
+ );
+
+EXODUS_EXPORT int
+ex_put_n_side_set(int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id side_set_id, /* Side-set ID to write */
+ int64_t start_side_num, /* Starting element number */
+ int64_t num_sides, /* Number of sides to write */
+ const void_int *side_set_elem_list, /* List of element IDs */
+ const void_int *side_set_side_list /* List of side IDs */
+ );
+
+EXODUS_EXPORT int
+ex_get_n_side_set_df(int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id side_set_id, /* Side-set ID */
+ int64_t start_num, /* Starting df number */
+ int64_t num_df_to_get, /* Number of df's to read */
+ void *side_set_df /* Distribution factors */
+ );
+
+EXODUS_EXPORT int
+ex_put_n_side_set_df(int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id side_set_id, /* Side-set ID */
+ int64_t start_num, /* Starting df number */
+ int64_t num_df_to_get, /* Number of df's to write */
+ void *side_set_df /* Distribution factors */
+ );
+
+EXODUS_EXPORT int
+ex_get_n_node_set(int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id node_set_id, /* Node set ID */
+ int64_t start_node_num, /* Node index to start reading at */
+ int64_t num_node, /* Number of nodes to read */
+ void_int *node_set_node_list /* List of nodes in node set */
+ );
+
+EXODUS_EXPORT int
+ex_put_n_node_set(int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id node_set_id, /* Node set ID */
+ int64_t start_node_num, /* Node index to start writing at */
+ int64_t num_node, /* Number of nodes to write */
+ const void_int *node_set_node_list /* List of nodes in node set */
+ );
+
+EXODUS_EXPORT int
+ex_get_n_node_set_df(int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id node_set_id, /* Node-set ID */
+ int64_t start_num, /* Starting df number */
+ int64_t num_df_to_get, /* Number of df's to read */
+ void *node_set_df /* Distribution factors */
+ );
+
+EXODUS_EXPORT int
+ex_put_n_node_set_df(int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id node_set_id, /* Node-set ID */
+ int64_t start_num, /* Starting df number */
+ int64_t num_df_to_get, /* Number of df's to write */
+ void *node_set_df /* Distribution factors */
+ );
+
+EXODUS_EXPORT int
+ex_get_n_elem_conn (int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id elem_blk_id, /* Element block ID */
+ int64_t start_elem_num, /* Starting position to read from */
+ int64_t num_elems, /* Number of elements to read */
+ void_int *connect /* Connectivity vector */
+ );
+
+EXODUS_EXPORT int
+ex_put_n_elem_conn (int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id elem_blk_id, /* Element block ID */
+ int64_t start_elem_num, /* Starting position to write to */
+ int64_t num_elems, /* Number of elements to write */
+ const void_int *connect /* Connectivity vector */
+);
+
+EXODUS_EXPORT int
+ex_get_n_elem_attr (int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id elem_blk_id, /* Element block ID */
+ int64_t start_elem_num, /* Starting position to read from */
+ int64_t num_elems, /* Number of elements to read */
+ void *attrib /* Attribute */
+ );
+
+EXODUS_EXPORT int
+ex_put_n_elem_attr (int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id elem_blk_id, /* Element block ID */
+ int64_t start_elem_num, /* Starting position to write to */
+ int64_t num_elems, /* Number of elements to write */
+ void *attrib /* Attribute */
+ );
+EXODUS_EXPORT int
+ex_get_partial_side_set(int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id side_set_id, /* Side-set ID to read */
+ int64_t start_side_num, /* Starting element number */
+ int64_t num_sides, /* Number of sides to read */
+ void_int *side_set_elem_list, /* List of element IDs */
+ void_int *side_set_side_list /* List of side IDs */
+ );
+
+EXODUS_EXPORT int
+ex_put_partial_side_set(int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id side_set_id, /* Side-set ID to write */
+ int64_t start_side_num, /* Starting element number */
+ int64_t num_sides, /* Number of sides to write */
+ const void_int *side_set_elem_list, /* List of element IDs */
+ const void_int *side_set_side_list /* List of side IDs */
+ );
+
+EXODUS_EXPORT int
+ex_get_partial_side_set_df(int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id side_set_id, /* Side-set ID */
+ int64_t start_num, /* Starting df number */
+ int64_t num_df_to_get, /* Number of df's to read */
+ void *side_set_df /* Distribution factors */
+ );
+
+EXODUS_EXPORT int
+ex_put_partial_side_set_df(int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id side_set_id, /* Side-set ID */
+ int64_t start_num, /* Starting df number */
+ int64_t num_df_to_get, /* Number of df's to write */
+ void *side_set_df /* Distribution factors */
+ );
+
+EXODUS_EXPORT int
+ex_get_partial_node_set(int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id node_set_id, /* Node set ID */
+ int64_t start_node_num, /* Node index to start reading at */
+ int64_t num_node, /* Number of nodes to read */
+ void_int *node_set_node_list /* List of nodes in node set */
+ );
+
+EXODUS_EXPORT int
+ex_put_partial_node_set(int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id node_set_id, /* Node set ID */
+ int64_t start_node_num, /* Node index to start writing at */
+ int64_t num_node, /* Number of nodes to write */
+ const void_int *node_set_node_list /* List of nodes in node set */
+ );
+
+EXODUS_EXPORT int
+ex_get_partial_node_set_df(int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id node_set_id, /* Node-set ID */
+ int64_t start_num, /* Starting df number */
+ int64_t num_df_to_get, /* Number of df's to read */
+ void *node_set_df /* Distribution factors */
+ );
+
+EXODUS_EXPORT int
+ex_put_partial_node_set_df(int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id node_set_id, /* Node-set ID */
+ int64_t start_num, /* Starting df number */
+ int64_t num_df_to_get, /* Number of df's to write */
+ void *node_set_df /* Distribution factors */
+ );
+
+EXODUS_EXPORT int
+ex_get_partial_elem_conn (int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id elem_blk_id, /* Element block ID */
+ int64_t start_elem_num, /* Starting position to read from */
+ int64_t num_elems, /* Number of elements to read */
+ void_int *connect /* Connectivity vector */
+ );
+
+EXODUS_EXPORT int
+ex_put_partial_elem_conn (int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id elem_blk_id, /* Element block ID */
+ int64_t start_elem_num, /* Starting position to write to */
+ int64_t num_elems, /* Number of elements to write */
+ const void_int *connect /* Connectivity vector */
+);
+
+EXODUS_EXPORT int
+ex_get_partial_elem_attr (int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id elem_blk_id, /* Element block ID */
+ int64_t start_elem_num, /* Starting position to read from */
+ int64_t num_elems, /* Number of elements to read */
+ void *attrib /* Attribute */
+ );
+
+EXODUS_EXPORT int
+ex_put_partial_elem_attr (int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id elem_blk_id, /* Element block ID */
+ int64_t start_elem_num, /* Starting position to write to */
+ int64_t num_elems, /* Number of elements to write */
+ void *attrib /* Attribute */
+ );
+
+EXODUS_EXPORT int
+ex_get_elem_type(int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id elem_blk_id, /* Element block ID */
+ char *elem_type /* The name of the element type */
+ );
+
+/*=============================================================================
+ * Variable Routines
+ *===========================================================================*/
+EXODUS_EXPORT int
+ex_put_elem_var_slab (int exoid, /* NetCDF/Exodus file ID */
+ int time_step, /* time index */
+ int elem_var_index, /* elemental variable index */
+ ex_entity_id elem_blk_id, /* elemental block id */
+ int64_t start_pos, /* Starting position to write to */
+ int64_t num_vals, /* Number of elements to write */
+ void *elem_var_vals /* variable values */
+ );
+
+EXODUS_EXPORT int
+ex_put_nodal_var_slab(int exoid, /* NetCDF/Exodus file ID */
+ int time_step, /* The time step index */
+ int nodal_var_index, /* Nodal variable index */
+ int64_t start_pos, /* Start position for write */
+ int64_t num_vals, /* Number of nodal variables */
+ void *nodal_var_vals /* Nodal variable values */
+ );
+
+/*=============================================================================
+ * Number Map Routines
+ *===========================================================================*/
+EXODUS_EXPORT int
+ex_get_n_elem_num_map (int exoid, /* NetCDF/Exodus file ID */
+ int64_t start_ent, /* Starting position to read from */
+ int64_t num_ents, /* Number of elements to read */
+ void_int *elem_map /* element map numbers */
+ );
+
+EXODUS_EXPORT int
+ex_get_n_node_num_map(int exoid, /* NetCDF/Exodus file ID */
+ int64_t start_ent, /* starting node number */
+ int64_t num_ents, /* number of nodes to read */
+ void_int *node_map /* vector for node map */
+ );
+
+EXODUS_EXPORT int
+ex_get_partial_elem_num_map (int exoid, /* NetCDF/Exodus file ID */
+ int64_t start_ent, /* Starting position to read from */
+ int64_t num_ents, /* Number of elements to read */
+ void_int *elem_map /* element map numbers */
+ );
+
+EXODUS_EXPORT int
+ex_get_partial_node_num_map(int exoid, /* NetCDF/Exodus file ID */
+ int64_t start_ent, /* starting node number */
+ int64_t num_ents, /* number of nodes to read */
+ void_int *node_map /* vector for node map */
+ );
+
+EXODUS_EXPORT int
+ex_get_processor_node_maps(int exoid, /* NetCDF/Exodus file ID */
+ void_int *node_mapi, /* Internal FEM node IDs */
+ void_int *node_mapb, /* Border FEM node IDs */
+ void_int *node_mape, /* External FEM node IDs */
+ int processor /* Processor IDs */
+ );
+
+EXODUS_EXPORT int
+ex_put_processor_node_maps(int exoid, /* NetCDF/Exodus file ID */
+ void_int *node_mapi, /* Internal FEM node IDs */
+ void_int *node_mapb, /* Border FEM node IDs */
+ void_int *node_mape, /* External FEM node IDs */
+ int processor /* This processor ID */
+ );
+
+EXODUS_EXPORT int
+ex_get_processor_elem_maps(int exoid, /* NetCDF/Exodus file ID */
+ void_int *elem_mapi, /* Internal element IDs */
+ void_int *elem_mapb, /* Border element IDs */
+ int processor /* Processor ID */
+ );
+
+EXODUS_EXPORT int
+ex_put_processor_elem_maps(int exoid, /* NetCDF/Exodus file ID */
+ void_int *elem_mapi, /* Internal FEM element IDs */
+ void_int *elem_mapb, /* Border FEM element IDs */
+ int processor /* This processor ID */
+ );
+
+
+/*=============================================================================
+ * Communications Maps Routines
+ *===========================================================================*/
+
+EXODUS_EXPORT int
+ex_get_cmap_params(int exoid, /* NetCDF/Exodus file ID */
+ void_int *node_cmap_ids, /* Nodal comm. map IDs */
+ void_int *node_cmap_node_cnts, /* Number of nodes in each map */
+ void_int *elem_cmap_ids, /* Elemental comm. map IDs */
+ void_int *elem_cmap_elem_cnts, /* Number of elems in each map */
+ int processor /* This processor ID */
+ );
+
+EXODUS_EXPORT int
+ex_put_cmap_params(int exoid, /* NetCDF/Exodus file ID */
+ void_int *node_map_ids, /* Node map IDs */
+ void_int *node_map_node_cnts,/* Nodes in nodal comm */
+ void_int *elem_map_ids, /* Elem map IDs */
+ void_int *elem_map_elem_cnts,/* Elems in elemental comm */
+ int64_t processor /* This processor ID */
+ );
+
+EXODUS_EXPORT int
+ex_put_cmap_params_cc(int exoid, /* NetCDF/Exodus file ID */
+ void_int *node_map_ids, /* Node map IDs */
+ void_int *node_map_node_cnts, /* Nodes in nodal comm */
+ void_int *node_proc_ptrs, /* Pointer into array for */
+ /* node maps */
+ void_int *elem_map_ids, /* Elem map IDs */
+ void_int *elem_map_elem_cnts, /* Elems in elemental comm */
+ void_int *elem_proc_ptrs /* Pointer into array for */
+ /* elem maps */
+ );
+
+EXODUS_EXPORT int
+ex_get_node_cmap(int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id map_id, /* Map ID */
+ void_int *node_ids, /* FEM node IDs */
+ void_int *proc_ids, /* Processor IDs */
+ int processor /* This processor ID */
+ );
+
+EXODUS_EXPORT int
+ex_put_node_cmap(int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id map_id, /* Nodal comm map ID */
+ void_int *node_ids, /* FEM node IDs */
+ void_int *proc_ids, /* Processor IDs */
+ int processor /* This processor ID */
+ );
+
+EXODUS_EXPORT int
+ex_get_elem_cmap(int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id map_id, /* Elemental comm map ID */
+ void_int *elem_ids, /* Element IDs */
+ void_int *side_ids, /* Element side IDs */
+ void_int *proc_ids, /* Processor IDs */
+ int processor /* This processor ID */
+ );
+
+EXODUS_EXPORT int
+ex_put_elem_cmap(int exoid, /* NetCDF/Exodus file ID */
+ ex_entity_id map_id, /* Elemental comm map ID */
+ void_int *elem_ids, /* Vector of element IDs */
+ void_int *side_ids, /* Vector of side IDs */
+ void_int *proc_ids, /* Vector of processor IDs */
+ int processor /* This processor ID */
+ );
+
+ /* ========================================================================
+ * Deprecated functiona
+ */
+
+ EXODUS_EXPORT int ex_get_nodal_var (int exoid,
+ int time_step,
+ int nodal_var_index,
+ int64_t num_nodes,
+ void *nodal_var_vals);
+
+ EXODUS_EXPORT int ex_get_nodal_var_time (int exoid,
+ int nodal_var_index,
+ int64_t node_number,
+ int beg_time_step,
+ int end_time_step,
+ void *nodal_var_vals);
+
+ /* Use ex_get_concat_sets() */
+ EXODUS_EXPORT int ex_get_concat_node_sets (int exoid,
+ void_int *node_set_ids,
+ void_int *num_nodes_per_set,
+ void_int *num_df_per_set,
+ void_int *node_sets_node_index,
+ void_int *node_sets_df_index,
+ void_int *node_sets_node_list,
+ void *node_sets_dist_fact);
+
+
+ EXODUS_EXPORT int ex_get_concat_side_sets (int exoid,
+ void_int *side_set_ids,
+ void_int *num_elem_per_set,
+ void_int *num_dist_per_set,
+ void_int *side_sets_elem_index,
+ void_int *side_sets_dist_index,
+ void_int *side_sets_elem_list,
+ void_int *side_sets_side_list,
+ void *side_sets_dist_fact);
+
+ EXODUS_EXPORT int ex_get_elem_attr (int exoid,
+ ex_entity_id elem_blk_id,
+ void *attrib);
+
+ EXODUS_EXPORT int ex_get_elem_attr_names (int exoid,
+ ex_entity_id elem_blk_id,
+ char **names);
+
+ EXODUS_EXPORT int ex_get_elem_blk_ids (int exoid,
+ void_int *ids);
+
+ EXODUS_EXPORT int ex_get_elem_block (int exoid,
+ ex_entity_id elem_blk_id,
+ char *elem_type,
+ void_int *num_elem_this_blk,
+ void_int *num_nodes_per_elem,
+ void_int *num_attr);
+
+ EXODUS_EXPORT int ex_get_elem_conn (int exoid,
+ ex_entity_id elem_blk_id,
+ void_int *connect);
+
+ EXODUS_EXPORT int ex_get_elem_map (int exoid,
+ ex_entity_id map_id,
+ void_int *elem_map);
+
+ EXODUS_EXPORT int ex_get_elem_num_map (int exoid,
+ void_int *elem_map);
+
+ EXODUS_EXPORT int ex_get_elem_var (int exoid,
int time_step,
- int varid,
- int num_entity,
- void *var_vals);
+ int elem_var_index,
+ ex_entity_id elem_blk_id,
+ int64_t num_elem_this_blk,
+ void *elem_var_vals);
+
+ EXODUS_EXPORT int ex_get_elem_var_tab (int exoid,
+ int num_elem_blk,
+ int num_elem_var,
+ int *elem_var_tab);
+
+ EXODUS_EXPORT int ex_get_elem_var_time (int exoid,
+ int elem_var_index,
+ int64_t elem_number,
+ int beg_time_step,
+ int end_time_step,
+ void *elem_var_vals);
+
+ EXODUS_EXPORT int ex_get_map (int exoid, void_int *elem_map);
+
+ EXODUS_EXPORT int ex_get_node_map (int exoid,
+ ex_entity_id map_id,
+ void_int *node_map);
+
+ EXODUS_EXPORT int ex_get_node_num_map (int exoid,
+ void_int *node_map);
+
+ EXODUS_EXPORT int ex_get_node_set_param (int exoid,
+ ex_entity_id node_set_id,
+ void_int *num_nodes_in_set,
+ void_int *num_df_in_set);
+
+ EXODUS_EXPORT int ex_get_node_set (int exoid,
+ ex_entity_id node_set_id,
+ void_int *node_set_node_list);
+
+ EXODUS_EXPORT int ex_get_node_set_dist_fact (int exoid,
+ ex_entity_id node_set_id,
+ void *node_set_dist_fact);
+
+ EXODUS_EXPORT int ex_get_node_set_ids (int exoid,
+ void_int *ids);
+
+ EXODUS_EXPORT int ex_get_nset_var_tab (int exoid,
+ int num_nodesets,
+ int num_nset_var,
+ int *nset_var_tab);
+
+ EXODUS_EXPORT int ex_get_nset_var (int exoid,
+ int time_step,
+ int nset_var_index,
+ ex_entity_id nset_id,
+ int64_t num_node_this_nset,
+ void *nset_var_vals);
+
+ EXODUS_EXPORT int ex_get_one_elem_attr (int exoid,
+ ex_entity_id elem_blk_id,
+ int attrib_index,
+ void *attrib);
+
+ EXODUS_EXPORT int ex_get_side_set (int exoid,
+ ex_entity_id side_set_id,
+ void_int *side_set_elem_list,
+ void_int *side_set_side_list);
+
+ EXODUS_EXPORT int ex_get_side_set_dist_fact (int exoid,
+ ex_entity_id side_set_id,
+ void *side_set_dist_fact);
+
+ EXODUS_EXPORT int ex_get_side_set_ids (int exoid,
+ void_int *ids);
+
+ EXODUS_EXPORT int ex_get_side_set_param (int exoid,
+ ex_entity_id side_set_id,
+ void_int *num_side_in_set,
+ void_int *num_dist_fact_in_set);
+
+ EXODUS_EXPORT int ex_get_sset_var (int exoid,
+ int time_step,
+ int sset_var_index,
+ ex_entity_id sset_id,
+ int64_t num_side_this_sset,
+ void *sset_var_vals);
+
+ EXODUS_EXPORT int ex_get_sset_var_tab (int exoid,
+ int num_sidesets,
+ int num_sset_var,
+ int *sset_var_tab);
+
+ EXODUS_EXPORT int ex_get_var_names (int exoid,
+ const char *var_type,
+ int num_vars,
+ char *var_names[]);
+
+ EXODUS_EXPORT int ex_get_var_name (int exoid,
+ const char *var_type,
+ int var_num,
+ char *var_name);
+
+ EXODUS_EXPORT int ex_get_var_param (int exoid,
+ const char *var_type,
+ int *num_vars);
+
+ EXODUS_EXPORT int ex_get_var_tab (int exoid,
+ const char *var_type,
+ int num_blk,
+ int num_var,
+ int *var_tab);
+
+ EXODUS_EXPORT int ex_put_concat_node_sets (int exoid,
+ void_int *node_set_ids,
+ void_int *num_nodes_per_set,
+ void_int *num_dist_per_set,
+ void_int *node_sets_node_index,
+ void_int *node_sets_df_index,
+ void_int *node_sets_node_list,
+ void *node_sets_dist_fact);
+
+ EXODUS_EXPORT int ex_put_concat_side_sets (int exoid,
+ void_int *side_set_ids,
+ void_int *num_elem_per_set,
+ void_int *num_dist_per_set,
+ void_int *side_sets_elem_index,
+ void_int *side_sets_dist_index,
+ void_int *side_sets_elem_list,
+ void_int *side_sets_side_list,
+ void *side_sets_dist_fact);
+
+ EXODUS_EXPORT int ex_put_concat_var_param (int exoid, int num_g, int num_n,
+ int num_e, int num_elem_blk, int *elem_var_tab);
+
+ EXODUS_EXPORT int ex_put_elem_attr_names(int exoid,
+ ex_entity_id elem_blk_id,
+ char *names[]);
+ EXODUS_EXPORT int ex_put_elem_attr (int exoid,
+ ex_entity_id elem_blk_id,
+ const void *attrib);
+
+ EXODUS_EXPORT int ex_put_elem_block (int exoid,
+ ex_entity_id elem_blk_id,
+ const char *elem_type,
+ int64_t num_elem_this_blk,
+ int64_t num_nodes_per_elem,
+ int64_t num_attr);
+
+ EXODUS_EXPORT int ex_put_elem_conn (int exoid,
+ ex_entity_id elem_blk_id,
+ const void_int *connect);
+
+ EXODUS_EXPORT int ex_put_elem_map (int exoid,
+ ex_entity_id map_id,
+ const void_int *elem_map);
+
+ EXODUS_EXPORT int ex_put_elem_num_map (int exoid,
+ const void_int *elem_map);
+
+ EXODUS_EXPORT int ex_put_elem_var (int exoid,
+ int time_step,
+ int elem_var_index,
+ ex_entity_id elem_blk_id,
+ int64_t num_elem_this_blk,
+ const void *elem_var_vals);
+
+ EXODUS_EXPORT int ex_put_elem_var_tab (int exoid,
+ int num_elem_blk,
+ int num_elem_var,
+ int *elem_var_tab);
+
+ EXODUS_EXPORT int ex_put_glob_vars (int exoid,
+ int time_step,
+ int num_glob_vars,
+ const void *glob_var_vals);
+
+ EXODUS_EXPORT int ex_put_map (int exoid,
+ const void_int *elem_map);
+
+ EXODUS_EXPORT int ex_put_node_map (int exoid,
+ ex_entity_id map_id,
+ const void_int *node_map);
+
+ EXODUS_EXPORT int ex_put_node_num_map (int exoid,
+ const void_int *node_map);
+
+ EXODUS_EXPORT int ex_put_node_set (int exoid,
+ ex_entity_id node_set_id,
+ const void_int *node_set_node_list);
+
+ EXODUS_EXPORT int ex_put_node_set_dist_fact (int exoid,
+ ex_entity_id node_set_id,
+ const void *node_set_dist_fact);
+
+ EXODUS_EXPORT int ex_put_node_set_param (int exoid,
+ ex_entity_id node_set_id,
+ int64_t num_nodes_in_set,
+ int64_t num_dist_in_set);
+
+ EXODUS_EXPORT int ex_put_nset_var (int exoid,
+ int time_step,
+ int nset_var_index,
+ ex_entity_id nset_id,
+ int64_t num_nodes_this_nset,
+ const void *nset_var_vals);
+
+ EXODUS_EXPORT int ex_put_nset_var_tab (int exoid,
+ int num_nset,
+ int num_nset_var,
+ int *nset_var_tab);
+
+ EXODUS_EXPORT int ex_put_one_elem_attr (int exoid,
+ ex_entity_id elem_blk_id,
+ int attrib_index,
+ const void *attrib);
+
+ EXODUS_EXPORT int ex_put_side_set (int exoid,
+ ex_entity_id side_set_id,
+ const void_int *side_set_elem_list,
+ const void_int *side_set_side_list);
+
+ EXODUS_EXPORT int ex_put_side_set_dist_fact (int exoid,
+ ex_entity_id side_set_id,
+ const void *side_set_dist_fact);
+
+ EXODUS_EXPORT int ex_put_side_set_param (int exoid,
+ ex_entity_id side_set_id,
+ int64_t num_side_in_set,
+ int64_t num_dist_fact_in_set);
+
+ EXODUS_EXPORT int ex_put_sset_var (int exoid,
+ int time_step,
+ int sset_var_index,
+ ex_entity_id sset_id,
+ int64_t num_faces_this_sset,
+ const void *sset_var_vals);
+
+ EXODUS_EXPORT int ex_put_sset_var_tab (int exoid,
+ int num_sset,
+ int num_sset_var,
+ int *sset_var_tab);
+
+ EXODUS_EXPORT int ex_put_var_name (int exoid,
+ const char *var_type,
+ int var_num,
+ const char *var_name);
+
+ EXODUS_EXPORT int ex_put_var_names (int exoid,
+ const char *var_type,
+ int num_vars,
+ char *var_names[]);
+
+ EXODUS_EXPORT int ex_put_var_param (int exoid,
+ const char *var_type,
+ int num_vars);
+
+ EXODUS_EXPORT int ex_put_var_tab (int exoid,
+ const char *var_type,
+ int num_blk,
+ int num_var,
+ int *var_tab);
+ /* End of Deprecated functions and their replacements
+ * ======================================================================== */
+
/* ERROR CODE DEFINITIONS AND STORAGE */
extern int exerrval; /**< shared error return value */
extern int exoptval; /**< error reporting flag (default is quiet) */
- /**
- * For output databases, the maximum length of any entity, variable,
- * property, attribute, or coordinate name to be written (not
- * including the NULL terminator). If a name is longer than this
- * value, a warning message will be output to stderr and the name
- * will be truncated. Must be set (via call to
- * 'ex_set_max_name_length(exoid, int len)' prior to calling ex_create.
- *
- * For input databases, the size of the name arrays that the client
- * code will be passing to API routines that retrieve names (not
- * including the NULL terminator). This defaults to 32 for
- * compatibility with older clients. The value used at the time of
- * creation of the database can be queried by ex_inquire with the
- * EX_INQ_DB_MAX_NAME_LENGTH argument. The current value for this
- * variable can be queried with EX_INQ_CUR_MAX_NAME_LENGTH argument.
- *
- * Note that this is a global setting for all databases. If you are
- * accessing multiple databases, they will all use the same value.
- */
- extern int ex_max_name_length;
-
char* ex_name_of_object(ex_entity_type obj_type);
ex_entity_type ex_var_type_to_ex_entity_type(char var_type);
+ /* Should be internal use only, but was in external include file for
+ nemesis and some codes are using the function
+ */
+ int ex_get_idx(int neid, /* NetCDF/Exodus file ID */
+ const char *ne_var_name, /* Nemesis index variable name */
+ int64_t *index, /* array of length 2 to hold results */
+ int pos /* position of this proc/cmap in index */
+ );
+
+
#ifdef __cplusplus
} /* close brackets on extern "C" declaration */
#endif
@@ -869,6 +1979,5 @@ extern "C" {
#define EX_NULLENTITY -1006 /**< null entity found */
/* @} */
-#include "exodusII_ext.h"
#endif
diff --git a/exodus/cbind/include/exodusII_cfg.h b/exodus/cbind/include/exodusII_cfg.h
new file mode 100755
index 0000000..7a209e7
--- /dev/null
+++ b/exodus/cbind/include/exodusII_cfg.h
@@ -0,0 +1,25 @@
+#ifndef __exodusII_cfg_h
+#define __exodusII_cfg_h
+
+#define EXODUSII_VERSION_MAJOR 5
+#define EXODUSII_VERSION_MINOR 14
+#define EXODUSII_VERSION_PATCH 0
+#define EXODUSII_VERSION "5.14.0"
+
+#if defined(_WIN32) && !defined(WIN32)
+# define WIN32
+#endif
+
+/* #undef EXODUSII_BUILD_SHARED_LIBS */
+#if defined(WIN32) && defined(EXODUSII_BUILD_SHARED_LIBS)
+# if defined(exoIIc_EXPORTS)
+# define EXODUS_EXPORT __declspec( dllexport ) extern
+# else
+# define EXODUS_EXPORT __declspec( dllimport ) extern
+# endif
+#else
+# define EXODUS_EXPORT extern
+#endif
+
+#endif
+
diff --git a/exodus/cbind/include/exodusII_ext.h b/exodus/cbind/include/exodusII_ext.h
deleted file mode 100644
index dd55eb5..0000000
--- a/exodus/cbind/include/exodusII_ext.h
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#ifndef __exodus_ext_h
-#define __exodus_ext_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
- /**
- * \defgroup APIStructs Structures used by external API functions.
- * @{
- */
-typedef struct ex_init_params {
- char title[MAX_LINE_LENGTH + 1];
- int num_dim;
- int num_nodes;
- int num_edge;
- int num_edge_blk;
- int num_face;
- int num_face_blk;
- int num_elem;
- int num_elem_blk;
- int num_node_sets;
- int num_edge_sets;
- int num_face_sets;
- int num_side_sets;
- int num_elem_sets;
- int num_node_maps;
- int num_edge_maps;
- int num_face_maps;
- int num_elem_maps;
-} ex_init_params;
-
-typedef struct ex_block_params {
- int* edge_blk_id;
- char** edge_type;
- int* num_edge_this_blk;
- int* num_nodes_per_edge;
- int* num_attr_edge;
- int* face_blk_id;
- char** face_type;
- int* num_face_this_blk;
- int* num_nodes_per_face;
- int* num_attr_face;
- int* elem_blk_id;
- char** elem_type;
- int* num_elem_this_blk;
- int* num_nodes_per_elem;
- int* num_edges_per_elem;
- int* num_faces_per_elem;
- int* num_attr_elem;
- int define_maps;
-} ex_block_params;
-
-typedef struct ex_set_specs {
- int* sets_ids;
- int* num_entries_per_set;
- int* num_dist_per_set;
- int* sets_entry_index;
- int* sets_dist_index;
- int* sets_entry_list;
- int* sets_extra_list;
- void* sets_dist_fact;
-} ex_set_specs;
-
-typedef struct ex_var_params {
- int num_glob;
- int num_node;
- int num_edge;
- int* edge_var_tab;
- int num_face;
- int* face_var_tab;
- int num_elem;
- int* elem_var_tab;
- int num_nset;
- int* nset_var_tab;
- int num_eset;
- int* eset_var_tab;
- int num_fset;
- int* fset_var_tab;
- int num_sset;
- int* sset_var_tab;
- int num_elset;
- int* elset_var_tab;
-} ex_var_params;
- /* @} */
-
-#ifndef EXODUS_EXPORT
-#define EXODUS_EXPORT extern
-#endif /* EXODUS_EXPORT */
-
-/* (MODIFIED) Write Initialization Parameters */
-EXODUS_EXPORT int ex_put_init_ext (int, const ex_init_params*);
-
-/* (MODIFIED) Read Initialization Parameters */
-EXODUS_EXPORT int ex_get_init_ext (int, ex_init_params*);
-
-/* Write Node Edge Face or Element Number Map */
-EXODUS_EXPORT int ex_put_num_map (int, ex_entity_type, int, const int*);
-
-/* Read Number Map */
-EXODUS_EXPORT int ex_get_num_map (int, ex_entity_type, int, int*);
-
-/* Write Edge Face or Element Block Parameters */
-EXODUS_EXPORT int ex_put_block (int, ex_entity_type, int, const char*, int, int,
- int, int, int);
-
-/* Read Edge Face or Element Block Parameters */
-EXODUS_EXPORT int ex_get_block (int, ex_entity_type, int, char*, int*, int*, int*,
- int*, int*);
-
-/* Write All Edge Face and Element Block Parameters */
-EXODUS_EXPORT int ex_put_concat_all_blocks(int, const ex_block_params*);
-
-EXODUS_EXPORT int ex_put_entity_count_per_polyhedra (int, ex_entity_type, int, const int*);
-
-EXODUS_EXPORT int ex_get_entity_count_per_polyhedra (int, ex_entity_type, int, int*);
-
-/* Write Edge Face or Element Block Connectivity */
-EXODUS_EXPORT int ex_put_conn (int, ex_entity_type, int, const int*, const int*,
- const int*);
-
-/* Read Edge Face or Element Block Connectivity */
-EXODUS_EXPORT int ex_get_conn (int, ex_entity_type, int, int*, int*, int*);
-
-/* Read Partial Edge Face or Element Block Connectivity */
-EXODUS_EXPORT int ex_get_n_conn (int, ex_entity_type, int, int, int, int*, int*, int*);
-
-/* Write Edge Face or Element Block Attributes */
-EXODUS_EXPORT int ex_put_attr (int, ex_entity_type, int, const void*);
-
-/* Read Edge Face or Element Block Attributes */
-EXODUS_EXPORT int ex_get_attr (int, ex_entity_type, int, void*);
-
-/* Write One Edge Face or Element Block Attribute */
-EXODUS_EXPORT int ex_put_one_attr (int, ex_entity_type, int, int, const void*);
-
-/* Read One Edge Face or Element Block Attribute */
-EXODUS_EXPORT int ex_get_one_attr (int, ex_entity_type, int, int, void*);
-
-/* Read One Edge Face or Element Block Attribute */
-EXODUS_EXPORT int ex_get_n_one_attr (int exoid, ex_entity_type obj_type, int obj_id,
- int start_num, int num_ent, int attrib_index,
- void* attrib );
-
-/* Write Edge Face or Element Block Attribute Names */
-EXODUS_EXPORT int ex_put_attr_names (int, ex_entity_type, int, char**);
-
-/* Read Edge Face or Element Block Attribute Names */
-EXODUS_EXPORT int ex_get_attr_names (int, ex_entity_type, int, char**);
-
-/* Write Node Edge Face or Side Set Parameters */
-EXODUS_EXPORT int ex_put_set_param (int, ex_entity_type, int, int, int);
-
-/* Read Node Edge Face or Side Set Parameters */
-EXODUS_EXPORT int ex_get_set_param (int, ex_entity_type, int, int*, int*);
-
-/* Write a Node Edge Face or Side Set */
-EXODUS_EXPORT int ex_put_set (int, ex_entity_type, int, const int*, const int*);
-
-/* Read a Node Edge Face or Side Set */
-EXODUS_EXPORT int ex_get_set (int, ex_entity_type, int, int*, int*);
-
-/* Write Node Edge Face or Side Set Distribution Factors */
-EXODUS_EXPORT int ex_put_set_dist_fact (int, ex_entity_type, int, const void*);
-
-/* Read Node Edge Face or Side Set Distribution Factors */
-EXODUS_EXPORT int ex_get_set_dist_fact (int, ex_entity_type, int, void*);
-
-/* Write Concatenated Node Edge Face or Side Sets */
-EXODUS_EXPORT int ex_put_concat_sets (int, ex_entity_type, const ex_set_specs*);
-
-/* Read Concatenated Node Edge Face or Side Sets */
-EXODUS_EXPORT int ex_get_concat_sets(int, ex_entity_type, ex_set_specs*);
-
-/* (MODIFIED) Write All Results Variables Parameters */
-EXODUS_EXPORT int ex_put_all_var_param_ext(int, const ex_var_params*);
-
-/* Write Edge Face or Element Variable Values on Blocks or Sets at a Time Step */
-EXODUS_EXPORT int ex_put_var (int, int, ex_entity_type, int, int, int,
- const void*);
-
-/* Write Partial Edge Face or Element Variable Values on Blocks or Sets at a Time Step */
-EXODUS_EXPORT int ex_put_n_var (int exoid, int time_step , ex_entity_type var_type,
- int var_index, int obj_id, int start_index, int num_entities,
- const void* var_vals);
-
-/* Read Edge Face or Element Variable Values Defined On Blocks or Sets at a Time Step */
-EXODUS_EXPORT int ex_get_var (int, int, ex_entity_type, int, int, int, void*);
-
-/* Read Partial Edge Face or Element Variable Values on Blocks or Sets at a Time Step */
-EXODUS_EXPORT int ex_get_n_var (int exoid, int time_step , ex_entity_type var_type,
- int var_index, int obj_id, int start_index, int num_entities,
- void* var_vals);
-
-/* Read Edge Face or Element Variable Values Defined On Blocks or Sets Through Time */
-EXODUS_EXPORT int ex_get_var_time (int, ex_entity_type, int, int, int, int,
- void*);
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* __exodus_ext_h */
diff --git a/exodus/cbind/include/exodusII_int.h b/exodus/cbind/include/exodusII_int.h
index fbab7c4..2501a53 100644
--- a/exodus/cbind/include/exodusII_int.h
+++ b/exodus/cbind/include/exodusII_int.h
@@ -42,6 +42,7 @@
#define EXODUS_II_INT_HDR
#include "netcdf.h"
+#include <inttypes.h>
#ifndef __APPLE__
#if defined __STDC__ || defined __cplusplus
@@ -62,6 +63,46 @@
#include <stdio.h>
+/* A format string for outputting size_t ... */
+#if 0
+#if (defined(__STDC__) && defined(__STDC_VERSION__))
+# if (__STDC__ && __STDC_VERSION__ >= 199901L)
+# define PRIoSIZE "zo"
+# define PRIuSIZE "zu"
+# define PRIxSIZE "zx"
+# define PRIXSIZE "zX"
+# endif
+#else
+/* ULLONG_MAX is defined in my wrapper if 64-bit integer extensions
+are detected, even if it's not a C99 compiler. */
+# if defined(ULLONG_MAX) && (SIZE_MAX == ULLONG_MAX)
+# define PRIoSIZE "llo"
+# define PRIuSIZE "llu"
+# define PRIxSIZE "llx"
+# define PRIXSIZE "llX"
+# elif (SIZE_MAX == ULONG_MAX)
+# define PRIoSIZE "lo"
+# define PRIuSIZE "lu"
+# define PRIxSIZE "lx"
+# define PRIXSIZE "lX"
+# elif (SIZE_MAX == UINT_MAX)
+# define PRIoSIZE "o"
+# define PRIuSIZE "u"
+# define PRIxSIZE "x"
+# define PRIXSIZE "X"
+# elif (SIZE_MAX == USHRT_MAX)
+# define PRIoSIZE "ho"
+# define PRIuSIZE "hu"
+# define PRIxSIZE "hx"
+# define PRIXSIZE "hX"
+# else
+# error "Platform not supported"
+# endif
+#endif
+#endif
+
+#define ST_ZU "lu"
+
#define MAX_VAR_NAME_LENGTH 32 /**< Internal use only */
/* this should be defined in ANSI C and C++, but just in case ... */
@@ -112,7 +153,8 @@
/* point numbers in file */
/* used for db version 2.01 */
/* and earlier */
-#define ATT_MAX_NAME_LENGTH "maximum_name_length"
+#define ATT_MAX_NAME_LENGTH "maximum_name_length"
+#define ATT_INT64_STATUS "int64_status"
#define DIM_NUM_NODES "num_nodes" /* # of nodes */
#define DIM_NUM_DIM "num_dim" /* # of dimensions; 2- or 3-d*/
@@ -182,8 +224,6 @@
#define DIM_NUM_ATT_IN_FBLK(num) ex_catstr("num_att_in_fblk",num)
/* # of attributes in face */
/* block num */
-#define DIM_NUM_ATT_IN_NBLK "num_att_in_nblk"
-
#define VAR_CONN(num) ex_catstr("connect",num)
/* element connectivity for */
/* element block num */
@@ -498,6 +538,62 @@
#define VAR_FRAME_IDS "frame_ids"
#define VAR_FRAME_TAGS "frame_tags"
+#define VAR_ELBLK_IDS_GLOBAL "el_blk_ids_global"
+#define VAR_ELBLK_CNT_GLOBAL "el_blk_cnt_global"
+#define VAR_NS_IDS_GLOBAL "ns_ids_global"
+#define VAR_NS_NODE_CNT_GLOBAL "ns_node_cnt_global"
+#define VAR_NS_DF_CNT_GLOBAL "ns_df_cnt_global"
+#define VAR_SS_IDS_GLOBAL "ss_ids_global"
+#define VAR_SS_SIDE_CNT_GLOBAL "ss_side_cnt_global"
+#define VAR_SS_DF_CNT_GLOBAL "ss_df_cnt_global"
+#define VAR_FILE_TYPE "nem_ftype"
+#define VAR_COMM_MAP "comm_map"
+#define VAR_NODE_MAP_INT "node_mapi"
+#define VAR_NODE_MAP_INT_IDX "node_mapi_idx"
+#define VAR_NODE_MAP_BOR "node_mapb"
+#define VAR_NODE_MAP_BOR_IDX "node_mapb_idx"
+#define VAR_NODE_MAP_EXT "node_mape"
+#define VAR_NODE_MAP_EXT_IDX "node_mape_idx"
+#define VAR_ELEM_MAP_INT "elem_mapi"
+#define VAR_ELEM_MAP_INT_IDX "elem_mapi_idx"
+#define VAR_ELEM_MAP_BOR "elem_mapb"
+#define VAR_ELEM_MAP_BOR_IDX "elem_mapb_idx"
+#define VAR_INT_N_STAT "int_n_stat"
+#define VAR_BOR_N_STAT "bor_n_stat"
+#define VAR_EXT_N_STAT "ext_n_stat"
+#define VAR_INT_E_STAT "int_e_stat"
+#define VAR_BOR_E_STAT "bor_e_stat"
+#define VAR_N_COMM_IDS "n_comm_ids"
+#define VAR_N_COMM_STAT "n_comm_stat"
+#define VAR_N_COMM_INFO_IDX "n_comm_info_idx"
+#define VAR_E_COMM_IDS "e_comm_ids"
+#define VAR_E_COMM_STAT "e_comm_stat"
+#define VAR_E_COMM_INFO_IDX "e_comm_info_idx"
+#define VAR_N_COMM_NIDS "n_comm_nids"
+#define VAR_N_COMM_PROC "n_comm_proc"
+#define VAR_N_COMM_DATA_IDX "n_comm_data_idx"
+#define VAR_E_COMM_EIDS "e_comm_eids"
+#define VAR_E_COMM_SIDS "e_comm_sids"
+#define VAR_E_COMM_PROC "e_comm_proc"
+#define VAR_E_COMM_DATA_IDX "e_comm_data_idx"
+
+#define DIM_NUM_INT_NODES "num_int_node"
+#define DIM_NUM_BOR_NODES "num_bor_node"
+#define DIM_NUM_EXT_NODES "num_ext_node"
+#define DIM_NUM_INT_ELEMS "num_int_elem"
+#define DIM_NUM_BOR_ELEMS "num_bor_elem"
+#define DIM_NUM_PROCS "num_processors"
+#define DIM_NUM_PROCS_F "num_procs_file"
+#define DIM_NUM_NODES_GLOBAL "num_nodes_global"
+#define DIM_NUM_ELEMS_GLOBAL "num_elems_global"
+#define DIM_NUM_NS_GLOBAL "num_ns_global"
+#define DIM_NUM_SS_GLOBAL "num_ss_global"
+#define DIM_NUM_ELBLK_GLOBAL "num_el_blk_global"
+#define DIM_NUM_N_CMAPS "num_n_cmaps"
+#define DIM_NUM_E_CMAPS "num_e_cmaps"
+#define DIM_NCNT_CMAP "ncnt_cmap"
+#define DIM_ECNT_CMAP "ecnt_cmap"
+
enum ex_element_type {
EX_EL_UNK = -1, /**< unknown entity */
EX_EL_NULL_ELEMENT= 0,
@@ -525,28 +621,40 @@ typedef enum ex_coordinate_frame_type ex_coordinate_frame_type;
/* Internal structure declarations */
+struct file_item {
+ int file_id;
+ nc_type netcdf_type_code;
+ int int64_status;
+ int maximum_name_length;
+ unsigned int compression_level:4; /* 0 (disabled) to 9 (maximum) compression level; netcdf-4 only */
+ unsigned int user_compute_wordsize:1; /* 0 for 4 byte or 1 for 8 byte reals */
+ unsigned int shuffle:1; /* 1 true, 0 false */
+ unsigned int file_type:2; /* 0 - classic, 1 -- 64 bit classic, 2 --netcdf4, 3 --netcdf4 classic */
+
+ struct file_item* next;
+};
+
struct elem_blk_parm
{
char elem_type[33];
- int elem_blk_id;
- int num_elem_in_blk;
+ int64_t elem_blk_id;
+ int64_t num_elem_in_blk;
int num_nodes_per_elem;
int num_sides;
int num_nodes_per_side[6];
int num_attr;
- int elem_ctr;
+ int64_t elem_ctr;
ex_element_type elem_type_val;
};
struct list_item { /* for use with ex_get_file_item */
-
int exo_id;
int value;
struct list_item* next;
};
struct obj_stats {
- int *id_vals;
+ int64_t *id_vals;
int *stat_vals;
long num;
int exoid;
@@ -556,6 +664,8 @@ struct obj_stats {
};
void ex_iqsort(int v[], int iv[], int count );
+void ex_iqsort64(int64_t v[], int64_t iv[], int64_t count );
+
char* ex_catstr(const char*, int);
char* ex_catstr2(const char*, int, const char*, int);
char* ex_dim_num_entries_in_object(ex_entity_type, int);
@@ -563,8 +673,9 @@ char* ex_dim_num_objects(ex_entity_type obj_type);
char* ex_name_var_of_object( ex_entity_type, int, int );
char* ex_name_of_map( ex_entity_type, int );
-int ex_conv_ini (int exoid, int* comp_wordsize, int* io_wordsize, int file_wordsize);
+int ex_conv_ini (int exoid, int* comp_wordsize, int* io_wordsize, int file_wordsize, int int64_status);
void ex_conv_exit (int exoid);
+
nc_type nc_flt_code (int exoid);
int ex_comp_ws (int exoid);
int ex_get_cpu_ws(void);
@@ -588,10 +699,13 @@ extern struct obj_stats* exoII_fam;
extern struct obj_stats* exoII_nm;
+struct file_item* ex_find_file_item(int exoid);
struct obj_stats *ex_get_stat_ptr ( int exoid, struct obj_stats** obj_ptr);
+
void ex_rm_stat_ptr (int exoid, struct obj_stats** obj_ptr);
-int ex_id_lkup (int exoid, ex_entity_type id_type, int num);
+void ex_compress_variable(int exoid, int varid, int type);
+int ex_id_lkup (int exoid, ex_entity_type id_type, ex_entity_id num);
int ex_check_file_type(const char *path, int *type);
int ex_get_dimension(int exoid, const char *dimtype, const char *label,
size_t *count, int *dimid, const char *routine);
@@ -606,4 +720,46 @@ int ex_put_names_internal(int exoid, int varid, size_t count, char**names,
ex_entity_type type, const char *subtype, const char *routine);
void ex_trim_internal(char *name);
void ex_update_max_name_length(int exoid, int length);
+int ex_leavedef(int neid, /* NemesisI file ID */
+ const char *func_name /* Name of calling function */
+ );
+
+int ex_get_file_type(int neid, /* NetCDF/Exodus file ID */
+ char *ftype /* Nemesis file type */
+ );
+
+int ex_put_nemesis_version(int neid); /* NetCDF/Exodus file ID */
+
+int ne_check_file_version(int neid /* NetCDF/Exodus file ID */
+ );
+
+char *ex_catstrn12(char *name, int num1, int num2);
+
+int ne_id_lkup(int neid, /* NetCDF/Exodus file ID */
+ const char *var_name, /* Nemesis variable name */
+ int64_t *idx, /* index variable for variable, length 2 */
+ ex_entity_id ne_var_id /* NetCDF variable ID */
+ );
+
+ /**
+ * For output databases, the maximum length of any entity, variable,
+ * property, attribute, or coordinate name to be written (not
+ * including the NULL terminator). If a name is longer than this
+ * value, a warning message will be output to stderr and the name
+ * will be truncated. Must be set (via call to
+ * 'ex_set_max_name_length(exoid, int len)' prior to calling ex_create.
+ *
+ * For input databases, the size of the name arrays that the client
+ * code will be passing to API routines that retrieve names (not
+ * including the NULL terminator). This defaults to 32 for
+ * compatibility with older clients. The value used at the time of
+ * creation of the database can be queried by ex_inquire with the
+ * EX_INQ_DB_MAX_NAME_LENGTH argument. The current value for this
+ * variable can be queried with EX_INQ_CUR_MAX_NAME_LENGTH argument.
+ *
+ * Note that this is a global setting for all databases. If you are
+ * accessing multiple databases, they will all use the same value.
+ */
+ extern int ex_default_max_name_length;
+
#endif
diff --git a/exodus/cbind/include/exodusII_par.h b/exodus/cbind/include/exodusII_par.h
new file mode 100644
index 0000000..58eb303
--- /dev/null
+++ b/exodus/cbind/include/exodusII_par.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2012 Sandia Corporation. Under the terms of Contract
+ * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
+ * retains certain rights in this software.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * * Neither the name of Sandia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+/*****************************************************************************
+ *
+ * exodusII_par.h - Exodus II parallel-aware API include file
+ *
+ *****************************************************************************/
+
+#ifndef EXODUS_II_PAR_HDR
+#define EXODUS_II_PAR_HDR
+
+#if !defined(PARALLEL_NETCDF)
+
+#include "exodusII.h"
+
+/*
+ * need following extern if this include file is used in a C++
+ * program, to keep the C++ compiler from mangling the function names.
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ex_open_par(path, mode, comp_ws, io_ws, version, comm, info) ex_open_par_int(path, mode, comp_ws, io_ws, version, comm, info, EX_API_VERS_NODOT)
+#define ex_create_par(path, mode, comp_ws, io_ws, comm, info) ex_create_par_int(path, mode, comp_ws, io_ws, comm, info, EX_API_VERS_NODOT)
+
+EXODUS_EXPORT int ex_open_par_int (const char *path,
+ int mode,
+ int *comp_ws,
+ int *io_ws,
+ float *version,
+ MPI_Comm comm,
+ MPI_Info info,
+ int my_version);
+
+EXODUS_EXPORT int ex_create_par_int (const char *path, int cmode, int *comp_ws, int *io_ws,
+ MPI_Comm comm,
+ MPI_Info info,
+ int my_version);
+
+#else
+#error "Parallel-aware exodusII_par.h included in non-parallel context"
+#endif
+
+#ifdef __cplusplus
+} /* close brackets on extern "C" declaration */
+#endif
+
+#endif
+
diff --git a/exodus/forbind/src/Makefile.standalone b/exodus/cbind/parallel/Imakefile
similarity index 62%
copy from exodus/forbind/src/Makefile.standalone
copy to exodus/cbind/parallel/Imakefile
index e635ea1..57bbd3a 100644
--- a/exodus/forbind/src/Makefile.standalone
+++ b/exodus/cbind/parallel/Imakefile
@@ -31,50 +31,36 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
-INCLUDES = -I../../cbind/include
-F77EXTRAOPTIONS = -I../include
-SRCS = exo_jack.c
+XCOMM Use include files locates in exodusii/cbind/include
+INCLUDES = IncRef-I../include
+REQUIREDLIBS = -L$(SHLIBDIR) $(EXODUS) $(NETCDF)
-SRCSF = addrwrap.F
+#ifndef BuildSharedExodusLibrary
+#define BuildSharedExodusLibrary NO
+#endif
-OBJS = ${SRCS:.c=.o} ${SRCSF:.F=.o}
+#define DoNormalLib YES
+#define DoSharedLib BuildSharedExodusLibrary
+#define LibName exodus_par
+SOREV = 5
+#define SoRev SOREV
-ifeq ($(BITS),64)
+CC = $(CCPAR)
+#define LibraryCcCmd $(CCPAR)
-LOCALFLAGS=-DBuild64
+DEFINES = $(PICFLAGS)
-# Need to compile exo_jack.c without the -DBuild64 option
-# real* -> float* (actually void* since it handles both float* and double*)
-exo_jack32.o: exo_jack.c
- $(CC) -o exo_jack32.o -c $(CFLAGS) -DDEFAULT_REAL_INT exo_jack.c
-
-all:: libexoIIv2for32.a
-libexoIIv2for32.a: exo_jack32.o
- $(AR) $@ $?
- $(_NULLCMD_)
- $(_NULLCMD_)
- $(CP) $@ ../../
+SRCS = ex_open_par.c ex_create_par.c
-endif
+OBJS = ${SRCS:.c=.o}
-all:: libexoIIv2for.a
-libexoIIv2for.a: $(OBJS)
- $(AR) $@ $?
- $(RANLIB) $@
- cp libexoIIv2for.a ../../
+#include <Library.tmpl>
-clean::
- rm -f *.CKP *.ln *.BAK *.bak *.o *.M *.mod core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut "#"*
+LibraryTargetSubdirsCopy(libexodus_par.a,$(OBJS),../../)
-.SUFFIXES: .c .F .f
-.c.o:
- $(CC) -c $(LOCALFLAGS) $(CFLAGS) -DADDC_ $*.c
-.f.o:
- $(FC) -c $(FFLAGS) $*.f
-.F.o:
- $(FC) -c $(LOCALFLAGS) $(DEFINES) $(FFLAGS) $*.F
+$(OBJS): ../include/exodusII.h ../include/exodusII_int.h ../include/exodusII_par.h
-# ----------------------------------------------------------------------
-# dependencies generated by makedepend or sfmakedepend
+DependTarget()
+LibraryObjectRule()
diff --git a/exodus/cbind/src/excre.c b/exodus/cbind/parallel/ex_create_par.c
similarity index 82%
copy from exodus/cbind/src/excre.c
copy to exodus/cbind/parallel/ex_create_par.c
index 17e252d..3f7b64b 100644
--- a/exodus/cbind/src/excre.c
+++ b/exodus/cbind/parallel/ex_create_par.c
@@ -123,15 +123,23 @@ exoid = ex_create ("test.exo" \comment{filename path}
\endcode
*/
+#include <stdlib.h>
+#include <assert.h>
+#include <mpi.h>
+
+#include "netcdf_par.h"
#include "exodusII.h"
#include "exodusII_int.h"
-#include <stdlib.h>
-int ex_create_int (const char *path,
- int cmode,
- int *comp_ws,
- int *io_ws,
- int run_version)
+static int warning_output = 0;
+
+int ex_create_par_int (const char *path,
+ int cmode,
+ int *comp_ws,
+ int *io_ws,
+ MPI_Comm comm,
+ MPI_Info info,
+ int run_version)
{
int exoid, dims[1];
int status;
@@ -148,18 +156,50 @@ int ex_create_int (const char *path,
char *option;
#endif /* NC_NETCDF4 */
+ int int64_status;
+ int pariomode = NC_MPIPOSIX;
+
+ unsigned int my_mode = cmode;
+ assert(my_mode == cmode);
exerrval = 0; /* clear error code */
- if (run_version != EX_API_VERS_NODOT) {
+ if (run_version != EX_API_VERS_NODOT && warning_output == 0) {
int run_version_major = run_version / 100;
int run_version_minor = run_version % 100;
int lib_version_major = EX_API_VERS_NODOT / 100;
int lib_version_minor = EX_API_VERS_NODOT % 100;
fprintf(stderr, "EXODUS: Warning: This code was compiled with exodusII version %d.%02d,\n but was linked with exodusII library version %d.%02d\n This is probably an error in the build process of this code.\n",
run_version_major, run_version_minor, lib_version_major, lib_version_minor);
+ warning_output = 1;
+ }
+
+ /*
+ * See if any integer data is to be stored as int64 (long long). If
+ * so, then need to set NC_NETCDF4 and unset NC_CLASSIC_MODEL (or
+ * set EX_NOCLASSIC. Output meaningful error message if the library
+ * is not NetCDF-4 enabled...
+ */
+ int64_status = my_mode & (EX_ALL_INT64_DB | EX_ALL_INT64_API);
+
+ if ((int64_status & EX_ALL_INT64_DB) != 0) {
+#if defined(NC_NETCDF4)
+ /* Library DOES support netcdf4... Set modes required to use
+ * netcdf-4 in non-classic mode
+ */
+ my_mode |= EX_NOCLASSIC;
+ my_mode |= EX_NETCDF4;
+#else
+ /* Library does NOT support netcdf4 */
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "EXODUS: Error: 64-bit integer storage requested, but the netcdf library does not support the required netcdf-4 extensions.\n");
+ ex_err("ex_create",errmsg,exerrval);
+ return (EX_FATAL);
+#endif
}
+
#if defined(NC_NETCDF4)
- if (cmode & EX_NETCDF4) {
+ if (my_mode & EX_NETCDF4) {
mode |= (NC_NETCDF4);
} else {
if (netcdf4_mode == -1) {
@@ -173,31 +213,41 @@ int ex_create_int (const char *path,
}
mode |= netcdf4_mode;
}
- if (! (cmode & EX_NOCLASSIC)) {
+ if (! (my_mode & EX_NOCLASSIC)) {
mode |= NC_CLASSIC_MODEL;
}
#endif
+ /* Check parallel io mode. Valid is NC_MPIPOSIX or NC_MPIIO or NC_PNETCDF
+ * Exodus uses different flag values; map to netcdf values
+ */
+ if (mode & EX_MPIPOSIX)
+ pariomode = NC_MPIPOSIX;
+ else if (mode & EX_MPIIO)
+ pariomode = NC_MPIIO;
+ else if (mode & EX_PNETCDF)
+ pariomode = NC_PNETCDF;
+
/*
- * See if "large file" mode was specified in a ex_create cmode. If
+ * See if "large file" mode was specified in a ex_create my_mode. If
* so, then pass the NC_64BIT_OFFSET flag down to netcdf.
* If netcdf4 mode specified, don't use NC_64BIT_OFFSET mode.
*/
- if ( (cmode & EX_LARGE_MODEL) && (cmode & EX_NORMAL_MODEL)) {
+ if ( (my_mode & EX_LARGE_MODEL) && (my_mode & EX_NORMAL_MODEL)) {
exerrval = EX_BADPARAM;
sprintf(errmsg,
"Warning: conflicting mode specification for file %s, mode %d. Using normal",
- path, cmode);
+ path, (int)my_mode);
ex_err("ex_create",errmsg,exerrval);
}
- if ((cmode & EX_NORMAL_MODEL) != 0)
+ if (my_mode & EX_NORMAL_MODEL)
filesiz = 0;
#if defined(NC_NETCDF4)
- else if ((mode & NC_NETCDF4) != 0)
+ else if (mode & NC_NETCDF4)
filesiz = 1;
#endif
else
- filesiz = (int)(((cmode & EX_LARGE_MODEL) != 0) || (ex_large_model(-1) == 1));
+ filesiz = (int)((my_mode & EX_LARGE_MODEL) || (ex_large_model(-1) == 1));
if (
#if defined(NC_NETCDF4)
@@ -207,7 +257,7 @@ int ex_create_int (const char *path,
mode |= NC_64BIT_OFFSET;
}
- if (cmode & EX_SHARE) {
+ if (my_mode & EX_SHARE) {
mode |= NC_SHARE;
}
@@ -216,7 +266,7 @@ int ex_create_int (const char *path,
*/
ex_opts(exoptval); /* call required to set ncopts first time through */
- if (cmode & EX_CLOBBER) {
+ if (my_mode & EX_CLOBBER) {
mode |= NC_CLOBBER;
mode_name = "CLOBBER";
} else {
@@ -224,9 +274,9 @@ int ex_create_int (const char *path,
mode_name = "NOCLOBBER";
}
- if ((status = nc_create (path, mode, &exoid)) != NC_NOERR) {
+ if ((status = nc_create_par (path, mode|pariomode, comm, info, &exoid)) != NC_NOERR) {
exerrval = status;
- if (cmode & EX_NETCDF4) {
+ if (my_mode & EX_NETCDF4) {
sprintf(errmsg,
"Error: file create failed for %s in NETCDF4 and %s mode.\n\tThis library probably does not support netcdf-4 files.",
path, mode_name);
@@ -255,7 +305,7 @@ int ex_create_int (const char *path,
* i/o wordsize attribute from file is zero.
*/
- if (ex_conv_ini( exoid, comp_ws, io_ws, 0 ) != EX_NOERR) {
+ if (ex_conv_ini( exoid, comp_ws, io_ws, 0, int64_status ) != EX_NOERR) {
exerrval = EX_FATAL;
sprintf(errmsg,
"Error: failed to init conversion routines in file id %d",
@@ -344,7 +394,6 @@ int ex_create_int (const char *path,
return (EX_FATAL);
}
-
if ((status = nc_def_dim(exoid, DIM_TIME, NC_UNLIMITED, &time_dim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
@@ -362,6 +411,18 @@ int ex_create_int (const char *path,
ex_err("ex_create",errmsg,exerrval);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, dimid, 2);
+
+ {
+ int int64_db_status = int64_status & EX_ALL_INT64_DB;
+ if ((status=nc_put_att_int(exoid, NC_GLOBAL, ATT_INT64_STATUS, NC_INT, 1, &int64_db_status)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to add int64_status attribute in file id %d",exoid);
+ ex_err("ex_put_init_ext",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ }
if ((status = nc_enddef (exoid)) != NC_NOERR) {
exerrval = status;
diff --git a/exodus/cbind/parallel/ex_open_par.c b/exodus/cbind/parallel/ex_open_par.c
new file mode 100644
index 0000000..4320f70
--- /dev/null
+++ b/exodus/cbind/parallel/ex_open_par.c
@@ -0,0 +1,318 @@
+/*
+ * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
+ * retains certain rights in this software.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * * Neither the name of Sandia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/*****************************************************************************
+*
+* exopen - ex_open
+*
+* entry conditions -
+* input parameters:
+* char* path exodus filename path
+* int mode access mode w/r
+*
+* exit conditions -
+* int exoid exodus file id
+* int* comp_ws computer word size
+* int* io_ws storage word size
+* float* version EXODUSII interface version number
+*
+* revision history -
+*
+*
+*****************************************************************************/
+
+#include <stdio.h>
+#include <mpi.h>
+
+#include "netcdf_par.h"
+#include "exodusII.h"
+#include "exodusII_int.h"
+
+/*!
+
+The function ex_open() opens an existing exodus file and returns
+an ID that can subsequently be used to refer to the file, the word
+size of the floating point values stored in the file, and the version
+of the exodus database (returned as a ``float'', regardless of the
+compute or I/O word size). Multiple files may be ``open'' simultaneously.
+
+\return In case of an error, ex_open() returns a negative
+number. Possible causes of errors include:
+ - The specified file does not exist.
+ - The mode specified is something other than the predefined constant \fparam{EX_READ} or \fparam{EX_WRITE}.
+ - Database version is earlier than 2.0.
+
+\param path The file name of the exodus file. This can be given as either an
+ absolute path name (from the root of the file system) or a relative
+ path name (from the current directory).
+
+\param mode Access mode. Use one of the following predefined constants:
+ - \fparam{EX_READ} To open the file just for reading.
+ - \fparam{EX_WRITE} To open the file for writing and reading.
+
+\param[in,out] comp_ws The word size in bytes (0, 4 or 8) of the floating point variables
+ used in the application program. If 0 (zero) is passed, the default
+ size of floating point values for the machine will be used and
+ returned in this variable. WARNING: all exodus functions requiring
+ reals must be passed reals declared with this passed in or returned
+ compute word size (4 or 8).
+
+
+\param[in,out] io_ws The word size in bytes (0, 4 or 8) of the floating
+ point data as they are stored in the exodus file. If the word
+ size does not match the word size of data stored in the file,
+ a fatal error is returned. If this argument is 0, the word size
+ of the floating point data already stored in the file is returned.
+
+\param[out] version Returned exodus database version number.
+
+The following opens an exodus file named \file{test.exo} for read
+only, using default settings for compute and I/O word sizes:
+
+\code
+#include "exodusII.h"
+int CPU_word_size,IO_word_size, exoid;
+float version;
+
+CPU_word_size = sizeof(float); \co{float or double}
+IO_word_size = 0; \co{use what is stored in file}
+
+\comment{open exodus files}
+exoid = ex_open ("test.exo", \co{filename path}
+ EX_READ, \co{access mode = READ}
+ &CPU_word_size, \co{CPU word size}
+ &IO_word_size, \co{IO word size}
+ &version); \co{ExodusII library version}
+\endcode
+ */
+
+static int warning_output = 0;
+
+int ex_open_par_int (const char *path,
+ int mode,
+ int *comp_ws,
+ int *io_ws,
+ float *version,
+ MPI_Comm comm,
+ MPI_Info info,
+ int run_version)
+{
+ int exoid;
+ int status, stat_att, stat_dim;
+ nc_type att_type = NC_NAT;
+ size_t att_len = 0;
+ int old_fill;
+ int file_wordsize;
+ int dim_str_name;
+ int int64_status = 0;
+ int pariomode = NC_MPIPOSIX;
+
+ char errmsg[MAX_ERR_LENGTH];
+
+ exerrval = 0; /* clear error code */
+
+ /* set error handling mode to no messages, non-fatal errors */
+ ex_opts(exoptval); /* call required to set ncopts first time through */
+
+ if (run_version != EX_API_VERS_NODOT && warning_output == 0) {
+ int run_version_major = run_version / 100;
+ int run_version_minor = run_version % 100;
+ int lib_version_major = EX_API_VERS_NODOT / 100;
+ int lib_version_minor = EX_API_VERS_NODOT % 100;
+ fprintf(stderr, "EXODUS: Warning: This code was compiled with exodus version %d.%02d,\n but was linked with exodus library version %d.%02d\n This is probably an error in the build process of this code.\n",
+ run_version_major, run_version_minor, lib_version_major, lib_version_minor);
+ warning_output = 1;
+ }
+
+
+ if ((mode & EX_READ) && (mode & EX_WRITE)) {
+ exerrval = EX_BADFILEMODE;
+ sprintf(errmsg,"Error: Cannot specify both EX_READ and EX_WRITE");
+ ex_err("ex_open",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* Check parallel io mode. Valid is NC_MPIPOSIX or NC_MPIIO or NC_PNETCDF
+ * Exodus uses different flag values; map to netcdf values
+ */
+ if (mode & EX_MPIPOSIX)
+ pariomode = NC_MPIPOSIX;
+ else if (mode & EX_MPIIO)
+ pariomode = NC_MPIIO;
+ else if (mode & EX_PNETCDF)
+ pariomode = NC_PNETCDF;
+
+
+ /* The EX_READ mode is the default if EX_WRITE is not specified... */
+ if (!(mode & EX_WRITE)) { /* READ ONLY */
+ if ((status = nc_open_par (path, NC_NOWRITE|NC_SHARE|pariomode, comm, info, &exoid)) != NC_NOERR)
+ {
+ /* NOTE: netCDF returns an id of -1 on an error - but no error code! */
+ if (status == 0) {
+ exerrval = EX_FATAL;
+ }
+ else {
+ /* It is possible that the user is trying to open a netcdf4
+ file, but the netcdf4 capabilities aren't available in the
+ netcdf linked to this library. Note that we can't just use a
+ compile-time define since we could be using a shareable
+ netcdf library, so the netcdf4 capabilities aren't known
+ until runtime...
+
+ Netcdf-4.X does not (yet?) have a function that can be
+ queried to determine whether the library being used was
+ compiled with --enable-netcdf4, so that isn't very
+ helpful..
+
+ At this time, query the beginning of the file and see if it
+ is an HDF-5 file and if it is assume that the open failure
+ is due to the netcdf library not enabling netcdf4 features...
+ */
+ int type = 0;
+ ex_check_file_type(path, &type);
+
+ if (type == 5) {
+ /* This is an hdf5 (netcdf4) file. Since the nc_open failed,
+ the assumption is that the netcdf doesn't have netcdf4
+ capabilities enabled. Tell the user...
+ */
+ fprintf(stderr,
+ "EXODUS: Error: Attempting to open the netcdf-4 file:\n\t'%s'\n\twith a netcdf library that does not support netcdf-4\n",
+ path);
+ }
+ exerrval = status;
+ }
+ sprintf(errmsg,"Error: failed to open %s read only",path);
+ ex_err("ex_open",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+ }
+ else /* (mode & EX_WRITE) READ/WRITE */
+ {
+ if ((status = nc_open_par (path, NC_WRITE|NC_SHARE|pariomode, comm, info, &exoid)) != NC_NOERR)
+ {
+ /* NOTE: netCDF returns an id of -1 on an error - but no error code! */
+ if (status == 0)
+ exerrval = EX_FATAL;
+ else
+ exerrval = status;
+ sprintf(errmsg,"Error: failed to open %s write only",path);
+ ex_err("ex_open",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+
+ /* turn off automatic filling of netCDF variables */
+ if ((status = nc_set_fill (exoid, NC_NOFILL, &old_fill)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to set nofill mode in file id %d",
+ exoid);
+ ex_err("ex_open", errmsg, exerrval);
+ return (EX_FATAL);
+ }
+
+ stat_att = nc_inq_att(exoid, NC_GLOBAL, ATT_MAX_NAME_LENGTH, &att_type, &att_len);
+ stat_dim = nc_inq_dimid(exoid, DIM_STR_NAME, &dim_str_name);
+ if(stat_att != NC_NOERR || stat_dim != NC_NOERR) {
+ nc_redef(exoid);
+ if (stat_att != NC_NOERR) {
+ int max_so_far = 32;
+ nc_put_att_int(exoid, NC_GLOBAL, ATT_MAX_NAME_LENGTH, NC_INT, 1, &max_so_far);
+ }
+
+ /* If the DIM_STR_NAME variable does not exist on the database, we need to add it now. */
+ if(stat_dim != NC_NOERR) {
+ /* Not found; set to default value of 32+1. */
+ int max_name = ex_default_max_name_length < 32 ? 32 : ex_default_max_name_length;
+ nc_def_dim(exoid, DIM_STR_NAME, max_name+1, &dim_str_name);
+ }
+ nc_enddef (exoid);
+ }
+ }
+
+ /* determine version of EXODUS II file, and the word size of
+ * floating point and integer values stored in the file
+ */
+
+ if ((status = nc_get_att_float(exoid, NC_GLOBAL, ATT_VERSION, version)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,"Error: failed to get database version for file id: %d",
+ exoid);
+ ex_err("ex_open",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+
+ /* check ExodusII file version - old version 1.x files are not supported */
+ if (*version < 2.0) {
+ exerrval = EX_FATAL;
+ sprintf(errmsg,"Error: Unsupported file version %.2f in file id: %d",
+ *version, exoid);
+ ex_err("ex_open",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+
+ if (nc_get_att_int (exoid, NC_GLOBAL, ATT_FLT_WORDSIZE, &file_wordsize) != NC_NOERR)
+ { /* try old (prior to db version 2.02) attribute name */
+ if (nc_get_att_int (exoid,NC_GLOBAL,ATT_FLT_WORDSIZE_BLANK,&file_wordsize) != NC_NOERR)
+ {
+ exerrval = EX_FATAL;
+ sprintf(errmsg,"Error: failed to get file wordsize from file id: %d",
+ exoid);
+ ex_err("ex_open",errmsg,exerrval);
+ return(exerrval);
+ }
+ }
+
+ /* See if int64 status attribute exists and if so, what data is stored as int64
+ * Older files don't have the attribute, so it is not an error if it is missing
+ */
+ if (nc_get_att_int (exoid, NC_GLOBAL, ATT_INT64_STATUS, &int64_status) != NC_NOERR) {
+ int64_status = 0; /* Just in case it gets munged by a failed get_att_int call */
+ }
+
+ /* Merge in API int64 status flags as specified by caller of function... */
+ int64_status |= (mode & EX_ALL_INT64_API);
+
+ /* initialize floating point and integer size conversion. */
+ if (ex_conv_ini( exoid, comp_ws, io_ws, file_wordsize, int64_status ) != EX_NOERR ) {
+ exerrval = EX_FATAL;
+ sprintf(errmsg,
+ "Error: failed to initialize conversion routines in file id %d",
+ exoid);
+ ex_err("ex_open", errmsg, exerrval);
+ return (EX_FATAL);
+ }
+
+ return (exoid);
+}
diff --git a/exodus/cbind/src/Imakefile b/exodus/cbind/src/Imakefile
index a922781..8a77a47 100644
--- a/exodus/cbind/src/Imakefile
+++ b/exodus/cbind/src/Imakefile
@@ -36,6 +36,10 @@ XCOMM Use include files locates in exodusii/cbind/include
INCLUDES = IncRef-I../include
REQUIREDLIBS = -L$(SHLIBDIR) $(NETCDF)
+#if !UseNetcdf4
+NET_DEF = -DNOT_NETCDF4
+#endif
+
#ifndef BuildSharedExodusLibrary
#define BuildSharedExodusLibrary NO
#endif
@@ -43,58 +47,278 @@ REQUIREDLIBS = -L$(SHLIBDIR) $(NETCDF)
#define DoNormalLib YES
#define DoSharedLib BuildSharedExodusLibrary
#define LibName exodus
-SOREV = 4
+SOREV = 5
#define SoRev SOREV
-DEFINES = $(PICFLAGS)
+DEFINES = $(PICFLAGS) $(NET_DEF)
+
+#if defined(BuildParallelAwareExodus)
+PARSRCS = ex_create_par.c ex_open_par.c
+PAROBJS = ${PARSRCS:.c=.o}
+$(PAROBJS): ../include/exodusII.h ../include/exodusII_int.h ../include/exodusII_par.h
+
+CC = $(CCPAR)
+#define LibraryCcCmd $(CCPAR)
+#endif
-SRCS = exclos.c exggvt.c exgpa.c exgvp.c expfrm.c expqa.c \
- excn2s.c exgids.c exgp.c exgvv.c expinf.c expset.c \
- ex_conv.c exginf.c exgpem.c exinq.c expini.c expsetd.c \
- excopy.c exgini.c exgpn.c exopen.c expinix.c expsetp.c \
- excre.c exginix.c exgqa.c exopts.c expmap.c expssv.c \
- exerr.c exgmap.c exgset.c expatn.c expmp.c exptim.c \
- exgatm.c exgmp.c exgsetd.c expatt.c expnam.c exptt.c \
- exgatn.c exgnam.c exgsetp.c expattp.c expnams.c expvan.c \
- exgatt.c exgnams.c exgsnl.c expblk.c expnmap.c expvar.c \
- exgattp.c exgnmap.c exgssc.c expcab.c expnnm.c expvnm.c \
- exgblk.c exgnnm.c exgssn.c expclb.c expnsv.c expvpax.c \
- exgcon.c exgnsv.c exgssv.c expcon.c expnv.c expvp.c \
- exgconn.c exgnv.c exgtim.c expconn.c expnvv.c expvv.c \
- exgcor.c exgnvid.c exgtt.c expcor.c expoatt.c exupda.c \
- exgcset.c exgnvt.c exgvan.c expcset.c exppa.c expidm.c \
- exgenm.c exgnvv.c exgvar.c expelc.c expp.c exgfrm.c \
- exgoatt.c exgvart.c expenm.c exppem.c exggv.c exgotv.c \
- exgvnm.c expev.c exppn.c exppsetd.c exgidm.c ex_utils.c \
- exgvarnam.c expvarnam.c exgvarnams.c expvarnams.c \
- exgvartab.c expvartab.c exgvarparam.c expvarparam.c \
- exgcns.c exgnstt.c expem.c exgnconn.c \
- exgcss.c exgnsvid.c expgv.c \
- exgean.c exgoea.c expnm.c \
- exgeat.c exgsp.c expnp.c \
- exgebi.c exgss.c expns.c \
- exgelb.c exgssd.c expnsd.c \
- exgelc.c exgssi.c expnstt.c \
- exgem.c exgsstt.c expoea.c \
- exgev.c exgssvid.c expsp.c \
- exgevid.c exgvid.c expss.c \
- exgevt.c exgvtt.c expssd.c \
- exgnm.c expcns.c expsstt.c \
- exgnp.c expcss.c expvpa.c \
- exgns.c expean.c expvpc.c \
- exgnsd.c expeat.c expvtt.c \
- exgnsi.c expelb.c exgncor.c \
- expncor.c exgnoatt.c expnoatt.c \
- expnvar.c exgnvar.c expnnv.c exgnnv.c exgcssc.c \
- expecpp.c exgecpp.c exppidm.c
+SRCS = ex_close.c \
+ ex_conv.c \
+ ex_copy.c \
+ ex_create.c \
+ ex_cvt_nodes_to_sides.c \
+ ex_err.c \
+ ex_get_all_times.c \
+ ex_get_attr.c \
+ ex_get_attr_names.c \
+ ex_get_attr_param.c \
+ ex_get_block.c \
+ ex_get_block_param.c \
+ ex_get_cmap_params.c \
+ ex_get_concat_node_sets.c \
+ ex_get_concat_sets.c \
+ ex_get_concat_side_set_node_count.c \
+ ex_get_concat_side_sets.c \
+ ex_get_conn.c \
+ ex_get_coord.c \
+ ex_get_coordinate_frames.c \
+ ex_get_coord_names.c \
+ ex_get_eb_info_global.c \
+ ex_get_elem_attr.c \
+ ex_get_elem_attr_names.c \
+ ex_get_elem_blk_ids.c \
+ ex_get_elem_block.c \
+ ex_get_elem_cmap.c \
+ ex_get_elem_conn.c \
+ ex_get_elem_map.c \
+ ex_get_elem_num_map.c \
+ ex_get_elem_type.c \
+ ex_get_elem_var.c \
+ ex_get_elem_var_tab.c \
+ ex_get_elem_var_time.c \
+ ex_get_entity_count_per_polyhedra.c \
+ ex_get_glob_vars.c \
+ ex_get_glob_var_time.c \
+ ex_get_id_map.c \
+ ex_get_ids.c \
+ ex_get_info.c \
+ ex_get_init.c \
+ ex_get_init_ext.c \
+ ex_get_init_global.c \
+ ex_get_init_info.c \
+ ex_get_loadbal_param.c \
+ ex_get_map.c \
+ ex_get_map_param.c \
+ ex_get_name.c \
+ ex_get_names.c \
+ ex_get_n_attr.c \
+ ex_get_n_conn.c \
+ ex_get_n_coord.c \
+ ex_get_n_elem_attr.c \
+ ex_get_n_elem_conn.c \
+ ex_get_n_elem_num_map.c \
+ ex_get_n_elem_var.c \
+ ex_get_n_nodal_var.c \
+ ex_get_n_node_num_map.c \
+ ex_get_n_node_set.c \
+ ex_get_n_node_set_df.c \
+ ex_get_nodal_var.c \
+ ex_get_nodal_var_time.c \
+ ex_get_node_cmap.c \
+ ex_get_node_map.c \
+ ex_get_node_num_map.c \
+ ex_get_node_set.c \
+ ex_get_node_set_dist_fact.c \
+ ex_get_node_set_ids.c \
+ ex_get_node_set_param.c \
+ ex_get_n_one_attr.c \
+ ex_get_nset_var.c \
+ ex_get_nset_var_tab.c \
+ ex_get_n_side_set.c \
+ ex_get_n_side_set_df.c \
+ ex_get_ns_param_global.c \
+ ex_get_num_map.c \
+ ex_get_n_var.c \
+ ex_get_object_truth_vector.c \
+ ex_get_one_attr.c \
+ ex_get_one_elem_attr.c \
+ ex_get_partial_attr.c \
+ ex_get_partial_conn.c \
+ ex_get_partial_coord.c \
+ ex_get_partial_elem_attr.c \
+ ex_get_partial_elem_conn.c \
+ ex_get_partial_elem_map.c \
+ ex_get_partial_elem_num_map.c \
+ ex_get_partial_elem_var.c \
+ ex_get_partial_id_map.c \
+ ex_get_partial_nodal_var.c \
+ ex_get_partial_node_num_map.c \
+ ex_get_partial_node_set.c \
+ ex_get_partial_node_set_df.c \
+ ex_get_partial_num_map.c \
+ ex_get_partial_one_attr.c \
+ ex_get_partial_set_dist_fact.c \
+ ex_get_partial_side_set.c \
+ ex_get_partial_side_set_df.c \
+ ex_get_partial_var.c \
+ ex_get_processor_elem_maps.c \
+ ex_get_processor_node_maps.c \
+ ex_get_prop_array.c \
+ ex_get_prop.c \
+ ex_get_prop_names.c \
+ ex_get_qa.c \
+ ex_get_set.c \
+ ex_get_set_dist_fact.c \
+ ex_get_set_param.c \
+ ex_get_sets.c \
+ ex_get_side_set.c \
+ ex_get_side_set_dist_fact.c \
+ ex_get_side_set_ids.c \
+ ex_get_side_set_node_count.c \
+ ex_get_side_set_node_list.c \
+ ex_get_side_set_node_list_len.c \
+ ex_get_side_set_param.c \
+ ex_get_sset_var.c \
+ ex_get_sset_var_tab.c \
+ ex_get_ss_param_global.c \
+ ex_get_time.c \
+ ex_get_truth_table.c \
+ ex_get_var.c \
+ ex_get_variable_name.c \
+ ex_get_variable_names.c \
+ ex_get_variable_param.c \
+ ex_get_var_name.c \
+ ex_get_var_names.c \
+ ex_get_var_param.c \
+ ex_get_var_tab.c \
+ ex_get_var_time.c \
+ ex_inquire.c \
+ ex_ne_util.c \
+ ex_open.c \
+ ex_opts.c \
+ ex_put_all_var_param.c \
+ ex_put_all_var_param_ext.c \
+ ex_put_attr.c \
+ ex_put_attr_names.c \
+ ex_put_attr_param.c \
+ ex_put_block.c \
+ ex_put_block_param.c \
+ ex_put_cmap_params.c \
+ ex_put_cmap_params_cc.c \
+ ex_put_concat_all_blocks.c \
+ ex_put_concat_elem_block.c \
+ ex_put_concat_node_sets.c \
+ ex_put_concat_sets.c \
+ ex_put_concat_side_sets.c \
+ ex_put_concat_var_param.c \
+ ex_put_conn.c \
+ ex_put_coord.c \
+ ex_put_coordinate_frames.c \
+ ex_put_coord_names.c \
+ ex_put_eb_info_global.c \
+ ex_put_elem_attr.c \
+ ex_put_elem_attr_names.c \
+ ex_put_elem_block.c \
+ ex_put_elem_cmap.c \
+ ex_put_elem_conn.c \
+ ex_put_elem_map.c \
+ ex_put_elem_num_map.c \
+ ex_put_elem_var.c \
+ ex_put_elem_var_slab.c \
+ ex_put_elem_var_tab.c \
+ ex_put_entity_count_per_polyhedra.c \
+ ex_put_glob_vars.c \
+ ex_put_id_map.c \
+ ex_put_info.c \
+ ex_put_init.c \
+ ex_put_init_ext.c \
+ ex_put_init_global.c \
+ ex_put_init_info.c \
+ ex_put_loadbal_param.c \
+ ex_put_loadbal_param_cc.c \
+ ex_put_map.c \
+ ex_put_map_param.c \
+ ex_put_name.c \
+ ex_put_names.c \
+ ex_put_n_coord.c \
+ ex_put_n_elem_attr.c \
+ ex_put_n_elem_conn.c \
+ ex_put_n_elem_num_map.c \
+ ex_put_n_nodal_var.c \
+ ex_put_n_node_num_map.c \
+ ex_put_n_node_set.c \
+ ex_put_n_node_set_df.c \
+ ex_put_nodal_var.c \
+ ex_put_nodal_var_slab.c \
+ ex_put_node_cmap.c \
+ ex_put_node_map.c \
+ ex_put_node_num_map.c \
+ ex_put_node_set.c \
+ ex_put_node_set_dist_fact.c \
+ ex_put_node_set_param.c \
+ ex_put_n_one_attr.c \
+ ex_put_nset_var.c \
+ ex_put_nset_var_tab.c \
+ ex_put_n_side_set.c \
+ ex_put_n_side_set_df.c \
+ ex_put_ns_param_global.c \
+ ex_put_num_map.c \
+ ex_put_n_var.c \
+ ex_put_one_attr.c \
+ ex_put_one_elem_attr.c \
+ ex_put_partial_attr.c \
+ ex_put_partial_coord.c \
+ ex_put_partial_elem_attr.c \
+ ex_put_partial_elem_conn.c \
+ ex_put_partial_elem_map.c \
+ ex_put_partial_elem_num_map.c \
+ ex_put_partial_id_map.c \
+ ex_put_partial_nodal_var.c \
+ ex_put_partial_node_num_map.c \
+ ex_put_partial_node_set.c \
+ ex_put_partial_node_set_df.c \
+ ex_put_partial_num_map.c \
+ ex_put_partial_one_attr.c \
+ ex_put_partial_set.c \
+ ex_put_partial_set_dist_fact.c \
+ ex_put_partial_side_set.c \
+ ex_put_partial_side_set_df.c \
+ ex_put_partial_var.c \
+ ex_put_processor_elem_maps.c \
+ ex_put_processor_node_maps.c \
+ ex_put_prop_array.c \
+ ex_put_prop.c \
+ ex_put_prop_names.c \
+ ex_put_qa.c \
+ ex_put_set.c \
+ ex_put_set_dist_fact.c \
+ ex_put_set_param.c \
+ ex_put_sets.c \
+ ex_put_side_set.c \
+ ex_put_side_set_dist_fact.c \
+ ex_put_side_set_param.c \
+ ex_put_sset_var.c \
+ ex_put_sset_var_tab.c \
+ ex_put_ss_param_global.c \
+ ex_put_time.c \
+ ex_put_truth_table.c \
+ ex_put_var.c \
+ ex_put_variable_name.c \
+ ex_put_variable_names.c \
+ ex_put_variable_param.c \
+ ex_put_var_name.c \
+ ex_put_var_names.c \
+ ex_put_var_param.c \
+ ex_put_var_tab.c \
+ ex_update.c \
+ ex_utils.c
-OBJS = ${SRCS:.c=.o}
+OBJS = ${SRCS:.c=.o}
-#include <Library.tmpl>
+#include <Library.tmpl>
-LibraryTargetSubdirsCopy(libexodus.a,$(OBJS),../../)
+LibraryTargetSubdirsCopy(libexodus.a,$(OBJS) $(PAROBJS),../../)
-$(OBJS): ../include/exodusII.h ../include/exodusII_int.h ../include/exodusII_ext.h
+$(OBJS): ../include/exodusII.h ../include/exodusII_int.h
DependTarget()
LibraryObjectRule()
diff --git a/exodus/cbind/src/Makefile.standalone b/exodus/cbind/src/Makefile.standalone
index 1fa6e35..ffc1698 100644
--- a/exodus/cbind/src/Makefile.standalone
+++ b/exodus/cbind/src/Makefile.standalone
@@ -1,180 +1,253 @@
-SRCS = \
- ex_conv.c \
- ex_utils.c \
- exclos.c \
- excn2s.c \
- excopy.c \
- excre.c \
- exerr.c \
- exgatm.c \
- exgatn.c \
- exgatt.c \
- exgattp.c \
- exgblk.c \
- exgcns.c \
- exgcon.c \
- exgconn.c \
- exgcor.c \
- exgcset.c \
- exgcss.c \
- exgcssc.c \
- exgean.c \
- exgeat.c \
- exgebi.c \
- exgecpp.c \
- exgelb.c \
- exgelc.c \
- exgem.c \
- exgenm.c \
- exgev.c \
- exgevid.c \
- exgevt.c \
- exgfrm.c \
- exggv.c \
- exggvt.c \
- exgidm.c \
- exgids.c \
- exginf.c \
- exgini.c \
- exginix.c \
- exgmap.c \
- exgmp.c \
- exgnam.c \
- exgnams.c \
- exgnconn.c \
- exgncor.c \
- exgnm.c \
- exgnmap.c \
- exgnnm.c \
- exgnnv.c \
- exgnoatt.c \
- exgnp.c \
- exgns.c \
- exgnsd.c \
- exgnsi.c \
- exgnstt.c \
- exgnsv.c \
- exgnsvid.c \
- exgnv.c \
- exgnvar.c \
- exgnvid.c \
- exgnvt.c \
- exgnvv.c \
- exgoatt.c \
- exgoea.c \
- exgotv.c \
- exgp.c \
- exgpa.c \
- exgpem.c \
- exgpn.c \
- exgqa.c \
- exgset.c \
- exgsetd.c \
- exgsetp.c \
- exgsnl.c \
- exgsp.c \
- exgss.c \
- exgssc.c \
- exgssd.c \
- exgssi.c \
- exgssn.c \
- exgsstt.c \
- exgssv.c \
- exgssvid.c \
- exgtim.c \
- exgtt.c \
- exgvan.c \
- exgvar.c \
- exgvarnam.c \
- exgvarnams.c \
- exgvarparam.c \
- exgvart.c \
- exgvartab.c \
- exgvid.c \
- exgvnm.c \
- exgvp.c \
- exgvtt.c \
- exgvv.c \
- exinq.c \
- exopen.c \
- exopts.c \
- expatn.c \
- expatt.c \
- expattp.c \
- expblk.c \
- expcab.c \
- expclb.c \
- expcns.c \
- expcon.c \
- expconn.c \
- expcor.c \
- expcset.c \
- expcss.c \
- expean.c \
- expeat.c \
- expecpp.c \
- expelb.c \
- expelc.c \
- expem.c \
- expenm.c \
- expev.c \
- expfrm.c \
- expgv.c \
- expidm.c \
- expinf.c \
- expini.c \
- expinix.c \
- expmap.c \
- expmp.c \
- expnam.c \
- expnams.c \
- expncor.c \
- expnm.c \
- expnmap.c \
- expnnm.c \
- expnnv.c \
- expnoatt.c \
- expnp.c \
- expns.c \
- expnsd.c \
- expnstt.c \
- expnsv.c \
- expnv.c \
- expnvar.c \
- expnvv.c \
- expoatt.c \
- expoea.c \
- expp.c \
- exppa.c \
- exppem.c \
- exppidm.c \
- exppn.c \
- exppsetd.c \
- expqa.c \
- expset.c \
- expsetd.c \
- expsetp.c \
- expsp.c \
- expss.c \
- expssd.c \
- expsstt.c \
- expssv.c \
- exptim.c \
- exptt.c \
- expvan.c \
- expvar.c \
- expvarnam.c \
- expvarnams.c \
- expvarparam.c \
- expvartab.c \
- expvnm.c \
- expvp.c \
- expvpa.c \
- expvpax.c \
- expvpc.c \
- expvtt.c \
- expvv.c \
- exupda.c
+SRCS = ex_close.c \
+ ex_conv.c \
+ ex_copy.c \
+ ex_create.c \
+ ex_cvt_nodes_to_sides.c \
+ ex_err.c \
+ ex_get_all_times.c \
+ ex_get_attr.c \
+ ex_get_attr_names.c \
+ ex_get_attr_param.c \
+ ex_get_block.c \
+ ex_get_block_param.c \
+ ex_get_cmap_params.c \
+ ex_get_concat_node_sets.c \
+ ex_get_concat_sets.c \
+ ex_get_concat_side_set_node_count.c \
+ ex_get_concat_side_sets.c \
+ ex_get_conn.c \
+ ex_get_coord.c \
+ ex_get_coordinate_frames.c \
+ ex_get_coord_names.c \
+ ex_get_eb_info_global.c \
+ ex_get_elem_attr.c \
+ ex_get_elem_attr_names.c \
+ ex_get_elem_blk_ids.c \
+ ex_get_elem_block.c \
+ ex_get_elem_cmap.c \
+ ex_get_elem_conn.c \
+ ex_get_elem_map.c \
+ ex_get_elem_num_map.c \
+ ex_get_elem_type.c \
+ ex_get_elem_var.c \
+ ex_get_elem_var_tab.c \
+ ex_get_elem_var_time.c \
+ ex_get_entity_count_per_polyhedra.c \
+ ex_get_glob_vars.c \
+ ex_get_glob_var_time.c \
+ ex_get_id_map.c \
+ ex_get_ids.c \
+ ex_get_info.c \
+ ex_get_init.c \
+ ex_get_init_ext.c \
+ ex_get_init_global.c \
+ ex_get_init_info.c \
+ ex_get_loadbal_param.c \
+ ex_get_map.c \
+ ex_get_map_param.c \
+ ex_get_name.c \
+ ex_get_names.c \
+ ex_get_n_attr.c \
+ ex_get_n_conn.c \
+ ex_get_n_coord.c \
+ ex_get_n_elem_attr.c \
+ ex_get_n_elem_conn.c \
+ ex_get_n_elem_num_map.c \
+ ex_get_n_elem_var.c \
+ ex_get_n_nodal_var.c \
+ ex_get_n_node_num_map.c \
+ ex_get_n_node_set.c \
+ ex_get_n_node_set_df.c \
+ ex_get_nodal_var.c \
+ ex_get_nodal_var_time.c \
+ ex_get_node_cmap.c \
+ ex_get_node_map.c \
+ ex_get_node_num_map.c \
+ ex_get_node_set.c \
+ ex_get_node_set_dist_fact.c \
+ ex_get_node_set_ids.c \
+ ex_get_node_set_param.c \
+ ex_get_n_one_attr.c \
+ ex_get_nset_var.c \
+ ex_get_nset_var_tab.c \
+ ex_get_n_side_set.c \
+ ex_get_n_side_set_df.c \
+ ex_get_ns_param_global.c \
+ ex_get_num_map.c \
+ ex_get_n_var.c \
+ ex_get_object_truth_vector.c \
+ ex_get_one_attr.c \
+ ex_get_one_elem_attr.c \
+ ex_get_partial_attr.c \
+ ex_get_partial_conn.c \
+ ex_get_partial_coord.c \
+ ex_get_partial_elem_attr.c \
+ ex_get_partial_elem_conn.c \
+ ex_get_partial_elem_map.c \
+ ex_get_partial_elem_num_map.c \
+ ex_get_partial_elem_var.c \
+ ex_get_partial_id_map.c \
+ ex_get_partial_nodal_var.c \
+ ex_get_partial_node_num_map.c \
+ ex_get_partial_node_set.c \
+ ex_get_partial_node_set_df.c \
+ ex_get_partial_num_map.c \
+ ex_get_partial_one_attr.c \
+ ex_get_partial_set_dist_fact.c \
+ ex_get_partial_side_set.c \
+ ex_get_partial_side_set_df.c \
+ ex_get_partial_var.c \
+ ex_get_processor_elem_maps.c \
+ ex_get_processor_node_maps.c \
+ ex_get_prop_array.c \
+ ex_get_prop.c \
+ ex_get_prop_names.c \
+ ex_get_qa.c \
+ ex_get_set.c \
+ ex_get_set_dist_fact.c \
+ ex_get_set_param.c \
+ ex_get_sets.c \
+ ex_get_side_set.c \
+ ex_get_side_set_dist_fact.c \
+ ex_get_side_set_ids.c \
+ ex_get_side_set_node_count.c \
+ ex_get_side_set_node_list.c \
+ ex_get_side_set_node_list_len.c \
+ ex_get_side_set_param.c \
+ ex_get_sset_var.c \
+ ex_get_sset_var_tab.c \
+ ex_get_ss_param_global.c \
+ ex_get_time.c \
+ ex_get_truth_table.c \
+ ex_get_var.c \
+ ex_get_variable_name.c \
+ ex_get_variable_names.c \
+ ex_get_variable_param.c \
+ ex_get_var_name.c \
+ ex_get_var_names.c \
+ ex_get_var_param.c \
+ ex_get_var_tab.c \
+ ex_get_var_time.c \
+ ex_inquire.c \
+ ex_ne_util.c \
+ ex_open.c \
+ ex_opts.c \
+ ex_put_all_var_param.c \
+ ex_put_all_var_param_ext.c \
+ ex_put_attr.c \
+ ex_put_attr_names.c \
+ ex_put_attr_param.c \
+ ex_put_block.c \
+ ex_put_block_param.c \
+ ex_put_cmap_params.c \
+ ex_put_cmap_params_cc.c \
+ ex_put_concat_all_blocks.c \
+ ex_put_concat_elem_block.c \
+ ex_put_concat_node_sets.c \
+ ex_put_concat_sets.c \
+ ex_put_concat_side_sets.c \
+ ex_put_concat_var_param.c \
+ ex_put_conn.c \
+ ex_put_coord.c \
+ ex_put_coordinate_frames.c \
+ ex_put_coord_names.c \
+ ex_put_eb_info_global.c \
+ ex_put_elem_attr.c \
+ ex_put_elem_attr_names.c \
+ ex_put_elem_block.c \
+ ex_put_elem_cmap.c \
+ ex_put_elem_conn.c \
+ ex_put_elem_map.c \
+ ex_put_elem_num_map.c \
+ ex_put_elem_var.c \
+ ex_put_elem_var_slab.c \
+ ex_put_elem_var_tab.c \
+ ex_put_entity_count_per_polyhedra.c \
+ ex_put_glob_vars.c \
+ ex_put_id_map.c \
+ ex_put_info.c \
+ ex_put_init.c \
+ ex_put_init_ext.c \
+ ex_put_init_global.c \
+ ex_put_init_info.c \
+ ex_put_loadbal_param.c \
+ ex_put_loadbal_param_cc.c \
+ ex_put_map.c \
+ ex_put_map_param.c \
+ ex_put_name.c \
+ ex_put_names.c \
+ ex_put_n_coord.c \
+ ex_put_n_elem_attr.c \
+ ex_put_n_elem_conn.c \
+ ex_put_n_elem_num_map.c \
+ ex_put_n_nodal_var.c \
+ ex_put_n_node_num_map.c \
+ ex_put_n_node_set.c \
+ ex_put_n_node_set_df.c \
+ ex_put_nodal_var.c \
+ ex_put_nodal_var_slab.c \
+ ex_put_node_cmap.c \
+ ex_put_node_map.c \
+ ex_put_node_num_map.c \
+ ex_put_node_set.c \
+ ex_put_node_set_dist_fact.c \
+ ex_put_node_set_param.c \
+ ex_put_n_one_attr.c \
+ ex_put_nset_var.c \
+ ex_put_nset_var_tab.c \
+ ex_put_n_side_set.c \
+ ex_put_n_side_set_df.c \
+ ex_put_ns_param_global.c \
+ ex_put_num_map.c \
+ ex_put_n_var.c \
+ ex_put_one_attr.c \
+ ex_put_one_elem_attr.c \
+ ex_put_partial_attr.c \
+ ex_put_partial_coord.c \
+ ex_put_partial_elem_attr.c \
+ ex_put_partial_elem_conn.c \
+ ex_put_partial_elem_map.c \
+ ex_put_partial_elem_num_map.c \
+ ex_put_partial_id_map.c \
+ ex_put_partial_nodal_var.c \
+ ex_put_partial_node_num_map.c \
+ ex_put_partial_node_set.c \
+ ex_put_partial_node_set_df.c \
+ ex_put_partial_num_map.c \
+ ex_put_partial_one_attr.c \
+ ex_put_partial_set.c \
+ ex_put_partial_set_dist_fact.c \
+ ex_put_partial_side_set.c \
+ ex_put_partial_side_set_df.c \
+ ex_put_partial_var.c \
+ ex_put_processor_elem_maps.c \
+ ex_put_processor_node_maps.c \
+ ex_put_prop_array.c \
+ ex_put_prop.c \
+ ex_put_prop_names.c \
+ ex_put_qa.c \
+ ex_put_set.c \
+ ex_put_set_dist_fact.c \
+ ex_put_set_param.c \
+ ex_put_sets.c \
+ ex_put_side_set.c \
+ ex_put_side_set_dist_fact.c \
+ ex_put_side_set_param.c \
+ ex_put_sset_var.c \
+ ex_put_sset_var_tab.c \
+ ex_put_ss_param_global.c \
+ ex_put_time.c \
+ ex_put_truth_table.c \
+ ex_put_var.c \
+ ex_put_variable_name.c \
+ ex_put_variable_names.c \
+ ex_put_variable_param.c \
+ ex_put_var_name.c \
+ ex_put_var_names.c \
+ ex_put_var_param.c \
+ ex_put_var_tab.c \
+ ex_update.c \
+ ex_utils.c
OBJS = ${SRCS:.c=.o}
diff --git a/exodus/cbind/src/exclos.c b/exodus/cbind/src/ex_close.c
similarity index 100%
rename from exodus/cbind/src/exclos.c
rename to exodus/cbind/src/ex_close.c
diff --git a/exodus/cbind/src/ex_conv.c b/exodus/cbind/src/ex_conv.c
index 4e1ef92..ab632ae 100644
--- a/exodus/cbind/src/ex_conv.c
+++ b/exodus/cbind/src/ex_conv.c
@@ -65,42 +65,40 @@
#define NC_FLOAT_WORDSIZE 4
#define NC_DOUBLE_WORDSIZE 8
-struct file_item {
- int file_id;
- nc_type netcdf_type_code;
- int user_compute_wordsize;
- struct file_item* next;
-};
-
-struct file_item* file_list = NULL;
-
-#define FIND_FILE(ptr,id) { ptr = file_list; \
- while(ptr) { \
- if( ptr->file_id == id ) break; \
- ptr = ptr->next; \
- } \
- }
+static struct file_item* file_list = NULL;
+
+struct file_item* ex_find_file_item(int exoid)
+{
+ struct file_item *ptr = file_list;
+ while (ptr) { \
+ if( ptr->file_id == exoid ) break; \
+ ptr = ptr->next; \
+ } \
+ return ptr;
+}
int ex_conv_ini( int exoid,
int* comp_wordsize,
int* io_wordsize,
- int file_wordsize )
+ int file_wordsize,
+ int int64_status)
{
char errmsg[MAX_ERR_LENGTH];
struct file_item* new_file;
-
+ int filetype = 0;
+
/*! ex_conv_ini() initializes the floating point conversion process.
*
- * \param exoid an integer uniquely identifying the file of interest.
+ * \param exoid an integer uniquely identifying the file of interest.
*
- * \param comp_wordsize compute floating point word size in the user's code.
+ * \param comp_wordsize compute floating point word size in the user's code.
* a zero value indicates that the user is requesting the
* default float size for the machine. The appropriate
* value is chosen and returned in comp_wordsize, and used
* in subsequent conversions. a valid but inappropriate
* for this parameter cannot be detected.
*
- * \param io_wordsize the desired floating point word size for a netCDF file.
+ * \param io_wordsize the desired floating point word size for a netCDF file.
* for an existing file, if this parameter doesn't match
* the word size of data already stored in the file, a
* fatal error is generated. a value of 0 for an existing
@@ -110,9 +108,13 @@ int ex_conv_ini( int exoid,
* NC_FLOAT (4 bytes). when a value of 0 is specified the
* actual value used is returned in io_wordsize.
*
- * \param file_wordsize floating point word size in an existing netCDF file.
+ * \param file_wordsize floating point word size in an existing netCDF file.
* a value of 0 should be passed in for a new netCDF file.
*
+ * \param int64_status the flags specifying how integer values should be stored
+ * on the database and how they should be passes through the
+ * api functions. See #FileVars for more information.
+ *
* word size parameters are specified in bytes. valid values are 0, 4, and 8:
*/
@@ -127,7 +129,6 @@ int ex_conv_ini( int exoid,
}
/* check to see if requested word sizes are valid */
-
if (!*io_wordsize ) {
if (!file_wordsize )
*io_wordsize = NC_FLOAT_WORDSIZE;
@@ -159,10 +160,37 @@ int ex_conv_ini( int exoid,
return(EX_FATAL);
}
+ /* Check that the int64_status contains only valid bits... */
+ {
+ int valid_int64 = EX_ALL_INT64_API | EX_ALL_INT64_DB;
+ if ((int64_status & valid_int64) != int64_status) {
+ sprintf(errmsg,
+ "Warning: invalid int64_status flag (%d) specified for existing file id: %d. Ignoring invalids",
+ int64_status, exoid);
+ ex_err("ex_conv_ini",errmsg,EX_MSG);
+ }
+ int64_status &= valid_int64;
+ }
+
+ /* Verify filetype
+ * 0 -- classic format (NC_FORMAT_CLASSIC -1)
+ * 1 -- 64 bit classic (NC_FORMAT_64BIT -1)
+ * 2 -- netcdf4 (NC_FORMAT_NETCDF4 -1)
+ * 3 -- netcdf4 classic (NC_FORMAT_NETCDF4_CLASSIC -1)
+ */
+
+ nc_inq_format(exoid, &filetype);
+
new_file = malloc(sizeof(struct file_item));
new_file->file_id = exoid;
- new_file->user_compute_wordsize = *comp_wordsize;
+ new_file->user_compute_wordsize = *comp_wordsize == 4 ? 0 : 1;
+ new_file->int64_status = int64_status;
+ new_file->maximum_name_length = ex_default_max_name_length;
+ new_file->compression_level = 0;
+ new_file->shuffle = 0;
+ new_file->file_type = filetype-1;
+
new_file->next = file_list;
file_list = new_file;
@@ -228,14 +256,12 @@ nc_type nc_flt_code( int exoid )
*
* "exoid" is some integer which uniquely identifies the file of interest.
*/
-
- char errmsg[MAX_ERR_LENGTH];
- struct file_item* file;
+ struct file_item* file = ex_find_file_item(exoid);
exerrval = 0; /* clear error code */
- FIND_FILE( file, exoid );
if (!file ) {
+ char errmsg[MAX_ERR_LENGTH];
exerrval = EX_BADFILEID;
sprintf(errmsg,"Error: unknown file id %d for nc_flt_code().",exoid);
ex_err("nc_flt_code",errmsg,exerrval);
@@ -244,6 +270,125 @@ nc_type nc_flt_code( int exoid )
return file->netcdf_type_code;
}
+int ex_int64_status(int exoid)
+{
+ /* ex_int64_status() returns an int that can be tested
+ against the defines listed below to determine which, if any,
+ 'types' in the database are to be stored as int64 types and which, if any,
+ types are passed/returned as int64 types in the API
+
+ Defines:
+ EX_MAPS_INT64_DB All maps (id, order, ...) store int64_t values
+ EX_IDS_INT64_DB All entity ids (sets, blocks, maps) are int64_t values
+ EX_BULK_INT64_DB
+ EX_ALL_INT64_DB (EX_MAPS_INT64_DB|EX_IDS_INT64_DB|EX_BULK_INT64_DB)
+
+ EX_MAPS_INT64_API All maps (id, order, ...) passed as int64_t values
+ EX_IDS_INT64_API All entity ids (sets, blocks, maps) are passed as int64_t values
+ EX_BULK_INT64_API
+ EX_ALL_INT64_API (EX_MAPS_INT64_API|EX_IDS_INT64_API|EX_BULK_INT64_API)
+ */
+ struct file_item* file = ex_find_file_item(exoid);
+
+ exerrval = 0; /* clear error code */
+
+ if (!file ) {
+ char errmsg[MAX_ERR_LENGTH];
+ exerrval = EX_BADFILEID;
+ sprintf(errmsg,"Error: unknown file id %d for ex_int64_status().",exoid);
+ ex_err("ex_int64_status",errmsg,exerrval);
+ return 0;
+ }
+ return file->int64_status;
+}
+
+int ex_set_int64_status(int exoid, int mode)
+{
+ /* ex_set_int64_status() sets the value of the INT64_API flags
+ which specify how integer types are passed/returned as int64 types in the API
+
+ Mode can be one of:
+ 0 All are passed as int32_t values.
+ EX_MAPS_INT64_API All maps (id, order, ...) passed as int64_t values
+ EX_IDS_INT64_API All entity ids (sets, blocks, maps) are passed as int64_t values
+ EX_BULK_INT64_API
+ EX_ALL_INT64_API (EX_MAPS_INT64_API|EX_IDS_INT64_API|EX_BULK_INT64_API)
+ */
+
+ int api_mode = 0;
+ int db_mode = 0;
+
+ struct file_item* file = ex_find_file_item(exoid);
+
+ exerrval = 0; /* clear error code */
+
+ if (!file ) {
+ char errmsg[MAX_ERR_LENGTH];
+ exerrval = EX_BADFILEID;
+ sprintf(errmsg,"Error: unknown file id %d for ex_int64_status().",exoid);
+ ex_err("ex_int64_status",errmsg,exerrval);
+ return 0;
+ }
+
+ /* Strip of all non-INT64_API values */
+ api_mode = mode & EX_ALL_INT64_API;
+ db_mode = file->int64_status & EX_ALL_INT64_DB;
+
+ file->int64_status = api_mode | db_mode;
+ return file->int64_status;
+}
+
+int ex_set_option(int exoid, ex_option_type option, int option_value)
+{
+ struct file_item* file = ex_find_file_item(exoid);
+ if (!file ) {
+ char errmsg[MAX_ERR_LENGTH];
+ exerrval = EX_BADFILEID;
+ sprintf(errmsg,"Error: unknown file id %d for ex_set_option().",exoid);
+ ex_err("ex_set_option",errmsg,exerrval);
+ return EX_FATAL;
+ }
+
+ exerrval = 0; /* clear error code */
+
+ switch (option) {
+ case EX_OPT_MAX_NAME_LENGTH:
+ file->maximum_name_length = option_value;
+ break;
+ case EX_OPT_COMPRESSION_TYPE: /* Currently not used. GZip by default */
+ break;
+ case EX_OPT_COMPRESSION_LEVEL: /* 0 (disabled/fastest) ... 9 (best/slowest) */
+ /* Check whether file type supports compression... */
+ if (file->file_type == 2 || file->file_type == 3) {
+ int value = option_value;
+ if (value > 9) value = 9;
+ if (value < 0) value = 0;
+ file->compression_level = value;
+ }
+ else {
+ file->compression_level = 0;
+ }
+ break;
+ case EX_OPT_COMPRESSION_SHUFFLE: /* 0 (disabled); 1 (enabled) */
+ file->shuffle = option_value != 0 ? 1 : 0;
+ break;
+ case EX_OPT_INTEGER_SIZE_API: /* See *_INT64_* values above */
+ ex_set_int64_status(exoid, option_value);
+ break;
+ case EX_OPT_INTEGER_SIZE_DB: /* (query only) */
+ break;
+ default:
+ {
+ char errmsg[MAX_ERR_LENGTH];
+ exerrval = EX_FATAL;
+ sprintf(errmsg,"Error: invalid option %d for ex_set_option().",(int)option);
+ ex_err("ex_set_option",errmsg,exerrval);
+ return EX_FATAL;
+ }
+ }
+ return EX_NOERR;
+}
+
int ex_comp_ws( int exoid )
{
/*!
@@ -252,19 +397,18 @@ int ex_comp_ws( int exoid )
* the conversion facility for this file id (exoid).
* \param exoid integer which uniquely identifies the file of interest.
*/
-
- char errmsg[MAX_ERR_LENGTH];
- struct file_item* file;
+ struct file_item* file = ex_find_file_item(exoid);
exerrval = 0; /* clear error code */
- FIND_FILE( file, exoid );
if (!file ) {
+ char errmsg[MAX_ERR_LENGTH];
exerrval = EX_BADFILEID;
sprintf(errmsg,"Error: unknown file id %d",exoid);
ex_err("ex_comp_ws",errmsg,exerrval);
return(EX_FATAL);
}
- return file->user_compute_wordsize;
+ /* Stored as 0 for 4-byte; 1 for 8-byte */
+ return (file->user_compute_wordsize+1)*4;
}
diff --git a/exodus/cbind/src/excopy.c b/exodus/cbind/src/ex_copy.c
similarity index 95%
rename from exodus/cbind/src/excopy.c
rename to exodus/cbind/src/ex_copy.c
index 19ef460..9a4198b 100644
--- a/exodus/cbind/src/excopy.c
+++ b/exodus/cbind/src/ex_copy.c
@@ -178,9 +178,9 @@ int ex_copy (int in_exoid, int out_exoid)
if(status != NC_NOERR) {
if(dimid != recdimid) {
- status = nc_def_dim(out_exoid, dim_nm, dim_sz, &dim_out_id);
+ nc_def_dim(out_exoid, dim_nm, dim_sz, &dim_out_id);
} else {
- status = nc_def_dim(out_exoid, dim_nm, NC_UNLIMITED, &dim_out_id);
+ nc_def_dim(out_exoid, dim_nm, NC_UNLIMITED, &dim_out_id);
} /* end else */
} /* end if */
} /* end if */
@@ -193,13 +193,13 @@ int ex_copy (int in_exoid, int out_exoid)
status = nc_inq_dimid(in_exoid, DIM_STR_NAME, &dim_out_id);
if (status != NC_NOERR) {
/* Not found; set to default value of 32+1. */
- status = nc_def_dim(out_exoid, DIM_STR_NAME, 33, &dim_out_id);
+ nc_def_dim(out_exoid, DIM_STR_NAME, 33, &dim_out_id);
}
status = nc_inq_att(in_exoid, NC_GLOBAL, ATT_MAX_NAME_LENGTH, &att_type, &att_len);
if (status != NC_NOERR) {
int max_so_far = 32;
- status=nc_put_att_int(out_exoid, NC_GLOBAL, ATT_MAX_NAME_LENGTH, NC_INT, 1, &max_so_far);
+ nc_put_att_int(out_exoid, NC_GLOBAL, ATT_MAX_NAME_LENGTH, NC_INT, 1, &max_so_far);
}
/* copy variable definitions and variable attributes */
@@ -432,9 +432,15 @@ int cpy_coord_def(int in_id,int out_id,int rec_dim_id,char *var_nm,
/* Define according to the EXODUS file's IO_word_size */
nbr_dim = 1;
nc_def_var(out_id, VAR_COORD_X, nc_flt_code(out_id), nbr_dim, dim_out_id, &var_out_id);
- nc_def_var(out_id, VAR_COORD_Y, nc_flt_code(out_id), nbr_dim, dim_out_id, &var_out_id);
- if (spatial_dim == 3)
+ ex_compress_variable(out_id, var_out_id, 2);
+ if (spatial_dim > 1) {
+ nc_def_var(out_id, VAR_COORD_Y, nc_flt_code(out_id), nbr_dim, dim_out_id, &var_out_id);
+ ex_compress_variable(out_id, var_out_id, 2);
+ }
+ if (spatial_dim > 2) {
nc_def_var(out_id, VAR_COORD_Z, nc_flt_code(out_id), nbr_dim, dim_out_id, &var_out_id);
+ ex_compress_variable(out_id, var_out_id, 2);
+ }
}
if (in_large == 1 && out_large == 0) {
@@ -531,8 +537,10 @@ int cpy_var_def(int in_id,int out_id,int rec_dim_id,char *var_nm)
if ((var_type == NC_FLOAT) || (var_type == NC_DOUBLE)) {
nc_def_var(out_id, var_nm, nc_flt_code(out_id), nbr_dim, dim_out_id, &var_out_id);
+ ex_compress_variable(out_id, var_out_id, 2);
} else {
nc_def_var(out_id, var_nm, var_type, nbr_dim, dim_out_id, &var_out_id);
+ ex_compress_variable(out_id, var_out_id, 1);
}
/* Free the space holding the dimension IDs */
@@ -622,6 +630,11 @@ cpy_var_val(int in_id,int out_id,char *var_nm)
nc_put_var1_int(out_id, var_out_id, 0L, void_ptr);
}
+ else if (var_type_in == NC_INT64 && var_type_out == NC_INT64) {
+ nc_get_var1_longlong(in_id, var_in_id, 0L, void_ptr);
+ nc_put_var1_longlong(out_id, var_out_id, 0L, void_ptr);
+ }
+
else if (var_type_in == NC_FLOAT) {
nc_get_var1_float(in_id, var_in_id, 0L, void_ptr);
nc_put_var1_float(out_id, var_out_id, 0L, void_ptr);
@@ -647,6 +660,11 @@ cpy_var_val(int in_id,int out_id,char *var_nm)
nc_put_var_int(out_id, var_out_id, void_ptr);
}
+ else if (var_type_in == NC_INT64 && var_type_out == NC_INT64) {
+ nc_get_var_longlong(in_id, var_in_id, void_ptr);
+ nc_put_var_longlong(out_id, var_out_id, void_ptr);
+ }
+
else if (var_type_in == NC_FLOAT) {
nc_get_var_float(in_id, var_in_id, void_ptr);
nc_put_var_float(out_id, var_out_id, void_ptr);
@@ -782,11 +800,7 @@ cpy_coord_val(int in_id,int out_id,char *var_nm,
void update_internal_structs( int out_exoid, ex_inquiry inqcode, struct list_item** ctr_list )
{
int i;
- int number;
- double fdum;
- char* cdum = 0;
-
- ex_inquire (out_exoid, inqcode, &number, &fdum, cdum);
+ int number = ex_inquire_int (out_exoid, inqcode);
if (number > 0) {
for (i=0; i<number; i++)
@@ -800,6 +814,8 @@ size_t type_size(nc_type type)
return sizeof(char);
else if (type == NC_INT)
return sizeof(int);
+ else if (type == NC_INT64)
+ return sizeof(int64_t);
else if (type == NC_FLOAT)
return sizeof(float);
else if (type == NC_DOUBLE)
diff --git a/exodus/cbind/src/excre.c b/exodus/cbind/src/ex_create.c
similarity index 86%
copy from exodus/cbind/src/excre.c
copy to exodus/cbind/src/ex_create.c
index 17e252d..37aece8 100644
--- a/exodus/cbind/src/excre.c
+++ b/exodus/cbind/src/ex_create.c
@@ -126,6 +126,9 @@ exoid = ex_create ("test.exo" \comment{filename path}
#include "exodusII.h"
#include "exodusII_int.h"
#include <stdlib.h>
+#include <assert.h>
+
+static int warning_output = 0;
int ex_create_int (const char *path,
int cmode,
@@ -148,18 +151,48 @@ int ex_create_int (const char *path,
char *option;
#endif /* NC_NETCDF4 */
+ int int64_status;
+ unsigned int my_mode = cmode;
+ assert(my_mode == cmode);
exerrval = 0; /* clear error code */
- if (run_version != EX_API_VERS_NODOT) {
+ if (run_version != EX_API_VERS_NODOT && warning_output == 0) {
int run_version_major = run_version / 100;
int run_version_minor = run_version % 100;
int lib_version_major = EX_API_VERS_NODOT / 100;
int lib_version_minor = EX_API_VERS_NODOT % 100;
fprintf(stderr, "EXODUS: Warning: This code was compiled with exodusII version %d.%02d,\n but was linked with exodusII library version %d.%02d\n This is probably an error in the build process of this code.\n",
run_version_major, run_version_minor, lib_version_major, lib_version_minor);
+ warning_output = 1;
+ }
+
+ /*
+ * See if any integer data is to be stored as int64 (long long). If
+ * so, then need to set NC_NETCDF4 and unset NC_CLASSIC_MODEL (or
+ * set EX_NOCLASSIC. Output meaningful error message if the library
+ * is not NetCDF-4 enabled...
+ */
+ int64_status = my_mode & (EX_ALL_INT64_DB | EX_ALL_INT64_API);
+
+ if ((int64_status & EX_ALL_INT64_DB) != 0) {
+#if defined(NC_NETCDF4)
+ /* Library DOES support netcdf4... Set modes required to use
+ * netcdf-4 in non-classic mode
+ */
+ my_mode |= EX_NOCLASSIC;
+ my_mode |= EX_NETCDF4;
+#else
+ /* Library does NOT support netcdf4 */
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "EXODUS: Error: 64-bit integer storage requested, but the netcdf library does not support the required netcdf-4 extensions.\n");
+ ex_err("ex_create",errmsg,exerrval);
+ return (EX_FATAL);
+#endif
}
+
#if defined(NC_NETCDF4)
- if (cmode & EX_NETCDF4) {
+ if (my_mode & EX_NETCDF4) {
mode |= (NC_NETCDF4);
} else {
if (netcdf4_mode == -1) {
@@ -173,31 +206,31 @@ int ex_create_int (const char *path,
}
mode |= netcdf4_mode;
}
- if (! (cmode & EX_NOCLASSIC)) {
+ if (! (my_mode & EX_NOCLASSIC)) {
mode |= NC_CLASSIC_MODEL;
}
#endif
/*
- * See if "large file" mode was specified in a ex_create cmode. If
+ * See if "large file" mode was specified in a ex_create my_mode. If
* so, then pass the NC_64BIT_OFFSET flag down to netcdf.
* If netcdf4 mode specified, don't use NC_64BIT_OFFSET mode.
*/
- if ( (cmode & EX_LARGE_MODEL) && (cmode & EX_NORMAL_MODEL)) {
+ if ( (my_mode & EX_LARGE_MODEL) && (my_mode & EX_NORMAL_MODEL)) {
exerrval = EX_BADPARAM;
sprintf(errmsg,
"Warning: conflicting mode specification for file %s, mode %d. Using normal",
- path, cmode);
+ path, (int)my_mode);
ex_err("ex_create",errmsg,exerrval);
}
- if ((cmode & EX_NORMAL_MODEL) != 0)
+ if (my_mode & EX_NORMAL_MODEL)
filesiz = 0;
#if defined(NC_NETCDF4)
- else if ((mode & NC_NETCDF4) != 0)
+ else if (mode & NC_NETCDF4)
filesiz = 1;
#endif
else
- filesiz = (int)(((cmode & EX_LARGE_MODEL) != 0) || (ex_large_model(-1) == 1));
+ filesiz = (int)((my_mode & EX_LARGE_MODEL) || (ex_large_model(-1) == 1));
if (
#if defined(NC_NETCDF4)
@@ -207,7 +240,7 @@ int ex_create_int (const char *path,
mode |= NC_64BIT_OFFSET;
}
- if (cmode & EX_SHARE) {
+ if (my_mode & EX_SHARE) {
mode |= NC_SHARE;
}
@@ -216,7 +249,7 @@ int ex_create_int (const char *path,
*/
ex_opts(exoptval); /* call required to set ncopts first time through */
- if (cmode & EX_CLOBBER) {
+ if (my_mode & EX_CLOBBER) {
mode |= NC_CLOBBER;
mode_name = "CLOBBER";
} else {
@@ -226,7 +259,7 @@ int ex_create_int (const char *path,
if ((status = nc_create (path, mode, &exoid)) != NC_NOERR) {
exerrval = status;
- if (cmode & EX_NETCDF4) {
+ if (my_mode & EX_NETCDF4) {
sprintf(errmsg,
"Error: file create failed for %s in NETCDF4 and %s mode.\n\tThis library probably does not support netcdf-4 files.",
path, mode_name);
@@ -255,7 +288,7 @@ int ex_create_int (const char *path,
* i/o wordsize attribute from file is zero.
*/
- if (ex_conv_ini( exoid, comp_ws, io_ws, 0 ) != EX_NOERR) {
+ if (ex_conv_ini( exoid, comp_ws, io_ws, 0, int64_status ) != EX_NOERR) {
exerrval = EX_FATAL;
sprintf(errmsg,
"Error: failed to init conversion routines in file id %d",
@@ -344,7 +377,6 @@ int ex_create_int (const char *path,
return (EX_FATAL);
}
-
if ((status = nc_def_dim(exoid, DIM_TIME, NC_UNLIMITED, &time_dim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
@@ -362,6 +394,18 @@ int ex_create_int (const char *path,
ex_err("ex_create",errmsg,exerrval);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, dimid, 2);
+
+ {
+ int int64_db_status = int64_status & EX_ALL_INT64_DB;
+ if ((status=nc_put_att_int(exoid, NC_GLOBAL, ATT_INT64_STATUS, NC_INT, 1, &int64_db_status)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to add int64_status attribute in file id %d",exoid);
+ ex_err("ex_put_init_ext",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ }
if ((status = nc_enddef (exoid)) != NC_NOERR) {
exerrval = status;
diff --git a/exodus/cbind/src/excre.c b/exodus/cbind/src/ex_create_par.c
similarity index 81%
rename from exodus/cbind/src/excre.c
rename to exodus/cbind/src/ex_create_par.c
index 17e252d..4e10ac3 100644
--- a/exodus/cbind/src/excre.c
+++ b/exodus/cbind/src/ex_create_par.c
@@ -123,15 +123,23 @@ exoid = ex_create ("test.exo" \comment{filename path}
\endcode
*/
+#include <stdlib.h>
+#include <assert.h>
+#include <mpi.h>
+
+#include "netcdf_par.h"
#include "exodusII.h"
#include "exodusII_int.h"
-#include <stdlib.h>
-int ex_create_int (const char *path,
- int cmode,
- int *comp_ws,
- int *io_ws,
- int run_version)
+static int warning_output = 0;
+
+int ex_create_par_int (const char *path,
+ int cmode,
+ int *comp_ws,
+ int *io_ws,
+ MPI_Comm comm,
+ MPI_Info info,
+ int run_version)
{
int exoid, dims[1];
int status;
@@ -143,71 +151,88 @@ int ex_create_int (const char *path,
char errmsg[MAX_ERR_LENGTH];
char *mode_name;
int mode = 0;
-#if defined(NC_NETCDF4)
- static int netcdf4_mode = -1;
- char *option;
-#endif /* NC_NETCDF4 */
+ int int64_status;
+ int pariomode = 0;
+
+ unsigned int my_mode = cmode;
+ assert(my_mode == cmode);
exerrval = 0; /* clear error code */
- if (run_version != EX_API_VERS_NODOT) {
+#if !defined(NC_NETCDF4)
+ /* Library does NOT support netcdf4 */
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "EXODUS: Error: Parallel output requires the netcdf-4 library format, but this netcdf library does not support that.\n");
+ ex_err("ex_create_par",errmsg,exerrval);
+ return (EX_FATAL);
+#endif
+
+ if (run_version != EX_API_VERS_NODOT && warning_output == 0) {
int run_version_major = run_version / 100;
int run_version_minor = run_version % 100;
int lib_version_major = EX_API_VERS_NODOT / 100;
int lib_version_minor = EX_API_VERS_NODOT % 100;
fprintf(stderr, "EXODUS: Warning: This code was compiled with exodusII version %d.%02d,\n but was linked with exodusII library version %d.%02d\n This is probably an error in the build process of this code.\n",
run_version_major, run_version_minor, lib_version_major, lib_version_minor);
+ warning_output = 1;
}
-#if defined(NC_NETCDF4)
- if (cmode & EX_NETCDF4) {
- mode |= (NC_NETCDF4);
- } else {
- if (netcdf4_mode == -1) {
- option = getenv("EXODUS_NETCDF4");
- if (option != NULL) {
- fprintf(stderr, "EXODUS: Using netcdf version 4 selected via EXODUS_NETCDF4 environment variable\n");
- netcdf4_mode = NC_NETCDF4;
- } else {
- netcdf4_mode = 0;
- }
- }
- mode |= netcdf4_mode;
+
+ /*
+ * See if any integer data is to be stored as int64 (long long). If
+ * so, then need to set NC_NETCDF4 and unset NC_CLASSIC_MODEL (or
+ * set EX_NOCLASSIC. Output meaningful error message if the library
+ * is not NetCDF-4 enabled...
+ */
+ int64_status = my_mode & (EX_ALL_INT64_DB | EX_ALL_INT64_API);
+
+ if ((int64_status & EX_ALL_INT64_DB) != 0) {
+ /* Library DOES support netcdf4... Set modes required to use
+ * netcdf-4 in non-classic mode
+ */
+ my_mode |= EX_NOCLASSIC;
+ my_mode |= EX_NETCDF4;
+ }
+
+ /* Check parallel io mode. Valid is NC_MPIPOSIX or NC_MPIIO or NC_PNETCDF
+ * Exodus uses different flag values; map to netcdf values
+ */
+ if (my_mode & EX_MPIPOSIX) {
+ pariomode = NC_MPIPOSIX;
+ my_mode |= EX_NETCDF4;
+ }
+ else if (my_mode & EX_MPIIO) {
+ pariomode = NC_MPIIO;
+ my_mode |= EX_NETCDF4;
}
- if (! (cmode & EX_NOCLASSIC)) {
+ else if (my_mode & EX_PNETCDF) {
+ pariomode = NC_PNETCDF;
+ mode |= NC_64BIT_OFFSET;
+ }
+
+ if (my_mode & EX_NETCDF4) {
+ mode |= NC_NETCDF4;
+ }
+
+ if (! (my_mode & EX_NOCLASSIC)) {
mode |= NC_CLASSIC_MODEL;
}
-#endif
/*
- * See if "large file" mode was specified in a ex_create cmode. If
+ * See if "large file" mode was specified in a ex_create my_mode. If
* so, then pass the NC_64BIT_OFFSET flag down to netcdf.
* If netcdf4 mode specified, don't use NC_64BIT_OFFSET mode.
*/
- if ( (cmode & EX_LARGE_MODEL) && (cmode & EX_NORMAL_MODEL)) {
+ if ( (my_mode & EX_LARGE_MODEL) && (my_mode & EX_NORMAL_MODEL)) {
exerrval = EX_BADPARAM;
sprintf(errmsg,
"Warning: conflicting mode specification for file %s, mode %d. Using normal",
- path, cmode);
+ path, (int)my_mode);
ex_err("ex_create",errmsg,exerrval);
}
- if ((cmode & EX_NORMAL_MODEL) != 0)
- filesiz = 0;
-#if defined(NC_NETCDF4)
- else if ((mode & NC_NETCDF4) != 0)
- filesiz = 1;
-#endif
- else
- filesiz = (int)(((cmode & EX_LARGE_MODEL) != 0) || (ex_large_model(-1) == 1));
-
- if (
-#if defined(NC_NETCDF4)
- !(mode & NC_NETCDF4) &&
-#endif
- filesiz == 1) {
- mode |= NC_64BIT_OFFSET;
- }
-
- if (cmode & EX_SHARE) {
+ filesiz = 1;
+
+ if (my_mode & EX_SHARE) {
mode |= NC_SHARE;
}
@@ -216,7 +241,7 @@ int ex_create_int (const char *path,
*/
ex_opts(exoptval); /* call required to set ncopts first time through */
- if (cmode & EX_CLOBBER) {
+ if (my_mode & EX_CLOBBER) {
mode |= NC_CLOBBER;
mode_name = "CLOBBER";
} else {
@@ -224,9 +249,9 @@ int ex_create_int (const char *path,
mode_name = "NOCLOBBER";
}
- if ((status = nc_create (path, mode, &exoid)) != NC_NOERR) {
+ if ((status = nc_create_par (path, mode|pariomode, comm, info, &exoid)) != NC_NOERR) {
exerrval = status;
- if (cmode & EX_NETCDF4) {
+ if (my_mode & EX_NETCDF4) {
sprintf(errmsg,
"Error: file create failed for %s in NETCDF4 and %s mode.\n\tThis library probably does not support netcdf-4 files.",
path, mode_name);
@@ -239,8 +264,7 @@ int ex_create_int (const char *path,
return (EX_FATAL);
}
- /* turn off automatic filling of netCDF variables
- */
+ /* turn off automatic filling of netCDF variables */
if ((status = nc_set_fill (exoid, NC_NOFILL, &old_fill)) != NC_NOERR) {
exerrval = status;
@@ -255,7 +279,7 @@ int ex_create_int (const char *path,
* i/o wordsize attribute from file is zero.
*/
- if (ex_conv_ini( exoid, comp_ws, io_ws, 0 ) != EX_NOERR) {
+ if (ex_conv_ini( exoid, comp_ws, io_ws, 0, int64_status ) != EX_NOERR) {
exerrval = EX_FATAL;
sprintf(errmsg,
"Error: failed to init conversion routines in file id %d",
@@ -344,7 +368,6 @@ int ex_create_int (const char *path,
return (EX_FATAL);
}
-
if ((status = nc_def_dim(exoid, DIM_TIME, NC_UNLIMITED, &time_dim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
@@ -362,6 +385,18 @@ int ex_create_int (const char *path,
ex_err("ex_create",errmsg,exerrval);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, dimid, 2);
+
+ {
+ int int64_db_status = int64_status & EX_ALL_INT64_DB;
+ if ((status=nc_put_att_int(exoid, NC_GLOBAL, ATT_INT64_STATUS, NC_INT, 1, &int64_db_status)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to add int64_status attribute in file id %d",exoid);
+ ex_err("ex_put_init_ext",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ }
if ((status = nc_enddef (exoid)) != NC_NOERR) {
exerrval = status;
diff --git a/exodus/cbind/src/ex_cvt_nodes_to_sides.c b/exodus/cbind/src/ex_cvt_nodes_to_sides.c
new file mode 100644
index 0000000..e478d49
--- /dev/null
+++ b/exodus/cbind/src/ex_cvt_nodes_to_sides.c
@@ -0,0 +1,1041 @@
+/*
+ * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
+ * retains certain rights in this software.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * * Neither the name of Sandia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <ctype.h>
+#include <string.h>
+#include <stdlib.h>
+#include "exodusII.h"
+#include "exodusII_int.h"
+
+static void *safe_free(void *array)
+{
+ if (array != 0) free(array);
+ return 0;
+}
+
+static int64_t get_node(void_int *connect, size_t index, size_t int_size)
+{
+ if (int_size == sizeof(int64_t)) {
+ return ((int64_t*)connect)[index];
+ } else {
+ return ((int*)connect)[index];
+ }
+}
+
+static void put_side(void_int *side_list, size_t index, size_t value, size_t int_size)
+{
+ if (int_size == sizeof(int64_t)) {
+ ((int64_t*)side_list)[index] = value;
+ } else {
+ ((int*)side_list)[index] = value;
+ }
+}
+
+/*!
+
+The function ex_cvt_nodes_to_sides() is used to convert a side set
+node list to a side set side list. This routine is provided for
+application programs that utilize side sets defined by nodes (as was
+done previous to release 2.0) rather than local faces or edges. The
+application program must allocate memory for the returned array of
+sides. The length of this array is the same as the length of the
+concatenated side sets element list, which can be determined with a
+call to ex_inquire() or ex_inquire_int().
+
+\return In case of an error, ex_cvt_nodes_to_sides() returns a
+negative number; a warning will return a positive number. Possible
+causes of errors include:
+ - a warning value is returned if no side sets are stored in the file.
+ - because the faces of a wedge require a different number of
+ nodes to describe them (quadrilateral vs. triangular faces), the
+ function will abort with a fatal return code if a wedge is
+ encountered in the side set element list.
+
+\param[in] exoid exodus file ID returned from a previous call to ex_create()
+ or ex_open().
+
+\param[in] num_elem_per_set Array containing the number of sides for each set. The number
+ of sides is equal to the number of elements for each set.
+
+\param[in] num_nodes_per_set Array containing the number of nodes for each set.
+
+\param[in] side_sets_elem_index Array containing indices into the \c side_sets_elem_list which are
+ the locations of the first element for each set. These indices are
+ 0-based. Unused.
+
+\param[in] side_sets_node_index Array containing indices into the \c side_sets_node_list
+ which are the locations of the first node for each set. These
+ indices are 0-based. Unused.
+
+\param[in] side_sets_elem_list Array containing the elements for all side sets. Internal element IDs
+ are used in this list (see Section LocalElementIds).
+
+\param[in] side_sets_node_list Array containing the nodes for all side sets. Internal node
+ IDs are used in this list (see Section LocalNodeIds).
+
+\param[out] side_sets_side_list Returned array containing the sides for all side sets.
+
+
+The following code segment will convert side sets described
+by nodes to side sets described by local side numbers:
+
+\code
+int error, exoid, ids[2], num_side_per_set[2],
+ num_nodes_per_set[2], elem_ind[2], node_ind[2],
+ elem_list[4], node_list[8], el_lst_len, *side_list;
+
+ids[0] = 30 ; ids[1] = 31;
+num_side_per_set[0] = 2; num_side_per_set[1] = 2;
+num_nodes_per_set[0] = 4; num_nodes_per_set[1] = 4;
+
+elem_ind[0] = 0; elem_ind[1] = 2;
+node_ind[0] = 0; node_ind[1] = 4;
+
+\comment{side set #1}
+elem_list[0] = 2; elem_list[1] = 2;
+node_list[0] = 8; node_list[1] = 5;
+node_list[2] = 6; node_list[3] = 7;
+
+\comment{side set #2}
+elem_list[2] = 1; elem_list[3] = 2;
+node_list[4] = 2; node_list[5] = 3;
+node_list[6] = 7; node_list[7] = 8;
+
+el_lst_len = ex_inquire_int(exoid, EX_INQ_SS_ELEM_LEN);
+
+\comment{side set element list is same length as side list}
+side_list = (int *) calloc (el_lst_len, sizeof(int));
+
+ex_cvt_nodes_to_sides(exoid, num_side_per_set, num_nodes_per_set,
+ elem_ind, node_ind, elem_list,
+ node_list, side_list);
+\endcode
+
+ <b>Algorithm:</b>
+
+\verbatim
+ Read elem_block_ids --> elem_blk_id[array]
+
+ Read element block parameters --> elem_blk_parms[array]
+
+ Determine total number of elements in side set by summing num_elem_per_set
+
+ Build side set element to side set node list index --> ss_elem_node_ndx[array]
+
+ For each element in the side_set_elem_list {
+ If Jth element is not in current element block (e.g. J>elem_ctr) {
+ get element block parameters (num_elem_in_blk, ...)
+ elem_ctr += num_elem_in_blk
+
+ free old connectity array space
+ allocate connectivity array: size=num_elem_in_blk*num_nodes_per_elem
+ get connectivity array
+ }
+
+ If Jth element is in current element block (e.g. J<=elem_ctr) {
+ For each node in element (linear search of up to num_nodes_per_elem) {
+ If side set element node[1] == element node[i] {
+ Case element type = Hex {
+ If side set element node[2] == element node[Hex_table[i,1]]
+ Jth side = Hex_table[i,2]
+
+ break
+ }
+ Case element type = Wedge {
+ If side set element node[2] == element node[Wedge_table[i,1]]
+ Jth side = Wedge_table[i,2]
+
+ break
+ }
+ }
+ }
+ }
+ }
+\endverbatim
+
+ */
+
+int ex_cvt_nodes_to_sides(int exoid,
+ void_int *num_elem_per_set,
+ void_int *num_nodes_per_set,
+ void_int *side_sets_elem_index, /* unused */
+ void_int *side_sets_node_index, /* unused */
+ void_int *side_sets_elem_list,
+ void_int *side_sets_node_list,
+ void_int *side_sets_side_list)
+{
+ size_t m;
+ size_t i, j, k, n;
+ int num_side_sets, num_elem_blks;
+ int64_t tot_num_elem = 0, tot_num_ss_elem = 0, elem_num = 0, ndim;
+ void_int *elem_blk_ids = NULL;
+ void_int *connect = NULL;
+ void_int *ss_elem_ndx = NULL;
+ void_int *ss_elem_node_ndx = NULL;
+ void_int *ss_parm_ndx = NULL;
+ size_t elem_ctr, node_ctr, elem_num_pos;
+ int num_nodes_per_elem, num_node_per_side;
+
+ int *same_elem_type = NULL;
+ int el_type = 0;
+
+ int int_size;
+ int ids_size;
+
+ struct elem_blk_parm *elem_blk_parms = NULL;
+
+ int err_stat = EX_NOERR;
+
+ /* node to side translation tables -
+ These tables are used to look up the side number based on the
+ first and second node in the side/face list. The side node order
+ is found in the original Exodus document, SAND87-2997. The element
+ node order is found in the ExodusII document, SAND92-2137. These
+ tables were generated by following the right-hand rule for determining
+ the outward normal. Note: Only the more complex 3-D shapes require
+ these tables, the simple shapes are trivial - the first node found
+ is also the side number.
+ */
+
+ /* 1 2 3 4 node 1 */
+ static int shell_table[2][8] = {
+ {2,4, 3,1, 4,2, 1,3}, /* node 2 */
+ {1,2, 1,2, 1,2, 1,2} /* side # */
+ };
+
+ /* 1 2 3 4 node 1 */
+ static int shell_edge_table[2][8] = {
+ {2,4, 3,1, 4,2, 1,3}, /* node 2 */
+ {3,6, 4,3, 5,4, 6,5} /* side # */
+ };
+
+ /* 1 2 3 node 1 */
+ static int trishell_table[2][6] = {
+ {2,3, 3,1, 1,2}, /* node 2 */
+ {1,2, 1,2, 1,2} /* side # */
+ };
+
+ /* 1 2 3 4 node 1 */
+ static int tetra_table[2][12] = {
+ {2,3,4, 1,3,4, 4,1,2, 1,2,3}, /* node 2 */
+ {1,4,3, 4,2,1, 2,3,4, 1,2,3} /* side # */
+ };
+
+#if 0
+ static int wedge_table[2][18] = {
+ /* 1 2 3 4 5 6 node 1 */
+ {2,4,3, 5,1,3, 6,1,2, 1,6,5, 6,2,4, 4,3,5}, /* node 2 */
+ {1,3,4, 1,4,2, 2,3,4, 1,3,5, 5,2,1, 5,3,2} /* side # */
+ };
+#endif
+
+ static int hex_table[2][24] = {
+ /* 1 2 3 4 5 6 7 8 node 1 */
+ {4,2,5, 1,3,6, 7,4,2, 3,1,8, 6,8,1, 5,2,7, 8,6,3, 7,5,4},/* node 2 */
+ {5,1,4, 5,2,1, 2,3,5, 5,4,3, 6,4,1, 1,2,6, 6,2,3, 3,6,4} /* side # */
+ };
+
+ char errmsg[MAX_ERR_LENGTH];
+
+ exerrval = 0; /* clear error code */
+
+ /* first check if any side sets are specified */
+ /* inquire how many side sets have been stored */
+
+ num_side_sets = ex_inquire_int(exoid, EX_INQ_SIDE_SETS);
+ if (num_side_sets < 0) {
+ sprintf(errmsg,
+ "Error: failed to get number of side sets in file id %d",exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+
+ if (num_side_sets == 0)
+ {
+ sprintf(errmsg,
+ "Warning: no side sets defined in file id %d",exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,EX_WARN);
+ return(EX_WARN);
+ }
+
+ num_elem_blks = ex_inquire_int(exoid, EX_INQ_ELEM_BLK);
+ if (num_elem_blks < 0) {
+ sprintf(errmsg,
+ "Error: failed to get number of element blocks in file id %d",exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+
+ tot_num_elem = ex_inquire_int(exoid, EX_INQ_ELEM);
+ if (tot_num_elem < 0) {
+ sprintf(errmsg,
+ "Error: failed to get total number of elements in file id %d",exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+
+ /* get the dimensionality of the coordinates; this is necessary to
+ distinguish between 2d TRIs and 3d TRIs */
+ ndim = ex_inquire_int(exoid, EX_INQ_DIM);
+
+ int_size = sizeof(int);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API)
+ int_size = sizeof(int64_t);
+
+ /* First count up # of elements in the side sets*/
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ for (i=0;i<num_side_sets;i++)
+ tot_num_ss_elem += ((int64_t*)num_elem_per_set)[i];
+ } else {
+ for (i=0;i<num_side_sets;i++)
+ tot_num_ss_elem += ((int*)num_elem_per_set)[i];
+ }
+
+ /* Allocate space for the ss element index array */
+ if (!(ss_elem_ndx=malloc(tot_num_ss_elem*int_size)))
+ {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for side set elem sort array for file id %d",
+ exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ if (int_size == sizeof(int64_t)) {
+ /* Sort side set element list into index array - non-destructive */
+ int64_t *elems = (int64_t*)ss_elem_ndx;
+ for (i=0;i<tot_num_ss_elem;i++) {
+ elems[i] = i; /* init index array to current position */
+ }
+ ex_iqsort64(side_sets_elem_list, elems, tot_num_ss_elem);
+ } else {
+ /* Sort side set element list into index array - non-destructive */
+ int *elems = (int*)ss_elem_ndx;
+ for (i=0;i<tot_num_ss_elem;i++) {
+ elems[i] = i; /* init index array to current position */
+ }
+ ex_iqsort(side_sets_elem_list, elems,tot_num_ss_elem);
+ }
+
+ /* Allocate space for the element block ids */
+ ids_size = sizeof(int);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ ids_size = sizeof(int64_t);
+ }
+
+ if (!(elem_blk_ids=malloc(num_elem_blks*ids_size)))
+ {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for element block ids for file id %d",
+ exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ if (ex_get_elem_blk_ids(exoid, elem_blk_ids))
+ {
+ sprintf(errmsg,
+ "Error: failed to get element block ids in file id %d",
+ exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,EX_MSG);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ /* Allocate space for the element block params */
+ if (!(elem_blk_parms=malloc(num_elem_blks*sizeof(struct elem_blk_parm))))
+ {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for element block params for file id %d",
+ exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+ elem_ctr = 0;
+ for (i=0; i<num_elem_blks; i++)
+ {
+ ex_block block;
+ block.type = EX_ELEM_BLOCK;
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ block.id = ((int64_t*)elem_blk_ids)[i];
+ } else {
+ block.id = ((int*)elem_blk_ids)[i];
+ }
+
+ /* read in an element block parameter */
+ if ((ex_get_block_param (exoid, &block)) == -1) {
+ sprintf(errmsg,
+ "Error: failed to get element block %"PRId64" parameters in file id %d",
+ block.id, exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,EX_MSG);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ elem_blk_parms[i].num_elem_in_blk = block.num_entry;
+ elem_blk_parms[i].num_nodes_per_elem = block.num_nodes_per_entry;
+ elem_blk_parms[i].num_attr = block.num_attribute;
+ elem_blk_parms[i].elem_blk_id = block.id;
+
+ for (m=0; m < strlen(block.topology); m++) {
+ elem_blk_parms[i].elem_type[m] = toupper(block.topology[m]);
+ }
+ elem_blk_parms[i].elem_type[m] = '\0';
+
+ if (strncmp(elem_blk_parms[i].elem_type,"CIRCLE",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_CIRCLE;
+ /* set side set node stride */
+ elem_blk_parms[i].num_nodes_per_side[0] = 1;
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"SPHERE",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_SPHERE;
+ /* set side set node stride */
+ elem_blk_parms[i].num_nodes_per_side[0] = 1;
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"QUAD",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_QUAD;
+ /* determine side set node stride */
+ if (elem_blk_parms[i].num_nodes_per_elem == 4)
+ elem_blk_parms[i].num_nodes_per_side[0] = 2;
+ else if (elem_blk_parms[i].num_nodes_per_elem == 5)
+ elem_blk_parms[i].num_nodes_per_side[0] = 2;
+ else
+ elem_blk_parms[i].num_nodes_per_side[0] = 3;
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"TRIANGLE",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_TRIANGLE;
+ /* determine side set node stride */
+ if (ndim == 2) /* 2d TRIs */
+ {
+ if (elem_blk_parms[i].num_nodes_per_elem == 3)
+ elem_blk_parms[i].num_nodes_per_side[0] = 2;
+ else
+ elem_blk_parms[i].num_nodes_per_side[0] = 3;
+ }
+ else if (ndim == 3) /* 3d TRIs */
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_TRISHELL;
+ elem_blk_parms[i].num_nodes_per_side[0] =
+ elem_blk_parms[i].num_nodes_per_elem;
+ }
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"SHELL",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_SHELL;
+ /* determine side set node stride */
+ if (elem_blk_parms[i].num_nodes_per_elem == 2)
+ {
+ /* 2d SHELL; same as BEAM or TRUSS or BAR */
+ elem_blk_parms[i].num_nodes_per_side[0] = 2;
+ elem_blk_parms[i].elem_type_val = EX_EL_BEAM;
+ }
+ else if (elem_blk_parms[i].num_nodes_per_elem == 4)
+ elem_blk_parms[i].num_nodes_per_side[0] = 4;
+ else
+ elem_blk_parms[i].num_nodes_per_side[0] = 8;
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"HEX",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_HEX;
+ /* determine side set node stride */
+ if (elem_blk_parms[i].num_nodes_per_elem == 8)
+ elem_blk_parms[i].num_nodes_per_side[0] = 4;
+ else if (elem_blk_parms[i].num_nodes_per_elem == 9)
+ elem_blk_parms[i].num_nodes_per_side[0] = 4;
+ else if (elem_blk_parms[i].num_nodes_per_elem == 12) /* HEXSHELL */
+ elem_blk_parms[i].num_nodes_per_side[0] = 4;
+ else if (elem_blk_parms[i].num_nodes_per_elem == 27)
+ elem_blk_parms[i].num_nodes_per_side[0] = 9;
+ else
+ elem_blk_parms[i].num_nodes_per_side[0] = 8;
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"TETRA",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_TETRA;
+ /* determine side set node stride */
+ if (elem_blk_parms[i].num_nodes_per_elem == 4)
+ elem_blk_parms[i].num_nodes_per_side[0] = 3;
+ else if (elem_blk_parms[i].num_nodes_per_elem == 8)
+ elem_blk_parms[i].num_nodes_per_side[0] = 4;
+ else
+ elem_blk_parms[i].num_nodes_per_side[0] = 6;
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"WEDGE",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_WEDGE;
+ /* determine side set node stride */
+ if (elem_blk_parms[i].num_nodes_per_elem == 6)
+ elem_blk_parms[i].num_nodes_per_side[0] = 4;
+ else
+ elem_blk_parms[i].num_nodes_per_side[0] = 8;
+ sprintf(errmsg,
+ "Warning: WEDGE%d is assumed to have %d nodes per face",
+ elem_blk_parms[i].num_nodes_per_elem,
+ elem_blk_parms[i].num_nodes_per_side[0]);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,EX_MSG);
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"PYRAMID",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_PYRAMID;
+ /* determine side set node stride */
+ if (elem_blk_parms[i].num_nodes_per_elem == 5)
+ elem_blk_parms[i].num_nodes_per_side[0] = 4;
+ else
+ elem_blk_parms[i].num_nodes_per_side[0] = 8;
+ sprintf(errmsg,
+ "Warning: PYRAMID%d is assumed to have %d nodes per face",
+ elem_blk_parms[i].num_nodes_per_elem,
+ elem_blk_parms[i].num_nodes_per_side[0]);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,EX_MSG);
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"BEAM",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_BEAM;
+ /* determine side set node stride */
+ if (elem_blk_parms[i].num_nodes_per_elem == 2)
+ elem_blk_parms[i].num_nodes_per_side[0] = 2;
+ else
+ elem_blk_parms[i].num_nodes_per_side[0] = 3;
+ }
+ else if ( (strncmp(elem_blk_parms[i].elem_type,"TRUSS",3) == 0) ||
+ (strncmp(elem_blk_parms[i].elem_type,"BAR",3) == 0) ||
+ (strncmp(elem_blk_parms[i].elem_type,"EDGE",3) == 0) )
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_TRUSS;
+ /* determine side set node stride */
+ if (elem_blk_parms[i].num_nodes_per_elem == 2)
+ elem_blk_parms[i].num_nodes_per_side[0] = 2;
+ else
+ elem_blk_parms[i].num_nodes_per_side[0] = 3;
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"NULL",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_NULL_ELEMENT;
+ /* set side set node stride */
+ elem_blk_parms[i].num_nodes_per_side[0] = 0;
+ }
+ else
+ { /* unsupported element type; no problem if no sides specified for
+ this element block */
+ elem_blk_parms[i].elem_type_val = EX_EL_UNK;
+ elem_blk_parms[i].num_nodes_per_side[0] = 0;
+ }
+ elem_blk_parms[i].elem_blk_id = block.id; /* save id */
+ elem_ctr += elem_blk_parms[i].num_elem_in_blk;
+ elem_blk_parms[i].elem_ctr = elem_ctr; /* save elem number max */
+ }
+
+
+ /* Allocate space for the ss element to element block parameter index array */
+ if (!(ss_parm_ndx=malloc(tot_num_ss_elem*int_size)))
+ {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for side set elem parms index for file id %d",
+ exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+
+ /* Allocate space for the ss element to node list index array */
+ if (!(ss_elem_node_ndx=malloc((tot_num_ss_elem+1)*int_size)))
+ {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for side set elem to node index for file id %d",
+ exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ /* determine if each side set has uniform element types; this will
+ be used to help determine the stride through the node list
+ */
+
+ /* Allocate space for same element type flag array*/
+ if (!(same_elem_type=malloc(num_side_sets*sizeof(int))))
+ {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for element type flag array for file id %d",
+ exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+
+ same_elem_type[0] = TRUE;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ elem_ctr = ((int64_t*)num_elem_per_set)[0];
+ for (i=0,k=0;i<tot_num_ss_elem;i++) {
+ int64_t elem = ((int64_t*)side_sets_elem_list)[i];
+ for (j=0; j<num_elem_blks; j++) {
+ if (elem <= elem_blk_parms[j].elem_ctr) break;
+ }
+
+ if (i==0) {
+ el_type = elem_blk_parms[j].elem_type_val;
+ }
+
+ /* determine which side set this element is in; assign to kth side set */
+ if (i >= elem_ctr) {
+ elem_ctr += ((int64_t*)num_elem_per_set)[++k];
+
+ el_type = elem_blk_parms[j].elem_type_val;
+ same_elem_type[k] = TRUE;
+ }
+
+ if (el_type != elem_blk_parms[j].elem_type_val) same_elem_type[k] = FALSE;
+ }
+
+ /* Build side set element to node list index and side set element
+ parameter index.
+ */
+ node_ctr = 0;
+ elem_ctr = ((int64_t*)num_elem_per_set)[0];
+ for (i=0,k=0;i<tot_num_ss_elem;i++) {
+ int64_t elem = ((int64_t*)side_sets_elem_list)[i];
+
+ for (j=0; j<num_elem_blks; j++) {
+ if (elem <= elem_blk_parms[j].elem_ctr) {
+ ((int64_t*)ss_parm_ndx)[i] = j; /* assign parameter block index */
+ break;
+ }
+ }
+ ((int64_t*)ss_elem_node_ndx)[i] = node_ctr; /* assign node list index */
+
+ /* determine which side set this element is in; assign to kth side set */
+ if (i >= elem_ctr) {
+ /* skip over NULL side sets */
+ while ( ((int64_t*)num_elem_per_set)[++k] == 0);
+ elem_ctr += ((int64_t*)num_elem_per_set)[k];
+ }
+
+ /* determine number of nodes per side */
+ if (((((int64_t*)num_nodes_per_set)[k] % ((int64_t*)num_elem_per_set)[k]) == 0) &&
+ (same_elem_type[k])) { /* all side set elements are same type */
+ node_ctr += ((int64_t*)num_nodes_per_set)[k] /((int64_t*)num_elem_per_set)[k];
+ } else {
+ node_ctr += elem_blk_parms[j].num_nodes_per_side[0];
+ }
+ }
+ ((int64_t*)ss_elem_node_ndx)[i] = node_ctr; /* assign node list index */
+ } else {
+ elem_ctr = ((int*)num_elem_per_set)[0];
+ for (i=0,k=0;i<tot_num_ss_elem;i++) {
+ int elem = ((int*)side_sets_elem_list)[i];
+
+ for (j=0; j<num_elem_blks; j++) {
+ if (elem <= elem_blk_parms[j].elem_ctr) break;
+ }
+
+ if (i==0) {
+ el_type = elem_blk_parms[j].elem_type_val;
+ }
+
+ /* determine which side set this element is in; assign to kth side set */
+ if (i >= elem_ctr) {
+ elem_ctr += ((int*)num_elem_per_set)[++k];
+
+ el_type = elem_blk_parms[j].elem_type_val;
+ same_elem_type[k] = TRUE;
+ }
+
+ if (el_type != elem_blk_parms[j].elem_type_val) same_elem_type[k] = FALSE;
+ }
+
+ /* Build side set element to node list index and side set element
+ parameter index.
+ */
+ node_ctr = 0;
+ elem_ctr = ((int*)num_elem_per_set)[0];
+ for (i=0,k=0;i<tot_num_ss_elem;i++) {
+ int elem = ((int*)side_sets_elem_list)[i];
+
+ for (j=0; j<num_elem_blks; j++) {
+ if (elem <= elem_blk_parms[j].elem_ctr)
+ {
+ ((int*)ss_parm_ndx)[i] = j; /* assign parameter block index */
+ break;
+ }
+ }
+ ((int*)ss_elem_node_ndx)[i] = node_ctr; /* assign node list index */
+
+ /* determine which side set this element is in; assign to kth side set */
+ if (i >= elem_ctr) {
+ /* skip over NULL side sets */
+ while ( ((int*)num_elem_per_set)[++k] == 0);
+ elem_ctr += ((int*)num_elem_per_set)[k];
+ }
+
+ /* determine number of nodes per side */
+ if (((((int*)num_nodes_per_set)[k] % ((int*)num_elem_per_set)[k]) == 0) &&
+ (same_elem_type[k])) { /* all side set elements are same type */
+ node_ctr += ((int*)num_nodes_per_set)[k] /((int*)num_elem_per_set)[k];
+ } else {
+ node_ctr += elem_blk_parms[j].num_nodes_per_side[0];
+ }
+ }
+ ((int*)ss_elem_node_ndx)[i] = node_ctr; /* assign node list index */
+ }
+
+ /* All setup, ready to go ... */
+
+ elem_ctr=0;
+
+ for (j=0; j < tot_num_ss_elem; j++)
+ {
+ int64_t elem;
+ int64_t idx;
+ int64_t ss_node0, ss_node1;
+ int64_t p_ndx;
+ if (int_size == sizeof(int64_t)) {
+ idx = ((int64_t*)ss_elem_ndx)[j];
+ elem = ((int64_t*)side_sets_elem_list)[idx];
+ ss_node0 = ((int64_t*)side_sets_node_list)[((int64_t*)ss_elem_node_ndx)[idx]];
+ ss_node1 = ((int64_t*)side_sets_node_list)[((int64_t*)ss_elem_node_ndx)[idx]+1];
+ p_ndx = ((int64_t*)ss_parm_ndx)[idx];
+ } else {
+ idx = ((int*)ss_elem_ndx)[j];
+ elem = ((int*)side_sets_elem_list)[idx];
+ ss_node0 = ((int*)side_sets_node_list)[((int*)ss_elem_node_ndx)[idx]];
+ ss_node1 = ((int*)side_sets_node_list)[((int*)ss_elem_node_ndx)[idx]+1];
+ p_ndx = ((int*)ss_parm_ndx)[idx];
+ }
+ elem_num = elem-1;
+
+ if (elem > elem_ctr)
+ {
+ /* release connectivity array space and get next one */
+ if (elem_ctr > 0)
+ safe_free(connect);
+
+ /* Allocate space for the connectivity array for new element block */
+ if (!(connect= malloc(elem_blk_parms[p_ndx].num_elem_in_blk*
+ elem_blk_parms[p_ndx].num_nodes_per_elem*
+ int_size)))
+ {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for connectivity array for file id %d",
+ exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ /* get connectivity array */
+ if (ex_get_elem_conn(
+ exoid,
+ elem_blk_parms[p_ndx].elem_blk_id,
+ connect) == -1)
+ {
+ sprintf(errmsg,
+ "Error: failed to get connectivity array for elem blk %"PRId64" for file id %d",
+ elem_blk_parms[p_ndx].elem_blk_id,
+ exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+ elem_ctr = elem_blk_parms[p_ndx].elem_ctr;
+ }
+ /* For the first node of each side in side set, using a linear search
+ (of up to num_nodes_per_elem) of the connectivity array,
+ locate the node position in the element. The first node position
+ and the second node position are used with a element type specific
+ table to determine the side. */
+
+ /* calculate the relative element number position in it's block*/
+ elem_num_pos = elem_num -
+ (elem_blk_parms[p_ndx].elem_ctr -
+ elem_blk_parms[p_ndx].num_elem_in_blk);
+ /* calculate the beginning of the node list for this element by
+ using the ss_elem_node_ndx index into the side_sets_node_index
+ and adding the element number position * number of nodes per elem */
+
+ num_nodes_per_elem = elem_blk_parms[p_ndx].num_nodes_per_elem;
+
+ for (n=0; n<num_nodes_per_elem; n++) {
+ /* find node in connectivity array that matches first node in side set */
+ if ( ((int_size == sizeof(int64_t)) &&
+ (ss_node0 == ((int64_t*)connect)[num_nodes_per_elem*(elem_num_pos)+n])) ||
+ ((int_size == sizeof(int)) &&
+ (ss_node0 == ((int*)connect)[num_nodes_per_elem*(elem_num_pos)+n])) ) {
+ switch (elem_blk_parms[p_ndx].elem_type_val)
+ {
+ case EX_EL_CIRCLE:
+ case EX_EL_SPHERE:
+ {
+ /* simple case: 1st node number is same as side # */
+ put_side(side_sets_side_list,idx, n+1, int_size);
+ break;
+ }
+ case EX_EL_QUAD:
+ case EX_EL_TRIANGLE:
+ case EX_EL_TRUSS:
+ case EX_EL_BEAM:
+ {
+ /* simple case: 1st node number is same as side # */
+ put_side(side_sets_side_list,idx,n+1, int_size);
+ break;
+ }
+ case EX_EL_TRISHELL:
+ {
+ /* use table to find which node to compare to next */
+ if (ss_node1 == get_node(connect,num_nodes_per_elem*(elem_num_pos)+
+ (trishell_table[0][2*n]-1),int_size))
+ {
+ /* Assume only front or back, no edges... */
+ put_side(side_sets_side_list,idx, trishell_table[1][2*n],int_size);
+ }
+ else if (ss_node1 == get_node(connect,num_nodes_per_elem*(elem_num_pos)+
+ (trishell_table[0][2*n+1]-1),int_size))
+ {
+ /* Assume only front or back, no edges... */
+ put_side(side_sets_side_list,idx,trishell_table[1][2*n+1],int_size);
+ }
+ else if (ss_node1 == get_node(connect,num_nodes_per_elem*(elem_num_pos)+
+ (trishell_table[0][2*n+2]-1),int_size))
+ {
+ /* Assume only front or back, no edges... */
+ put_side(side_sets_side_list,idx,trishell_table[1][2*n+2],int_size);
+ }
+ else
+ {
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Error: failed to find TRIANGULAR SHELL element %"PRId64", node %"PRId64" in connectivity array %"PRId64" for file id %d",
+ elem_num+1,
+ ss_node1,
+ elem_blk_parms[p_ndx].elem_blk_id,
+ exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+ break;
+
+ }
+ case EX_EL_SHELL:
+ {
+ /* use table to find which node to compare to next */
+
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API)
+ num_node_per_side = ((int64_t*)ss_elem_node_ndx)[idx+1] - ((int64_t*)ss_elem_node_ndx)[idx];
+ else
+ num_node_per_side = ((int*)ss_elem_node_ndx)[idx+1] - ((int*)ss_elem_node_ndx)[idx];
+
+
+ if (ss_node1 == get_node(connect,num_nodes_per_elem*(elem_num_pos)+
+ (shell_table[0][2*n]-1),int_size))
+ {
+ if (num_node_per_side >= 4)
+ /* 4- or 8-node side (front or back face) */
+ put_side(side_sets_side_list,idx,shell_table[1][2*n],int_size);
+ else
+ /* 2- or 3-node side (edge of shell) */
+ put_side(side_sets_side_list,idx,shell_edge_table[1][2*n],int_size);
+ }
+ else if (ss_node1 == get_node(connect,num_nodes_per_elem*(elem_num_pos)+
+ (shell_table[0][2*n+1]-1),int_size))
+ {
+ if (num_node_per_side >= 4)
+ /* 4- or 8-node side (front or back face) */
+ put_side(side_sets_side_list,idx,shell_table[1][2*n+1],int_size);
+ else
+ /* 2- or 3-node side (edge of shell) */
+ put_side(side_sets_side_list,idx,shell_edge_table[1][2*n+1],int_size);
+ }
+ else if (ss_node1 == get_node(connect,num_nodes_per_elem*(elem_num_pos)+
+ (shell_table[0][2*n+2]-1),int_size))
+ {
+ if (num_node_per_side >= 4)
+ /* 4- or 8-node side (front or back face) */
+ put_side(side_sets_side_list,idx,shell_table[1][2*n+2],int_size);
+ else
+ /* 2- or 3-node side (edge of shell) */
+ put_side(side_sets_side_list,idx,shell_edge_table[1][2*n+2],int_size);
+ }
+ else
+ {
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Error: failed to find SHELL element %"PRId64", node %"PRId64" in connectivity array %"PRId64" for file id %d",
+ elem_num+1,
+ ss_node1,
+ elem_blk_parms[p_ndx].elem_blk_id,
+ exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+ break;
+
+ }
+ case EX_EL_HEX:
+ {
+ /* use table to find which node to compare to next */
+
+ if (ss_node1 == get_node(connect,num_nodes_per_elem*(elem_num_pos)+
+ (hex_table[0][3*n]-1),int_size))
+ put_side(side_sets_side_list,idx,hex_table[1][3*n],int_size);
+ else if (ss_node1 == get_node(connect,num_nodes_per_elem*(elem_num_pos)+
+ (hex_table[0][3*n+1]-1),int_size))
+ put_side(side_sets_side_list,idx,hex_table[1][3*n+1],int_size);
+ else if (ss_node1 == get_node(connect,num_nodes_per_elem*(elem_num_pos)+
+ (hex_table[0][3*n+2]-1),int_size))
+ put_side(side_sets_side_list,idx,hex_table[1][3*n+2],int_size);
+ else
+ {
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Error: failed to find HEX element %"PRId64", node %"PRId64" in connectivity array %"PRId64" for file id %d",
+ elem_num+1,
+ ss_node1,
+ elem_blk_parms[p_ndx].elem_blk_id,
+ exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+ break;
+ }
+ case EX_EL_TETRA:
+ {
+ /* use table to find which node to compare to next */
+
+ if (ss_node1 == get_node(connect,num_nodes_per_elem*(elem_num_pos)+
+ (tetra_table[0][3*n]-1),int_size))
+ put_side(side_sets_side_list,idx,tetra_table[1][3*n],int_size);
+ else if (ss_node1 == get_node(connect,num_nodes_per_elem*(elem_num_pos)+
+ (tetra_table[0][3*n+1]-1),int_size))
+ put_side(side_sets_side_list,idx,tetra_table[1][3*n+1],int_size);
+ else if (ss_node1 == get_node(connect,num_nodes_per_elem*(elem_num_pos)+
+ (tetra_table[0][3*n+2]-1),int_size))
+ put_side(side_sets_side_list,idx,tetra_table[1][3*n+2],int_size);
+ else
+ {
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Error: failed to find TETRA element %"PRId64", node %"PRId64" in connectivity array %"PRId64" for file id %d",
+ elem_num+1,
+ ss_node1,
+ elem_blk_parms[p_ndx].elem_blk_id,
+ exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+ break;
+ }
+ case EX_EL_PYRAMID:
+ {
+ /* NOTE: PYRAMID elements in side set node lists are currently not supported */
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "ERROR: unsupported PYRAMID element found in side set node list in file id %d",
+ exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+ case EX_EL_WEDGE:
+ {
+ /* NOTE: WEDGE elements in side set node lists are currently not supported */
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "ERROR: unsupported WEDGE element found in side set node list in file id %d",
+ exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+ default:
+ {
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Error: %s is an unsupported element type",
+ elem_blk_parms[p_ndx].elem_type);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+ }
+ break; /* done with this element */
+ }
+ }
+ if (n >= num_nodes_per_elem) /* did we find the node? */
+ {
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Error: failed to find element %"PRId64", node %"PRId64" in element block %"PRId64" for file id %d",
+ elem_num+1, ss_node0,
+ elem_blk_parms[p_ndx].elem_blk_id,
+ exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ }
+
+ /* All done: release connectivity array space, element block ids array,
+ element block parameters array, and side set element index array */
+ cleanup:
+ safe_free(connect);
+ safe_free(ss_elem_node_ndx);
+ safe_free(ss_parm_ndx);
+ safe_free(elem_blk_parms);
+ safe_free(elem_blk_ids);
+ safe_free(ss_elem_ndx);
+
+ return (err_stat);
+}
+
diff --git a/exodus/cbind/src/exerr.c b/exodus/cbind/src/ex_err.c
similarity index 100%
rename from exodus/cbind/src/exerr.c
rename to exodus/cbind/src/ex_err.c
diff --git a/exodus/cbind/src/exgatm.c b/exodus/cbind/src/ex_get_all_times.c
similarity index 100%
rename from exodus/cbind/src/exgatm.c
rename to exodus/cbind/src/ex_get_all_times.c
diff --git a/exodus/cbind/src/exgatt.c b/exodus/cbind/src/ex_get_attr.c
similarity index 93%
rename from exodus/cbind/src/exgatt.c
rename to exodus/cbind/src/ex_get_attr.c
index 2191bd5..e8f869c 100644
--- a/exodus/cbind/src/exgatt.c
+++ b/exodus/cbind/src/ex_get_attr.c
@@ -59,7 +59,7 @@
int ex_get_attr( int exoid,
ex_entity_type obj_type,
- int obj_id,
+ ex_entity_id obj_id,
void* attrib )
{
@@ -79,13 +79,13 @@ int ex_get_attr( int exoid,
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no attributes found for NULL %s %d in file id %d",
+ "Warning: no attributes found for NULL %s %"PRId64" in file id %d",
ex_name_of_object(obj_type),obj_id,exoid);
ex_err("ex_get_attr",errmsg,EX_MSG);
return (EX_WARN); /* no attributes for this object */
} else {
sprintf(errmsg,
- "Warning: failed to locate %s id %d in id array in file id %d",
+ "Warning: failed to locate %s id %"PRId64" in id array in file id %d",
ex_name_of_object(obj_type),obj_id, exoid);
ex_err("ex_get_attr",errmsg,exerrval);
return (EX_WARN);
@@ -134,7 +134,7 @@ int ex_get_attr( int exoid,
if ((status = nc_inq_varid(exoid, vattrbname, &attrid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate attributes for %s %d in file id %d",
+ "Error: failed to locate attributes for %s %"PRId64" in file id %d",
ex_name_of_object(obj_type), obj_id,exoid);
ex_err("ex_get_attr",errmsg,exerrval);
return (EX_FATAL);
@@ -151,7 +151,7 @@ int ex_get_attr( int exoid,
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get attributes for %s %d in file id %d",
+ "Error: failed to get attributes for %s %"PRId64" in file id %d",
ex_name_of_object(obj_type),obj_id,exoid);
ex_err("ex_get_attr",errmsg,exerrval);
return (EX_FATAL);
diff --git a/exodus/cbind/src/exgatn.c b/exodus/cbind/src/ex_get_attr_names.c
similarity index 94%
rename from exodus/cbind/src/exgatn.c
rename to exodus/cbind/src/ex_get_attr_names.c
index b00bf10..171a5a1 100644
--- a/exodus/cbind/src/exgatn.c
+++ b/exodus/cbind/src/ex_get_attr_names.c
@@ -59,7 +59,7 @@
*/
int ex_get_attr_names( int exoid,
ex_entity_type obj_type,
- int obj_id,
+ ex_entity_id obj_id,
char **names)
{
int status;
@@ -77,13 +77,13 @@ int ex_get_attr_names( int exoid,
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no attributes found for NULL %s %d in file id %d",
+ "Warning: no attributes found for NULL %s %"PRId64" in file id %d",
ex_name_of_object(obj_type), obj_id, exoid);
ex_err("ex_get_attr_names",errmsg,EX_MSG);
return (EX_WARN); /* no attributes for this object */
} else {
sprintf(errmsg,
- "Warning: failed to locate %s id %d in id array in file id %d",
+ "Warning: failed to locate %s id %"PRId64" in id array in file id %d",
ex_name_of_object(obj_type), obj_id, exoid);
ex_err("ex_get_attr_names",errmsg,exerrval);
return (EX_WARN);
@@ -141,7 +141,7 @@ int ex_get_attr_names( int exoid,
if ((status = nc_inq_dimid(exoid, dnumobjatt, &numattrdim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Warning: no attributes found for %s %d in file id %d",
+ "Warning: no attributes found for %s %"PRId64" in file id %d",
ex_name_of_object(obj_type),obj_id,exoid);
ex_err("ex_get_attr_names",errmsg,EX_MSG);
return (EX_WARN); /* no attributes for this object */
@@ -150,7 +150,7 @@ int ex_get_attr_names( int exoid,
if ((status = nc_inq_dimlen(exoid, numattrdim, &num_attr)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of attributes for %s %d in file id %d",
+ "Error: failed to get number of attributes for %s %"PRId64" in file id %d",
ex_name_of_object(obj_type),obj_id,exoid);
ex_err("ex_get_attr_names",errmsg,exerrval);
return (EX_FATAL);
diff --git a/exodus/cbind/src/exgattp.c b/exodus/cbind/src/ex_get_attr_param.c
similarity index 95%
rename from exodus/cbind/src/exgattp.c
rename to exodus/cbind/src/ex_get_attr_param.c
index ea101a0..ffc3ac8 100644
--- a/exodus/cbind/src/exgattp.c
+++ b/exodus/cbind/src/ex_get_attr_param.c
@@ -57,7 +57,7 @@
int ex_get_attr_param (int exoid,
ex_entity_type obj_type,
- int obj_id,
+ ex_entity_id obj_id,
int* num_attrs)
{
int status;
@@ -81,7 +81,7 @@ int ex_get_attr_param (int exoid,
return (EX_NOERR);
} else {
sprintf(errmsg,
- "Warning: failed to locate %s id %d in id array in file id %d",
+ "Warning: failed to locate %s id %"PRId64" in id array in file id %d",
ex_name_of_object(obj_type),obj_id,exoid);
ex_err("ex_get_attr_param",errmsg,exerrval);
return (EX_WARN);
@@ -134,7 +134,7 @@ int ex_get_attr_param (int exoid,
if ((status = nc_inq_dimlen(exoid, dimid, &lnum_attr_per_entry)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of attributes in %s %d in file id %d",
+ "Error: failed to get number of attributes in %s %"PRId64" in file id %d",
ex_name_of_object(obj_type),obj_id, exoid);
ex_err("ex_get_attr_param",errmsg, exerrval);
return(EX_FATAL);
diff --git a/exodus/cbind/src/ex_get_block.c b/exodus/cbind/src/ex_get_block.c
new file mode 100644
index 0000000..f25e33c
--- /dev/null
+++ b/exodus/cbind/src/ex_get_block.c
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2006 Sandia Corporation. Under the terms of Contract
+ * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
+ * retains certain rights in this software.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * * Neither the name of Sandia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/*!
+*
+* \undoc exgblk - read block parameters
+*
+* entry conditions -
+* input parameters:
+* int idexo exodus file id
+* int blk_type block type (edge,face,element)
+* int blk_id block id
+*
+* exit conditions -
+* char* elem_type element type name
+* int* num_entries_this_blk number of elements in this element block
+* int* num_nodes_per_entry number of nodes per element block
+* int* num_attr_per_entry number of attributes
+*
+* revision history -
+*
+*
+*/
+
+#include <string.h>
+#include <stdio.h>
+#include "exodusII.h"
+#include "exodusII_int.h"
+
+/*
+ * reads the parameters used to describe an edge, face, or element block
+ */
+
+int ex_get_block( int exoid,
+ ex_entity_type blk_type,
+ ex_entity_id blk_id,
+ char* elem_type,
+ void_int* num_entries_this_blk,
+ void_int* num_nodes_per_entry,
+ void_int* num_edges_per_entry,
+ void_int* num_faces_per_entry,
+ void_int* num_attr_per_entry )
+{
+ int err;
+ ex_block block;
+ block.id = blk_id;
+ block.type = blk_type;
+
+ err = ex_get_block_param(exoid, &block);
+
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ int64_t* n_entries_this_blk = num_entries_this_blk;
+ int64_t* n_nodes_per_entry = num_nodes_per_entry;
+ int64_t* n_edges_per_entry = num_edges_per_entry;
+ int64_t* n_faces_per_entry = num_faces_per_entry;
+ int64_t* n_attr_per_entry = num_attr_per_entry;
+
+ if (n_entries_this_blk) *n_entries_this_blk = block.num_entry;
+ if (n_nodes_per_entry) *n_nodes_per_entry = block.num_nodes_per_entry;
+ if (n_edges_per_entry) *n_edges_per_entry = block.num_edges_per_entry;
+ if (n_faces_per_entry) *n_faces_per_entry = block.num_faces_per_entry;
+ if (n_attr_per_entry) *n_attr_per_entry = block.num_attribute;
+ } else {
+ int* n_entries_this_blk = num_entries_this_blk;
+ int* n_nodes_per_entry = num_nodes_per_entry;
+ int* n_edges_per_entry = num_edges_per_entry;
+ int* n_faces_per_entry = num_faces_per_entry;
+ int* n_attr_per_entry = num_attr_per_entry;
+
+ if (n_entries_this_blk) *n_entries_this_blk = block.num_entry;
+ if (n_nodes_per_entry) *n_nodes_per_entry = block.num_nodes_per_entry;
+ if (n_edges_per_entry) *n_edges_per_entry = block.num_edges_per_entry;
+ if (n_faces_per_entry) *n_faces_per_entry = block.num_faces_per_entry;
+ if (n_attr_per_entry) *n_attr_per_entry = block.num_attribute;
+ }
+
+ if (elem_type)
+ strcpy(elem_type, block.topology);
+
+ return err;
+}
+
diff --git a/exodus/cbind/src/ex_get_block_param.c b/exodus/cbind/src/ex_get_block_param.c
new file mode 100644
index 0000000..2e59fcf
--- /dev/null
+++ b/exodus/cbind/src/ex_get_block_param.c
@@ -0,0 +1,277 @@
+/*
+ * Copyright (c) 2006 Sandia Corporation. Under the terms of Contract
+ * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
+ * retains certain rights in this software.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * * Neither the name of Sandia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/*!
+*
+* \undoc exgblk - read block parameters
+*
+* entry conditions -
+* input parameters:
+* int idexo exodus file id
+* int blk_type block type (edge,face,element)
+* int blk_id block id
+*
+* exit conditions -
+* char* elem_type element type name
+* int* num_entries_this_blk number of elements in this element block
+* int* num_nodes_per_entry number of nodes per element block
+* int* num_attr_per_entry number of attributes
+*
+* revision history -
+*
+*
+*/
+
+#include <string.h>
+#include <stdio.h>
+#include "exodusII.h"
+#include "exodusII_int.h"
+
+/*
+ * reads the parameters used to describe an edge, face, or element block
+ */
+
+int ex_get_block_param( int exoid,
+ ex_block *block )
+{
+ int dimid, connid, blk_id_ndx;
+ size_t len, i;
+ char errmsg[MAX_ERR_LENGTH];
+ int status;
+ const char* dnument;
+ const char* dnumnod;
+ const char* dnumedg;
+ const char* dnumfac;
+ const char* dnumatt;
+ const char* ablknam;
+ const char* vblkcon;
+
+ exerrval = 0;
+
+ /* First, locate index of element block id in VAR_ID_EL_BLK array */
+ blk_id_ndx = ex_id_lkup(exoid,block->type,block->id);
+ if (exerrval != 0) {
+ strcpy(block->topology, "NULL"); /* NULL element type name */
+ block->num_entry = 0; /* no elements */
+ block->num_nodes_per_entry = 0; /* no nodes */
+ block->num_edges_per_entry = 0;
+ block->num_faces_per_entry = 0;
+ block->num_attribute = 0; /* no attributes */
+ if (exerrval == EX_NULLENTITY) { /* NULL element block? */
+ return (EX_NOERR);
+ } else {
+ sprintf(errmsg,
+ "Error: failed to locate %s id %"PRId64" in id array in file id %d",
+ ex_name_of_object(block->type), block->id,exoid);
+ ex_err("ex_get_block_param",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ }
+
+ switch (block->type) {
+ case EX_EDGE_BLOCK:
+ dnument = DIM_NUM_ED_IN_EBLK(blk_id_ndx);
+ dnumnod = DIM_NUM_NOD_PER_ED(blk_id_ndx);
+ dnumedg = 0;
+ dnumfac = 0;
+ dnumatt = DIM_NUM_ATT_IN_EBLK(blk_id_ndx);
+ vblkcon = VAR_EBCONN(blk_id_ndx);
+ ablknam = ATT_NAME_ELB;
+ break;
+ case EX_FACE_BLOCK:
+ dnument = DIM_NUM_FA_IN_FBLK(blk_id_ndx);
+ dnumnod = DIM_NUM_NOD_PER_FA(blk_id_ndx);
+ dnumedg = 0; /* it is possible this might be non-NULL some day */
+ dnumfac = 0;
+ dnumatt = DIM_NUM_ATT_IN_FBLK(blk_id_ndx);
+ vblkcon = VAR_FBCONN(blk_id_ndx);
+ ablknam = ATT_NAME_ELB;
+ break;
+ case EX_ELEM_BLOCK:
+ dnument = DIM_NUM_EL_IN_BLK(blk_id_ndx);
+ dnumnod = DIM_NUM_NOD_PER_EL(blk_id_ndx);
+ dnumedg = DIM_NUM_EDG_PER_EL(blk_id_ndx);
+ dnumfac = DIM_NUM_FAC_PER_EL(blk_id_ndx);
+ dnumatt = DIM_NUM_ATT_IN_BLK(blk_id_ndx);
+ vblkcon = VAR_CONN(blk_id_ndx);
+ ablknam = ATT_NAME_ELB;
+ break;
+ default:
+ exerrval = EX_BADPARAM;
+ sprintf( errmsg, "Bad block type parameter (%d) specified for file id %d.",
+ block->type, exoid );
+ return (EX_FATAL);
+ }
+
+ /* inquire values of some dimensions */
+ if ((status = nc_inq_dimid (exoid, dnument, &dimid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to locate number of entities in %s %"PRId64" in file id %d",
+ ex_name_of_object(block->type),block->id,exoid);
+ ex_err("ex_get_block_param",errmsg, exerrval);
+ return(EX_FATAL);
+ }
+
+ if ((status = nc_inq_dimlen (exoid, dimid, &len)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to get number of %ss in block %"PRId64" in file id %d",
+ ex_name_of_object(block->type),block->id, exoid);
+ ex_err("ex_get_block_param",errmsg, exerrval);
+ return(EX_FATAL);
+ }
+ block->num_entry = len;
+
+ if ((status = nc_inq_dimid (exoid, dnumnod, &dimid)) != NC_NOERR) {
+ /* undefined => no node entries per element */
+ len = 0;
+ } else {
+ if ((status = nc_inq_dimlen (exoid, dimid, &len)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to get number of nodes/entity in %s %"PRId64" in file id %d",
+ ex_name_of_object(block->type),block->id, exoid);
+ ex_err("ex_get_block_param",errmsg, exerrval);
+ return(EX_FATAL);
+ }
+ }
+ block->num_nodes_per_entry = len;
+
+ if ( block->type != EX_ELEM_BLOCK ) {
+ block->num_edges_per_entry = 0;
+ } else {
+ if ((status = nc_inq_dimid (exoid, dnumedg, &dimid)) != NC_NOERR) {
+ /* undefined => no edge entries per element */
+ len = 0;
+ } else {
+ if ((status = nc_inq_dimlen (exoid, dimid, &len)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to get number of edges/entry in %s %"PRId64" in file id %d",
+ ex_name_of_object(block->type),block->id, exoid);
+ ex_err("ex_get_block_param",errmsg, exerrval);
+ return(EX_FATAL);
+ }
+ }
+ block->num_edges_per_entry = len;
+ }
+
+ if ( block->type != EX_ELEM_BLOCK ) {
+ block->num_faces_per_entry = 0;
+ } else {
+ if ((status = nc_inq_dimid (exoid, dnumfac, &dimid)) != NC_NOERR) {
+ /* undefined => no face entries per element */
+ len = 0;
+ } else {
+ if ((status = nc_inq_dimlen(exoid, dimid, &len)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to get number of faces/entity in %s %"PRId64" in file id %d",
+ ex_name_of_object(block->type),block->id, exoid);
+ ex_err("ex_get_block_param",errmsg, exerrval);
+ return(EX_FATAL);
+ }
+ }
+ block->num_faces_per_entry = len;
+ }
+
+ if ((status = nc_inq_dimid (exoid, dnumatt, &dimid)) != NC_NOERR) {
+ /* dimension is undefined */
+ block->num_attribute = 0;
+ } else {
+ if ((status = nc_inq_dimlen(exoid, dimid, &len)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to get number of attributes in %s %"PRId64" in file id %d",
+ ex_name_of_object(block->type),block->id, exoid);
+ ex_err("ex_get_block_param",errmsg, exerrval);
+ return(EX_FATAL);
+ }
+ block->num_attribute = len;
+ }
+
+ if (block->num_nodes_per_entry > 0) {
+ ; /* Do nothing, vblkcon should be correctly set already */
+ } else if (block->num_edges_per_entry > 0) {
+ vblkcon = VAR_EBCONN(blk_id_ndx);
+ } else if (block->num_faces_per_entry > 0) {
+ vblkcon = VAR_FCONN(blk_id_ndx);
+ }
+
+ if (vblkcon) {
+ /* look up connectivity array for this element block id */
+ if ((status = nc_inq_varid (exoid, vblkcon, &connid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to locate connectivity array for %s %"PRId64" in file id %d",
+ ex_name_of_object(block->type), block->id,exoid);
+ ex_err("ex_get_block_param",errmsg, exerrval);
+ return(EX_FATAL);
+ }
+
+ if ((status = nc_inq_attlen (exoid, connid, ablknam, &len)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to get %s %"PRId64" type in file id %d",
+ ex_name_of_object(block->type), block->id,exoid);
+ ex_err("ex_get_block_param",errmsg, exerrval);
+ return(EX_FATAL);
+ }
+
+ if (len > (MAX_STR_LENGTH+1)) {
+ len = MAX_STR_LENGTH;
+ sprintf (errmsg,
+ "Warning: %s %"PRId64" type will be truncated to %ld chars",
+ ex_name_of_object(block->type), block->id, (long)len);
+ ex_err("ex_get_block_param",errmsg,EX_MSG);
+ }
+
+ for (i=0; i < MAX_STR_LENGTH+1; i++)
+ block->topology[i] = '\0';
+
+ /* get the element type name */
+ if ((status = nc_get_att_text (exoid, connid, ablknam, block->topology)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,"Error: failed to get %s %"PRId64" type in file id %d",
+ ex_name_of_object(block->type), block->id, exoid);
+ ex_err("ex_get_block_param",errmsg, exerrval);
+ return(EX_FATAL);
+ }
+
+ /* get rid of trailing blanks */
+ ex_trim_internal(block->topology);
+ }
+ return (EX_NOERR);
+}
diff --git a/nemesis/ne_gcmp.c b/exodus/cbind/src/ex_get_cmap_params.c
similarity index 72%
rename from nemesis/ne_gcmp.c
rename to exodus/cbind/src/ex_get_cmap_params.c
index bebf908..c40dd08 100644
--- a/nemesis/ne_gcmp.c
+++ b/exodus/cbind/src/ex_get_cmap_params.c
@@ -36,12 +36,12 @@
/*****************************************************************************/
/*****************************************************************************/
/* Function(s) contained in this file:
- * ne_get_cmap_params()
+ * ex_get_cmap_params()
*****************************************************************************
* This function outputs the communication map parameters.
*****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* node_cmap_ids - Pointer to vector of nodal communication
* set IDs.
* node_cmap_node_cnts - Pointer to a vector which contains a count of
@@ -67,18 +67,15 @@
#include <exodusII.h>
#include <exodusII_int.h>
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-int ne_get_cmap_params(int neid,
- int *node_cmap_ids,
- int *node_cmap_node_cnts,
- int *elem_cmap_ids,
- int *elem_cmap_elem_cnts,
+int ex_get_cmap_params(int exoid,
+ void_int *node_cmap_ids,
+ void_int *node_cmap_node_cnts,
+ void_int *elem_cmap_ids,
+ void_int *elem_cmap_elem_cnts,
int processor
)
{
- char *func_name="ne_get_cmap_params";
+ const char *func_name="ex_get_cmap_params";
size_t cnt, num_n_comm_maps, num_e_comm_maps, start[1], count[1];
int64_t cmap_info_idx[2], cmap_data_idx[2];
@@ -97,24 +94,24 @@ int ne_get_cmap_params(int neid,
/*****************************************************************************/
/* get the cmap information variables index */
- if (ne_get_idx(neid, VAR_N_COMM_INFO_IDX, cmap_info_idx, processor) == -1) {
+ if (ex_get_idx(exoid, VAR_N_COMM_INFO_IDX, cmap_info_idx, processor) == -1) {
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_N_COMM_INFO_IDX, neid);
+ VAR_N_COMM_INFO_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the number of nodal communications maps in the file */
- if ((status = nc_inq_dimid(neid, DIM_NUM_N_CMAPS, &dimid)) == NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_N_CMAPS, &dimid)) == NC_NOERR) {
/* check if I need to get the dimension of the nodal comm map */
if (cmap_info_idx[1] == -1) {
- if ((status = nc_inq_dimlen(neid, dimid, count)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, count)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_N_CMAPS, neid);
+ DIM_NUM_N_CMAPS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -129,11 +126,11 @@ int ne_get_cmap_params(int neid,
count[0] = num_n_comm_maps;
/* Get the variable ID for the vector of nodal comm map IDs */
- if ((status = nc_inq_varid(neid, VAR_N_COMM_IDS, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_N_COMM_IDS, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable ID for \"%s\" in file ID %d",
- VAR_N_COMM_IDS, neid);
+ VAR_N_COMM_IDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -141,22 +138,26 @@ int ne_get_cmap_params(int neid,
/* Get the vector of nodal communication map IDs */
if (node_cmap_ids != NULL) {
start[0] = cmap_info_idx[0];
- status = nc_get_vara_int(neid, varid, start, count, node_cmap_ids);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ status = nc_get_vara_longlong(exoid, varid, start, count, node_cmap_ids);
+ } else {
+ status = nc_get_vara_int(exoid, varid, start, count, node_cmap_ids);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_N_COMM_IDS, neid);
+ VAR_N_COMM_IDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_varid(neid, VAR_N_COMM_STAT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_N_COMM_STAT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" from file ID %d",
- VAR_N_COMM_STAT, neid);
+ VAR_N_COMM_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -165,24 +166,29 @@ int ne_get_cmap_params(int neid,
/* Get the node counts in each of the nodal communication maps */
for(cnt=0; cnt < num_n_comm_maps; cnt++) {
-
- if ((map_idx=ne_id_lkup(neid, VAR_N_COMM_IDS, cmap_info_idx,
- node_cmap_ids[cnt])) < 0) {
+ int64_t cmap_id;
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ cmap_id = ((int64_t*)node_cmap_ids)[cnt];
+ } else {
+ cmap_id = ((int*)node_cmap_ids)[cnt];
+ }
+
+ if ((map_idx=ne_id_lkup(exoid, VAR_N_COMM_IDS, cmap_info_idx, cmap_id)) < 0) {
exerrval = EX_MSG;
sprintf(errmsg,
- "Error: failed to find nodal comm map with ID %d in file ID %d",
- node_cmap_ids[cnt], neid);
+ "Error: failed to find nodal comm map with ID %"PRId64" in file ID %d",
+ cmap_id, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Check the status of the node map */
start[0] = map_idx;
- if ((status = nc_get_var1_int(neid, varid, start, &nmstat)) != NC_NOERR) {
+ if ((status = nc_get_var1_int(exoid, varid, start, &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get status for \"%s\" from file ID %d",
- VAR_N_COMM_STAT, neid);
+ VAR_N_COMM_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -190,12 +196,12 @@ int ne_get_cmap_params(int neid,
if (nmstat == 1) {
/* get the cmap information variables index */
- if (ne_get_idx(neid, VAR_N_COMM_DATA_IDX, cmap_data_idx,
+ if (ex_get_idx(exoid, VAR_N_COMM_DATA_IDX, cmap_data_idx,
map_idx) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_N_COMM_DATA_IDX, neid);
+ VAR_N_COMM_DATA_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -206,21 +212,21 @@ int ne_get_cmap_params(int neid,
* Find the dimension ID of the variable containing the
* node count
*/
- if ((status = nc_inq_dimid(neid, DIM_NCNT_CMAP, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NCNT_CMAP, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NCNT_CMAP, neid);
+ DIM_NCNT_CMAP, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Find the value of the number of nodes in this nodal comm map */
- if ((status = nc_inq_dimlen(neid, dimid, count)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, count)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NCNT_CMAP, neid);
+ DIM_NCNT_CMAP, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -228,15 +234,23 @@ int ne_get_cmap_params(int neid,
cmap_data_idx[1] = count[0];
}
- node_cmap_node_cnts[cnt] = cmap_data_idx[1] - cmap_data_idx[0];
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ ((int64_t*)node_cmap_node_cnts)[cnt] = cmap_data_idx[1] - cmap_data_idx[0];
+ } else {
+ ((int*)node_cmap_node_cnts)[cnt] = cmap_data_idx[1] - cmap_data_idx[0];
+ }
}
else
- node_cmap_node_cnts[cnt] = 0;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ ((int64_t*)node_cmap_node_cnts)[cnt] = 0;
+ } else {
+ ((int*)node_cmap_node_cnts)[cnt] = 0;
+ }
} /* "for(cnt=0; cnt < num_n_comm_maps; cnt++)" */
} /* "if (node_cmap_node_cnts != NULL)" */
} /* "if (node_cmap_ids != NULL)" */
} /* "if (num_n_comm_maps > 0)" */
- } /* End "if ((dimid = nc_inq_dimid(neid, DIM_NUM_N_CMAPS)) != -1)" */
+ } /* End "if ((dimid = nc_inq_dimid(exoid, DIM_NUM_N_CMAPS)) != -1)" */
/*****************************************************************************/
/*****************************************************************************/
@@ -245,25 +259,25 @@ int ne_get_cmap_params(int neid,
/*****************************************************************************/
/* get the cmap information variables index */
- if (ne_get_idx(neid, VAR_E_COMM_INFO_IDX, cmap_info_idx, processor) == -1) {
+ if (ex_get_idx(exoid, VAR_E_COMM_INFO_IDX, cmap_info_idx, processor) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_E_COMM_INFO_IDX, neid);
+ VAR_E_COMM_INFO_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the number of elemental communications maps in the file */
- if ((status = nc_inq_dimid(neid, DIM_NUM_E_CMAPS, &dimid)) == NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_E_CMAPS, &dimid)) == NC_NOERR) {
/* check if I need to get the dimension of the nodal comm map */
if (cmap_info_idx[1] == -1) {
- if ((status = nc_inq_dimlen(neid, dimid, count)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, count)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_E_CMAPS, neid);
+ DIM_NUM_E_CMAPS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -278,11 +292,11 @@ int ne_get_cmap_params(int neid,
count[0] = num_e_comm_maps;
/* Get the variable ID for the vector of nodal comm map IDs */
- if ((status = nc_inq_varid(neid, VAR_E_COMM_IDS, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_E_COMM_IDS, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable ID for \"%s\" in file ID %d",
- VAR_E_COMM_IDS, neid);
+ VAR_E_COMM_IDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -290,21 +304,25 @@ int ne_get_cmap_params(int neid,
/* Get the vector of elemental communication map IDs */
if (elem_cmap_ids != NULL) {
start[0] = cmap_info_idx[0];
- status = nc_get_vara_int(neid, varid, start, count, elem_cmap_ids);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ status = nc_get_vara_longlong(exoid, varid, start, count, elem_cmap_ids);
+ } else {
+ status = nc_get_vara_int(exoid, varid, start, count, elem_cmap_ids);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_E_COMM_IDS, neid);
+ VAR_E_COMM_IDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_varid(neid, VAR_E_COMM_STAT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_E_COMM_STAT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" from file ID %d",
- VAR_E_COMM_STAT, neid);
+ VAR_E_COMM_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -315,24 +333,30 @@ int ne_get_cmap_params(int neid,
* communication maps
*/
for(cnt=0; cnt < num_e_comm_maps; cnt++) {
-
- if ((map_idx=ne_id_lkup(neid, VAR_E_COMM_IDS, cmap_info_idx,
- elem_cmap_ids[cnt])) < 0) {
+ int64_t cmap_id;
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ cmap_id = ((int64_t*)elem_cmap_ids)[cnt];
+ } else {
+ cmap_id = ((int*)elem_cmap_ids)[cnt];
+ }
+
+ if ((map_idx=ne_id_lkup(exoid, VAR_E_COMM_IDS, cmap_info_idx,
+ cmap_id)) < 0) {
exerrval = EX_MSG;
sprintf(errmsg,
- "Error: failed to find elemental comm map with ID %d in file ID %d",
- elem_cmap_ids[cnt], neid);
+ "Error: failed to find elemental comm map with ID %"PRId64" in file ID %d",
+ cmap_id, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Check the status of the requested elemental map */
start[0] = map_idx;
- if ((status = nc_get_var1_int(neid, varid, start, &nmstat)) != NC_NOERR) {
+ if ((status = nc_get_var1_int(exoid, varid, start, &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get status for \"%s\" from file ID %d",
- VAR_E_COMM_STAT, neid);
+ VAR_E_COMM_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -340,12 +364,12 @@ int ne_get_cmap_params(int neid,
if (nmstat == 1) {
/* get the cmap information variables index */
- if (ne_get_idx(neid, VAR_E_COMM_DATA_IDX, cmap_data_idx,
+ if (ex_get_idx(exoid, VAR_E_COMM_DATA_IDX, cmap_data_idx,
map_idx) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_E_COMM_DATA_IDX, neid);
+ VAR_E_COMM_DATA_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -356,11 +380,11 @@ int ne_get_cmap_params(int neid,
* Find the dimension ID of the variable containing the
* element count
*/
- if ((status = nc_inq_dimid(neid, DIM_ECNT_CMAP, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_ECNT_CMAP, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_ECNT_CMAP, neid);
+ DIM_ECNT_CMAP, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -369,24 +393,32 @@ int ne_get_cmap_params(int neid,
* Find the value of the number of elements in this elemental
* comm map
*/
- if ((status = nc_inq_dimlen(neid, dimid, count)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, count)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_ECNT_CMAP, neid);
+ DIM_ECNT_CMAP, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
cmap_data_idx[1] = count[0];
}
- elem_cmap_elem_cnts[cnt] = cmap_data_idx[1] - cmap_data_idx[0];
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ ((int64_t*)elem_cmap_elem_cnts)[cnt] = cmap_data_idx[1] - cmap_data_idx[0];
+ } else {
+ ((int*)elem_cmap_elem_cnts)[cnt] = cmap_data_idx[1] - cmap_data_idx[0];
+ }
}
else
- elem_cmap_elem_cnts[cnt] = 0;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ ((int64_t*)elem_cmap_elem_cnts)[cnt] = 0;
+ } else {
+ ((int*)elem_cmap_elem_cnts)[cnt] = 0;
+ }
} /* "for(cnt=0; cnt < num_e_comm_maps; cnt++)" */
} /* "if (elem_cmap_elem_cnts != NULL)" */
} /* "if (elem_cmap_ids != NULL)" */
} /* "if (num_e_comm_maps > 0)" */
- } /* End "if ((dimid = nc_inq_dimid(neid, DIM_NUM_E_CMAPS(processor))) != -1)" */
+ } /* End "if ((dimid = nc_inq_dimid(exoid, DIM_NUM_E_CMAPS(processor))) != -1)" */
return (EX_NOERR);
}
diff --git a/exodus/cbind/src/exgcns.c b/exodus/cbind/src/ex_get_concat_node_sets.c
similarity index 94%
rename from exodus/cbind/src/exgcns.c
rename to exodus/cbind/src/ex_get_concat_node_sets.c
index 368d2a4..7006119 100644
--- a/exodus/cbind/src/exgcns.c
+++ b/exodus/cbind/src/ex_get_concat_node_sets.c
@@ -120,12 +120,12 @@ error = ex_get_concat_node_sets (exoid, ids, num_nodes_per_set,
*/
int ex_get_concat_node_sets (int exoid,
- int *node_set_ids,
- int *num_nodes_per_set,
- int *num_df_per_set,
- int *node_sets_node_index,
- int *node_sets_df_index,
- int *node_sets_node_list,
+ void_int *node_set_ids,
+ void_int *num_nodes_per_set,
+ void_int *num_df_per_set,
+ void_int *node_sets_node_index,
+ void_int *node_sets_df_index,
+ void_int *node_sets_node_list,
void *node_sets_dist_fact)
{
struct ex_set_specs set_specs;
diff --git a/exodus/cbind/src/exgcset.c b/exodus/cbind/src/ex_get_concat_sets.c
similarity index 56%
rename from exodus/cbind/src/exgcset.c
rename to exodus/cbind/src/ex_get_concat_sets.c
index 248c34f..bb1b674 100644
--- a/exodus/cbind/src/exgcset.c
+++ b/exodus/cbind/src/ex_get_concat_sets.c
@@ -61,17 +61,14 @@ int ex_get_concat_sets (int exoid,
struct ex_set_specs* set_specs)
{
int status, dimid;
- int *set_ids = set_specs->sets_ids;
- int *num_entries_per_set = set_specs->num_entries_per_set;
- int *num_dist_per_set = set_specs->num_dist_per_set;
- int *sets_entry_index = set_specs->sets_entry_index;
- int *sets_dist_index = set_specs->sets_dist_index;
- int *sets_entry_list = set_specs->sets_entry_list;
- int *sets_extra_list = set_specs->sets_extra_list;
+ void_int *num_entries_per_set = set_specs->num_entries_per_set;
+ void_int *num_dist_per_set = set_specs->num_dist_per_set;
+ void_int *sets_entry_index = set_specs->sets_entry_index;
+ void_int *sets_dist_index = set_specs->sets_dist_index;
+
void *sets_dist_fact = set_specs->sets_dist_fact;
- char *cdum;
+
int num_sets, i;
- float fdum;
float *flt_dist_fact;
double *dbl_dist_fact;
char errmsg[MAX_ERR_LENGTH];
@@ -79,8 +76,6 @@ int ex_get_concat_sets (int exoid,
exerrval = 0; /* clear error code */
- cdum = 0; /* initialize even though it is not used */
-
/* setup pointers based on set_type
NOTE: there is another block that sets more stuff later ... */
@@ -128,7 +123,8 @@ int ex_get_concat_sets (int exoid,
/* inquire how many sets have been stored */
- if (ex_inquire(exoid, ex_inq_val, &num_sets, &fdum, cdum) != NC_NOERR) {
+ num_sets = ex_inquire_int(exoid, ex_inq_val);
+ if (num_sets < 0) {
sprintf(errmsg,
"Error: failed to get number of %ss defined for file id %d",
ex_name_of_object(set_type), exoid);
@@ -137,7 +133,7 @@ int ex_get_concat_sets (int exoid,
return (EX_FATAL);
}
- if (ex_get_ids (exoid, set_type, set_ids) != NC_NOERR) {
+ if (ex_get_ids (exoid, set_type, set_specs->sets_ids) != NC_NOERR) {
sprintf(errmsg,
"Error: failed to get %s ids for file id %d",
ex_name_of_object(set_type), exoid);
@@ -146,74 +142,101 @@ int ex_get_concat_sets (int exoid,
return (EX_FATAL);
}
- sets_entry_index[0] = 0;
- sets_dist_index[0] = 0;
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ ((int64_t*)sets_entry_index)[0] = 0;
+ ((int64_t*)sets_dist_index)[0] = 0;
+ } else {
+ ((int*)sets_entry_index)[0] = 0;
+ ((int*)sets_dist_index)[0] = 0;
+ }
for (i=0; i<num_sets; i++) {
- if (ex_get_set_param(exoid, set_type, set_ids[i],
- &(num_entries_per_set[i]), &(num_dist_per_set[i])) != NC_NOERR)
- return(EX_FATAL); /* error will be reported by sub */
-
- if (i < num_sets-1) {
- /* fill in entry and dist factor index arrays */
- sets_entry_index[i+1] = sets_entry_index[i]+num_entries_per_set[i];
- sets_dist_index[i+1] = sets_dist_index[i]+num_dist_per_set[i];
+ int set_id;
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ set_id = ((int64_t*)set_specs->sets_ids)[i];
+ } else {
+ set_id = ((int*)set_specs->sets_ids)[i];
}
- if (num_entries_per_set[i] == 0) /* NULL set? */
- continue;
-
- /* Now, use ExodusII call to get sets */
-
- if (ex_comp_ws(exoid) == sizeof(float)) {
- int *extra_sets = NULL;
- if (sets_extra_list != NULL)
- extra_sets = &(sets_extra_list[sets_entry_index[i]]);
-
- if (ex_get_set(exoid, set_type, set_ids[i],
- &(sets_entry_list[sets_entry_index[i]]),
- extra_sets) == -1)
- return(EX_FATAL); /* error will be reported by subroutine */
-
- /* get distribution factors for this set */
- if (sets_dist_fact != 0) {
- flt_dist_fact = sets_dist_fact;
- if (num_dist_per_set[i] > 0) { /* only get df if they exist */
- if (ex_get_set_dist_fact(exoid, set_type, set_ids[i],
- &(flt_dist_fact[sets_dist_index[i]])) != NC_NOERR) {
- sprintf(errmsg,
- "Error: failed to get %s %d dist factors in file id %d",
- ex_name_of_object(set_type), set_ids[i], exoid);
- ex_err("ex_get_concat_sets",errmsg,exerrval);
- return(EX_FATAL);
- }
- } else { /* fill distribution factor array with 1's */
- }
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ if (ex_get_set_param(exoid, set_type, set_id,
+ &(((int64_t*)num_entries_per_set)[i]),
+ &(((int64_t*)num_dist_per_set)[i])) != NC_NOERR)
+ return(EX_FATAL); /* error will be reported by sub */
+
+ if (i < num_sets-1) {
+ /* fill in entry and dist factor index arrays */
+ ((int64_t*)sets_entry_index)[i+1] = ((int64_t*)sets_entry_index)[i]+((int64_t*)num_entries_per_set)[i];
+ ((int64_t*)sets_dist_index)[i+1] = ((int64_t*)sets_dist_index)[i]+((int64_t*)num_dist_per_set)[i];
}
- }
- else if (ex_comp_ws(exoid) == sizeof(double))
+
+ if (((int64_t*)num_entries_per_set)[i] == 0) /* NULL set? */
+ continue;
+
{
- if (ex_get_set(exoid, set_type, set_ids[i],
- &(sets_entry_list[sets_entry_index[i]]),
- &(sets_extra_list[sets_entry_index[i]])) != NC_NOERR)
- return(EX_FATAL); /* error will be reported by subroutine */
+ /* Now, use ExodusII call to get sets */
+ int64_t *sets_entry_list = set_specs->sets_entry_list;
+ int64_t *sets_extra_list = set_specs->sets_extra_list;
+ int64_t *sets_extra = sets_extra_list ? &((int64_t*)sets_extra_list)[((int64_t*)sets_entry_index)[i]] : NULL;
+ status = ex_get_set(exoid, set_type, set_id,
+ &(sets_entry_list[((int64_t*)sets_entry_index)[i]]),
+ sets_extra);
+ }
+ } else {
+ if (ex_get_set_param(exoid, set_type, set_id,
+ &(((int*)num_entries_per_set)[i]),
+ &(((int*)num_dist_per_set)[i])) != NC_NOERR)
+ return(EX_FATAL); /* error will be reported by sub */
+
+ if (i < num_sets-1) {
+ /* fill in entry and dist factor index arrays */
+ ((int*)sets_entry_index)[i+1] = ((int*)sets_entry_index)[i]+((int*)num_entries_per_set)[i];
+ ((int*)sets_dist_index)[i+1] = ((int*)sets_dist_index)[i]+((int*)num_dist_per_set)[i];
+ }
+
+ if (((int*)num_entries_per_set)[i] == 0) /* NULL set? */
+ continue;
- /* get distribution factors for this set */
- if (sets_dist_fact != 0) {
+ {
+ /* Now, use ExodusII call to get sets */
+ int *sets_entry_list = set_specs->sets_entry_list;
+ int *sets_extra_list = set_specs->sets_extra_list;
+ int *sets_extra = sets_extra_list ? &((int*)sets_extra_list)[((int*)sets_entry_index)[i]] : NULL;
+ status = ex_get_set(exoid, set_type, set_id,
+ &(sets_entry_list[((int*)sets_entry_index)[i]]),
+ sets_extra);
+ }
+ }
+
+ if (status != NC_NOERR)
+ return(EX_FATAL); /* error will be reported by subroutine */
+
+ /* get distribution factors for this set */
+ if (sets_dist_fact != 0) {
+ size_t df_idx;
+ size_t num_dist;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ df_idx = ((int64_t*)sets_dist_index)[i];
+ num_dist = ((int64_t*)num_dist_per_set)[i];
+ } else {
+ df_idx = ((int*)sets_dist_index)[i];
+ num_dist = ((int*)num_dist_per_set)[i];
+ }
+ if (num_dist > 0) { /* only get df if they exist */
+ if (ex_comp_ws(exoid) == sizeof(float)) {
+ flt_dist_fact = sets_dist_fact;
+ status = ex_get_set_dist_fact(exoid, set_type, set_id,
+ &(flt_dist_fact[df_idx]));
+ } else {
dbl_dist_fact = sets_dist_fact;
- if (num_dist_per_set[i] > 0) { /* only get df if they exist */
- if (ex_get_set_dist_fact(exoid, set_type, set_ids[i],
- &(dbl_dist_fact[sets_dist_index[i]])) != NC_NOERR) {
- sprintf(errmsg,
- "Error: failed to get %s %d dist factors in file id %d",
- ex_name_of_object(set_type), set_ids[i], exoid);
- ex_err("ex_get_concat_sets",errmsg,exerrval);
- return(EX_FATAL);
- }
- } else { /* fill distribution factor array with 1's */
- }
+ status = ex_get_set_dist_fact(exoid, set_type, set_id,
+ &(dbl_dist_fact[df_idx]));
+ }
+ if (status != NC_NOERR) {
+ return(EX_FATAL); /* error will be reported by subroutine */
}
}
+ }
}
return(EX_NOERR);
}
diff --git a/exodus/cbind/src/exgcssc.c b/exodus/cbind/src/ex_get_concat_side_set_node_count.c
similarity index 78%
rename from exodus/cbind/src/exgcssc.c
rename to exodus/cbind/src/ex_get_concat_side_set_node_count.c
index 82a2535..e715f8c 100644
--- a/exodus/cbind/src/exgcssc.c
+++ b/exodus/cbind/src/ex_get_concat_side_set_node_count.c
@@ -56,7 +56,7 @@
#include "exodusII_int.h"
/*! \cond INTERNAL */
-void *safe_free(void *array)
+static void *safe_free(void *array)
{
if (array != 0) free(array);
return 0;
@@ -68,8 +68,8 @@ void *safe_free(void *array)
elem_blk_parms[i].elem_type,\
elem_blk_parms[i].num_nodes_per_elem);\
ex_err("ex_get_side_set_node_count",errmsg,EX_MSG);\
- return(EX_FATAL);\
-/* \endcond */
+ return(EX_FATAL);
+/*! \endcond */
/*! \undoc */
int ex_get_concat_side_set_node_count(int exoid,
@@ -77,55 +77,51 @@ int ex_get_concat_side_set_node_count(int exoid,
{
size_t m;
int ii, i, j, iss, ioff;
- int side_set_id;
+ ex_entity_id side_set_id;
int num_side_sets, num_elem_blks, num_df, ndim;
- int tot_num_elem = 0, tot_num_ss_elem = 0, side, elem;
- int *elem_blk_ids = NULL;
- int *side_set_ids = NULL;
- int *ss_elem_ndx = NULL;
- int *side_set_elem_list = NULL;
- int *side_set_side_list = NULL;
- int elem_ctr;
- int num_elem_in_blk, num_nodes_per_elem, num_attr;
- float fdum;
- char *cdum, elem_type[MAX_STR_LENGTH+1];
-
+ int64_t tot_num_elem = 0, tot_num_ss_elem = 0, side, elem;
+ void_int *elem_blk_ids = NULL;
+ void_int *side_set_ids = NULL;
+ void_int *ss_elem_ndx = NULL;
+ void_int *side_set_elem_list = NULL;
+ void_int *side_set_side_list = NULL;
+ size_t elem_ctr;
+ int int_size, ids_size;
+ int status;
+
struct elem_blk_parm *elem_blk_parms;
char errmsg[MAX_ERR_LENGTH];
exerrval = 0; /* clear error code */
- cdum = 0; /* initialize even though it is not used */
-
/* first check if any side sets are specified */
/* inquire how many side sets have been stored */
- if ((ex_inquire(exoid, EX_INQ_SIDE_SETS, &num_side_sets, &fdum, cdum)) == -1)
- {
+ num_side_sets = ex_inquire_int(exoid, EX_INQ_SIDE_SETS);
+ if (num_side_sets < 0) {
sprintf(errmsg,
"Error: failed to get number of side sets in file id %d",exoid);
ex_err("ex_get_concat_side_set_node_count",errmsg,exerrval);
return(EX_FATAL);
}
- if (num_side_sets == 0)
- {
+ if (num_side_sets == 0) {
sprintf(errmsg,
"Warning: no side sets defined in file id %d",exoid);
ex_err("ex_get_concat_side_set_node_count",errmsg,EX_WARN);
return(EX_WARN);
}
- if ((ex_inquire(exoid, EX_INQ_ELEM_BLK, &num_elem_blks, &fdum, cdum)) == -1)
- {
+ num_elem_blks = ex_inquire_int(exoid, EX_INQ_ELEM_BLK);
+ if (num_elem_blks < 0) {
sprintf(errmsg,
"Error: failed to get number of element blocks in file id %d",exoid);
ex_err("ex_get_concat_side_set_node_count",errmsg,exerrval);
return(EX_FATAL);
}
- if ((ex_inquire(exoid, EX_INQ_ELEM, &tot_num_elem, &fdum, cdum)) == -1)
- {
+ tot_num_elem = ex_inquire_int(exoid, EX_INQ_ELEM);
+ if (tot_num_elem < 0) {
sprintf(errmsg,
"Error: failed to get total number of elements in file id %d",exoid);
ex_err("ex_get_concat_side_set_node_count",errmsg,exerrval);
@@ -134,17 +130,25 @@ int ex_get_concat_side_set_node_count(int exoid,
/* get the dimensionality of the coordinates; this is necessary to
distinguish between 2d TRIs and 3d TRIs */
- if ((ex_inquire(exoid, EX_INQ_DIM, &ndim, &fdum, cdum)) == -1)
- {
+ ndim = ex_inquire_int(exoid, EX_INQ_DIM);
+ if (ndim < 0) {
sprintf(errmsg,
"Error: failed to get dimensionality in file id %d",exoid);
ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
return(EX_FATAL);
}
+ int_size = sizeof(int);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API)
+ int_size = sizeof(int64_t);
+
/* Allocate space for the element block ids */
- if (!(elem_blk_ids=malloc(num_elem_blks*sizeof(int))))
- {
+ ids_size = sizeof(int);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ ids_size = sizeof(int64_t);
+ }
+
+ if (!(elem_blk_ids=malloc(num_elem_blks*ids_size))) {
exerrval = EX_MEMFAIL;
sprintf(errmsg,
"Error: failed to allocate space for element block ids for file id %d",
@@ -153,8 +157,7 @@ int ex_get_concat_side_set_node_count(int exoid,
goto error_ret;
}
- if (ex_get_ids(exoid, EX_ELEM_BLOCK, elem_blk_ids) == -1)
- {
+ if (ex_get_ids(exoid, EX_ELEM_BLOCK, elem_blk_ids) == -1) {
sprintf(errmsg,
"Error: failed to get element block ids in file id %d",
exoid);
@@ -163,8 +166,7 @@ int ex_get_concat_side_set_node_count(int exoid,
}
/* Allocate space for the element block params */
- if (!(elem_blk_parms=malloc(num_elem_blks*sizeof(struct elem_blk_parm))))
- {
+ if (!(elem_blk_parms=malloc(num_elem_blks*sizeof(struct elem_blk_parm)))) {
exerrval = EX_MEMFAIL;
sprintf(errmsg,
"Error: failed to allocate space for element block params for file id %d",
@@ -176,23 +178,33 @@ int ex_get_concat_side_set_node_count(int exoid,
elem_ctr = 0;
for (i=0; i<num_elem_blks; i++)
{
+ ex_entity_id id;
+ ex_block block;
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ id = ((int64_t*)elem_blk_ids)[i];
+ } else {
+ id = ((int*)elem_blk_ids)[i];
+ }
+
+ /* read in an element block parameter */
+ block.type = EX_ELEM_BLOCK;
+ block.id = id;
+
/* read in an element block parameter */
- if ((ex_get_elem_block (exoid, elem_blk_ids[i], elem_type,
- &num_elem_in_blk,
- &num_nodes_per_elem, &num_attr)) == -1) {
+ if ((ex_get_block_param (exoid, &block)) == -1) {
sprintf(errmsg,
- "Error: failed to get element block %d parameters in file id %d",
- elem_blk_ids[i], exoid);
+ "Error: failed to get element block %"PRId64" parameters in file id %d",
+ block.id, exoid);
ex_err("ex_get_concat_side_set_node_count",errmsg,EX_MSG);
return(EX_FATAL);
}
- elem_blk_parms[i].num_elem_in_blk = num_elem_in_blk;
- elem_blk_parms[i].num_nodes_per_elem = num_nodes_per_elem;
- elem_blk_parms[i].num_attr = num_attr;
+ elem_blk_parms[i].num_elem_in_blk = block.num_entry;
+ elem_blk_parms[i].num_nodes_per_elem = block.num_nodes_per_entry;
+ elem_blk_parms[i].num_attr = block.num_attribute;
- for (m=0; m < strlen(elem_type); m++) {
- elem_blk_parms[i].elem_type[m] = toupper(elem_type[m]);
+ for (m=0; m < strlen(block.topology); m++) {
+ elem_blk_parms[i].elem_type[m] = toupper(block.topology[m]);
}
elem_blk_parms[i].elem_type[m] = '\0';
@@ -450,7 +462,7 @@ int ex_get_concat_side_set_node_count(int exoid,
elem_blk_parms[i].num_nodes_per_side[0] = 0;
}
- elem_blk_parms[i].elem_blk_id = elem_blk_ids[i]; /* save id */
+ elem_blk_parms[i].elem_blk_id = id; /* save id */
elem_ctr += elem_blk_parms[i].num_elem_in_blk;
elem_blk_parms[i].elem_ctr = elem_ctr; /* save elem number max */
}
@@ -460,8 +472,7 @@ int ex_get_concat_side_set_node_count(int exoid,
* side set.
*/
/* Allocate space for the sideset ids */
- if (!(side_set_ids=malloc(num_side_sets*sizeof(int))))
- {
+ if (!(side_set_ids=malloc(num_side_sets*ids_size))) {
exerrval = EX_MEMFAIL;
sprintf(errmsg,
"Error: failed to allocate space for side set ids for file id %d",
@@ -470,8 +481,7 @@ int ex_get_concat_side_set_node_count(int exoid,
goto error_ret;
}
- if (ex_get_ids(exoid, EX_SIDE_SET, side_set_ids) == -1)
- {
+ if (ex_get_ids(exoid, EX_SIDE_SET, side_set_ids) == -1) {
sprintf(errmsg,
"Error: failed to get side set ids in file id %d",
exoid);
@@ -482,78 +492,102 @@ int ex_get_concat_side_set_node_count(int exoid,
/* Lookup index of side set id in VAR_SS_IDS array */
ioff = 0;
for (iss=0; iss<num_side_sets; iss++) {
- side_set_id = side_set_ids[iss];
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ side_set_id = ((int64_t*)side_set_ids)[iss];
+ } else {
+ side_set_id = ((int*)side_set_ids)[iss];
+ }
/* First determine the # of elements in the side set*/
- if ((ex_get_set_param(exoid,EX_SIDE_SET, side_set_id,
- &tot_num_ss_elem,&num_df)) == -1)
- {
- sprintf(errmsg,
- "Error: failed to get number of elements in side set %d in file id %d",
- side_set_id, exoid);
- ex_err("ex_get_concat_side_set_node_count",errmsg,exerrval);
- goto error_ret;
- }
+ if (int_size == sizeof(int64_t)) {
+ status = ex_get_set_param(exoid,EX_SIDE_SET, side_set_id,&tot_num_ss_elem,&num_df);
+ } else {
+ int tot, df;
+ status = ex_get_set_param(exoid,EX_SIDE_SET, side_set_id,&tot,&df);
+ tot_num_ss_elem = tot;
+ num_df = df;
+ }
+
+ if (status != EX_NOERR) {
+ sprintf(errmsg,
+ "Error: failed to get number of elements in side set %"PRId64" in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_get_concat_side_set_node_count",errmsg,exerrval);
+ goto error_ret;
+ }
if (tot_num_ss_elem == 0)
continue;
/* Allocate space for the side set element list */
- if (!(side_set_elem_list=malloc(tot_num_ss_elem*sizeof(int))))
- {
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for side set element list for file id %d",
- exoid);
- ex_err("ex_get_concat_side_set_node_count",errmsg,exerrval);
- goto error_ret;
- }
+ if (!(side_set_elem_list=malloc(tot_num_ss_elem*int_size))) {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for side set element list for file id %d",
+ exoid);
+ ex_err("ex_get_concat_side_set_node_count",errmsg,exerrval);
+ goto error_ret;
+ }
/* Allocate space for the side set side list */
- if (!(side_set_side_list=malloc(tot_num_ss_elem*sizeof(int))))
- {
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for side set side list for file id %d",
- exoid);
- ex_err("ex_get_concat_side_set_node_count",errmsg,exerrval);
- goto error_ret;
- }
+ if (!(side_set_side_list=malloc(tot_num_ss_elem*int_size))) {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for side set side list for file id %d",
+ exoid);
+ ex_err("ex_get_concat_side_set_node_count",errmsg,exerrval);
+ goto error_ret;
+ }
if (ex_get_set(exoid, EX_SIDE_SET, side_set_id,
- side_set_elem_list, side_set_side_list) == -1)
- {
- sprintf(errmsg,
- "Error: failed to get side set %d in file id %d",
- side_set_id, exoid);
- ex_err("ex_get_concat_side_set_node_count",errmsg,exerrval);
- goto error_ret;
- }
+ side_set_elem_list, side_set_side_list) == -1) {
+ sprintf(errmsg,
+ "Error: failed to get side set %"PRId64" in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_get_concat_side_set_node_count",errmsg,exerrval);
+ goto error_ret;
+ }
/* Allocate space for the ss element index array */
- if (!(ss_elem_ndx=malloc(tot_num_ss_elem*sizeof(int))))
- {
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for side set elem sort array for file id %d",
- exoid);
- ex_err("ex_get_concat_side_set_node_count",errmsg,exerrval);
- goto error_ret;
- }
+ if (!(ss_elem_ndx=malloc(tot_num_ss_elem*int_size))) {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for side set elem sort array for file id %d",
+ exoid);
+ ex_err("ex_get_concat_side_set_node_count",errmsg,exerrval);
+ goto error_ret;
+ }
/* Sort side set element list into index array - non-destructive */
- for (i=0;i<tot_num_ss_elem;i++) {
- ss_elem_ndx[i] = i; /* init index array to current position */
+ if (int_size == sizeof(int64_t)) {
+ /* Sort side set element list into index array - non-destructive */
+ int64_t *elems = (int64_t*)ss_elem_ndx;
+ for (i=0;i<tot_num_ss_elem;i++) {
+ elems[i] = i; /* init index array to current position */
+ }
+ ex_iqsort64(side_set_elem_list, ss_elem_ndx,tot_num_ss_elem);
+ } else {
+ /* Sort side set element list into index array - non-destructive */
+ int *elems = (int*)ss_elem_ndx;
+ for (i=0;i<tot_num_ss_elem;i++) {
+ elems[i] = i; /* init index array to current position */
+ }
+ ex_iqsort(side_set_elem_list, ss_elem_ndx,tot_num_ss_elem);
}
- ex_iqsort(side_set_elem_list, ss_elem_ndx,tot_num_ss_elem);
-
j = 0; /* The current element block... */
for (ii=0;ii<tot_num_ss_elem;ii++) {
- i = ss_elem_ndx[ii];
- elem = side_set_elem_list[i];
- side = side_set_side_list[i]-1; /* Convert to 0-based sides */
+ int64_t elem_ndx;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ elem_ndx = ((int64_t*)ss_elem_ndx)[ii];
+ elem = ((int64_t*)side_set_elem_list)[elem_ndx];
+ side = ((int64_t*)side_set_side_list)[elem_ndx]-1;
+ } else {
+ elem_ndx = ((int*)ss_elem_ndx)[ii];
+ elem = ((int*)side_set_elem_list)[elem_ndx];
+ side = ((int*)side_set_side_list)[elem_ndx]-1;
+ }
/*
* Since the elements are being accessed in sorted, order, the
@@ -569,12 +603,12 @@ int ex_get_concat_side_set_node_count(int exoid,
if (j < num_elem_blks) {
assert(side < elem_blk_parms[j].num_sides);
- side_set_node_cnt_list[i+ioff] = elem_blk_parms[j].num_nodes_per_side[side];
+ side_set_node_cnt_list[elem_ndx+ioff] = elem_blk_parms[j].num_nodes_per_side[side];
} else {
exerrval = EX_BADPARAM;
sprintf(errmsg,
- "Error: Invalid element number %d found in side set %d in file %d",
- side_set_elem_list[i], side_set_id, exoid);
+ "Error: Invalid element number %"PRId64" found in side set %"PRId64" in file %d",
+ elem, side_set_id, exoid);
ex_err("ex_get_concat_side_set_node_count",errmsg,EX_MSG);
goto error_ret;
}
@@ -586,16 +620,16 @@ int ex_get_concat_side_set_node_count(int exoid,
}
/* All done: release allocated memory */
- elem_blk_ids = safe_free(elem_blk_ids);
- side_set_ids = safe_free(side_set_ids);
+ safe_free(elem_blk_ids);
+ safe_free(side_set_ids);
return(EX_NOERR);
error_ret:
- elem_blk_ids = safe_free(elem_blk_ids);
- side_set_ids = safe_free(side_set_ids);
- ss_elem_ndx = safe_free(ss_elem_ndx);
- side_set_elem_list = safe_free(side_set_elem_list);
- side_set_side_list = safe_free(side_set_side_list);
+ safe_free(elem_blk_ids);
+ safe_free(side_set_ids);
+ safe_free(ss_elem_ndx);
+ safe_free(side_set_elem_list);
+ safe_free(side_set_side_list);
return (EX_FATAL);
}
diff --git a/exodus/cbind/src/exgcss.c b/exodus/cbind/src/ex_get_concat_side_sets.c
similarity index 89%
rename from exodus/cbind/src/exgcss.c
rename to exodus/cbind/src/ex_get_concat_side_sets.c
index 750cade..e874973 100644
--- a/exodus/cbind/src/exgcss.c
+++ b/exodus/cbind/src/ex_get_concat_side_sets.c
@@ -66,13 +66,13 @@
*/
int ex_get_concat_side_sets (int exoid,
- int *side_set_ids,
- int *num_elem_per_set,
- int *num_dist_per_set,
- int *side_sets_elem_index,
- int *side_sets_dist_index,
- int *side_sets_elem_list,
- int *side_sets_side_list,
+ void_int *side_set_ids,
+ void_int *num_elem_per_set,
+ void_int *num_dist_per_set,
+ void_int *side_sets_elem_index,
+ void_int *side_sets_dist_index,
+ void_int *side_sets_elem_list,
+ void_int *side_sets_side_list,
void *side_sets_dist_fact)
{
struct ex_set_specs set_specs;
diff --git a/exodus/cbind/src/exgnconn.c b/exodus/cbind/src/ex_get_conn.c
similarity index 64%
copy from exodus/cbind/src/exgnconn.c
copy to exodus/cbind/src/ex_get_conn.c
index 24fe1f4..cfeb134 100644
--- a/exodus/cbind/src/exgnconn.c
+++ b/exodus/cbind/src/ex_get_conn.c
@@ -32,9 +32,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-/*****************************************************************************
+/*!
*
-* exgnconn - exodusII read partial edge/face/element block connectivity
+* \undoc exgconn - exodusII read edge/face/element block connectivity
*
* entry conditions -
* expelb must be called first to establish element block parameters.
@@ -42,58 +42,55 @@
* int exoid exodus file id
* int blk_type block type (edge, face, element)
* int blk_id block id
-* int start_num The starting index (1-based) of entities to read
-* int num_ent The number of entities to read connectivity info for.
-*
+*
* exit conditions -
* int* nodeconn nodal connectivity array
* int* edgeconn edge connectivity array (where applicable)
* int* faceconn face connectivity array (where applicable)
*
-* revision history -
*
*/
#include <stdlib.h>
#include "exodusII.h"
#include "exodusII_int.h"
-/*
- * reads the connectivity array for an element block
- */
-
-int ex_get_n_conn( int exoid,
- ex_entity_type blk_type,
- int blk_id,
- int start_num,
- int num_ent,
- int* nodeconn,
- int* edgeconn,
- int* faceconn )
+int ex_get_conn( int exoid,
+ ex_entity_type blk_type,
+ ex_entity_id blk_id,
+ void_int* nodeconn,
+ void_int* edgeconn,
+ void_int* faceconn )
{
- int connid, econnid, fconnid, blk_id_ndx, status;
- int numnodperentdim, numedgperentdim, numfacperentdim;
+ int connid = -1;
+ int econnid = -1;
+ int fconnid = -1;
+
+ int blk_id_ndx, status;
+
+ int numnodperentdim = -1;
+ int numedgperentdim = -1;
+ int numfacperentdim = -1;
+
int iexit = (EX_NOERR); /* exit status */
- size_t num_nodes_per_entry, num_edges_per_entry, num_faces_per_entry;
+
+ size_t num_nodes_per_entry = 0;
+ size_t num_edges_per_entry = 0;
+ size_t num_faces_per_entry = 0;
+
char errmsg[MAX_ERR_LENGTH];
- const char* dnumnodent;
- const char* dnumedgent;
- const char* dnumfacent;
- const char* vnodeconn;
- const char* vedgeconn;
- const char* vfaceconn;
+ const char* dnumnodent = NULL;
+ const char* dnumedgent = NULL;
+ const char* dnumfacent = NULL;
+ const char* vnodeconn = NULL;
+ const char* vedgeconn = NULL;
+ const char* vfaceconn = NULL;
- /* The partial connectivity input function can currently only handle nodal
- * connectivity. Print a warning if edgeconn or faceconn is non-NULL
+ /* Should we warn if edgeconn or faceconn are non-NULL?
+ * No, fail silently so the same code can be used to read any type of block info.
+ * However, we will warn if edgeconn or faceconn are NULL but num_edges_per_entry
+ * or num_faces_per_entry (respectively) are positive.
*/
- if (edgeconn != NULL || faceconn != NULL) {
- exerrval = 1005;
- sprintf(errmsg,
- "Warning: ex_get_n_conn only supports nodal connectivity at this time. %s %d in file id %d",
- ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg,EX_MSG);
- }
-
exerrval = 0; /* clear error code */
/* Locate index of element block id in VAR_ID_EL_BLK array */
@@ -104,17 +101,17 @@ int ex_get_n_conn( int exoid,
if (exerrval == EX_NULLENTITY)
{
sprintf(errmsg,
- "Warning: no connectivity array for NULL %s %d in file id %d",
+ "Warning: no connectivity array for NULL %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg,EX_MSG);
+ ex_err("ex_get_conn",errmsg,EX_MSG);
return (EX_WARN); /* no connectivity array for this element block */
}
else
{
sprintf(errmsg,
- "Error: failed to locate %s id %d in id array in file id %d",
+ "Error: failed to locate %s id %"PRId64" in id array in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg,exerrval);
+ ex_err("ex_get_conn",errmsg,exerrval);
return (EX_FATAL);
}
}
@@ -149,30 +146,24 @@ int ex_get_n_conn( int exoid,
sprintf(errmsg,
"Internal Error: unrecognized block type in switch: %d in file id %d",
blk_type,exoid);
- ex_err("ex_get_n_conn",errmsg,EX_MSG);
+ ex_err("ex_get_conn",errmsg,EX_MSG);
return (EX_FATAL); /* number of attributes not defined */
}
/* inquire id's of previously defined dimensions */
- if ((status = nc_inq_dimid (exoid, dnumnodent, &numnodperentdim)) != NC_NOERR)
- {
+ num_nodes_per_entry = 0;
+ if ((status = nc_inq_dimid (exoid, dnumnodent, &numnodperentdim)) != NC_NOERR) {
+ numnodperentdim = -1;
+ } else {
+ if ((status = nc_inq_dimlen(exoid, numnodperentdim, &num_nodes_per_entry)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of nodes/entity for %s %d in file id %d",
+ "Error: failed to get number of nodes/entity for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg,exerrval);
- return(EX_FATAL);
- }
-
- if (nc_inq_dimlen(exoid, numnodperentdim, &num_nodes_per_entry) != NC_NOERR)
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get number of nodes/entity for %s %d in file id %d",
- ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg, exerrval);
+ ex_err("ex_get_conn",errmsg, exerrval);
return(EX_FATAL);
}
+ }
if ( dnumedgent ) {
num_edges_per_entry = 0;
@@ -182,9 +173,9 @@ int ex_get_n_conn( int exoid,
if ((status = nc_inq_dimlen(exoid, numedgperentdim, &num_edges_per_entry)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of edges/entry for %s %d in file id %d",
+ "Error: failed to get number of edges/entry for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg, exerrval);
+ ex_err("ex_get_conn",errmsg, exerrval);
return(EX_FATAL);
}
}
@@ -198,93 +189,102 @@ int ex_get_n_conn( int exoid,
if ((status = nc_inq_dimlen(exoid, numfacperentdim, &num_faces_per_entry)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of faces/entry for %s %d in file id %d",
+ "Error: failed to get number of faces/entry for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg, exerrval);
+ ex_err("ex_get_conn",errmsg, exerrval);
return(EX_FATAL);
}
}
}
- if ((status = nc_inq_varid(exoid, vnodeconn, &connid)) != NC_NOERR)
+ status = 0;
+ if (nodeconn && (numnodperentdim >= 0) &&
+ ((status = nc_inq_varid(exoid, vnodeconn, &connid)) != NC_NOERR))
{
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate connectivity array for %s %d in file id %d",
+ "Error: failed to locate node connectivity array for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg, exerrval);
+ ex_err("ex_get_conn",errmsg, exerrval);
return(EX_FATAL);
}
status = 0;
- if (edgeconn && (numedgperentdim > 0) &&
+ if (edgeconn && (numedgperentdim >= 0) &&
((status = nc_inq_varid (exoid, vedgeconn, &econnid)) != NC_NOERR))
{
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate edge connectivity array for %s %d in file id %d",
+ "Error: failed to locate edge connectivity array for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg, exerrval);
+ ex_err("ex_get_conn",errmsg, exerrval);
return(EX_FATAL);
}
- if (faceconn && (numfacperentdim > 0) &&
+ if (faceconn && (numfacperentdim >= 0) &&
((status = nc_inq_varid (exoid, vfaceconn, &fconnid)) != NC_NOERR))
{
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate face connectivity array for %s %d in file id %d",
+ "Error: failed to locate face connectivity array for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg, exerrval);
+ ex_err("ex_get_conn",errmsg, exerrval);
return(EX_FATAL);
}
/* read in the connectivity array */
if ( edgeconn && num_edges_per_entry > 0) {
- status = nc_get_var_int(exoid, econnid, edgeconn);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_get_var_longlong(exoid, econnid, edgeconn);
+ } else {
+ status = nc_get_var_int(exoid, econnid, edgeconn);
+ }
if (status != NC_NOERR)
{
exerrval = status;
sprintf(errmsg,
- "Error: failed to get edge connectivity array for %s %d in file id %d",
+ "Error: failed to get edge connectivity array for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg, exerrval);
+ ex_err("ex_get_conn",errmsg, exerrval);
return(EX_FATAL);
}
}
if ( faceconn && num_faces_per_entry > 0) {
- status = nc_get_var_int(exoid, fconnid, faceconn);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_get_var_longlong(exoid, fconnid, faceconn);
+ } else {
+ status = nc_get_var_int(exoid, fconnid, faceconn);
+ }
if (status != NC_NOERR)
{
exerrval = status;
sprintf(errmsg,
- "Error: failed to get face connectivity array for %s %d in file id %d",
+ "Error: failed to get face connectivity array for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg, exerrval);
+ ex_err("ex_get_conn",errmsg, exerrval);
return(EX_FATAL);
}
}
if ( nodeconn && num_nodes_per_entry > 0) {
- size_t start[1], count[1];
-
- start[0] = (start_num-1) * num_nodes_per_entry;
- count[0] = num_ent * num_nodes_per_entry;
-
- status = nc_get_vara_int(exoid, connid, start, count, nodeconn);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_get_var_longlong(exoid, connid, nodeconn);
+ } else {
+ status = nc_get_var_int(exoid, connid, nodeconn);
+ }
if (status != NC_NOERR)
{
exerrval = status;
sprintf(errmsg,
- "Error: failed to get connectivity array for %s %d in file id %d",
+ "Error: failed to get node connectivity array for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg, exerrval);
+ ex_err("ex_get_conn",errmsg, exerrval);
return(EX_FATAL);
}
}
diff --git a/exodus/cbind/src/exgcor.c b/exodus/cbind/src/ex_get_coord.c
similarity index 100%
rename from exodus/cbind/src/exgcor.c
rename to exodus/cbind/src/ex_get_coord.c
diff --git a/exodus/cbind/src/exgcon.c b/exodus/cbind/src/ex_get_coord_names.c
similarity index 100%
rename from exodus/cbind/src/exgcon.c
rename to exodus/cbind/src/ex_get_coord_names.c
diff --git a/exodus/cbind/src/exgfrm.c b/exodus/cbind/src/ex_get_coordinate_frames.c
similarity index 93%
rename from exodus/cbind/src/exgfrm.c
rename to exodus/cbind/src/ex_get_coordinate_frames.c
index 1e91ba8..1909dd1 100644
--- a/exodus/cbind/src/exgfrm.c
+++ b/exodus/cbind/src/ex_get_coordinate_frames.c
@@ -113,7 +113,10 @@
* 'nframes' characters.
*/
- int ex_get_coordinate_frames( int exoid, int *nframes, int *cf_ids, void* pt_coordinates,
+ int ex_get_coordinate_frames( int exoid,
+ int *nframes,
+ void_int *cf_ids,
+ void* pt_coordinates,
char* tags)
{
@@ -138,9 +141,8 @@
if ( count==0 )
return (EX_NOERR);
- if ( cf_ids )
- if ((status = nc_inq_varid(exoid,VAR_FRAME_IDS, &varids))!= NC_NOERR ||
- (nc_get_var_int(exoid,varids,cf_ids)!= NC_NOERR)) {
+ if ( cf_ids ) {
+ if ((status = nc_inq_varid(exoid,VAR_FRAME_IDS, &varids))!= NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to read number coordinate ids from file id %d",
@@ -149,6 +151,22 @@
return (EX_FATAL);
}
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ status = nc_get_var_longlong(exoid,varids,cf_ids);
+ } else {
+ status = nc_get_var_int(exoid,varids,cf_ids);
+ }
+
+ if (status != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to read coordinate frame ids from file id %d",
+ exoid);
+ ex_err(PROCNAME,errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ }
+
if ( tags )
if ( (status = nc_inq_varid(exoid,VAR_FRAME_TAGS,&varids))!= NC_NOERR ||
(nc_get_vara_text(exoid,varids,&start,&count,tags) != NC_NOERR)) {
diff --git a/nemesis/ne_gebig.c b/exodus/cbind/src/ex_get_eb_info_global.c
similarity index 79%
rename from nemesis/ne_gebig.c
rename to exodus/cbind/src/ex_get_eb_info_global.c
index b9fcab0..73b575d 100644
--- a/nemesis/ne_gebig.c
+++ b/exodus/cbind/src/ex_get_eb_info_global.c
@@ -35,13 +35,13 @@
/*****************************************************************************/
/*****************************************************************************/
/* Function(s) contained in this file:
- * ne_get_eb_info_global()
+ * ex_get_eb_info_global()
*****************************************************************************
* This function retrieves the global parameters of all the element blocks
* associated with a geometry.
*****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* el_blk_ids - Pointer to vector of global element block IDs.
* el_blk_cnts - Pointer to vector of global element block counts.
*/
@@ -57,14 +57,11 @@
#include <exodusII.h>
#include <exodusII_int.h>
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-int ne_get_eb_info_global(int neid,
- int *el_blk_ids,
- int *el_blk_cnts)
+int ex_get_eb_info_global(int exoid,
+ void_int *el_blk_ids,
+ void_int *el_blk_cnts)
{
- char *func_name="ne_get_eb_info_global";
+ const char *func_name="ex_get_eb_info_global";
int varid, status;
@@ -74,46 +71,54 @@ int ne_get_eb_info_global(int neid,
exerrval = 0; /* clear error code */
/* Find the variable ID for the element block IDs */
- if ((status = nc_inq_varid(neid, VAR_ELBLK_IDS_GLOBAL, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_ELBLK_IDS_GLOBAL, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_ELBLK_IDS_GLOBAL, neid);
+ VAR_ELBLK_IDS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the global element block IDs */
- status = nc_get_var_int(neid, varid, el_blk_ids);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ status = nc_get_var_longlong(exoid, varid, el_blk_ids);
+ } else {
+ status = nc_get_var_int(exoid, varid, el_blk_ids);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_ELBLK_IDS_GLOBAL, neid);
+ VAR_ELBLK_IDS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Find the variable ID for the element block counts */
- if ((status = nc_inq_varid(neid, VAR_ELBLK_CNT_GLOBAL, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_ELBLK_CNT_GLOBAL, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_ELBLK_CNT_GLOBAL, neid);
+ VAR_ELBLK_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the global element block counts */
- status = nc_get_var_int(neid, varid, el_blk_cnts);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_get_var_longlong(exoid, varid, el_blk_cnts);
+ } else {
+ status = nc_get_var_int(exoid, varid, el_blk_cnts);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_ELBLK_CNT_GLOBAL, neid);
+ VAR_ELBLK_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
diff --git a/exodus/cbind/src/exgeat.c b/exodus/cbind/src/ex_get_elem_attr.c
similarity index 98%
rename from exodus/cbind/src/exgeat.c
rename to exodus/cbind/src/ex_get_elem_attr.c
index 5bff46c..afb3d9f 100644
--- a/exodus/cbind/src/exgeat.c
+++ b/exodus/cbind/src/ex_get_elem_attr.c
@@ -66,7 +66,7 @@ of reading the element attributes for an element block.
*/
int ex_get_elem_attr (int exoid,
- int elem_blk_id,
+ ex_entity_id elem_blk_id,
void *attrib)
{
return ex_get_attr( exoid, EX_ELEM_BLOCK, elem_blk_id, attrib );
diff --git a/exodus/cbind/src/exgean.c b/exodus/cbind/src/ex_get_elem_attr_names.c
similarity index 97%
rename from exodus/cbind/src/exgean.c
rename to exodus/cbind/src/ex_get_elem_attr_names.c
index d421bd4..b045cc5 100644
--- a/exodus/cbind/src/exgean.c
+++ b/exodus/cbind/src/ex_get_elem_attr_names.c
@@ -55,7 +55,7 @@
* \deprecated Use ex_get_attr_names()(exoid, EX_ELEM_BLOCK, elem_blk_id, names) instead
*/
int ex_get_elem_attr_names (int exoid,
- int elem_blk_id,
+ ex_entity_id elem_blk_id,
char **names)
{
return ex_get_attr_names( exoid, EX_ELEM_BLOCK, elem_blk_id, names );
diff --git a/exodus/cbind/src/exgebi.c b/exodus/cbind/src/ex_get_elem_blk_ids.c
similarity index 98%
rename from exodus/cbind/src/exgebi.c
rename to exodus/cbind/src/ex_get_elem_blk_ids.c
index a2bff26..58e4255 100644
--- a/exodus/cbind/src/exgebi.c
+++ b/exodus/cbind/src/ex_get_elem_blk_ids.c
@@ -72,7 +72,7 @@ error = ex_get_ids (exoid, EX_ELEM_BLOCK, idelbs);
*/
int ex_get_elem_blk_ids (int exoid,
- int *ids)
+ void_int *ids)
{
/* ex_get_elem_blk_ids should be deprecated. */
return ex_get_ids( exoid, EX_ELEM_BLOCK, ids );
diff --git a/exodus/cbind/src/exgelb.c b/exodus/cbind/src/ex_get_elem_block.c
similarity index 95%
rename from exodus/cbind/src/exgelb.c
rename to exodus/cbind/src/ex_get_elem_block.c
index 12987b8..798d830 100644
--- a/exodus/cbind/src/exgelb.c
+++ b/exodus/cbind/src/ex_get_elem_block.c
@@ -93,11 +93,11 @@ error = ex_get_attr (exoid, EX_ELEM_BLOCK, id, attrib);
*/
int ex_get_elem_block (int exoid,
- int elem_blk_id,
+ ex_entity_id elem_blk_id,
char *elem_type,
- int *num_elem_this_blk,
- int *num_nodes_per_elem,
- int *num_attr)
+ void_int *num_elem_this_blk,
+ void_int *num_nodes_per_elem,
+ void_int *num_attr)
{
return ex_get_block( exoid, EX_ELEM_BLOCK, elem_blk_id, elem_type,
diff --git a/nemesis/ne_gelcm.c b/exodus/cbind/src/ex_get_elem_cmap.c
similarity index 75%
rename from nemesis/ne_gelcm.c
rename to exodus/cbind/src/ex_get_elem_cmap.c
index 3af1458..7f1380f 100644
--- a/nemesis/ne_gelcm.c
+++ b/exodus/cbind/src/ex_get_elem_cmap.c
@@ -35,12 +35,12 @@
/****************************************************************************/
/****************************************************************************/
/* Function(s) in this file:
- * ne_get_elem_cmap()
+ * ex_get_elem_cmap()
****************************************************************************
* This function retrieves an elemental communication map.
****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* map_id - The ID of the nodal communication map to retrieve.
* elem_ids - Pointer to vector for retrieval of FEM element IDs
* that make up this communication map.
@@ -63,18 +63,15 @@
#include <exodusII.h>
#include <exodusII_int.h>
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-int ne_get_elem_cmap(int neid,
- int map_id,
- int *elem_ids,
- int *side_ids,
- int *proc_ids,
+int ex_get_elem_cmap(int exoid,
+ ex_entity_id map_id,
+ void_int *elem_ids,
+ void_int *side_ids,
+ void_int *proc_ids,
int processor
)
{
- char *func_name="ne_get_elem_cmap";
+ const char *func_name="ex_get_elem_cmap";
int map_idx, dimid, varid[3], status;
size_t start[1], count[1];
@@ -86,11 +83,11 @@ int ne_get_elem_cmap(int neid,
exerrval = 0; /* clear error code */
/* get the cmap information variables index */
- if (ne_get_idx(neid, VAR_E_COMM_INFO_IDX, varidx, processor) == -1) {
+ if (ex_get_idx(exoid, VAR_E_COMM_INFO_IDX, varidx, processor) == -1) {
exerrval = -1;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_E_COMM_INFO_IDX, neid);
+ VAR_E_COMM_INFO_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -102,21 +99,21 @@ int ne_get_elem_cmap(int neid,
*/
/* Get the index of the elemental comm map with the given ID */
- if ((map_idx=ne_id_lkup(neid, VAR_E_COMM_IDS, varidx, map_id)) < 0) {
+ if ((map_idx=ne_id_lkup(exoid, VAR_E_COMM_IDS, varidx, map_id)) < 0) {
exerrval = EX_MSG;
sprintf(errmsg,
- "Error: failed to find elemental comm map with ID %d in file \
+ "Error: failed to find elemental comm map with ID %"PRId64" in file \
ID %d",
- map_id, neid);
+ map_id, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* get the cmap data variables index for this map */
- if (ne_get_idx(neid, VAR_E_COMM_DATA_IDX, varidx, map_idx) == -1) {
+ if (ex_get_idx(exoid, VAR_E_COMM_DATA_IDX, varidx, map_idx) == -1) {
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_E_COMM_DATA_IDX, neid);
+ VAR_E_COMM_DATA_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -124,20 +121,20 @@ ID %d",
if (varidx[1] == -1) {
/* Get the dimension of this elemental communication map */
- if ((status = nc_inq_dimid(neid, DIM_ECNT_CMAP, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_ECNT_CMAP, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_ECNT_CMAP, neid);
+ DIM_ECNT_CMAP, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid, count)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, count)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_ECNT_CMAP, neid);
+ DIM_ECNT_CMAP, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -146,31 +143,31 @@ ID %d",
}
/* Get the variable ID for the elemental comm map node IDs */
- if ((status = nc_inq_varid(neid, VAR_E_COMM_EIDS, &varid[0])) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_E_COMM_EIDS, &varid[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_E_COMM_EIDS, neid);
+ VAR_E_COMM_EIDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the variable ID for the elemental side set IDs */
- if ((status = nc_inq_varid(neid, VAR_E_COMM_SIDS, &varid[1])) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_E_COMM_SIDS, &varid[1])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_E_COMM_SIDS, neid);
+ VAR_E_COMM_SIDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the variable ID for the elemental comm map processor IDs */
- if ((status = nc_inq_varid(neid, VAR_E_COMM_PROC, &varid[2])) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_E_COMM_PROC, &varid[2])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_E_COMM_PROC, neid);
+ VAR_E_COMM_PROC, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -178,34 +175,46 @@ ID %d",
/* Get the elemental comm map element IDs */
start[0] = varidx[0];
count[0] = varidx[1] - varidx[0];
- status = nc_get_vara_int(neid, varid[0], start, count, elem_ids);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_get_vara_longlong(exoid, varid[0], start, count, elem_ids);
+ } else {
+ status = nc_get_vara_int(exoid, varid[0], start, count, elem_ids);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_E_COMM_EIDS, neid);
+ VAR_E_COMM_EIDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the elemental comm map side IDs */
- status = nc_get_vara_int(neid, varid[1], start, count, side_ids);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_get_vara_longlong(exoid, varid[1], start, count, side_ids);
+ } else {
+ status = nc_get_vara_int(exoid, varid[1], start, count, side_ids);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_E_COMM_SIDS, neid);
+ VAR_E_COMM_SIDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the elemental comm map processor IDs */
- status = nc_get_vara_int(neid, varid[2], start, count, proc_ids);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_get_vara_longlong(exoid, varid[2], start, count, proc_ids);
+ } else {
+ status = nc_get_vara_int(exoid, varid[2], start, count, proc_ids);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_E_COMM_PROC, neid);
+ VAR_E_COMM_PROC, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
diff --git a/exodus/cbind/src/exgelc.c b/exodus/cbind/src/ex_get_elem_conn.c
similarity index 96%
rename from exodus/cbind/src/exgelc.c
rename to exodus/cbind/src/ex_get_elem_conn.c
index 025b2ca..396c23b 100644
--- a/exodus/cbind/src/exgelc.c
+++ b/exodus/cbind/src/ex_get_elem_conn.c
@@ -60,8 +60,8 @@ reading the connectivity for an element block.
*/
int ex_get_elem_conn (int exoid,
- int elem_blk_id,
- int *connect)
+ ex_entity_id elem_blk_id,
+ void_int *connect)
{
return ex_get_conn( exoid, EX_ELEM_BLOCK, elem_blk_id, connect, 0, 0 );
}
diff --git a/exodus/cbind/src/exgem.c b/exodus/cbind/src/ex_get_elem_map.c
similarity index 96%
rename from exodus/cbind/src/exgem.c
rename to exodus/cbind/src/ex_get_elem_map.c
index bae6b2a..f071976 100644
--- a/exodus/cbind/src/exgem.c
+++ b/exodus/cbind/src/ex_get_elem_map.c
@@ -56,8 +56,8 @@
*/
int ex_get_elem_map (int exoid,
- int map_id,
- int *elem_map)
+ ex_entity_id map_id,
+ void_int *elem_map)
{
return ex_get_num_map( exoid, EX_ELEM_MAP, map_id, elem_map );
}
diff --git a/exodus/cbind/src/exgenm.c b/exodus/cbind/src/ex_get_elem_num_map.c
similarity index 99%
rename from exodus/cbind/src/exgenm.c
rename to exodus/cbind/src/ex_get_elem_num_map.c
index f887354..5fc94c9 100644
--- a/exodus/cbind/src/exgenm.c
+++ b/exodus/cbind/src/ex_get_elem_num_map.c
@@ -83,7 +83,7 @@ error = ex_get_id_map(exoid, EX_ELEM_MAP, elem_map);
*/
int ex_get_elem_num_map (int exoid,
- int *elem_map)
+ void_int *elem_map)
{
return ex_get_id_map(exoid, EX_ELEM_MAP, elem_map);
}
diff --git a/nemesis/ne_gelt.c b/exodus/cbind/src/ex_get_elem_type.c
similarity index 82%
rename from nemesis/ne_gelt.c
rename to exodus/cbind/src/ex_get_elem_type.c
index c9f5998..7b32fe1 100644
--- a/nemesis/ne_gelt.c
+++ b/exodus/cbind/src/ex_get_elem_type.c
@@ -36,13 +36,13 @@
/*****************************************************************************/
/* Function(s) contained in this file:
*
- * ne_get_elem_type()
+ * ex_get_elem_type()
*
*****************************************************************************
*
* Variable Index:
*
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* elem_blk_id - The element block ID to find the element type
* for.
* elem_type - The returned name of the element.
@@ -56,16 +56,15 @@
#include "exodusII.h"
#include "exodusII_int.h"
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-int ne_get_elem_type (int neid, int elem_blk_id, char *elem_type)
+int ex_get_elem_type (int exoid,
+ ex_entity_id elem_blk_id,
+ char *elem_type)
/*
* Reads the element type for a specific element block
* elem_type is assumed to have a length of MAX_STR_LENGTH+1
*/
{
- char *func_name="ne_get_elem_type";
+ const char *func_name="ex_get_elem_type";
int connid, el_blk_id_ndx, status;
size_t len;
@@ -74,28 +73,28 @@ int ne_get_elem_type (int neid, int elem_blk_id, char *elem_type)
/*****************************************************************************/
/* inquire id's of previously defined dimensions */
- if ((el_blk_id_ndx=ex_id_lkup(neid, EX_ELEM_BLOCK, elem_blk_id)) == -1) {
+ if ((el_blk_id_ndx=ex_id_lkup(exoid, EX_ELEM_BLOCK, elem_blk_id)) == -1) {
sprintf(errmsg,
- "Error: failed to find element block ID %d in file %d",
- elem_blk_id, neid);
+ "Error: failed to find element block ID %"PRId64" in file %d",
+ elem_blk_id, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_varid(neid, VAR_CONN(el_blk_id_ndx), &connid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_CONN(el_blk_id_ndx), &connid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find connectivity variable in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* get the element type name */
- if ((status = nc_inq_attlen(neid, connid, ATT_NAME_ELB, &len)) != NC_NOERR) {
+ if ((status = nc_inq_attlen(exoid, connid, ATT_NAME_ELB, &len)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to find attribute in file ID %d", neid);
+ "Error: failed to find attribute in file ID %d", exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -105,7 +104,7 @@ int ne_get_elem_type (int neid, int elem_blk_id, char *elem_type)
exerrval = EX_MSG;
sprintf(errmsg,
"Error: Element type must be of length %d in file ID %d",
- (int)len, neid);
+ (int)len, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -114,11 +113,11 @@ int ne_get_elem_type (int neid, int elem_blk_id, char *elem_type)
/* Make sure the end of the string is terminated with a null character */
elem_type[MAX_STR_LENGTH] = '\0';
- if ((status = nc_get_att_text(neid, connid, ATT_NAME_ELB, (void *) elem_type)) != NC_NOERR ) {
+ if ((status = nc_get_att_text(exoid, connid, ATT_NAME_ELB, elem_type)) != NC_NOERR ) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get attribute \"%s\" in file ID %d",
- ATT_NAME_ELB, neid);
+ ATT_NAME_ELB, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
diff --git a/exodus/cbind/src/exgev.c b/exodus/cbind/src/ex_get_elem_var.c
similarity index 97%
rename from exodus/cbind/src/exgev.c
rename to exodus/cbind/src/ex_get_elem_var.c
index 5935c97..3648143 100644
--- a/exodus/cbind/src/exgev.c
+++ b/exodus/cbind/src/ex_get_elem_var.c
@@ -107,8 +107,8 @@ for (i=0; i < num_elem_blk; i++) {
int ex_get_elem_var (int exoid,
int time_step,
int elem_var_index,
- int elem_blk_id,
- int num_elem_this_blk,
+ ex_entity_id elem_blk_id,
+ int64_t num_elem_this_blk,
void *elem_var_vals)
{
return ex_get_var( exoid, time_step, EX_ELEM_BLOCK, elem_var_index, elem_blk_id, num_elem_this_blk, elem_var_vals );
diff --git a/exodus/cbind/src/exgvtt.c b/exodus/cbind/src/ex_get_elem_var_tab.c
similarity index 100%
rename from exodus/cbind/src/exgvtt.c
rename to exodus/cbind/src/ex_get_elem_var_tab.c
diff --git a/exodus/cbind/src/exgevt.c b/exodus/cbind/src/ex_get_elem_var_time.c
similarity index 99%
rename from exodus/cbind/src/exgevt.c
rename to exodus/cbind/src/ex_get_elem_var_time.c
index 4e03afe..a19979b 100644
--- a/exodus/cbind/src/exgevt.c
+++ b/exodus/cbind/src/ex_get_elem_var_time.c
@@ -132,7 +132,7 @@ error = ex_get_elem_var_time (exoid, EX_ELEM_BLOCK, var_index, elem_num,
int ex_get_elem_var_time (int exoid,
int elem_var_index,
- int elem_number,
+ int64_t elem_number,
int beg_time_step,
int end_time_step,
void *elem_var_vals)
diff --git a/exodus/cbind/src/exgecpp.c b/exodus/cbind/src/ex_get_entity_count_per_polyhedra.c
similarity index 94%
rename from exodus/cbind/src/exgecpp.c
rename to exodus/cbind/src/ex_get_entity_count_per_polyhedra.c
index 27d4212..ea5c806 100644
--- a/exodus/cbind/src/exgecpp.c
+++ b/exodus/cbind/src/ex_get_entity_count_per_polyhedra.c
@@ -53,7 +53,7 @@
int ex_get_entity_count_per_polyhedra (int exoid,
ex_entity_type blk_type,
- int blk_id,
+ ex_entity_id blk_id,
int *entity_counts)
{
int npeid=-1, blk_id_ndx, status;
@@ -67,7 +67,7 @@ int ex_get_entity_count_per_polyhedra (int exoid,
if (exerrval == EX_NULLENTITY)
{
sprintf(errmsg,
- "Warning: entity_counts array not allowed for NULL %s block %d in file id %d",
+ "Warning: entity_counts array not allowed for NULL %s block %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
ex_err("ex_get_entity_count_per_polyhedra",errmsg,EX_MSG);
return (EX_WARN);
@@ -75,7 +75,7 @@ int ex_get_entity_count_per_polyhedra (int exoid,
else
{
sprintf(errmsg,
- "Error: failed to locate %s block id %d in id array in file id %d",
+ "Error: failed to locate %s block id %"PRId64" in id array in file id %d",
ex_name_of_object(blk_type),blk_id, exoid);
ex_err("ex_get_entity_count_per_polyhedra",errmsg,exerrval);
return (EX_FATAL);
@@ -102,7 +102,7 @@ int ex_get_entity_count_per_polyhedra (int exoid,
{
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate entity_counts array for %s block %d in file id %d",
+ "Error: failed to locate entity_counts array for %s block %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
ex_err("ex_get_entity_count_per_polyhedra",errmsg, exerrval);
return(EX_FATAL);
@@ -112,7 +112,7 @@ int ex_get_entity_count_per_polyhedra (int exoid,
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to read node counts array for %s block %d in file id %d",
+ "Error: failed to read node counts array for %s block %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
ex_err("ex_get_entity_count_per_polyhedra",errmsg, exerrval);
return(EX_FATAL);
diff --git a/exodus/cbind/src/exggvt.c b/exodus/cbind/src/ex_get_glob_var_time.c
similarity index 93%
rename from exodus/cbind/src/exggvt.c
rename to exodus/cbind/src/ex_get_glob_var_time.c
index 3ff2a87..1d44c89 100644
--- a/exodus/cbind/src/exggvt.c
+++ b/exodus/cbind/src/ex_get_glob_var_time.c
@@ -98,48 +98,39 @@ int ex_get_glob_var_time (int exoid,
int end_time_step,
void *glob_var_vals)
{
- int status;
+ int status;
int varid;
size_t start[2], count[2];
- float fdum;
- char *cdum = 0;
char errmsg[MAX_ERR_LENGTH];
exerrval = 0; /* clear error code */
- /* inquire previously defined variable */
- if ((status = nc_inq_varid (exoid, VAR_GLO_VAR, &varid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate global variables in file id %d",
- exoid);
- ex_err("ex_get_glob_var_time",errmsg,exerrval);
- return (EX_WARN);
- }
-
- /* read values of global variables */
- start[0] = --beg_time_step;
- start[1] = --glob_var_index;
-
if (end_time_step < 0) {
/* user is requesting the maximum time step; we find this out using the
* database inquire function to get the number of time steps
*/
- if ((status = ex_inquire (exoid, EX_INQ_TIME, &end_time_step, &fdum, cdum)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get number of time steps in file id %d",
- exoid);
- ex_err("ex_get_glob_var_time",errmsg,exerrval);
- return (EX_FATAL);
- }
+ end_time_step = ex_inquire_int(exoid, EX_INQ_TIME);
}
end_time_step--;
+ /* read values of global variables */
+ start[0] = --beg_time_step;
+ start[1] = --glob_var_index;
+
count[0] = end_time_step - beg_time_step + 1;
count[1] = 1;
+ /* inquire previously defined variable */
+ if ((status = nc_inq_varid (exoid, VAR_GLO_VAR, &varid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to locate global variables in file id %d",
+ exoid);
+ ex_err("ex_get_glob_var_time",errmsg,exerrval);
+ return (EX_WARN);
+ }
+
if (ex_comp_ws(exoid) == 4) {
status = nc_get_vara_float(exoid, varid, start, count, glob_var_vals);
} else {
diff --git a/exodus/cbind/src/exggv.c b/exodus/cbind/src/ex_get_glob_vars.c
similarity index 100%
rename from exodus/cbind/src/exggv.c
rename to exodus/cbind/src/ex_get_glob_vars.c
diff --git a/exodus/cbind/src/exgidm.c b/exodus/cbind/src/ex_get_id_map.c
similarity index 90%
copy from exodus/cbind/src/exgidm.c
copy to exodus/cbind/src/ex_get_id_map.c
index 18efe5e..858ae74 100644
--- a/exodus/cbind/src/exgidm.c
+++ b/exodus/cbind/src/ex_get_id_map.c
@@ -56,7 +56,7 @@
int ex_get_id_map ( int exoid,
ex_entity_type map_type,
- int* map )
+ void_int* map )
{
int dimid, mapid, status;
size_t i;
@@ -112,15 +112,27 @@ int ex_get_id_map ( int exoid,
}
/* generate default map of 1..n, where n is num_entries */
- for (i=0; i<num_entries; i++) {
- map[i] = (int)i+1;
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ int64_t *lmap = (int64_t*)map;
+ for (i=0; i<num_entries; i++) {
+ lmap[i] = i+1;
+ }
+ } else {
+ int *lmap = (int*)map;
+ for (i=0; i<num_entries; i++) {
+ lmap[i] = i+1;
+ }
}
return (EX_NOERR);
}
/* read in the id map */
- status = nc_get_var_int(exoid, mapid, map);
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_get_var_longlong(exoid, mapid, map);
+ } else {
+ status = nc_get_var_int(exoid, mapid, map);
+ }
if (status != NC_NOERR) {
exerrval = status;
diff --git a/exodus/cbind/src/exgids.c b/exodus/cbind/src/ex_get_ids.c
similarity index 95%
rename from exodus/cbind/src/exgids.c
rename to exodus/cbind/src/ex_get_ids.c
index c4d80ba..31c8e58 100644
--- a/exodus/cbind/src/exgids.c
+++ b/exodus/cbind/src/ex_get_ids.c
@@ -46,7 +46,7 @@
int ex_get_ids (int exoid,
ex_entity_type obj_type,
- int *ids)
+ void_int *ids)
{
int varid, status;
char errmsg[MAX_ERR_LENGTH];
@@ -121,7 +121,11 @@ int ex_get_ids (int exoid,
}
/* read in the element block ids */
- status = nc_get_var_int(exoid, varid, ids);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ status = nc_get_var_longlong(exoid, varid, ids);
+ } else {
+ status = nc_get_var_int(exoid, varid, ids);
+ }
if (status != NC_NOERR) {
exerrval = status;
diff --git a/exodus/cbind/src/exginf.c b/exodus/cbind/src/ex_get_info.c
similarity index 100%
rename from exodus/cbind/src/exginf.c
rename to exodus/cbind/src/ex_get_info.c
diff --git a/exodus/cbind/src/exgini.c b/exodus/cbind/src/ex_get_init.c
similarity index 77%
rename from exodus/cbind/src/exgini.c
rename to exodus/cbind/src/ex_get_init.c
index 265a289..8057479 100644
--- a/exodus/cbind/src/exgini.c
+++ b/exodus/cbind/src/ex_get_init.c
@@ -99,29 +99,51 @@ error = ex_get_init (exoid, title, &num_dim, &num_nodes,
int ex_get_init (int exoid,
char *title,
- int *num_dim,
- int *num_nodes,
- int *num_elem,
- int *num_elem_blk,
- int *num_node_sets,
- int *num_side_sets)
+ void_int *num_dim,
+ void_int *num_nodes,
+ void_int *num_elem,
+ void_int *num_elem_blk,
+ void_int *num_node_sets,
+ void_int *num_side_sets)
{
ex_init_params info;
int errval;
info.title[0] = '\0';
errval = ex_get_init_ext( exoid, &info );
- if ( errval < 0 )
- {
- return errval;
- }
-
- *num_dim = info.num_dim;
- *num_nodes = info.num_nodes;
- *num_elem = info.num_elem;
- *num_elem_blk = info.num_elem_blk;
- *num_node_sets = info.num_node_sets;
- *num_side_sets = info.num_side_sets;
+ if ( errval < 0 ) {
+ return errval;
+ }
+
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ int64_t *n_dim = num_dim;
+ int64_t *n_nodes = num_nodes;
+ int64_t *n_elem = num_elem;
+ int64_t *n_elem_blk = num_elem_blk;
+ int64_t *n_node_sets = num_node_sets;
+ int64_t *n_side_sets = num_side_sets;
+
+ *n_dim = info.num_dim;
+ *n_nodes = info.num_nodes;
+ *n_elem = info.num_elem;
+ *n_elem_blk = info.num_elem_blk;
+ *n_node_sets = info.num_node_sets;
+ *n_side_sets = info.num_side_sets;
+ } else {
+ int *n_dim = num_dim;
+ int *n_nodes = num_nodes;
+ int *n_elem = num_elem;
+ int *n_elem_blk = num_elem_blk;
+ int *n_node_sets = num_node_sets;
+ int *n_side_sets = num_side_sets;
+
+ *n_dim = info.num_dim;
+ *n_nodes = info.num_nodes;
+ *n_elem = info.num_elem;
+ *n_elem_blk = info.num_elem_blk;
+ *n_node_sets = info.num_node_sets;
+ *n_side_sets = info.num_side_sets;
+ }
strcpy( title, info.title );
return (EX_NOERR);
diff --git a/exodus/cbind/src/exginix.c b/exodus/cbind/src/ex_get_init_ext.c
similarity index 91%
rename from exodus/cbind/src/exginix.c
rename to exodus/cbind/src/ex_get_init_ext.c
index 93e68fc..3b6e66a 100644
--- a/exodus/cbind/src/exginix.c
+++ b/exodus/cbind/src/ex_get_init_ext.c
@@ -54,25 +54,25 @@
#include <string.h>
/* Used to reduce repeated code below */
-static int ex_get_dim_value(int exoid, const char *name, const char *dimension_name,
- int dimension, int *value)
+static int64_t ex_get_dim_value(int exoid, const char *name, const char *dimension_name,
+ int dimension, int64_t *value)
{
char errmsg[MAX_ERR_LENGTH];
int status;
- size_t lnum;
if ((status = nc_inq_dimid (exoid, dimension_name, &dimension)) != NC_NOERR) {
/* optional and default to zero. */
*value = 0;
} else {
- if ((status = nc_inq_dimlen(exoid, dimension, &lnum)) != NC_NOERR) {
+ size_t tmp;
+ if ((status = nc_inq_dimlen(exoid, dimension, &tmp)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg, "Error: failed to get number of %s in file id %d",
name, exoid);
ex_err("ex_get_init",errmsg,exerrval);
return (EX_FATAL);
}
- *value = lnum;
+ *value = tmp;
}
return EX_NOERR;
}
@@ -88,7 +88,6 @@ int ex_get_init_ext (int exoid,
ex_init_params *info)
{
int dimid;
- size_t lnum;
char errmsg[MAX_ERR_LENGTH];
int status;
size_t title_len;
@@ -100,12 +99,12 @@ int ex_get_init_ext (int exoid,
exerrval = status;
sprintf(errmsg,
"Error: failed to inquire title in file id %d", exoid);
- ex_err("ex_get_init",errmsg,exerrval);
+ ex_err("ex_get_init_ext",errmsg,exerrval);
return (EX_FATAL);
}
/* Check title length to avoid overrunning clients memory space; include trailing null */
- if (title_len > MAX_LINE_LENGTH+1) {
+ if (title_len > MAX_LINE_LENGTH) {
char *title = malloc(title_len+1);
if ((status = nc_get_att_text(exoid, NC_GLOBAL, ATT_TITLE, title)) == NC_NOERR) {
strncpy(info->title, title, MAX_LINE_LENGTH+1);
@@ -120,14 +119,16 @@ int ex_get_init_ext (int exoid,
exerrval = status;
sprintf(errmsg,
"Error: failed to get title in file id %d", exoid);
- ex_err("ex_get_init",errmsg,exerrval);
+ ex_err("ex_get_init_ext",errmsg,exerrval);
return (EX_FATAL);
}
- status = ex_get_dimension(exoid, DIM_NUM_DIM, "dimensions", &lnum, &dimid, "ex_get_init");
- if (status != NC_NOERR) return status;
- info->num_dim = lnum;
-
+ {
+ size_t tmp;
+ status = ex_get_dimension(exoid, DIM_NUM_DIM, "dimensions", &tmp, &dimid, "ex_get_init_ext");
+ if (status != NC_NOERR) return status;
+ info->num_dim = tmp;
+ }
/* Handle case with zero-nodes */
if (ex_get_dim_value(exoid, "nodes",DIM_NUM_NODES,dimid,&info->num_nodes) != EX_NOERR) return EX_FATAL;
@@ -141,7 +142,7 @@ int ex_get_init_ext (int exoid,
sprintf(errmsg,
"Error: failed to locate number of element blocks in file id %d",
exoid);
- ex_err("ex_get_init",errmsg,exerrval);
+ ex_err("ex_get_init_ext",errmsg,exerrval);
return (EX_FATAL);
}
diff --git a/nemesis/ne_ginig.c b/exodus/cbind/src/ex_get_init_global.c
similarity index 73%
rename from nemesis/ne_ginig.c
rename to exodus/cbind/src/ex_get_init_global.c
index 6c98e77..be7742a 100644
--- a/nemesis/ne_ginig.c
+++ b/exodus/cbind/src/ex_get_init_global.c
@@ -35,12 +35,12 @@
/*****************************************************************************/
/*****************************************************************************/
/* Function(s) contained in this file:
- * ne_get_init_global()
+ * ex_get_init_global()
*****************************************************************************
* This function reads the global initial information.
*****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* num_nodes_g - The number of global FEM nodes. This is output as
* a NetCDF variable.
* num_elems_g - The number of global FEM elements. This is output
@@ -63,20 +63,17 @@
#include "exodusII.h"
#include "exodusII_int.h"
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-int ne_get_init_global(int neid,
- int *num_nodes_g,
- int *num_elems_g,
- int *num_elem_blks_g,
- int *num_node_sets_g,
- int *num_side_sets_g
+int ex_get_init_global(int exoid,
+ void_int *num_nodes_g,
+ void_int *num_elems_g,
+ void_int *num_elem_blks_g,
+ void_int *num_node_sets_g,
+ void_int *num_side_sets_g
)
{
- char *func_name="ne_get_init_global";
+ const char *func_name="ex_get_init_global";
int dimid, status;
- size_t ltempsv;
+ size_t nng, neg, nebg, nnsg, nssg;
char errmsg[MAX_ERR_LENGTH];
/*-----------------------------Execution begins-----------------------------*/
@@ -84,111 +81,120 @@ int ne_get_init_global(int neid,
exerrval = 0; /* clear error flag */
/* Check the file version information */
- if ((dimid=ne_check_file_version(neid)) != EX_NOERR) return (dimid);
+ if ((dimid=ne_check_file_version(exoid)) != EX_NOERR) return (dimid);
/* Get the dimension ID for the number of global FEM nodes */
- if ((status = nc_inq_dimid(neid, DIM_NUM_NODES_GLOBAL, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_NODES_GLOBAL, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NUM_NODES_GLOBAL, neid);
+ DIM_NUM_NODES_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the value of the number of global FEM nodes */
- if ((status = nc_inq_dimlen(neid, dimid, <empsv)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &nng)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_NODES_GLOBAL, neid);
+ DIM_NUM_NODES_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- *num_nodes_g = ltempsv;
/* Get the dimension ID for the number of global FEM elements */
- if ((status = nc_inq_dimid(neid, DIM_NUM_ELEMS_GLOBAL, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_ELEMS_GLOBAL, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NUM_ELEMS_GLOBAL, neid);
+ DIM_NUM_ELEMS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the value of the number of global FEM elements */
- if ((status = nc_inq_dimlen(neid, dimid, <empsv)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &neg)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_ELEMS_GLOBAL, neid);
+ DIM_NUM_ELEMS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- *num_elems_g = ltempsv;
/* Get the dimension ID for the number of global element blocks */
- if ((status = nc_inq_dimid(neid, DIM_NUM_ELBLK_GLOBAL, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_ELBLK_GLOBAL, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NUM_ELBLK_GLOBAL, neid);
+ DIM_NUM_ELBLK_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the value of the number of global element blocks */
- if ((status = nc_inq_dimlen(neid, dimid, <empsv)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &nebg)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_ELBLK_GLOBAL, neid);
+ DIM_NUM_ELBLK_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- *num_elem_blks_g = ltempsv;
/* Get the dimension ID for the number of global node sets */
- if ((status = nc_inq_dimid(neid, DIM_NUM_NS_GLOBAL, &dimid)) != NC_NOERR) {
- *num_node_sets_g = (int) 0;
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_NS_GLOBAL, &dimid)) != NC_NOERR) {
+ nnsg = 0;
}
else {
/* Get the value of the number of global node sets */
- if ((status = nc_inq_dimlen(neid, dimid, <empsv)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &nnsg)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_NS_GLOBAL, neid);
+ DIM_NUM_NS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- *num_node_sets_g = ltempsv;
}
/* Get the dimension ID for the number of global side sets */
- if ((status = nc_inq_dimid(neid, DIM_NUM_SS_GLOBAL, &dimid)) != NC_NOERR) {
- *num_side_sets_g = (int) 0;
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_SS_GLOBAL, &dimid)) != NC_NOERR) {
+ nssg = 0;
}
else {
/* Get the value of the number of global side sets */
- if ((status = nc_inq_dimlen(neid, dimid, <empsv)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &nssg)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_SS_GLOBAL, neid);
+ DIM_NUM_SS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- *num_side_sets_g = ltempsv;
+ }
+
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ *(int64_t*)num_nodes_g = nng;
+ *(int64_t*)num_elems_g = neg;
+ *(int64_t*)num_elem_blks_g = nebg;
+ *(int64_t*)num_node_sets_g = nnsg;
+ *(int64_t*)num_side_sets_g = nssg;
+ } else {
+ *(int*)num_nodes_g = nng;
+ *(int*)num_elems_g = neg;
+ *(int*)num_elem_blks_g = nebg;
+ *(int*)num_node_sets_g = nnsg;
+ *(int*)num_side_sets_g = nssg;
}
return (EX_NOERR);
diff --git a/nemesis/ne_giinf.c b/exodus/cbind/src/ex_get_init_info.c
similarity index 85%
rename from nemesis/ne_giinf.c
rename to exodus/cbind/src/ex_get_init_info.c
index fb59381..23e579f 100644
--- a/nemesis/ne_giinf.c
+++ b/exodus/cbind/src/ex_get_init_info.c
@@ -35,13 +35,13 @@
/*****************************************************************************/
/*****************************************************************************/
/* Function(s) contained in this file:
- * ne_get_init_info()
+ * ex_get_init_info()
*****************************************************************************
* This function reads information about the processors for which the
* decomposition was performed.
*****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* num_proc - The number of processors in the decomposition.
* num_proc_in_f - The number of processors the file contains
* information for.
@@ -57,16 +57,13 @@
#include <exodusII.h>
#include <exodusII_int.h>
-#include "ne_nemesisI.h"
-#include "ne_nemesisI_int.h"
-
-int ne_get_init_info(int neid,
+int ex_get_init_info(int exoid,
int *num_proc,
int *num_proc_in_f,
char *ftype
)
{
- char *func_name="ne_get_init_info";
+ const char *func_name="ex_get_init_info";
int dimid, status;
size_t ltempsv;
@@ -77,32 +74,32 @@ int ne_get_init_info(int neid,
exerrval = 0; /* clear error code */
/* Get the file type */
- if (ne_get_file_type(neid, ftype) != EX_NOERR) {
+ if (ex_get_file_type(exoid, ftype) != EX_NOERR) {
exerrval = EX_MSG;
sprintf(errmsg,
"Error: failed to get file type for file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimid(neid, DIM_NUM_PROCS, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_PROCS, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NUM_PROCS, neid);
+ DIM_NUM_PROCS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the value of the number of processors */
- if ((status = nc_inq_dimlen(neid, dimid, <empsv)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, <empsv)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_PROCS, neid);
+ DIM_NUM_PROCS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -110,22 +107,22 @@ int ne_get_init_info(int neid,
*num_proc = ltempsv;
/* Get the dimension ID of processors that have info in this file */
- if ((status = nc_inq_dimid(neid, DIM_NUM_PROCS_F, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_PROCS_F, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NUM_PROCS_F, neid);
+ DIM_NUM_PROCS_F, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the value of the number of processors that have info in this file */
- if ((status = nc_inq_dimlen(neid, dimid, <empsv)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, <empsv)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_PROCS_F, neid);
+ DIM_NUM_PROCS_F, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
diff --git a/nemesis/ne_glbp.c b/exodus/cbind/src/ex_get_loadbal_param.c
similarity index 67%
rename from nemesis/ne_glbp.c
rename to exodus/cbind/src/ex_get_loadbal_param.c
index 1d70a46..ec5e11e 100644
--- a/nemesis/ne_glbp.c
+++ b/exodus/cbind/src/ex_get_loadbal_param.c
@@ -35,12 +35,12 @@
/*****************************************************************************/
/*****************************************************************************/
/* Function(s) contained in this file:
- * ne_get_loadbal_param()
+ * ex_get_loadbal_param()
*****************************************************************************
* This function retrieves the load balance parameters.
*****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* num_int_nodes - The number of internal FEM nodes.
* num_bor_nodes - The number of border FEM nodes.
* num_ext_nodes - The number of external FEM nodes.
@@ -61,53 +61,68 @@
#include "exodusII.h"
#include "exodusII_int.h"
-#include "ne_nemesisI.h"
-#include "ne_nemesisI_int.h"
-
-int ne_get_loadbal_param(int neid,
- int *num_int_nodes,
- int *num_bor_nodes,
- int *num_ext_nodes,
- int *num_int_elems,
- int *num_bor_elems,
- int *num_node_cmaps,
- int *num_elem_cmaps,
+int ex_get_loadbal_param(int exoid,
+ void_int *num_int_nodes,
+ void_int *num_bor_nodes,
+ void_int *num_ext_nodes,
+ void_int *num_int_elems,
+ void_int *num_bor_elems,
+ void_int *num_node_cmaps,
+ void_int *num_elem_cmaps,
int processor
)
{
- char *func_name="ne_get_loadbal_param";
+ const char *func_name="ex_get_loadbal_param";
int dimid, varid, status;
- size_t start[1], ltempsv, ltempsv2;
+ size_t start[1];
+ size_t nin, nbn, nen, nie, nbe, nncm, necm;
int64_t varidx[2];
char ftype[2];
int nmstat;
char errmsg[MAX_ERR_LENGTH];
/*-----------------------------Execution begins-----------------------------*/
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ *(int64_t*)num_int_nodes = 0;
+ *(int64_t*)num_bor_nodes = 0;
+ *(int64_t*)num_ext_nodes = 0;
+ *(int64_t*)num_int_elems = 0;
+ *(int64_t*)num_bor_elems = 0;
+ *(int64_t*)num_node_cmaps = 0;
+ *(int64_t*)num_elem_cmaps = 0;
+ } else {
+ *(int*)num_int_nodes = 0;
+ *(int*)num_bor_nodes = 0;
+ *(int*)num_ext_nodes = 0;
+ *(int*)num_int_elems = 0;
+ *(int*)num_bor_elems = 0;
+ *(int*)num_node_cmaps = 0;
+ *(int*)num_elem_cmaps = 0;
+ }
exerrval = 0; /* clear error code */
/* Check the file version information */
- if ((dimid=ne_check_file_version(neid)) != EX_NOERR) return (dimid);
+ if ((dimid=ne_check_file_version(exoid)) != EX_NOERR) return (dimid);
/* Get the file type */
- if (ne_get_file_type(neid, ftype) != EX_NOERR) {
+ if (ex_get_file_type(exoid, ftype) != EX_NOERR) {
exerrval = EX_MSG;
sprintf(errmsg,
"Error: unable to find file type for file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the status for this node map */
- if ((status = nc_inq_varid(neid, VAR_INT_N_STAT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_INT_N_STAT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" from file ID %d",
- VAR_INT_N_STAT, neid);
+ VAR_INT_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -118,21 +133,21 @@ int ne_get_loadbal_param(int neid,
else
start[0] = 0;
- if ((status = nc_get_var1_int(neid, varid, start, &nmstat)) != NC_NOERR) {
+ if ((status = nc_get_var1_int(exoid, varid, start, &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get status for \"%s\" from file ID %d",
- VAR_INT_N_STAT, neid);
+ VAR_INT_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
if (nmstat == 1) {
- if (ne_get_idx(neid, VAR_NODE_MAP_INT_IDX, varidx, processor) == -1) {
+ if (ex_get_idx(exoid, VAR_NODE_MAP_INT_IDX, varidx, processor) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_NODE_MAP_INT_IDX, neid);
+ VAR_NODE_MAP_INT_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -141,11 +156,11 @@ int ne_get_loadbal_param(int neid,
/* check if I need to get the dimension of the internal node map */
if (varidx[1] == -1) {
/* Get the dimension ID for the number of internal nodes */
- if ((status = nc_inq_dimid(neid, DIM_NUM_INT_NODES, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_INT_NODES, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NUM_INT_NODES, neid);
+ DIM_NUM_INT_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -155,34 +170,34 @@ int ne_get_loadbal_param(int neid,
* Get the value of the dimension representing the total number of
* internal FEM nodes.
*/
- if ((status = nc_inq_dimlen(neid, dimid, <empsv)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &nin)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_INT_NODES, neid);
+ DIM_NUM_INT_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* set the end value for the node map */
- varidx[1] = ltempsv;
+ varidx[1] = nin;
} /* End "if (varidx[1] = -1)" */
/* now get the number of nodes */
- *num_int_nodes = varidx[1] - varidx[0];
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ *(int64_t*)num_int_nodes = varidx[1] - varidx[0];
+ } else {
+ *(int*)num_int_nodes = varidx[1] - varidx[0];
+ }
}
- else { /* if (nmstat != 1) */
- *num_int_nodes = 0;
-
- } /* End "if (nmstat == 1)" */
/* Get the status for this node map */
- if ((status = nc_inq_varid(neid, VAR_BOR_N_STAT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_BOR_N_STAT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" from file ID %d",
- VAR_BOR_N_STAT, neid);
+ VAR_BOR_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -193,21 +208,21 @@ int ne_get_loadbal_param(int neid,
else
start[0] = 0;
- if ((status = nc_get_var1_int(neid, varid, start, &nmstat)) != NC_NOERR) {
+ if ((status = nc_get_var1_int(exoid, varid, start, &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get status for \"%s\" from file ID %d",
- VAR_BOR_N_STAT, neid);
+ VAR_BOR_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
if (nmstat == 1) {
- if (ne_get_idx(neid, VAR_NODE_MAP_BOR_IDX, varidx, processor) == -1) {
+ if (ex_get_idx(exoid, VAR_NODE_MAP_BOR_IDX, varidx, processor) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_NODE_MAP_BOR_IDX, neid);
+ VAR_NODE_MAP_BOR_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -216,11 +231,11 @@ int ne_get_loadbal_param(int neid,
/* check if I need to get the dimension of the border node map */
if (varidx[1] == -1) {
/* Get the dimension ID for the number of border nodes */
- if ((status = nc_inq_dimid(neid, DIM_NUM_BOR_NODES, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_BOR_NODES, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NUM_BOR_NODES, neid);
+ DIM_NUM_BOR_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -230,33 +245,34 @@ int ne_get_loadbal_param(int neid,
* Get the value of the dimension representing the number of border
* FEM nodes.
*/
- if ((status = nc_inq_dimlen(neid, dimid, <empsv)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &nbn)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_BOR_NODES, neid);
+ DIM_NUM_BOR_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* set the end value for the node map */
- varidx[1] = ltempsv;
+ varidx[1] = nbn;
} /* End "if (varidx[1] == -1)" */
/* now calculate the number of nodes */
- *num_bor_nodes = varidx[1] - varidx[0];
- }
- else { /* if (nmstat != 1) */
- *num_bor_nodes = 0;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ *(int64_t*)num_bor_nodes = varidx[1] - varidx[0];
+ } else {
+ *(int*)num_bor_nodes = varidx[1] - varidx[0];
+ }
}
/* Get the status for this node map */
- if ((status = nc_inq_varid(neid, VAR_EXT_N_STAT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_EXT_N_STAT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" from file ID %d",
- VAR_EXT_N_STAT, neid);
+ VAR_EXT_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -267,21 +283,21 @@ int ne_get_loadbal_param(int neid,
else
start[0] = 0;
- if ((status = nc_get_var1_int(neid, varid, start, &nmstat)) != NC_NOERR) {
+ if ((status = nc_get_var1_int(exoid, varid, start, &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get status for \"%s\" from file ID %d",
- VAR_EXT_N_STAT, neid);
+ VAR_EXT_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
if (nmstat == 1) {
- if (ne_get_idx(neid, VAR_NODE_MAP_EXT_IDX, varidx, processor) == -1) {
+ if (ex_get_idx(exoid, VAR_NODE_MAP_EXT_IDX, varidx, processor) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_NODE_MAP_EXT_IDX, neid);
+ VAR_NODE_MAP_EXT_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -290,11 +306,11 @@ int ne_get_loadbal_param(int neid,
/* check if I need to get the dimension of the external node map */
if (varidx[1] == -1) {
/* Get the dimension ID for the number of external nodes */
- if ((status = nc_inq_dimid(neid, DIM_NUM_EXT_NODES, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_EXT_NODES, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NUM_EXT_NODES, neid);
+ DIM_NUM_EXT_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -304,33 +320,33 @@ int ne_get_loadbal_param(int neid,
* Get the value of the dimension representing the number of external
* FEM nodes.
*/
- if ((status = nc_inq_dimlen(neid, dimid, <empsv)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &nen)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_EXT_NODES, neid);
+ DIM_NUM_EXT_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* set the end value for the node map */
- varidx[1] = ltempsv;
+ varidx[1] = nen;
} /* End "if (varidx[1] == -1)" */
/* now get the number of nodes */
- *num_ext_nodes = varidx[1] - varidx[0];
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ *(int64_t*)num_ext_nodes = varidx[1] - varidx[0];
+ } else {
+ *(int*)num_ext_nodes = varidx[1] - varidx[0];
+ }
}
- else { /* if (nmstat != 1) */
- *num_ext_nodes = 0;
-
- } /* End "if (nmstat == 1)" */
/* Get the status for this element map */
- if ((status = nc_inq_varid(neid, VAR_INT_E_STAT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_INT_E_STAT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" from file ID %d",
- VAR_INT_E_STAT, neid);
+ VAR_INT_E_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -340,21 +356,21 @@ int ne_get_loadbal_param(int neid,
else
start[0] = 0;
- if ((status = nc_get_var1_int(neid, varid, start, &nmstat)) != NC_NOERR) {
+ if ((status = nc_get_var1_int(exoid, varid, start, &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get status for \"%s\" from file ID %d",
- VAR_INT_E_STAT, neid);
+ VAR_INT_E_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
if (nmstat == 1) {
- if (ne_get_idx(neid, VAR_ELEM_MAP_INT_IDX, varidx, processor) == -1) {
+ if (ex_get_idx(exoid, VAR_ELEM_MAP_INT_IDX, varidx, processor) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_ELEM_MAP_INT_IDX, neid);
+ VAR_ELEM_MAP_INT_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -363,11 +379,11 @@ int ne_get_loadbal_param(int neid,
/* check if I need to get the dimension of the internal element map */
if (varidx[1] == -1) {
/* Get the dimension ID for the number of internal elements */
- if ((status = nc_inq_dimid(neid, DIM_NUM_INT_ELEMS, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_INT_ELEMS, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" from file ID %d",
- DIM_NUM_INT_ELEMS, neid);
+ DIM_NUM_INT_ELEMS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -377,33 +393,33 @@ int ne_get_loadbal_param(int neid,
* Get the value of the dimension representing the number of internal
* FEM elements.
*/
- if ((status = nc_inq_dimlen(neid, dimid, <empsv)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &nie)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimesion \"%s\" in file ID %d",
- DIM_NUM_INT_ELEMS, neid);
+ DIM_NUM_INT_ELEMS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* set the end value for the node map */
- varidx[1] = ltempsv;
+ varidx[1] = nie;
} /* End "if (varidx[1] == -1)" */
/* now get the number of elements */
- *num_int_elems = varidx[1] - varidx[0];
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ *(int64_t*)num_int_elems = varidx[1] - varidx[0];
+ } else {
+ *(int*)num_int_elems = varidx[1] - varidx[0];
+ }
}
- else { /* if (nmstat != 1) */
- *num_int_elems = 0;
-
- } /* End "if (nmstat == 1)" */
/* Get the status for this element map */
- if ((status = nc_inq_varid(neid, VAR_BOR_E_STAT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_BOR_E_STAT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" from file ID %d",
- VAR_BOR_E_STAT, neid);
+ VAR_BOR_E_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -413,21 +429,21 @@ int ne_get_loadbal_param(int neid,
else
start[0] = 0;
- if ((status = nc_get_var1_int(neid, varid, start, &nmstat)) != NC_NOERR) {
+ if ((status = nc_get_var1_int(exoid, varid, start, &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get status for \"%s\" from file ID %d",
- VAR_BOR_E_STAT, neid);
+ VAR_BOR_E_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
if (nmstat == 1) {
- if (ne_get_idx(neid, VAR_ELEM_MAP_BOR_IDX, varidx, processor) == -1) {
+ if (ex_get_idx(exoid, VAR_ELEM_MAP_BOR_IDX, varidx, processor) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_ELEM_MAP_BOR_IDX, neid);
+ VAR_ELEM_MAP_BOR_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -436,46 +452,46 @@ int ne_get_loadbal_param(int neid,
/* check if I need to get the dimension of the border element map */
if (varidx[1] == -1) {
/* Get the dimension ID for the number of border elements */
- if ((status = nc_inq_dimid(neid, DIM_NUM_BOR_ELEMS, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_BOR_ELEMS, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" from file ID %d",
- DIM_NUM_BOR_ELEMS, neid);
+ DIM_NUM_BOR_ELEMS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/*
- * Get the value of the dimension representing the number of internal
+ * Get the value of the dimension representing the number of border
* FEM elements.
*/
- if ((status = nc_inq_dimlen(neid, dimid, <empsv)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &nbe)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimesion \"%s\" in file ID %d",
- DIM_NUM_BOR_ELEMS, neid);
+ DIM_NUM_BOR_ELEMS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* set the end value for the node map */
- varidx[1] = ltempsv;
+ varidx[1] = nbe;
} /* End "if (varidx[1] == -1)" */
/* now get the number of nodes */
- *num_bor_elems = varidx[1] - varidx[0];
- }
- else { /* if (nmstat != 1) */
- *num_bor_elems = 0;
-
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ *(int64_t*)num_bor_elems = varidx[1] - varidx[0];
+ } else {
+ *(int*)num_bor_elems = varidx[1] - varidx[0];
+ }
} /* End "if (nmstat == 1)" */
- if (ne_get_idx(neid, VAR_N_COMM_INFO_IDX, varidx, processor) == -1) {
+ if (ex_get_idx(exoid, VAR_N_COMM_INFO_IDX, varidx, processor) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_N_COMM_INFO_IDX, neid);
+ VAR_N_COMM_INFO_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -484,29 +500,33 @@ int ne_get_loadbal_param(int neid,
/* check if I need to get the dimension of the nodal comm map */
if (varidx[1] == -1) {
/* Get the nodal comm map information */
- if ((status = nc_inq_dimid(neid, DIM_NUM_N_CMAPS, &dimid)) != NC_NOERR)
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_N_CMAPS, &dimid)) != NC_NOERR)
varidx[1] = 0;
else {
- if ((status = nc_inq_dimlen(neid, dimid, <empsv2)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &nncm)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_N_CMAPS, neid);
+ DIM_NUM_N_CMAPS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* set the end value for the node map */
- varidx[1] = ltempsv2;
+ varidx[1] = nncm;
}
} /* End "if (varidx[1] == -1)" */
- *num_node_cmaps = varidx[1] - varidx[0];
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ *(int64_t*)num_node_cmaps = varidx[1] - varidx[0];
+ } else {
+ *(int*)num_node_cmaps = varidx[1] - varidx[0];
+ }
- if (ne_get_idx(neid, VAR_E_COMM_INFO_IDX, varidx, processor) == -1) {
+ if (ex_get_idx(exoid, VAR_E_COMM_INFO_IDX, varidx, processor) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_E_COMM_INFO_IDX, neid);
+ VAR_E_COMM_INFO_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -515,24 +535,28 @@ int ne_get_loadbal_param(int neid,
/* check if I need to get the dimension of the elemental comm map */
if (varidx[1] == -1) {
/* Get the elemental comm map information */
- if ((status = nc_inq_dimid(neid, DIM_NUM_E_CMAPS, &dimid)) != NC_NOERR)
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_E_CMAPS, &dimid)) != NC_NOERR)
varidx[1] = 0;
else {
- if ((status = nc_inq_dimlen(neid, dimid, <empsv2)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &necm)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_E_CMAPS, neid);
+ DIM_NUM_E_CMAPS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* set the end value for the node map */
- varidx[1] = ltempsv2;
+ varidx[1] = necm;
}
} /* End "if (varidx[1] == -1)" */
- *num_elem_cmaps = varidx[1] - varidx[0];
-
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ *(int64_t*)num_elem_cmaps = varidx[1] - varidx[0];
+ } else {
+ *(int*)num_elem_cmaps = varidx[1] - varidx[0];
+ }
+
return (EX_NOERR);
}
diff --git a/exodus/cbind/src/exgmap.c b/exodus/cbind/src/ex_get_map.c
similarity index 87%
rename from exodus/cbind/src/exgmap.c
rename to exodus/cbind/src/ex_get_map.c
index 927ff56..ddd7e36 100644
--- a/exodus/cbind/src/exgmap.c
+++ b/exodus/cbind/src/ex_get_map.c
@@ -40,7 +40,7 @@
/*!
\deprecated Use ex_get_num_map() instead.
-The function ex_get_map() reads the element order mapelement order map
+The function ex_get_map() reads the element order map
from the database. See #ElementOrderMap for a description of the
element order map. If an element order map is not stored in the data
file, a default array (1,2,3,. .. \c num_elem) is returned. Memory
@@ -72,7 +72,7 @@ error = ex_get_map(exoid, elem_map);
*/
int ex_get_map (int exoid,
- int *elem_map)
+ void_int *elem_map)
{
int numelemdim, mapid, status;
size_t num_elem, i;
@@ -99,14 +99,27 @@ int ex_get_map (int exoid,
if (nc_inq_varid(exoid, VAR_MAP, &mapid) != NC_NOERR) {
/* generate default map of 1..n, where n is num_elem */
- for (i=0; i<num_elem; i++)
- elem_map[i] = i+1;
-
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ int64_t *lmap = (int64_t*)elem_map;
+ for (i=0; i<num_elem; i++) {
+ lmap[i] = i+1;
+ }
+ } else {
+ int *lmap = (int*)elem_map;
+ for (i=0; i<num_elem; i++) {
+ lmap[i] = i+1;
+ }
+ }
+
return (EX_NOERR);
}
/* read in the element order map */
- status = nc_get_var_int(exoid, mapid, elem_map);
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_get_var_longlong(exoid, mapid, elem_map);
+ } else {
+ status = nc_get_var_int(exoid, mapid, elem_map);
+ }
if (status != NC_NOERR) {
exerrval = status;
diff --git a/exodus/cbind/src/exgmp.c b/exodus/cbind/src/ex_get_map_param.c
similarity index 100%
rename from exodus/cbind/src/exgmp.c
rename to exodus/cbind/src/ex_get_map_param.c
diff --git a/exodus/cbind/src/exgnm.c b/exodus/cbind/src/ex_get_n_attr.c
similarity index 69%
copy from exodus/cbind/src/exgnm.c
copy to exodus/cbind/src/ex_get_n_attr.c
index 062c96e..3339b91 100644
--- a/exodus/cbind/src/exgnm.c
+++ b/exodus/cbind/src/ex_get_n_attr.c
@@ -32,35 +32,29 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-/*****************************************************************************
-*
-* exgnm - ex_get_node_map
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-* int map_id node map id
-*
-* exit conditions -
-* int* node_map node map
-*
-* revision history -
-*
-*
-*****************************************************************************/
-#include <stdlib.h>
#include "exodusII.h"
-#include "exodusII_int.h"
/*!
- * reads the node map with specified ID
- * \deprecated Use ex_get_num_map()(exoid, EX_NODE_MAP, map_id, node_map
+ * \deprecated Use ex_get_partial_attr() instead
+ * reads the specified attribute for a subsect of a block
+ * \param exoid exodus file id
+ * \param obj_type object type (edge, face, elem block)
+ * \param obj_id object id (edge, face, elem block ID)
+ * \param start_num the starting index of the attributes to be returned.
+ * \param num_ent the number of entities to read attributes for.
+ * \param attrib_index index of attribute to write
+ * \param attrib array of attributes
*/
+/*
+ */
+int ex_get_n_attr( int exoid,
+ ex_entity_type obj_type,
+ ex_entity_id obj_id,
+ int64_t start_num,
+ int64_t num_ent,
+ void* attrib )
-int ex_get_node_map( int exoid,
- int map_id,
- int *node_map )
{
- return ex_get_num_map( exoid, EX_NODE_MAP, map_id, node_map );
+ return ex_get_partial_attr(exoid, obj_type, obj_id, start_num, num_ent, attrib);
}
diff --git a/exodus/cbind/src/exgevid.c b/exodus/cbind/src/ex_get_n_conn.c
similarity index 71%
copy from exodus/cbind/src/exgevid.c
copy to exodus/cbind/src/ex_get_n_conn.c
index e29c861..0027a4f 100644
--- a/exodus/cbind/src/exgevid.c
+++ b/exodus/cbind/src/ex_get_n_conn.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 2006 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -32,31 +32,21 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-/*****************************************************************************
-*
-* exgevid - ex_get_elem_varid
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-*
-* exit conditions -
-* int* varid variable id array
-*
-* revision history -
-*
-*
-*****************************************************************************/
#include "exodusII.h"
/*!
- * reads the EXODUS II variable varids from the database
- * \deprecated Use ex_get_varid()(exoid, EX_ELEM_BLOCK, varid)
+ * \deprecated Use ex_get_partial_conn() instead.
*/
-int ex_get_elem_varid (int exoid,
- int *varid)
+int ex_get_n_conn( int exoid,
+ ex_entity_type blk_type,
+ ex_entity_id blk_id,
+ int64_t start_num,
+ int64_t num_ent,
+ void_int* nodeconn,
+ void_int* edgeconn,
+ void_int* faceconn )
{
- return ex_get_varid(exoid, EX_ELEM_BLOCK, varid);
+ return ex_get_partial_conn(exoid, blk_type, blk_id, start_num, num_ent, nodeconn, edgeconn, faceconn);
}
diff --git a/exodus/cbind/src/exgssd.c b/exodus/cbind/src/ex_get_n_coord.c
similarity index 55%
copy from exodus/cbind/src/exgssd.c
copy to exodus/cbind/src/ex_get_n_coord.c
index 020688d..d2e67c3 100644
--- a/exodus/cbind/src/exgssd.c
+++ b/exodus/cbind/src/ex_get_n_coord.c
@@ -34,15 +34,18 @@
*/
/*****************************************************************************
*
-* exgssd - ex_get_side_set_dist_fact
+* exgcor - ex_get_n_coord
*
* entry conditions -
* input parameters:
* int exoid exodus file id
-* int side_set_id side set id
+* int start_node_num starting index of coordinates to be returned.
+* int num_nodes number of nodes to read coordinates for.
*
* exit conditions -
-* float* side_set_dist_fact array of dist factors for side set
+* float* x_coord X coord array
+* float* y_coord y coord array
+* float* z_coord z coord array
*
* revision history -
*
@@ -50,17 +53,33 @@
*****************************************************************************/
#include "exodusII.h"
-#include "exodusII_int.h"
/*!
- * reads the distribution factors for a single side set
- * \deprecated Use ex_get_set_dist_fact()(exoid, EX_SIDE_SET, side_set_id, side_set_dist_fact)
+ * \deprecated Use ex_get_partial_coord() instead
+ * reads the coordinates of the nodes.
+ * Memory must be allocated for the coordinate arrays (x_coor, y_coor,
+ * and z_coor) before this call is made. The length of each of these
+ * arrays is the number of nodes in the mesh. Because the coordinates
+ * are floating point values, the application code must declare the
+ * arrays passed to be the appropriate type "float" or "double"
+ * to match the compute word size passed in ex_create() or ex_open()
+ * \param exoid exodus file id
+ * \param start_node_num the starting index of the coordinates to be returned.
+ * \param num_nodes the number of nodes to read coordinates for.
+ * \param[out] x_coor Returned X coordinates of the nodes. These are
+ * returned only if x_coor is non-NULL.
+ * \param[out] y_coor Returned Y coordinates of the nodes. These are
+ * returned only if y_coor is non-NULL.
+ * \param[out] z_coor Returned Z coordinates of the nodes. These are
+ * returned only if z_coor is non-NULL.
*/
-int ex_get_side_set_dist_fact (int exoid,
- int side_set_id,
- void *side_set_dist_fact)
+int ex_get_n_coord (int exoid,
+ int64_t start_node_num,
+ int64_t num_nodes,
+ void *x_coor,
+ void *y_coor,
+ void *z_coor)
{
- return ex_get_set_dist_fact(exoid, EX_SIDE_SET, side_set_id,
- side_set_dist_fact);
+ return ex_get_partial_coord(exoid, start_node_num, num_nodes, x_coor, y_coor, z_coor);
}
diff --git a/exodus/cbind/src/exgsp.c b/exodus/cbind/src/ex_get_n_elem_attr.c
similarity index 59%
copy from exodus/cbind/src/exgsp.c
copy to exodus/cbind/src/ex_get_n_elem_attr.c
index 71cbf07..0cb8f94 100644
--- a/exodus/cbind/src/exgsp.c
+++ b/exodus/cbind/src/ex_get_n_elem_attr.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -32,43 +32,42 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-
-/*****************************************************************************
- *
- * exgsp - ex_get_side_set_param
+/*****************************************************************************/
+/*****************************************************************************/
+/* Function(s) contained in this file:
*
- * entry conditions -
- * input parameters:
- * int exoid exodus file id
- * int side_set_id side set id
+ * ex_get_n_elem_attr()
*
- * exit conditions -
- * int* num_side_in_set number of sides in the side set
- * int* num_dist_fact_in_set number of distribution factors in the
- * side set
+ *****************************************************************************
*
- * revision history -
+ * Variable Index:
*
+ * exoid - The NetCDF ID of an already open NemesisI file.
+ * elem_blk_id - The element block ID.
+ * start_elem_num - The starting index of the elements to be
+ * obtained.
+ * num_elems - The number of FEM elements to read coords for.
+ * attrib - Pointer to the attribute vector.
*
- *****************************************************************************/
+ */
+/*****************************************************************************/
+/*****************************************************************************/
+/*****************************************************************************/
+#include <stdio.h>
#include "exodusII.h"
+#include "exodusII_int.h"
/*!
- * reads the number of sides and the number of distribution factors which
- * describe a single side set
- * \param exoid exodus file id
- * \param side_set_id side set id
- * \param[out] num_side_in_set number of sides in the side set
- * \param[out] num_dist_fact_in_set number of distribution factors in the
- * \deprecated Use ex_get_set_param()(exoid, EX_SIDE_SET, side_set_id, num_side_in_set, num_dist_fact_in_set)
+ * \deprecated Use ex_get_partial_attr() instead.
*/
-int ex_get_side_set_param (int exoid,
- int side_set_id,
- int *num_side_in_set,
- int *num_dist_fact_in_set)
+int ex_get_n_elem_attr (int exoid,
+ ex_entity_id elem_blk_id,
+ int64_t start_elem_num,
+ int64_t num_elems,
+ void *attrib)
+
{
- return ex_get_set_param(exoid, EX_SIDE_SET, side_set_id,
- num_side_in_set, num_dist_fact_in_set);
+ return ex_get_partial_attr(exoid, EX_ELEM_BLOCK, elem_blk_id, start_elem_num, num_elems, attrib);
}
diff --git a/exodus/cbind/src/exgsp.c b/exodus/cbind/src/ex_get_n_elem_conn.c
similarity index 59%
copy from exodus/cbind/src/exgsp.c
copy to exodus/cbind/src/ex_get_n_elem_conn.c
index 71cbf07..fcbbece 100644
--- a/exodus/cbind/src/exgsp.c
+++ b/exodus/cbind/src/ex_get_n_elem_conn.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -32,43 +32,40 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-
-/*****************************************************************************
- *
- * exgsp - ex_get_side_set_param
+/*****************************************************************************/
+/*****************************************************************************/
+/* Function(s) contained in this file:
*
- * entry conditions -
- * input parameters:
- * int exoid exodus file id
- * int side_set_id side set id
+ * ex_get_n_elem_conn()
*
- * exit conditions -
- * int* num_side_in_set number of sides in the side set
- * int* num_dist_fact_in_set number of distribution factors in the
- * side set
+ *****************************************************************************
*
- * revision history -
+ * Variable Index:
*
+ * exoid - The NetCDF ID of an already open NemesisI file.
+ * elem_blk_id - The element block ID.
+ * start_elem_num - The starting index of the elements to be
+ * obtained.
+ * num_elems - The number of FEM elements to read coords for.
+ * connect - Pointer to the connectivity vector.
*
- *****************************************************************************/
-
+ */
+/*****************************************************************************/
+/*****************************************************************************/
+/*****************************************************************************/
#include "exodusII.h"
/*!
- * reads the number of sides and the number of distribution factors which
- * describe a single side set
- * \param exoid exodus file id
- * \param side_set_id side set id
- * \param[out] num_side_in_set number of sides in the side set
- * \param[out] num_dist_fact_in_set number of distribution factors in the
- * \deprecated Use ex_get_set_param()(exoid, EX_SIDE_SET, side_set_id, num_side_in_set, num_dist_fact_in_set)
+ * \deprecated use ex_get_partial_conn()
+ * reads the connectivity array for an element block
*/
-int ex_get_side_set_param (int exoid,
- int side_set_id,
- int *num_side_in_set,
- int *num_dist_fact_in_set)
+int ex_get_n_elem_conn (int exoid,
+ ex_entity_id elem_blk_id,
+ int64_t start_elem_num,
+ int64_t num_elems,
+ void_int *connect)
{
- return ex_get_set_param(exoid, EX_SIDE_SET, side_set_id,
- num_side_in_set, num_dist_fact_in_set);
+ return ex_get_partial_conn(exoid, EX_ELEM_BLOCK, elem_blk_id,
+ start_elem_num, num_elems, connect, NULL, NULL);
}
diff --git a/exodus/cbind/src/exgssvid.c b/exodus/cbind/src/ex_get_n_elem_num_map.c
similarity index 79%
rename from exodus/cbind/src/exgssvid.c
rename to exodus/cbind/src/ex_get_n_elem_num_map.c
index 238de4a..5d0c2d9 100644
--- a/exodus/cbind/src/exgssvid.c
+++ b/exodus/cbind/src/ex_get_n_elem_num_map.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -34,31 +34,34 @@
*/
/*****************************************************************************
*
-* exgnsvid - ex_get_sset_varid
+* ne_gennm - ex_get_n_elem_num_map
+*
+* environment - UNIX
*
* entry conditions -
* input parameters:
-* int exoid exodus file id
+* int exoid exodus file id
+* int start_ent starting location for read
+* int num_ents number of elemental points
*
* exit conditions -
-* int* varid variable id array
+* int* elem_map element number map array
*
* revision history -
*
-*
*****************************************************************************/
-#include <stdlib.h>
#include "exodusII.h"
#include "exodusII_int.h"
/*!
- * reads the EXODUS II variable varids from the database
- * \deprecated Use ex_get_varid()(exoid, EX_SIDE_SET, varid)
+ * \deprecated Use ex_get_partial_id_map() instead
*/
-int ex_get_sset_varid (int exoid,
- int *varid)
+int ex_get_n_elem_num_map (int exoid,
+ int64_t start_ent,
+ int64_t num_ents,
+ void_int *elem_map)
{
- return ex_get_varid(exoid, EX_SIDE_SET, varid);
+ return ex_get_partial_id_map(exoid, EX_ELEM_MAP, start_ent, num_ents, elem_map);
}
diff --git a/exodus/cbind/src/exgevid.c b/exodus/cbind/src/ex_get_n_elem_var.c
similarity index 71%
copy from exodus/cbind/src/exgevid.c
copy to exodus/cbind/src/ex_get_n_elem_var.c
index e29c861..ad919c6 100644
--- a/exodus/cbind/src/exgevid.c
+++ b/exodus/cbind/src/ex_get_n_elem_var.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -32,31 +32,24 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-/*****************************************************************************
-*
-* exgevid - ex_get_elem_varid
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-*
-* exit conditions -
-* int* varid variable id array
-*
-* revision history -
-*
-*
-*****************************************************************************/
#include "exodusII.h"
/*!
- * reads the EXODUS II variable varids from the database
- * \deprecated Use ex_get_varid()(exoid, EX_ELEM_BLOCK, varid)
+ * \deprecated Use ex_get_partial_var() instead
*/
-int ex_get_elem_varid (int exoid,
- int *varid)
+int ex_get_n_elem_var (int exoid,
+ int time_step,
+ int elem_var_index,
+ ex_entity_id elem_blk_id,
+ int64_t num_elem_this_blk,
+ int64_t start_elem_num,
+ int64_t num_elem,
+ void *elem_var_vals)
{
- return ex_get_varid(exoid, EX_ELEM_BLOCK, varid);
+ return ex_get_partial_var(exoid, time_step, EX_ELEM_BLOCK,
+ elem_var_index, elem_blk_id,
+ start_elem_num, num_elem,
+ elem_var_vals);
}
diff --git a/exodus/cbind/src/exgevid.c b/exodus/cbind/src/ex_get_n_nodal_var.c
similarity index 70%
copy from exodus/cbind/src/exgevid.c
copy to exodus/cbind/src/ex_get_n_nodal_var.c
index e29c861..dc1f66a 100644
--- a/exodus/cbind/src/exgevid.c
+++ b/exodus/cbind/src/ex_get_n_nodal_var.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -32,31 +32,19 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-/*****************************************************************************
-*
-* exgevid - ex_get_elem_varid
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-*
-* exit conditions -
-* int* varid variable id array
-*
-* revision history -
-*
-*
-*****************************************************************************/
-#include "exodusII.h"
+#include <exodusII.h>
/*!
- * reads the EXODUS II variable varids from the database
- * \deprecated Use ex_get_varid()(exoid, EX_ELEM_BLOCK, varid)
+ * \deprecated Use ex_get_partial_nodal_var() instead
*/
-int ex_get_elem_varid (int exoid,
- int *varid)
+int ex_get_n_nodal_var (int exoid,
+ int time_step,
+ int nodal_var_index,
+ int64_t start_node,
+ int64_t num_nodes,
+ void *var_vals)
{
- return ex_get_varid(exoid, EX_ELEM_BLOCK, varid);
+ return ex_get_partial_nodal_var(exoid, time_step, nodal_var_index, start_node, num_nodes, var_vals);
}
diff --git a/exodus/cbind/src/exgnsvid.c b/exodus/cbind/src/ex_get_n_node_num_map.c
similarity index 77%
rename from exodus/cbind/src/exgnsvid.c
rename to exodus/cbind/src/ex_get_n_node_num_map.c
index 496a5ce..a7d1181 100644
--- a/exodus/cbind/src/exgnsvid.c
+++ b/exodus/cbind/src/ex_get_n_node_num_map.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -34,31 +34,32 @@
*/
/*****************************************************************************
*
-* exgnsvid - ex_get_nset_varid
+* ne_gnnnm - ex_get_n_node_num_map
*
-* entry conditions -
+* environment - UNIX
+*
+* entry conditions -
* input parameters:
-* int exoid exodus file id
+* int exoid nemesis file id
*
-* exit conditions -
-* int* varid variable id array
+* exit conditions -
+* int* node_map node numbering map array
*
-* revision history -
+* revision history -
*
*
*****************************************************************************/
-#include <stdlib.h>
#include "exodusII.h"
-#include "exodusII_int.h"
/*!
- * reads the EXODUS II variable varids from the database
- * \deprecated Use ex_get_varid()(exoid, EX_NODE_SET, varid)
+ * \deprecated Use ex_get_partial_num_map() instead
*/
-int ex_get_nset_varid (int exoid,
- int *varid)
+int ex_get_n_node_num_map (int exoid,
+ int64_t start_ent,
+ int64_t num_ents,
+ void_int *node_map)
{
- return ex_get_varid(exoid, EX_NODE_SET, varid);
+ return ex_get_partial_id_map(exoid, EX_NODE_MAP, start_ent, num_ents, node_map);
}
diff --git a/exodus/cbind/src/exgsp.c b/exodus/cbind/src/ex_get_n_node_set.c
similarity index 59%
copy from exodus/cbind/src/exgsp.c
copy to exodus/cbind/src/ex_get_n_node_set.c
index 71cbf07..641b7ab 100644
--- a/exodus/cbind/src/exgsp.c
+++ b/exodus/cbind/src/ex_get_n_node_set.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -32,43 +32,37 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-
-/*****************************************************************************
- *
- * exgsp - ex_get_side_set_param
+/*****************************************************************************/
+/*****************************************************************************/
+/* Function(s) contained in this file:
*
- * entry conditions -
- * input parameters:
- * int exoid exodus file id
- * int side_set_id side set id
+ * ex_get_n_node_set()
*
- * exit conditions -
- * int* num_side_in_set number of sides in the side set
- * int* num_dist_fact_in_set number of distribution factors in the
- * side set
+ *****************************************************************************
*
- * revision history -
+ * Variable Index:
*
- *
- *****************************************************************************/
+ * exoid - The NetCDF ID of an already open NemesisI file.
+ * node_set_id - ID of node set to read.
+ * start_node_num - The starting index of the nodes to be read.
+ * num_nodes - The number of nodes to read in.
+ * node_set_node_list - List of node IDs in node set.
+ */
+/*****************************************************************************/
+/*****************************************************************************/
+/*****************************************************************************/
#include "exodusII.h"
/*!
- * reads the number of sides and the number of distribution factors which
- * describe a single side set
- * \param exoid exodus file id
- * \param side_set_id side set id
- * \param[out] num_side_in_set number of sides in the side set
- * \param[out] num_dist_fact_in_set number of distribution factors in the
- * \deprecated Use ex_get_set_param()(exoid, EX_SIDE_SET, side_set_id, num_side_in_set, num_dist_fact_in_set)
+ * \deprecated Use ex_get_partial_node_set() instead
*/
-int ex_get_side_set_param (int exoid,
- int side_set_id,
- int *num_side_in_set,
- int *num_dist_fact_in_set)
+int ex_get_n_node_set (int exoid,
+ ex_entity_id node_set_id,
+ int64_t start_node_num,
+ int64_t num_nodes,
+ void_int *node_set_node_list)
{
- return ex_get_set_param(exoid, EX_SIDE_SET, side_set_id,
- num_side_in_set, num_dist_fact_in_set);
+ return ex_get_partial_node_set(exoid, node_set_id, start_node_num, num_nodes, node_set_node_list);
}
diff --git a/exodus/cbind/src/exgevid.c b/exodus/cbind/src/ex_get_n_node_set_df.c
similarity index 71%
copy from exodus/cbind/src/exgevid.c
copy to exodus/cbind/src/ex_get_n_node_set_df.c
index e29c861..107fa43 100644
--- a/exodus/cbind/src/exgevid.c
+++ b/exodus/cbind/src/ex_get_n_node_set_df.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -32,31 +32,19 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-/*****************************************************************************
-*
-* exgevid - ex_get_elem_varid
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-*
-* exit conditions -
-* int* varid variable id array
-*
-* revision history -
-*
-*
-*****************************************************************************/
#include "exodusII.h"
/*!
- * reads the EXODUS II variable varids from the database
- * \deprecated Use ex_get_varid()(exoid, EX_ELEM_BLOCK, varid)
+ * \deprecated Use ex_get_partial_set_dist_fact() instead
*/
-int ex_get_elem_varid (int exoid,
- int *varid)
+int ex_get_n_node_set_df (int exoid,
+ ex_entity_id node_set_id,
+ int64_t start_num,
+ int64_t num_df_to_get,
+ void *node_set_dist_fact)
{
- return ex_get_varid(exoid, EX_ELEM_BLOCK, varid);
+ return ex_get_partial_set_dist_fact(exoid, EX_NODE_SET, node_set_id,
+ start_num, num_df_to_get, node_set_dist_fact);
}
diff --git a/exodus/cbind/src/exgnm.c b/exodus/cbind/src/ex_get_n_one_attr.c
similarity index 67%
copy from exodus/cbind/src/exgnm.c
copy to exodus/cbind/src/ex_get_n_one_attr.c
index 062c96e..8407f94 100644
--- a/exodus/cbind/src/exgnm.c
+++ b/exodus/cbind/src/ex_get_n_one_attr.c
@@ -32,35 +32,31 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-/*****************************************************************************
-*
-* exgnm - ex_get_node_map
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-* int map_id node map id
-*
-* exit conditions -
-* int* node_map node map
-*
-* revision history -
-*
-*
-*****************************************************************************/
-#include <stdlib.h>
#include "exodusII.h"
-#include "exodusII_int.h"
/*!
- * reads the node map with specified ID
- * \deprecated Use ex_get_num_map()(exoid, EX_NODE_MAP, map_id, node_map
+ * \deprecated Use ex_get_partial_one_attr() instead.
+ *
+ * reads the specified attribute for a subsect of a block
+ * \param exoid exodus file id
+ * \param obj_type object type (edge, face, elem block)
+ * \param obj_id object id (edge, face, elem block ID)
+ * \param start_num the starting index of the attributes to be returned.
+ * \param num_ent the number of entities to read attributes for.
+ * \param attrib_index index of attribute to write
+ * \param attrib array of attributes
*/
+/*
+ */
+int ex_get_n_one_attr( int exoid,
+ ex_entity_type obj_type,
+ ex_entity_id obj_id,
+ int64_t start_num,
+ int64_t num_ent,
+ int attrib_index,
+ void* attrib )
-int ex_get_node_map( int exoid,
- int map_id,
- int *node_map )
{
- return ex_get_num_map( exoid, EX_NODE_MAP, map_id, node_map );
+ return ex_get_partial_one_attr(exoid, obj_type, obj_id, start_num, num_ent, attrib_index, attrib);
}
diff --git a/exodus/cbind/src/exgevid.c b/exodus/cbind/src/ex_get_n_side_set.c
similarity index 71%
copy from exodus/cbind/src/exgevid.c
copy to exodus/cbind/src/ex_get_n_side_set.c
index e29c861..2c753b6 100644
--- a/exodus/cbind/src/exgevid.c
+++ b/exodus/cbind/src/ex_get_n_side_set.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -32,31 +32,20 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-/*****************************************************************************
-*
-* exgevid - ex_get_elem_varid
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-*
-* exit conditions -
-* int* varid variable id array
-*
-* revision history -
-*
-*
-*****************************************************************************/
#include "exodusII.h"
/*!
- * reads the EXODUS II variable varids from the database
- * \deprecated Use ex_get_varid()(exoid, EX_ELEM_BLOCK, varid)
+ * \deprecated Use ex_get_partial_side_set() instead
*/
-int ex_get_elem_varid (int exoid,
- int *varid)
+int ex_get_n_side_set (int exoid,
+ ex_entity_id side_set_id,
+ int64_t start_side_num,
+ int64_t num_sides,
+ void_int *side_set_elem_list,
+ void_int *side_set_side_list)
{
- return ex_get_varid(exoid, EX_ELEM_BLOCK, varid);
+ return ex_get_partial_side_set(exoid, side_set_id, start_side_num, num_sides,
+ side_set_elem_list, side_set_side_list);
}
diff --git a/exodus/cbind/src/exgsp.c b/exodus/cbind/src/ex_get_n_side_set_df.c
similarity index 57%
copy from exodus/cbind/src/exgsp.c
copy to exodus/cbind/src/ex_get_n_side_set_df.c
index 71cbf07..14a7840 100644
--- a/exodus/cbind/src/exgsp.c
+++ b/exodus/cbind/src/ex_get_n_side_set_df.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -32,43 +32,41 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-
-/*****************************************************************************
- *
- * exgsp - ex_get_side_set_param
- *
- * entry conditions -
- * input parameters:
- * int exoid exodus file id
- * int side_set_id side set id
+/*****************************************************************************/
+/*****************************************************************************/
+/*****************************************************************************/
+/* Function(s) contained in this file:
*
- * exit conditions -
- * int* num_side_in_set number of sides in the side set
- * int* num_dist_fact_in_set number of distribution factors in the
- * side set
+ * ex_get_n_side_set_df()
*
- * revision history -
+ *****************************************************************************
*
+ * Variable Index:
*
- *****************************************************************************/
+ * exoid - The NetCDF ID of an already open NemesisI file.
+ * side_set_id - ID of side set to read.
+ * start_side_num - The starting index of the sides to be read.
+ * num_sides - The number of sides to read in.
+ * side_set_dist_fact - List of side IDs in side set.
+ */
+/*****************************************************************************/
+/*****************************************************************************/
+/*****************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
#include "exodusII.h"
+#include "exodusII_int.h"
/*!
- * reads the number of sides and the number of distribution factors which
- * describe a single side set
- * \param exoid exodus file id
- * \param side_set_id side set id
- * \param[out] num_side_in_set number of sides in the side set
- * \param[out] num_dist_fact_in_set number of distribution factors in the
- * \deprecated Use ex_get_set_param()(exoid, EX_SIDE_SET, side_set_id, num_side_in_set, num_dist_fact_in_set)
+ * \deprecated Use ex_get_partial_set_dist_fact() instead
*/
-
-int ex_get_side_set_param (int exoid,
- int side_set_id,
- int *num_side_in_set,
- int *num_dist_fact_in_set)
+int ex_get_n_side_set_df (int exoid,
+ ex_entity_id side_set_id,
+ int64_t start_num,
+ int64_t num_df_to_get,
+ void *side_set_dist_fact)
{
- return ex_get_set_param(exoid, EX_SIDE_SET, side_set_id,
- num_side_in_set, num_dist_fact_in_set);
+ return ex_get_partial_set_dist_fact(exoid, EX_SIDE_SET, side_set_id, start_num, num_df_to_get,
+ side_set_dist_fact);
}
diff --git a/exodus/cbind/src/expoea.c b/exodus/cbind/src/ex_get_n_var.c
similarity index 60%
copy from exodus/cbind/src/expoea.c
copy to exodus/cbind/src/ex_get_n_var.c
index ddc1113..ef01f56 100644
--- a/exodus/cbind/src/expoea.c
+++ b/exodus/cbind/src/ex_get_n_var.c
@@ -32,42 +32,41 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-/*****************************************************************************
-*
-* expoea - ex_put_one_elem_attr
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-* int elem_blk_id element block id
-* int attrib_index index of attribute to write
-* float* attrib array of attributes
-*
-* exit conditions -
-*
-* revision history -
-* 20061003 - David Thompson - moved to ex_put_one_attr
-*
-*
-*****************************************************************************/
#include "exodusII.h"
#include "exodusII_int.h"
-/*!
- * writes the specified attribute for an element block
- * \param exoid exodus file id
- * \param elem_blk_id element block id
- * \param attrib_index index of attribute to write
- * \param attrib array of attributes
- * \deprecated Use ex_put_one_attr()(exoid, EX_ELEM_BLOCK, elem_blk_id, attrib_index, attrib)
+/*
+ * reads the values of a single element variable for one element block at
+ * one time step in the database; assume the first time step and
+ * element variable index is 1
+ */
+/*!
+ * \deprecated Use ex_get_partial_var() instead.
+ *
+ * reads the values of a single variable for a partial block at one time
+ * step from the database; assume the first time step and variable index
+ * and start_index are 1
+ * \param exoid exodus file id
+ * \param time_step time step number
+ * \param var_type type (edge block, face block, edge set, ... )
+ * \param var_index element variable index
+ * \param obj_id element block id
+ * \param start_index index of first entity in block to read (1-based)
+ * \param num_entities number of entries to read in this block/set
+ * \param var_vals the values to read
*/
-int ex_put_one_elem_attr (int exoid,
- int elem_blk_id,
- int attrib_index,
- const void *attrib)
+int ex_get_n_var( int exoid,
+ int time_step,
+ ex_entity_type var_type,
+ int var_index,
+ ex_entity_id obj_id,
+ int64_t start_index,
+ int64_t num_entities,
+ void* var_vals )
{
- return ex_put_one_attr( exoid, EX_ELEM_BLOCK, elem_blk_id, attrib_index, attrib );
+ return ex_get_partial_var(exoid, time_step, var_type, var_index, obj_id,
+ start_index, num_entities, var_vals);
}
diff --git a/exodus/cbind/src/exgnam.c b/exodus/cbind/src/ex_get_name.c
similarity index 95%
rename from exodus/cbind/src/exgnam.c
rename to exodus/cbind/src/ex_get_name.c
index bb58c29..d21aff9 100644
--- a/exodus/cbind/src/exgnam.c
+++ b/exodus/cbind/src/ex_get_name.c
@@ -59,7 +59,7 @@
int ex_get_name (int exoid,
ex_entity_type obj_type,
- int entity_id,
+ ex_entity_id entity_id,
char *name)
{
int status;
@@ -125,7 +125,8 @@ int ex_get_name (int exoid,
/* read the name */
{
int db_name_size = ex_inquire_int(exoid, EX_INQ_DB_MAX_ALLOWED_NAME_LENGTH);
- int name_size = db_name_size < ex_max_name_length ? db_name_size : ex_max_name_length;
+ int api_name_size = ex_inquire_int(exoid, EX_INQ_MAX_READ_NAME_LENGTH);
+ int name_size = db_name_size < api_name_size ? db_name_size : api_name_size;
status = ex_get_name_internal(exoid, varid, ent_ndx-1, name, name_size, obj_type, routine);
if (status != NC_NOERR) {
diff --git a/exodus/cbind/src/exgnams.c b/exodus/cbind/src/ex_get_names.c
similarity index 100%
rename from exodus/cbind/src/exgnams.c
rename to exodus/cbind/src/ex_get_names.c
diff --git a/exodus/cbind/src/exgnv.c b/exodus/cbind/src/ex_get_nodal_var.c
similarity index 99%
rename from exodus/cbind/src/exgnv.c
rename to exodus/cbind/src/ex_get_nodal_var.c
index 75903c8..2fadafd 100644
--- a/exodus/cbind/src/exgnv.c
+++ b/exodus/cbind/src/ex_get_nodal_var.c
@@ -91,7 +91,7 @@ error = ex_get_nodal_var(exoid, time_step, var_index, num_nodes,
int ex_get_nodal_var (int exoid,
int time_step,
int nodal_var_index,
- int num_nodes,
+ int64_t num_nodes,
void *nodal_var_vals)
{
int varid;
diff --git a/exodus/cbind/src/exgnvt.c b/exodus/cbind/src/ex_get_nodal_var_time.c
similarity index 92%
rename from exodus/cbind/src/exgnvt.c
rename to exodus/cbind/src/ex_get_nodal_var_time.c
index 07c0019..cd6e355 100644
--- a/exodus/cbind/src/exgnvt.c
+++ b/exodus/cbind/src/ex_get_nodal_var_time.c
@@ -99,7 +99,7 @@ error = ex_get_nodal_var_time(exoid, var_index, node_num, beg_time,
int ex_get_nodal_var_time (int exoid,
int nodal_var_index,
- int node_number,
+ int64_t node_number,
int beg_time_step,
int end_time_step,
void *nodal_var_vals)
@@ -107,25 +107,18 @@ int ex_get_nodal_var_time (int exoid,
int status;
int varid;
size_t start[3], count[3];
- float fdum;
- char *cdum = 0;
char errmsg[MAX_ERR_LENGTH];
+ beg_time_step--;
+ node_number--;
+
/* inquire previously defined variable */
if (end_time_step < 0) {
-
/* user is requesting the maximum time step; we find this out using the
* database inquire function to get the number of time steps; the ending
* time step number is 1 less due to 0 based array indexing in C
*/
- if ((status = ex_inquire (exoid, EX_INQ_TIME, &end_time_step, &fdum, cdum)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get number of time steps in file id %d",
- exoid);
- ex_err("ex_get_nodal_var_time",errmsg,exerrval);
- return (EX_FATAL);
- }
+ end_time_step = ex_inquire_int (exoid, EX_INQ_TIME);
}
end_time_step--;
@@ -144,9 +137,9 @@ int ex_get_nodal_var_time (int exoid,
return (EX_WARN);
}
- start[0] = --beg_time_step;
+ start[0] = beg_time_step;
start[1] = --nodal_var_index;
- start[2] = --node_number;
+ start[2] = node_number;
count[0] = end_time_step - beg_time_step + 1;
count[1] = 1;
@@ -166,8 +159,8 @@ int ex_get_nodal_var_time (int exoid,
* so it is 0-based
*/
- start[0] = --beg_time_step;
- start[1] = --node_number;
+ start[0] = beg_time_step;
+ start[1] = node_number;
count[0] = end_time_step - beg_time_step + 1;
count[1] = 1;
diff --git a/nemesis/ne_gncm.c b/exodus/cbind/src/ex_get_node_cmap.c
similarity index 76%
rename from nemesis/ne_gncm.c
rename to exodus/cbind/src/ex_get_node_cmap.c
index 3ec9d77..253e86e 100644
--- a/nemesis/ne_gncm.c
+++ b/exodus/cbind/src/ex_get_node_cmap.c
@@ -35,11 +35,11 @@
/****************************************************************************/
/****************************************************************************/
/* Function(s) in this file:
- * ne_get_node_cmap()
+ * ex_get_node_cmap()
*
****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* map_id - The ID of the nodal communication map to retrieve.
* node_ids - Pointer to vector for retrieval of FEM node IDs
* that make up this communication map.
@@ -60,17 +60,14 @@
#include "exodusII.h"
#include "exodusII_int.h"
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-int ne_get_node_cmap(int neid,
- int map_id,
- int *node_ids,
- int *proc_ids,
+int ex_get_node_cmap(int exoid,
+ ex_entity_id map_id,
+ void_int *node_ids,
+ void_int *proc_ids,
int processor
)
{
- char *func_name="ne_get_node_cmap";
+ const char *func_name="ex_get_node_cmap";
int map_idx, dimid, varid[2], status;
size_t start[1], count[1];
@@ -81,10 +78,10 @@ int ne_get_node_cmap(int neid,
exerrval = 0; /* clear error code */
/* get the cmap information variables index */
- if (ne_get_idx(neid, VAR_N_COMM_INFO_IDX, varidx, processor) == -1) {
+ if (ex_get_idx(exoid, VAR_N_COMM_INFO_IDX, varidx, processor) == -1) {
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_N_COMM_INFO_IDX, neid);
+ VAR_N_COMM_INFO_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -96,20 +93,20 @@ int ne_get_node_cmap(int neid,
*/
/* Get the index of the nodal comm map with the given ID */
- if ((map_idx=ne_id_lkup(neid, VAR_N_COMM_IDS, varidx, map_id)) < 0) {
+ if ((map_idx=ne_id_lkup(exoid, VAR_N_COMM_IDS, varidx, map_id)) < 0) {
exerrval = EX_MSG;
sprintf(errmsg,
- "Error: failed to find nodal comm map with ID %d in file ID %d",
- map_id, neid);
+ "Error: failed to find nodal comm map with ID %"PRId64" in file ID %d",
+ map_id, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* get the cmap data variables index for this map */
- if (ne_get_idx(neid, VAR_N_COMM_DATA_IDX, varidx, map_idx) == -1) {
+ if (ex_get_idx(exoid, VAR_N_COMM_DATA_IDX, varidx, map_idx) == -1) {
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_N_COMM_DATA_IDX, neid);
+ VAR_N_COMM_DATA_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -117,20 +114,20 @@ int ne_get_node_cmap(int neid,
if (varidx[1] == -1) {
/* Get the dimension of this nodal communication map */
- if ((status = nc_inq_dimid(neid, DIM_NCNT_CMAP, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NCNT_CMAP, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NCNT_CMAP, neid);
+ DIM_NCNT_CMAP, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid,count)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid,count)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NCNT_CMAP, neid);
+ DIM_NCNT_CMAP, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -138,21 +135,21 @@ int ne_get_node_cmap(int neid,
}
/* Get the variable ID for the nodal comm map node IDs */
- if ((status = nc_inq_varid(neid, VAR_N_COMM_NIDS, &varid[0])) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_N_COMM_NIDS, &varid[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_N_COMM_NIDS, neid);
+ VAR_N_COMM_NIDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the variable ID for the nodal comm map processor IDs */
- if ((status = nc_inq_varid(neid, VAR_N_COMM_PROC, &varid[1])) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_N_COMM_PROC, &varid[1])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_N_COMM_PROC, neid);
+ VAR_N_COMM_PROC, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -160,25 +157,33 @@ int ne_get_node_cmap(int neid,
/* Get the nodal comm map node IDs */
start[0] = varidx[0];
count[0] = varidx[1] - varidx[0];
- status = nc_get_vara_int(neid, varid[0], start, count, node_ids);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_get_vara_longlong(exoid, varid[0], start, count, node_ids);
+ } else {
+ status = nc_get_vara_int(exoid, varid[0], start, count, node_ids);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_N_COMM_NIDS, neid);
+ VAR_N_COMM_NIDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the nodal comm map processor IDs */
- status = nc_get_vara_int(neid, varid[1], start, count, proc_ids);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_get_vara_longlong(exoid, varid[1], start, count, proc_ids);
+ } else {
+ status = nc_get_vara_int(exoid, varid[1], start, count, proc_ids);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_N_COMM_PROC, neid);
+ VAR_N_COMM_PROC, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
diff --git a/exodus/cbind/src/exgnm.c b/exodus/cbind/src/ex_get_node_map.c
similarity index 96%
copy from exodus/cbind/src/exgnm.c
copy to exodus/cbind/src/ex_get_node_map.c
index 062c96e..ad58604 100644
--- a/exodus/cbind/src/exgnm.c
+++ b/exodus/cbind/src/ex_get_node_map.c
@@ -59,8 +59,8 @@
*/
int ex_get_node_map( int exoid,
- int map_id,
- int *node_map )
+ ex_entity_id map_id,
+ void_int *node_map )
{
return ex_get_num_map( exoid, EX_NODE_MAP, map_id, node_map );
}
diff --git a/exodus/cbind/src/exgnnm.c b/exodus/cbind/src/ex_get_node_num_map.c
similarity index 99%
rename from exodus/cbind/src/exgnnm.c
rename to exodus/cbind/src/ex_get_node_num_map.c
index 7f4caee..16c16f3 100644
--- a/exodus/cbind/src/exgnnm.c
+++ b/exodus/cbind/src/ex_get_node_num_map.c
@@ -86,7 +86,7 @@ error = ex_get_id_map(exoid, EX_NODE_MAP, node_map);
*/
int ex_get_node_num_map (int exoid,
- int *node_map)
+ void_int *node_map)
{
return ex_get_id_map(exoid, EX_NODE_MAP, node_map);
}
diff --git a/exodus/cbind/src/exgns.c b/exodus/cbind/src/ex_get_node_set.c
similarity index 96%
copy from exodus/cbind/src/exgns.c
copy to exodus/cbind/src/ex_get_node_set.c
index eece0de..6b6390d 100644
--- a/exodus/cbind/src/exgns.c
+++ b/exodus/cbind/src/ex_get_node_set.c
@@ -59,8 +59,8 @@
*/
int ex_get_node_set (int exoid,
- int node_set_id,
- int *node_set_node_list)
+ ex_entity_id node_set_id,
+ void_int *node_set_node_list)
{
return ex_get_set(exoid, EX_NODE_SET, node_set_id, node_set_node_list,
NULL);
diff --git a/exodus/cbind/src/exgnsd.c b/exodus/cbind/src/ex_get_node_set_dist_fact.c
similarity index 98%
rename from exodus/cbind/src/exgnsd.c
rename to exodus/cbind/src/ex_get_node_set_dist_fact.c
index 3c028df..a5f9d74 100644
--- a/exodus/cbind/src/exgnsd.c
+++ b/exodus/cbind/src/ex_get_node_set_dist_fact.c
@@ -62,7 +62,7 @@ segment to read a node set's distribution factors.
*/
int ex_get_node_set_dist_fact (int exoid,
- int node_set_id,
+ ex_entity_id node_set_id,
void *node_set_dist_fact)
{
return ex_get_set_dist_fact(exoid, EX_NODE_SET, node_set_id,
diff --git a/exodus/cbind/src/exgnsi.c b/exodus/cbind/src/ex_get_node_set_ids.c
similarity index 98%
rename from exodus/cbind/src/exgnsi.c
rename to exodus/cbind/src/ex_get_node_set_ids.c
index 626e49e..e7fe0b8 100644
--- a/exodus/cbind/src/exgnsi.c
+++ b/exodus/cbind/src/ex_get_node_set_ids.c
@@ -69,7 +69,7 @@ error = ex_get_ids (exoid, EX_NODE_SET, ids);
*/
int ex_get_node_set_ids (int exoid,
- int *ids)
+ void_int *ids)
{
return ex_get_ids( exoid, EX_NODE_SET, ids );
}
diff --git a/exodus/cbind/src/exgnp.c b/exodus/cbind/src/ex_get_node_set_param.c
similarity index 95%
rename from exodus/cbind/src/exgnp.c
rename to exodus/cbind/src/ex_get_node_set_param.c
index 7f2dbc6..ddfae47 100644
--- a/exodus/cbind/src/exgnp.c
+++ b/exodus/cbind/src/ex_get_node_set_param.c
@@ -88,9 +88,9 @@ if (num_df_in_set > 0) {
*/
int ex_get_node_set_param (int exoid,
- int node_set_id,
- int *num_nodes_in_set,
- int *num_df_in_set)
+ ex_entity_id node_set_id,
+ void_int *num_nodes_in_set,
+ void_int *num_df_in_set)
{
return ex_get_set_param(exoid, EX_NODE_SET, node_set_id,
num_nodes_in_set, num_df_in_set);
diff --git a/nemesis/ne_gnspg.c b/exodus/cbind/src/ex_get_ns_param_global.c
similarity index 77%
rename from nemesis/ne_gnspg.c
rename to exodus/cbind/src/ex_get_ns_param_global.c
index 4980e05..21dd43f 100644
--- a/nemesis/ne_gnspg.c
+++ b/exodus/cbind/src/ex_get_ns_param_global.c
@@ -36,12 +36,12 @@
/*****************************************************************************/
/*****************************************************************************/
/* Function(s) contained in this file:
- * ne_get_ns_param_global()
+ * ex_get_ns_param_global()
*****************************************************************************
* This function retrieves the global node-set parameters.
*****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* global_ids - Pointer to a vector of global node-set IDs.
* node_cnts - Pointer to a vector of global node counts in
* each global node set.
@@ -59,16 +59,13 @@
#include <exodusII.h>
#include <exodusII_int.h>
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-int ne_get_ns_param_global(int neid,
- int *global_ids,
- int *node_cnts,
- int *df_cnts
+int ex_get_ns_param_global(int exoid,
+ void_int *global_ids,
+ void_int *node_cnts,
+ void_int *df_cnts
)
{
- char *func_name="ne_get_ns_param_global";
+ const char *func_name="ex_get_ns_param_global";
int varid, status;
char errmsg[MAX_ERR_LENGTH];
@@ -77,23 +74,27 @@ int ne_get_ns_param_global(int neid,
exerrval = 0; /* clear error code */
/* Get the variable ID for the vector of global node set IDs */
- if ((status = nc_inq_varid(neid, VAR_NS_IDS_GLOBAL, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_NS_IDS_GLOBAL, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_NS_IDS_GLOBAL, neid);
+ VAR_NS_IDS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the vector of node set IDs */
- status = nc_get_var_int(neid, varid, global_ids);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ status = nc_get_var_longlong(exoid, varid, global_ids);
+ } else {
+ status = nc_get_var_int(exoid, varid, global_ids);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_NS_IDS_GLOBAL, neid);
+ VAR_NS_IDS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -101,23 +102,27 @@ int ne_get_ns_param_global(int neid,
/* Get the variable ID for the vector of global node set node count */
if (node_cnts != NULL) {
- if ((status = nc_inq_varid(neid, VAR_NS_NODE_CNT_GLOBAL, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_NS_NODE_CNT_GLOBAL, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_NS_NODE_CNT_GLOBAL, neid);
+ VAR_NS_NODE_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the vector of node set node counts */
- status = nc_get_var_int(neid, varid, node_cnts);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_get_var_longlong(exoid, varid, node_cnts);
+ } else {
+ status = nc_get_var_int(exoid, varid, node_cnts);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_NS_NODE_CNT_GLOBAL, neid);
+ VAR_NS_NODE_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -127,23 +132,27 @@ int ne_get_ns_param_global(int neid,
/* Get the variable ID for the vector of global node set dist. fact count */
if (df_cnts != NULL) {
- if ((status = nc_inq_varid(neid, VAR_NS_DF_CNT_GLOBAL, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_NS_DF_CNT_GLOBAL, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_NS_DF_CNT_GLOBAL, neid);
+ VAR_NS_DF_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the vector of node set dist. fact counts */
- status = nc_get_var_int(neid, varid, df_cnts);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_get_var_longlong(exoid, varid, df_cnts);
+ } else {
+ status = nc_get_var_int(exoid, varid, df_cnts);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_NS_DF_CNT_GLOBAL, neid);
+ VAR_NS_DF_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
diff --git a/exodus/cbind/src/exgnsv.c b/exodus/cbind/src/ex_get_nset_var.c
similarity index 96%
rename from exodus/cbind/src/exgnsv.c
rename to exodus/cbind/src/ex_get_nset_var.c
index 875783d..489fdc0 100644
--- a/exodus/cbind/src/exgnsv.c
+++ b/exodus/cbind/src/ex_get_nset_var.c
@@ -67,8 +67,8 @@
int ex_get_nset_var (int exoid,
int time_step,
int nset_var_index,
- int nset_id,
- int num_node_this_nset,
+ ex_entity_id nset_id,
+ int64_t num_node_this_nset,
void *nset_var_vals)
{
return ex_get_var(exoid, time_step, EX_NODE_SET, nset_var_index,
diff --git a/exodus/cbind/src/exgnstt.c b/exodus/cbind/src/ex_get_nset_var_tab.c
similarity index 100%
rename from exodus/cbind/src/exgnstt.c
rename to exodus/cbind/src/ex_get_nset_var_tab.c
diff --git a/exodus/cbind/src/exgnmap.c b/exodus/cbind/src/ex_get_num_map.c
similarity index 92%
rename from exodus/cbind/src/exgnmap.c
rename to exodus/cbind/src/ex_get_num_map.c
index 676d019..d43e3a0 100644
--- a/exodus/cbind/src/exgnmap.c
+++ b/exodus/cbind/src/ex_get_num_map.c
@@ -60,8 +60,8 @@
int ex_get_num_map ( int exoid,
ex_entity_type map_type,
- int map_id,
- int* map )
+ ex_entity_id map_id,
+ void_int* map )
{
int dimid, var_id, id_ndx, status;
char errmsg[MAX_ERR_LENGTH];
@@ -113,7 +113,7 @@ int ex_get_num_map ( int exoid,
id_ndx = ex_id_lkup(exoid,map_type,map_id);
if (exerrval != 0) {
sprintf(errmsg,
- "Error: failed to locate %s id %d in id variable in file id %d",
+ "Error: failed to locate %s id %"PRId64" in id variable in file id %d",
ex_name_of_object(map_type),map_id,exoid);
ex_err("ex_get_map",errmsg,exerrval);
return (EX_FATAL);
@@ -123,14 +123,18 @@ int ex_get_num_map ( int exoid,
if ((status = nc_inq_varid(exoid, ex_name_of_map(map_type,id_ndx), &var_id)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate %s %d in file id %d",
+ "Error: failed to locate %s %"PRId64" in file id %d",
ex_name_of_object(map_type),map_id,exoid);
ex_err("ex_get_map",errmsg,exerrval);
return (EX_FATAL);
}
/* read in the map */
- status = nc_get_var_int(exoid, var_id, map);
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_get_var_longlong(exoid, var_id, map);
+ } else {
+ status = nc_get_var_int(exoid, var_id, map);
+ }
if (status != NC_NOERR) {
exerrval = status;
diff --git a/exodus/cbind/src/exgotv.c b/exodus/cbind/src/ex_get_object_truth_vector.c
similarity index 98%
rename from exodus/cbind/src/exgotv.c
rename to exodus/cbind/src/ex_get_object_truth_vector.c
index e993d40..32453d5 100644
--- a/exodus/cbind/src/exgotv.c
+++ b/exodus/cbind/src/ex_get_object_truth_vector.c
@@ -51,7 +51,7 @@
int ex_get_object_truth_vector (int exoid,
ex_entity_type obj_type,
- int entity_id,
+ ex_entity_id entity_id,
int num_var,
int *var_vec)
{
@@ -140,7 +140,7 @@ int ex_get_object_truth_vector (int exoid,
if (exerrval != 0) {
if (exerrval != EX_NULLENTITY) {
sprintf(errmsg,
- "Error: failed to locate %s id %d in id variable in file id %d",
+ "Error: failed to locate %s id %"PRId64" in id variable in file id %d",
ex_name_of_object(obj_type), entity_id, exoid);
ex_err(routine,errmsg,exerrval);
return (EX_FATAL);
diff --git a/exodus/cbind/src/exgoatt.c b/exodus/cbind/src/ex_get_one_attr.c
similarity index 94%
rename from exodus/cbind/src/exgoatt.c
rename to exodus/cbind/src/ex_get_one_attr.c
index 3fe17ef..d069794 100644
--- a/exodus/cbind/src/exgoatt.c
+++ b/exodus/cbind/src/ex_get_one_attr.c
@@ -58,7 +58,7 @@
*/
int ex_get_one_attr( int exoid,
ex_entity_type obj_type,
- int obj_id,
+ ex_entity_id obj_id,
int attrib_index,
void* attrib )
@@ -82,13 +82,13 @@ int ex_get_one_attr( int exoid,
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no attributes found for NULL %s %d in file id %d",
+ "Warning: no attributes found for NULL %s %"PRId64" in file id %d",
ex_name_of_object(obj_type),obj_id,exoid);
ex_err("ex_get_one_attr",errmsg,EX_MSG);
return (EX_WARN); /* no attributes for this object */
} else {
sprintf(errmsg,
- "Warning: failed to locate %s id %d in id array in file id %d",
+ "Warning: failed to locate %s id %"PRId64" in id array in file id %d",
ex_name_of_object(obj_type),obj_id, exoid);
ex_err("ex_get_one_attr",errmsg,exerrval);
return (EX_WARN);
@@ -161,7 +161,7 @@ int ex_get_one_attr( int exoid,
if (attrib_index < 1 || attrib_index > (int)num_attr) {
exerrval = EX_FATAL;
sprintf(errmsg,
- "Error: Invalid attribute index specified: %d. Valid range is 1 to %d for %s %d in file id %d",
+ "Error: Invalid attribute index specified: %d. Valid range is 1 to %d for %s %"PRId64" in file id %d",
attrib_index, (int)num_attr, ex_name_of_object(obj_type), obj_id, exoid);
ex_err("ex_get_one_attr",errmsg,exerrval);
return (EX_FATAL);
@@ -170,7 +170,7 @@ int ex_get_one_attr( int exoid,
if ((status = nc_inq_varid(exoid, vattrbname, &attrid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate attributes for %s %d in file id %d",
+ "Error: failed to locate attributes for %s %"PRId64" in file id %d",
ex_name_of_object(obj_type),obj_id,exoid);
ex_err("ex_get_one_attr",errmsg,exerrval);
return (EX_FATAL);
@@ -196,7 +196,7 @@ int ex_get_one_attr( int exoid,
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get attribute %d for %s %d in file id %d",
+ "Error: failed to get attribute %d for %s %"PRId64" in file id %d",
attrib_index, ex_name_of_object(obj_type), obj_id,exoid);
ex_err("ex_get_one_attr",errmsg,exerrval);
return (EX_FATAL);
diff --git a/exodus/cbind/src/exgoea.c b/exodus/cbind/src/ex_get_one_elem_attr.c
similarity index 97%
copy from exodus/cbind/src/exgoea.c
copy to exodus/cbind/src/ex_get_one_elem_attr.c
index 5d9cf8d..fde25f2 100644
--- a/exodus/cbind/src/exgoea.c
+++ b/exodus/cbind/src/ex_get_one_elem_attr.c
@@ -57,7 +57,7 @@
* \deprecated Use ex_get_one_attr()(exoid, EX_ELEM_BLOCK, elem_blk_id, attrib_index, attrib)
*/
int ex_get_one_elem_attr (int exoid,
- int elem_blk_id,
+ ex_entity_id elem_blk_id,
int attrib_index,
void *attrib)
diff --git a/exodus/cbind/src/exgnoatt.c b/exodus/cbind/src/ex_get_partial_attr.c
similarity index 77%
copy from exodus/cbind/src/exgnoatt.c
copy to exodus/cbind/src/ex_get_partial_attr.c
index 246e35b..75e966f 100644
--- a/exodus/cbind/src/exgnoatt.c
+++ b/exodus/cbind/src/ex_get_partial_attr.c
@@ -34,7 +34,7 @@
*/
/*****************************************************************************
*
-* exgeat - ex_get_n_one_attr
+* exgeat - ex_get_partial_attr
*
* entry conditions -
* input parameters:
@@ -67,13 +67,12 @@
*/
/*
*/
-int ex_get_n_one_attr( int exoid,
- ex_entity_type obj_type,
- int obj_id,
- int start_num,
- int num_ent,
- int attrib_index,
- void* attrib )
+int ex_get_partial_attr( int exoid,
+ ex_entity_type obj_type,
+ ex_entity_id obj_id,
+ int64_t start_num,
+ int64_t num_ent,
+ void* attrib )
{
int status;
@@ -81,7 +80,6 @@ int ex_get_n_one_attr( int exoid,
int temp;
size_t num_entries_this_obj, num_attr;
size_t start[2], count[2];
- ptrdiff_t stride[2];
char errmsg[MAX_ERR_LENGTH];
const char* dnumobjent;
const char* dnumobjatt;
@@ -89,21 +87,23 @@ int ex_get_n_one_attr( int exoid,
exerrval = 0; /* clear error code */
+ if (num_ent == 0)
+ return 0;
/* Determine index of obj_id in vobjids array */
if (obj_type != EX_NODAL) {
obj_id_ndx = ex_id_lkup(exoid,obj_type,obj_id);
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no attributes found for NULL %s %d in file id %d",
+ "Warning: no attributes found for NULL %s %"PRId64" in file id %d",
ex_name_of_object(obj_type),obj_id,exoid);
- ex_err("ex_get_n_one_attr",errmsg,EX_MSG);
+ ex_err("ex_get_partial_attr",errmsg,EX_MSG);
return (EX_WARN); /* no attributes for this object */
} else {
sprintf(errmsg,
- "Warning: failed to locate %s id %d in id array in file id %d",
+ "Warning: failed to locate %s id%"PRId64" in id array in file id %d",
ex_name_of_object(obj_type),obj_id, exoid);
- ex_err("ex_get_n_one_attr",errmsg,exerrval);
+ ex_err("ex_get_partial_attr",errmsg,exerrval);
return (EX_WARN);
}
}
@@ -160,67 +160,55 @@ int ex_get_n_one_attr( int exoid,
sprintf(errmsg,
"Internal Error: unrecognized object type in switch: %d in file id %d",
obj_type,exoid);
- ex_err("ex_get_n_one_attr",errmsg,EX_MSG);
+ ex_err("ex_get_partial_attr",errmsg,EX_MSG);
return (EX_FATAL); /* number of attributes not defined */
}
/* inquire id's of previously defined dimensions */
- if (ex_get_dimension(exoid, dnumobjent,"entries", &num_entries_this_obj, &temp, "ex_get_n_one_attr") != NC_NOERR)
+ if (ex_get_dimension(exoid, dnumobjent,"entries", &num_entries_this_obj, &temp, "ex_get_partial_attr") != NC_NOERR)
return EX_FATAL;
- if (start_num + num_ent -1 > (int)num_entries_this_obj) {
+ if (start_num + num_ent -1 > num_entries_this_obj) {
exerrval = EX_BADPARAM;
sprintf(errmsg,
- "Error: start index (%d) + count (%d) is larger than total number of entities (%d) in file id %d",
- start_num, num_ent, (int)num_entries_this_obj, exoid);
- ex_err("ex_get_n_one_attr",errmsg,exerrval);
+ "Error: start index (%"PRId64") + count (%"PRId64") is larger than total number of entities (%"ST_ZU") in file id %d",
+ start_num, num_ent, num_entries_this_obj, exoid);
+ ex_err("ex_get_partial_attr",errmsg,exerrval);
return (EX_FATAL);
}
- if (ex_get_dimension(exoid, dnumobjatt,"attributes", &num_attr, &temp, "ex_get_n_one_attr") != NC_NOERR)
+ if (ex_get_dimension(exoid, dnumobjatt,"attributes", &num_attr, &temp, "ex_get_partial_attr") != NC_NOERR)
return EX_FATAL;
- if (attrib_index < 1 || attrib_index > (int)num_attr) {
- exerrval = EX_FATAL;
- sprintf(errmsg,
- "Error: Invalid attribute index specified: %d. Valid range is 1 to %d for %s %d in file id %d",
- attrib_index, (int)num_attr, ex_name_of_object(obj_type), obj_id, exoid);
- ex_err("ex_get_n_one_attr",errmsg,exerrval);
- return (EX_FATAL);
- }
-
if ((status = nc_inq_varid(exoid, vattrbname, &attrid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate attributes for %s %d in file id %d",
+ "Error: failed to locate attributes for %s %"PRId64" in file id %d",
ex_name_of_object(obj_type),obj_id,exoid);
- ex_err("ex_get_n_one_attr",errmsg,exerrval);
+ ex_err("ex_get_partial_attr",errmsg,exerrval);
return (EX_FATAL);
}
/* read in the attributes */
start[0] = start_num-1;
- start[1] = attrib_index-1;
+ start[1] = 0;
count[0] = num_ent;
- count[1] = 1;
+ count[1] = num_attr;
- stride[0] = 1;
- stride[1] = num_attr;
-
if (ex_comp_ws(exoid) == 4) {
- status = nc_get_vars_float(exoid, attrid, start, count, stride, attrib);
+ status = nc_get_vara_float(exoid, attrid, start, count, attrib);
} else {
- status = nc_get_vars_double(exoid, attrid, start, count, stride, attrib);
+ status = nc_get_vara_double(exoid, attrid, start, count, attrib);
}
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get attribute %d for %s %d in file id %d",
- attrib_index, ex_name_of_object(obj_type), obj_id,exoid);
- ex_err("ex_get_n_one_attr",errmsg,exerrval);
+ "Error: failed to get attributes for %s %"PRId64" in file id %d",
+ ex_name_of_object(obj_type), obj_id,exoid);
+ ex_err("ex_get_partial_attr",errmsg,exerrval);
return (EX_FATAL);
}
return(EX_NOERR);
diff --git a/exodus/cbind/src/exgnconn.c b/exodus/cbind/src/ex_get_partial_conn.c
similarity index 67%
rename from exodus/cbind/src/exgnconn.c
rename to exodus/cbind/src/ex_get_partial_conn.c
index 24fe1f4..6b0abe4 100644
--- a/exodus/cbind/src/exgnconn.c
+++ b/exodus/cbind/src/ex_get_partial_conn.c
@@ -61,27 +61,38 @@
* reads the connectivity array for an element block
*/
-int ex_get_n_conn( int exoid,
+int ex_get_partial_conn( int exoid,
ex_entity_type blk_type,
- int blk_id,
- int start_num,
- int num_ent,
- int* nodeconn,
- int* edgeconn,
- int* faceconn )
+ ex_entity_id blk_id,
+ int64_t start_num,
+ int64_t num_ent,
+ void_int* nodeconn,
+ void_int* edgeconn,
+ void_int* faceconn )
{
- int connid, econnid, fconnid, blk_id_ndx, status;
- int numnodperentdim, numedgperentdim, numfacperentdim;
+ int connid = -1;
+ int econnid = -1;
+ int fconnid = -1;
+
+ int blk_id_ndx, status;
+
+ int numnodperentdim = -1;
+ int numedgperentdim = -1;
+ int numfacperentdim = -1;
+
int iexit = (EX_NOERR); /* exit status */
- size_t num_nodes_per_entry, num_edges_per_entry, num_faces_per_entry;
+
+ size_t num_nodes_per_entry = 0;
+ size_t num_edges_per_entry = 0;
+ size_t num_faces_per_entry = 0;
char errmsg[MAX_ERR_LENGTH];
- const char* dnumnodent;
- const char* dnumedgent;
- const char* dnumfacent;
- const char* vnodeconn;
- const char* vedgeconn;
- const char* vfaceconn;
+ const char* dnumnodent = NULL;
+ const char* dnumedgent = NULL;
+ const char* dnumfacent = NULL;
+ const char* vnodeconn = NULL;
+ const char* vedgeconn = NULL;
+ const char* vfaceconn = NULL;
/* The partial connectivity input function can currently only handle nodal
* connectivity. Print a warning if edgeconn or faceconn is non-NULL
@@ -89,9 +100,9 @@ int ex_get_n_conn( int exoid,
if (edgeconn != NULL || faceconn != NULL) {
exerrval = 1005;
sprintf(errmsg,
- "Warning: ex_get_n_conn only supports nodal connectivity at this time. %s %d in file id %d",
+ "Warning: ex_get_partial_conn only supports nodal connectivity at this time. %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg,EX_MSG);
+ ex_err("ex_get_partial_conn",errmsg,EX_MSG);
}
exerrval = 0; /* clear error code */
@@ -104,17 +115,17 @@ int ex_get_n_conn( int exoid,
if (exerrval == EX_NULLENTITY)
{
sprintf(errmsg,
- "Warning: no connectivity array for NULL %s %d in file id %d",
+ "Warning: no connectivity array for NULL %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg,EX_MSG);
+ ex_err("ex_get_partial_conn",errmsg,EX_MSG);
return (EX_WARN); /* no connectivity array for this element block */
}
else
{
sprintf(errmsg,
- "Error: failed to locate %s id %d in id array in file id %d",
+ "Error: failed to locate %s id %"PRId64" in id array in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg,exerrval);
+ ex_err("ex_get_partial_conn",errmsg,exerrval);
return (EX_FATAL);
}
}
@@ -149,7 +160,7 @@ int ex_get_n_conn( int exoid,
sprintf(errmsg,
"Internal Error: unrecognized block type in switch: %d in file id %d",
blk_type,exoid);
- ex_err("ex_get_n_conn",errmsg,EX_MSG);
+ ex_err("ex_get_partial_conn",errmsg,EX_MSG);
return (EX_FATAL); /* number of attributes not defined */
}
/* inquire id's of previously defined dimensions */
@@ -158,9 +169,9 @@ int ex_get_n_conn( int exoid,
{
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of nodes/entity for %s %d in file id %d",
+ "Error: failed to locate number of nodes/entity for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg,exerrval);
+ ex_err("ex_get_partial_conn",errmsg,exerrval);
return(EX_FATAL);
}
@@ -168,13 +179,13 @@ int ex_get_n_conn( int exoid,
{
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of nodes/entity for %s %d in file id %d",
+ "Error: failed to get number of nodes/entity for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg, exerrval);
+ ex_err("ex_get_partial_conn",errmsg, exerrval);
return(EX_FATAL);
}
- if ( dnumedgent ) {
+ if ( edgeconn && dnumedgent ) {
num_edges_per_entry = 0;
if ((status = nc_inq_dimid(exoid, dnumedgent, &numedgperentdim)) != NC_NOERR) {
numedgperentdim = -1;
@@ -182,15 +193,15 @@ int ex_get_n_conn( int exoid,
if ((status = nc_inq_dimlen(exoid, numedgperentdim, &num_edges_per_entry)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of edges/entry for %s %d in file id %d",
+ "Error: failed to get number of edges/entry for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg, exerrval);
+ ex_err("ex_get_partial_conn",errmsg, exerrval);
return(EX_FATAL);
}
}
}
- if ( dnumfacent ) {
+ if ( faceconn && dnumfacent ) {
num_faces_per_entry = 0;
if ((status = nc_inq_dimid(exoid, dnumfacent, &numfacperentdim)) != NC_NOERR) {
numfacperentdim = -1;
@@ -198,9 +209,9 @@ int ex_get_n_conn( int exoid,
if ((status = nc_inq_dimlen(exoid, numfacperentdim, &num_faces_per_entry)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of faces/entry for %s %d in file id %d",
+ "Error: failed to get number of faces/entry for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg, exerrval);
+ ex_err("ex_get_partial_conn",errmsg, exerrval);
return(EX_FATAL);
}
}
@@ -211,9 +222,9 @@ int ex_get_n_conn( int exoid,
{
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate connectivity array for %s %d in file id %d",
+ "Error: failed to locate connectivity array for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg, exerrval);
+ ex_err("ex_get_partial_conn",errmsg, exerrval);
return(EX_FATAL);
}
@@ -223,9 +234,9 @@ int ex_get_n_conn( int exoid,
{
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate edge connectivity array for %s %d in file id %d",
+ "Error: failed to locate edge connectivity array for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg, exerrval);
+ ex_err("ex_get_partial_conn",errmsg, exerrval);
return(EX_FATAL);
}
@@ -234,57 +245,85 @@ int ex_get_n_conn( int exoid,
{
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate face connectivity array for %s %d in file id %d",
+ "Error: failed to locate face connectivity array for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg, exerrval);
+ ex_err("ex_get_partial_conn",errmsg, exerrval);
return(EX_FATAL);
}
/* read in the connectivity array */
if ( edgeconn && num_edges_per_entry > 0) {
- status = nc_get_var_int(exoid, econnid, edgeconn);
+ size_t start[2], count[2];
+
+ start[0] = (start_num-1);
+ start[1] = 0;
+ count[0] = num_ent;
+ count[1] = num_edges_per_entry;
+
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_get_vara_longlong(exoid, econnid, start, count, edgeconn);
+ } else {
+ status = nc_get_vara_int(exoid, econnid, start, count, edgeconn);
+ }
if (status != NC_NOERR)
{
exerrval = status;
sprintf(errmsg,
- "Error: failed to get edge connectivity array for %s %d in file id %d",
+ "Error: failed to get edge connectivity array for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg, exerrval);
+ ex_err("ex_get_partial_conn",errmsg, exerrval);
return(EX_FATAL);
}
}
if ( faceconn && num_faces_per_entry > 0) {
- status = nc_get_var_int(exoid, fconnid, faceconn);
+ size_t start[2], count[2];
+
+ start[0] = start_num-1;
+ start[1] = 0;
+ count[0] = num_ent;
+ count[1] = num_faces_per_entry;
+
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_get_vara_longlong(exoid, fconnid, start, count, faceconn);
+ } else {
+ status = nc_get_vara_int(exoid, fconnid, start, count, faceconn);
+ }
if (status != NC_NOERR)
{
exerrval = status;
sprintf(errmsg,
- "Error: failed to get face connectivity array for %s %d in file id %d",
+ "Error: failed to get face connectivity array for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg, exerrval);
+ ex_err("ex_get_partial_conn",errmsg, exerrval);
return(EX_FATAL);
}
}
if ( nodeconn && num_nodes_per_entry > 0) {
- size_t start[1], count[1];
+ size_t start[2], count[2];
- start[0] = (start_num-1) * num_nodes_per_entry;
- count[0] = num_ent * num_nodes_per_entry;
+ start[0] = start_num-1;
+ start[1] = 0;
+ count[0] = num_ent;
+ count[1] = num_nodes_per_entry;
- status = nc_get_vara_int(exoid, connid, start, count, nodeconn);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_get_vara_longlong(exoid, connid, start, count, nodeconn);
+ } else {
+ status = nc_get_vara_int(exoid, connid, start, count, nodeconn);
+ }
if (status != NC_NOERR)
{
exerrval = status;
sprintf(errmsg,
- "Error: failed to get connectivity array for %s %d in file id %d",
+ "Error: failed to get connectivity array for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_n_conn",errmsg, exerrval);
+ ex_err("ex_get_partial_conn",errmsg, exerrval);
return(EX_FATAL);
}
}
diff --git a/exodus/cbind/src/exgncor.c b/exodus/cbind/src/ex_get_partial_coord.c
similarity index 89%
rename from exodus/cbind/src/exgncor.c
rename to exodus/cbind/src/ex_get_partial_coord.c
index 23844a9..7a19159 100644
--- a/exodus/cbind/src/exgncor.c
+++ b/exodus/cbind/src/ex_get_partial_coord.c
@@ -34,7 +34,7 @@
*/
/*****************************************************************************
*
-* exgcor - ex_get_n_coord
+* exgcor - ex_get_partial_coord
*
* entry conditions -
* input parameters:
@@ -74,9 +74,9 @@
* returned only if z_coor is non-NULL.
*/
-int ex_get_n_coord (int exoid,
- int start_node_num,
- int num_nodes,
+int ex_get_partial_coord (int exoid,
+ int64_t start_node_num,
+ int64_t num_nodes,
void *x_coor,
void *y_coor,
void *z_coor)
@@ -86,7 +86,8 @@ int ex_get_n_coord (int exoid,
int coordidx, coordidy, coordidz;
int numnoddim, ndimdim;
- size_t num_nod, num_dim, start[2], count[2], i;
+ size_t num_nod;
+ size_t num_dim, start[2], count[2], i;
char errmsg[MAX_ERR_LENGTH];
exerrval = 0;
@@ -106,21 +107,21 @@ int ex_get_n_coord (int exoid,
sprintf(errmsg,
"Error: failed to get number of nodes in file id %d",
exoid);
- ex_err("ex_get_n_coord",errmsg,exerrval);
+ ex_err("ex_get_partial_coord",errmsg,exerrval);
return (EX_FATAL);
}
- if (start_node_num + num_nodes -1 > (int)num_nod) {
+ if (start_node_num + num_nodes -1 > num_nod) {
exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "Error: start index (%d) + node count (%d) is larger than total number of nodes (%d) in file id %d",
- start_node_num, num_nodes, (int)num_nod, exoid);
- ex_err("ex_get_n_coord",errmsg,exerrval);
- return (EX_FATAL);
+ sprintf(errmsg,
+ "Error: start index (%"PRId64") + node count (%"PRId64") is larger than total number of nodes (%"ST_ZU") in file id %d",
+ start_node_num, num_nodes, num_nod, exoid);
+ ex_err("ex_get_partial_coord",errmsg,exerrval);
+ return (EX_FATAL);
}
if (ex_get_dimension(exoid, DIM_NUM_DIM, "dimensions",
- &num_dim, &ndimdim, "ex_get_n_coord") != NC_NOERR) {
+ &num_dim, &ndimdim, "ex_get_partial_coord") != NC_NOERR) {
return(EX_FATAL);
}
@@ -132,7 +133,7 @@ int ex_get_n_coord (int exoid,
exerrval = status;
sprintf(errmsg,
"Error: failed to locate nodal coordinates in file id %d", exoid);
- ex_err("ex_get_n_coord",errmsg,exerrval);
+ ex_err("ex_get_partial_coord",errmsg,exerrval);
return (EX_FATAL);
}
@@ -173,7 +174,7 @@ int ex_get_n_coord (int exoid,
exerrval = status;
sprintf(errmsg,
"Error: failed to get %s coord array in file id %d", which, exoid);
- ex_err("ex_get_n_coord",errmsg,exerrval);
+ ex_err("ex_get_partial_coord",errmsg,exerrval);
return (EX_FATAL);
}
}
@@ -183,7 +184,7 @@ int ex_get_n_coord (int exoid,
exerrval = status;
sprintf(errmsg,
"Error: failed to locate x nodal coordinates in file id %d", exoid);
- ex_err("ex_get_n_coord",errmsg,exerrval);
+ ex_err("ex_get_partial_coord",errmsg,exerrval);
return (EX_FATAL);
}
@@ -192,7 +193,7 @@ int ex_get_n_coord (int exoid,
exerrval = status;
sprintf(errmsg,
"Error: failed to locate y nodal coordinates in file id %d", exoid);
- ex_err("ex_get_n_coord",errmsg,exerrval);
+ ex_err("ex_get_partial_coord",errmsg,exerrval);
return (EX_FATAL);
}
} else {
@@ -204,7 +205,7 @@ int ex_get_n_coord (int exoid,
exerrval = status;
sprintf(errmsg,
"Error: failed to locate z nodal coordinates in file id %d", exoid);
- ex_err("ex_get_n_coord",errmsg,exerrval);
+ ex_err("ex_get_partial_coord",errmsg,exerrval);
return (EX_FATAL);
}
} else {
diff --git a/nemesis/ne_gneat.c b/exodus/cbind/src/ex_get_partial_elem_attr.c
similarity index 63%
rename from nemesis/ne_gneat.c
rename to exodus/cbind/src/ex_get_partial_elem_attr.c
index 08e6c23..09bc660 100644
--- a/nemesis/ne_gneat.c
+++ b/exodus/cbind/src/ex_get_partial_elem_attr.c
@@ -36,13 +36,13 @@
/*****************************************************************************/
/* Function(s) contained in this file:
*
- * ne_get_n_elem_attr()
+ * ex_get_partial_elem_attr()
*
*****************************************************************************
*
* Variable Index:
*
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* elem_blk_id - The element block ID.
* start_elem_num - The starting index of the elements to be
* obtained.
@@ -58,17 +58,14 @@
#include "exodusII.h"
#include "exodusII_int.h"
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
/*
* reads the attributes for an element block
*/
-int ne_get_n_elem_attr (int neid,
- int elem_blk_id,
- int start_elem_num,
- int num_elems,
+int ex_get_partial_elem_attr (int exoid,
+ ex_entity_id elem_blk_id,
+ int64_t start_elem_num,
+ int64_t num_elems,
void *attrib)
{
@@ -79,18 +76,18 @@ int ne_get_n_elem_attr (int neid,
exerrval = 0; /* clear error code */
/* Determine index of elem_blk_id in VAR_ID_EL_BLK array */
- if ((elem_blk_id_ndx = ex_id_lkup(neid, EX_ELEM_BLOCK, elem_blk_id)) < 0) {
+ if ((elem_blk_id_ndx = ex_id_lkup(exoid, EX_ELEM_BLOCK, elem_blk_id)) < 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no attributes found for NULL block %d in file id %d",
- elem_blk_id,neid);
- ex_err("ne_get_n_elem_attr",errmsg,EX_MSG);
+ "Warning: no attributes found for NULL block %"PRId64" in file id %d",
+ elem_blk_id,exoid);
+ ex_err("ex_get_partial_elem_attr",errmsg,EX_MSG);
return (EX_WARN); /* no attributes for this element block */
} else {
sprintf(errmsg,
- "Warning: failed to locate element block id %d in %s array in file id %d",
- elem_blk_id,VAR_ID_EL_BLK, neid);
- ex_err("ne_get_n_elem_attr",errmsg,exerrval);
+ "Warning: failed to locate element block %"PRId64" in %s array in file id %d",
+ elem_blk_id,VAR_ID_EL_BLK, exoid);
+ ex_err("ex_get_partial_elem_attr",errmsg,exerrval);
return (EX_WARN);
}
}
@@ -98,48 +95,48 @@ int ne_get_n_elem_attr (int neid,
/* inquire id's of previously defined dimensions */
- if ((status = nc_inq_dimid(neid, DIM_NUM_EL_IN_BLK(elem_blk_id_ndx), &numelbdim)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_EL_IN_BLK(elem_blk_id_ndx), &numelbdim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of elements for block %d in file id %d",
- elem_blk_id, neid);
- ex_err("ne_get_n_elem_attr",errmsg,exerrval);
+ "Error: failed to locate number of elements for block %"PRId64" in file id %d",
+ elem_blk_id, exoid);
+ ex_err("ex_get_partial_elem_attr",errmsg,exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, numelbdim, &num_elem_this_blk)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, numelbdim, &num_elem_this_blk)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of elements for block %d in file id %d",
- elem_blk_id,neid);
- ex_err("ne_get_n_elem_attr",errmsg,exerrval);
+ "Error: failed to get number of elements for block %"PRId64" in file id %d",
+ elem_blk_id,exoid);
+ ex_err("ex_get_partial_elem_attr",errmsg,exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimid(neid, DIM_NUM_ATT_IN_BLK(elem_blk_id_ndx), &numattrdim)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_ATT_IN_BLK(elem_blk_id_ndx), &numattrdim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Warning: no attributes found for block %d in file id %d",
- elem_blk_id,neid);
- ex_err("ne_get_n_elem_attr",errmsg,EX_MSG);
+ "Warning: no attributes found for block %"PRId64" in file id %d",
+ elem_blk_id,exoid);
+ ex_err("ex_get_partial_elem_attr",errmsg,EX_MSG);
return (EX_WARN); /* no attributes for this element block */
}
- if ((status = nc_inq_dimlen(neid, numattrdim, &num_attr)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, numattrdim, &num_attr)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of attributes for block %d in file id %d",
- elem_blk_id,neid);
- ex_err("ne_get_n_elem_attr",errmsg,exerrval);
+ "Error: failed to get number of attributes for block %"PRId64" in file id %d",
+ elem_blk_id,exoid);
+ ex_err("ex_get_partial_elem_attr",errmsg,exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_varid(neid, VAR_ATTRIB(elem_blk_id_ndx), &attrid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_ATTRIB(elem_blk_id_ndx), &attrid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate attributes for block %d in file id %d",
- elem_blk_id,neid);
- ex_err("ne_get_n_elem_attr",errmsg,exerrval);
+ "Error: failed to locate attributes for block %"PRId64" in file id %d",
+ elem_blk_id,exoid);
+ ex_err("ex_get_partial_elem_attr",errmsg,exerrval);
return (EX_FATAL);
}
@@ -147,9 +144,9 @@ int ne_get_n_elem_attr (int neid,
if (num_elem_this_blk < (start_elem_num + num_elems - 1)) {
exerrval = status;
sprintf(errmsg,
- "Error: requested attributes from too many elements in this block, %d",
+ "Error: requested attributes from too many elements in this block, %"PRId64"",
elem_blk_id);
- ex_err("ne_get_n_elem_attr",errmsg, exerrval);
+ ex_err("ex_get_partial_elem_attr",errmsg, exerrval);
return(EX_FATAL);
}
@@ -161,18 +158,18 @@ int ne_get_n_elem_attr (int neid,
count[0] = num_elems;
count[1] = num_attr;
- if (ex_comp_ws(neid) == 4) {
- status = nc_get_vara_float(neid, attrid, start, count, attrib);
+ if (ex_comp_ws(exoid) == 4) {
+ status = nc_get_vara_float(exoid, attrid, start, count, attrib);
} else {
- status = nc_get_vara_double(neid, attrid, start, count, attrib);
+ status = nc_get_vara_double(exoid, attrid, start, count, attrib);
}
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get attributes for block %d in file id %d",
- elem_blk_id,neid);
- ex_err("ne_get_n_elem_attr",errmsg,exerrval);
+ "Error: failed to get attributes for block %"PRId64" in file id %d",
+ elem_blk_id,exoid);
+ ex_err("ex_get_partial_elem_attr",errmsg,exerrval);
return (EX_FATAL);
}
return(EX_NOERR);
diff --git a/exodus/cbind/src/exgsp.c b/exodus/cbind/src/ex_get_partial_elem_conn.c
similarity index 59%
copy from exodus/cbind/src/exgsp.c
copy to exodus/cbind/src/ex_get_partial_elem_conn.c
index 71cbf07..5c3cc0b 100644
--- a/exodus/cbind/src/exgsp.c
+++ b/exodus/cbind/src/ex_get_partial_elem_conn.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -32,43 +32,40 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-
-/*****************************************************************************
- *
- * exgsp - ex_get_side_set_param
+/*****************************************************************************/
+/*****************************************************************************/
+/* Function(s) contained in this file:
*
- * entry conditions -
- * input parameters:
- * int exoid exodus file id
- * int side_set_id side set id
+ * ex_get_partial_elem_conn()
*
- * exit conditions -
- * int* num_side_in_set number of sides in the side set
- * int* num_dist_fact_in_set number of distribution factors in the
- * side set
+ *****************************************************************************
*
- * revision history -
+ * Variable Index:
*
+ * exoid - The NetCDF ID of an already open NemesisI file.
+ * elem_blk_id - The element block ID.
+ * start_elem_num - The starting index of the elements to be
+ * obtained.
+ * num_elems - The number of FEM elements to read coords for.
+ * connect - Pointer to the connectivity vector.
*
- *****************************************************************************/
-
+ */
+/*****************************************************************************/
+/*****************************************************************************/
+/*****************************************************************************/
#include "exodusII.h"
/*!
- * reads the number of sides and the number of distribution factors which
- * describe a single side set
- * \param exoid exodus file id
- * \param side_set_id side set id
- * \param[out] num_side_in_set number of sides in the side set
- * \param[out] num_dist_fact_in_set number of distribution factors in the
- * \deprecated Use ex_get_set_param()(exoid, EX_SIDE_SET, side_set_id, num_side_in_set, num_dist_fact_in_set)
+ * \deprecated use ex_get_partial_conn()
+ * reads the connectivity array for an element block
*/
-int ex_get_side_set_param (int exoid,
- int side_set_id,
- int *num_side_in_set,
- int *num_dist_fact_in_set)
+int ex_get_partial_elem_conn (int exoid,
+ ex_entity_id elem_blk_id,
+ int64_t start_elem_num,
+ int64_t num_elems,
+ void_int *connect)
{
- return ex_get_set_param(exoid, EX_SIDE_SET, side_set_id,
- num_side_in_set, num_dist_fact_in_set);
+ return ex_get_partial_conn(exoid, EX_ELEM_BLOCK, elem_blk_id,
+ start_elem_num, num_elems, connect, NULL, NULL);
}
diff --git a/exodus/cbind/src/exgevid.c b/exodus/cbind/src/ex_get_partial_elem_map.c
similarity index 74%
rename from exodus/cbind/src/exgevid.c
rename to exodus/cbind/src/ex_get_partial_elem_map.c
index e29c861..b71f363 100644
--- a/exodus/cbind/src/exgevid.c
+++ b/exodus/cbind/src/ex_get_partial_elem_map.c
@@ -32,31 +32,21 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-/*****************************************************************************
-*
-* exgevid - ex_get_elem_varid
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-*
-* exit conditions -
-* int* varid variable id array
-*
-* revision history -
-*
-*
-*****************************************************************************/
+#include <stdlib.h>
#include "exodusII.h"
+#include "exodusII_int.h"
-/*!
- * reads the EXODUS II variable varids from the database
- * \deprecated Use ex_get_varid()(exoid, EX_ELEM_BLOCK, varid)
+/*
+ * reads the element map with specified ID
+ * \deprecated Use ex_get_partial_num_map()(exoid, EX_ELEM_MAP, map_id, ent_start, ent_count, elem_map) instead
*/
-int ex_get_elem_varid (int exoid,
- int *varid)
+int ex_get_partial_elem_map (int exoid,
+ ex_entity_id map_id,
+ int64_t ent_start,
+ int64_t ent_count,
+ void_int *elem_map)
{
- return ex_get_varid(exoid, EX_ELEM_BLOCK, varid);
+ return ex_get_partial_num_map(exoid, EX_ELEM_MAP, map_id, ent_start, ent_count, elem_map);
}
diff --git a/nemesis/ne_gennm.c b/exodus/cbind/src/ex_get_partial_elem_num_map.c
similarity index 71%
rename from nemesis/ne_gennm.c
rename to exodus/cbind/src/ex_get_partial_elem_num_map.c
index 34d9b19..701d382 100644
--- a/nemesis/ne_gennm.c
+++ b/exodus/cbind/src/ex_get_partial_elem_num_map.c
@@ -34,13 +34,13 @@
*/
/*****************************************************************************
*
-* ne_gennm - ne_get_n_elem_num_map
+* ne_gennm - ex_get_partial_elem_num_map
*
* environment - UNIX
*
* entry conditions -
* input parameters:
-* int neid exodus file id
+* int exoid exodus file id
* int start_ent starting location for read
* int num_ents number of elemental points
*
@@ -54,41 +54,39 @@
#include "exodusII.h"
#include "exodusII_int.h"
-#include "ne_nemesisI.h"
-
/*
* reads the element numbering map from the database; allows element numbers
* to be noncontiguous
*/
-int ne_get_n_elem_num_map (int neid,
- int start_ent,
- int num_ents,
- int *elem_map)
+int ex_get_partial_elem_num_map (int exoid,
+ int64_t start_ent,
+ int64_t num_ents,
+ void_int *elem_map)
{
- int numelemdim, mapid, i, status;
+ int numelemdim, mapid, status;
+ size_t i;
size_t num_elem, start[1], count[1];
char errmsg[MAX_ERR_LENGTH];
exerrval = 0; /* clear error code */
/* inquire id's of previously defined dimensions and variables */
-
- if ((status = nc_inq_dimid (neid, DIM_NUM_ELEM, &numelemdim)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_ELEM, &numelemdim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to locate number of elements in file id %d",
- neid);
- ex_err("ne_get_n_elem_num_map",errmsg,exerrval);
+ exoid);
+ ex_err("ex_get_partial_elem_num_map",errmsg,exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen (neid, numelemdim, &num_elem)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen (exoid, numelemdim, &num_elem)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get number of elements in file id %d",
- neid);
- ex_err("ne_get_n_elem_num_map",errmsg,exerrval);
+ exoid);
+ ex_err("ex_get_partial_elem_num_map",errmsg,exerrval);
return (EX_FATAL);
}
@@ -96,15 +94,15 @@ int ne_get_n_elem_num_map (int neid,
if (start_ent < 0 || start_ent > num_elem) {
exerrval = status;
sprintf(errmsg,
- "Error: Invalid input to function ne_get_n_elem_num_map!\n");
- ex_err("ne_get_n_elem_num_map",errmsg,exerrval);
+ "Error: Invalid input to function ex_get_partial_elem_num_map!\n");
+ ex_err("ex_get_partial_elem_num_map",errmsg,exerrval);
return (EX_FATAL);
}
if (num_ents < 0) {
exerrval = status;
sprintf(errmsg, "Error: Invalid number of entries in map!\n");
- ex_err("ne_get_n_elem_num_map",errmsg,exerrval);
+ ex_err("ex_get_partial_elem_num_map",errmsg,exerrval);
return (EX_FATAL);
}
@@ -112,21 +110,29 @@ int ne_get_n_elem_num_map (int neid,
if ((start_ent + num_ents - 1) > num_elem) {
exerrval = status;
sprintf(errmsg, "Error: request range invalid!\n");
- ex_err("ne_get_n_elem_num_map",errmsg,exerrval);
+ ex_err("ex_get_partial_elem_num_map",errmsg,exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_varid (neid, VAR_ELEM_NUM_MAP, &mapid)) != NC_NOERR) {
+ if ((status = nc_inq_varid (exoid, VAR_ELEM_NUM_MAP, &mapid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Warning: elem numbering map not stored in file id %d; returning default map",
- neid);
- ex_err("ne_get_n_elem_num_map",errmsg,exerrval);
+ exoid);
+ ex_err("ex_get_partial_elem_num_map",errmsg,exerrval);
/* generate default map of 1..n, where n is num_elem */
- for (i=0; i<num_ents; i++)
- elem_map[i] = start_ent+i;
-
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ int64_t *lmap = (int64_t*)elem_map;
+ for (i=0; i<num_ents; i++) {
+ lmap[i] = start_ent+i;
+ }
+ } else {
+ int *lmap = (int*)elem_map;
+ for (i=0; i<num_ents; i++) {
+ lmap[i] = start_ent+i;
+ }
+ }
return (EX_WARN);
}
@@ -135,14 +141,18 @@ int ne_get_n_elem_num_map (int neid,
start[0] = --start_ent;
count[0] = num_ents;
- status = nc_get_vara_int (neid, mapid, start, count, elem_map);
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_get_vara_longlong(exoid, mapid, start, count, elem_map);
+ } else {
+ status = nc_get_vara_int(exoid, mapid, start, count, elem_map);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get element number map in file id %d",
- neid);
- ex_err("ne_get_n_elem_num_map",errmsg,exerrval);
+ exoid);
+ ex_err("ex_get_partial_elem_num_map",errmsg,exerrval);
return (EX_FATAL);
}
diff --git a/nemesis/ne_genv.c b/exodus/cbind/src/ex_get_partial_elem_var.c
similarity index 57%
rename from nemesis/ne_genv.c
rename to exodus/cbind/src/ex_get_partial_elem_var.c
index 472074a..e9b45a6 100644
--- a/nemesis/ne_genv.c
+++ b/exodus/cbind/src/ex_get_partial_elem_var.c
@@ -37,13 +37,13 @@
/*****************************************************************************/
/* Function(s) contained in this file:
*
- * ne_get_n_elem_var()
+ * ex_get_partial_elem_var()
*
*****************************************************************************
*
* Variable Index:
*
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* time_step - The time step to write this data to.
* elem_var_index - The index of this elemental variable.
* elem_blk_id - The ID of the element block being written to.
@@ -57,10 +57,6 @@
/*****************************************************************************/
#include "exodusII.h"
-#include "exodusII_int.h"
-
-#include "ne_nemesisI.h"
-#include "ne_nemesisI_int.h"
/*
* reads the values of a single element variable for one element block at
@@ -68,72 +64,17 @@
* element variable index is 1
*/
-int ne_get_n_elem_var (int neid,
+int ex_get_partial_elem_var (int exoid,
int time_step,
int elem_var_index,
- int elem_blk_id,
- int num_elem_this_blk,
- int start_elem_num,
- int num_elem,
+ ex_entity_id elem_blk_id,
+ int64_t num_elem_this_blk,
+ int64_t start_elem_num,
+ int64_t num_elem,
void *elem_var_vals)
{
- int varid, elem_blk_id_ndx, status;
- size_t start[2], count[2];
- char errmsg[MAX_ERR_LENGTH];
-
- exerrval = 0; /* clear error code */
-
- /* Determine index of elem_blk_id in VAR_ID_EL_BLK array */
- if ((elem_blk_id_ndx = ex_id_lkup(neid,EX_ELEM_BLOCK,elem_blk_id)) < 0) {
- if (exerrval == EX_NULLENTITY) {
- sprintf(errmsg,
- "Warning: no element variables for NULL block %d in file id %d",
- elem_blk_id,neid);
- ex_err("ne_get_n_elem_var",errmsg,EX_MSG);
- return (EX_WARN);
- } else {
- sprintf(errmsg,
- "Error: failed to locate element block id %d in %s variable in file id %d",
- elem_blk_id, VAR_ID_EL_BLK, neid);
- ex_err("ne_get_n_elem_var",errmsg,exerrval);
- return (EX_FATAL);
- }
- }
-
-
- /* inquire previously defined variable */
- if ((status = nc_inq_varid(neid,VAR_ELEM_VAR(elem_var_index,elem_blk_id_ndx), &varid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate elem var %d for elem block %d in file id %d",
- elem_var_index,elem_blk_id,neid); /* this msg needs to be improved */
- ex_err("ne_get_n_elem_var",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* read values of element variable */
- start[0] = --time_step;
- start[1] = --start_elem_num;
-
- count[0] = 1;
- if ((num_elem_this_blk - start_elem_num) > num_elem)
- count[1] = num_elem;
- else
- count[1] = num_elem_this_blk - start_elem_num;
-
- if (ex_comp_ws(neid) == 4) {
- status = nc_get_vara_float(neid, varid, start, count, elem_var_vals);
- } else {
- status = nc_get_vara_double(neid, varid, start, count, elem_var_vals);
- }
-
- if (status != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get elem var %d for block %d in file id %d",
- elem_var_index,elem_blk_id,neid);/*this msg needs to be improved*/
- ex_err("ne_get_n_elem_var",errmsg,exerrval);
- return (EX_FATAL);
- }
- return (EX_NOERR);
+ return ex_get_partial_var(exoid, time_step, EX_ELEM_BLOCK,
+ elem_var_index, elem_blk_id,
+ start_elem_num, num_elem,
+ elem_var_vals);
}
diff --git a/exodus/cbind/src/exgidm.c b/exodus/cbind/src/ex_get_partial_id_map.c
similarity index 79%
rename from exodus/cbind/src/exgidm.c
rename to exodus/cbind/src/ex_get_partial_id_map.c
index 18efe5e..0a280ac 100644
--- a/exodus/cbind/src/exgidm.c
+++ b/exodus/cbind/src/ex_get_partial_id_map.c
@@ -32,19 +32,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-/*****************************************************************************
-*
-* exgnm - ex_get_id_map
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-* int map_type type of map (node, edge, face, element)
-*
-* exit conditions -
-* int* map map
-*
-*****************************************************************************/
#include <stdlib.h>
#include "exodusII.h"
@@ -54,13 +41,16 @@
* reads the id map
*/
-int ex_get_id_map ( int exoid,
- ex_entity_type map_type,
- int* map )
+int ex_get_partial_id_map ( int exoid,
+ ex_entity_type map_type,
+ int64_t start_entity_num,
+ int64_t num_entities,
+ void_int* map )
{
int dimid, mapid, status;
size_t i;
size_t num_entries;
+ size_t start[1], count[1];
char errmsg[MAX_ERR_LENGTH];
const char* dnumentries;
const char* vmap;
@@ -92,7 +82,7 @@ int ex_get_id_map ( int exoid,
sprintf( errmsg,
"Error: Bad map type (%d) specified for file id %d",
map_type, exoid );
- ex_err( "ex_get_id_map", errmsg, exerrval );
+ ex_err( "ex_get_partial_id_map", errmsg, exerrval );
return (EX_FATAL);
}
exerrval = 0; /* clear error code */
@@ -107,27 +97,42 @@ int ex_get_id_map ( int exoid,
exerrval = status;
sprintf(errmsg,
"Error: failed to get number of %ss in file id %d", tname, exoid);
- ex_err("ex_get_id_map",errmsg,exerrval);
+ ex_err("ex_get_partial_id_map",errmsg,exerrval);
return (EX_FATAL);
}
/* generate default map of 1..n, where n is num_entries */
- for (i=0; i<num_entries; i++) {
- map[i] = (int)i+1;
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ int64_t *lmap = (int64_t*)map;
+ for (i=0; i < num_entities; i++) {
+ lmap[i] = start_entity_num+i;
+ }
+ } else {
+ int *lmap = (int*)map;
+ for (i=0; i<num_entities; i++) {
+ lmap[i] = start_entity_num+i;
+ }
}
return (EX_NOERR);
}
+ start[0] = start_entity_num-1;
+ count[0] = num_entities;
+
/* read in the id map */
- status = nc_get_var_int(exoid, mapid, map);
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_get_vara_longlong(exoid, mapid, start, count, map);
+ } else {
+ status = nc_get_vara_int(exoid, mapid, start, count, map);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get %s id map in file id %d",
tname, exoid);
- ex_err("ex_get_id_map",errmsg,exerrval);
+ ex_err("ex_get_partial_id_map",errmsg,exerrval);
return (EX_FATAL);
}
diff --git a/nemesis/ne_gnnv.c b/exodus/cbind/src/ex_get_partial_nodal_var.c
similarity index 74%
rename from nemesis/ne_gnnv.c
rename to exodus/cbind/src/ex_get_partial_nodal_var.c
index df5113a..d996668 100644
--- a/nemesis/ne_gnnv.c
+++ b/exodus/cbind/src/ex_get_partial_nodal_var.c
@@ -34,20 +34,20 @@
*/
/*****************************************************************************
*
-* exgnnv - ex_get_n_nodal_var
+* exgnnv - ex_get_partial_nodal_var
*
* environment - UNIX
*
* entry conditions -
* input parameters:
-* int neid exodus file id
+* int exoid exodus file id
* int time_step whole time step number
* int nodeal_var_index index of desired nodal variable
-* int start_node_num starting location for read
+* int start_node starting location for read
* int num_nodes number of nodal points
*
* exit conditions -
-* float* nodal_var_vals array of nodal variable values
+* float* var_vals array of nodal variable values
*
* revision history -
*
@@ -58,40 +58,41 @@
#include <exodusII.h>
#include <exodusII_int.h>
-#include "ne_nemesisI.h"
-#include "ne_nemesisI_int.h"
-
/*
* reads the values of a single nodal variable for a single time step from
* the database; assume the first time step and nodal variable index is 1
*/
-int ne_get_n_nodal_var (int neid,
+int ex_get_partial_nodal_var (int exoid,
int time_step,
int nodal_var_index,
- int start_node_num,
- int num_nodes,
- void *nodal_var_vals)
+ int64_t start_node,
+ int64_t num_nodes,
+ void *var_vals)
{
- int varid, status;
+ int varid;
+ int status;
size_t start[3], count[3];
char errmsg[MAX_ERR_LENGTH];
exerrval = 0; /* clear error code */
- if (ex_large_model(neid) == 0) {
+ /* inquire previously defined variable */
+
+ if (ex_large_model(exoid) == 0) {
/* read values of the nodal variable */
- if ((status = nc_inq_varid (neid, VAR_NOD_VAR, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_NOD_VAR, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Warning: could not find nodal variable %d in file id %d",
- nodal_var_index, neid);
- ex_err("ne_get_n_nodal_var",errmsg,exerrval);
+ "Warning: could not find nodal variables in file id %d",
+ exoid);
+ ex_err("ex_get_partial_nodal_var",errmsg,exerrval);
return (EX_WARN);
}
+
start[0] = --time_step;
start[1] = --nodal_var_index;
- start[2] = --start_node_num;
+ start[2] = --start_node;
count[0] = 1;
count[1] = 1;
@@ -100,32 +101,34 @@ int ne_get_n_nodal_var (int neid,
} else {
/* read values of the nodal variable -- stored as separate variables... */
/* Get the varid.... */
- if ((status = nc_inq_varid (neid, VAR_NOD_VAR_NEW(nodal_var_index), &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_NOD_VAR_NEW(nodal_var_index), &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Warning: could not find nodal variable %d in file id %d",
- nodal_var_index, neid);
- ex_err("ne_get_n_nodal_var",errmsg,exerrval);
+ nodal_var_index, exoid);
+ ex_err("ex_get_partial_nodal_var",errmsg,exerrval);
return (EX_WARN);
}
-
+
start[0] = --time_step;
- start[1] = --start_node_num;
+ start[1] = --start_node;
count[0] = 1;
count[1] = num_nodes;
}
- if (ex_comp_ws(neid) == 4) {
- status = nc_get_vara_float(neid, varid, start, count, nodal_var_vals);
+ if (ex_comp_ws(exoid) == 4) {
+ status = nc_get_vara_float(exoid, varid, start, count, var_vals);
} else {
- status = nc_get_vara_double(neid, varid, start, count, nodal_var_vals);
+ status = nc_get_vara_double(exoid, varid, start, count, var_vals);
}
+
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get nodal variables in file id %d", neid);
- ex_err("ne_get_n_nodal_var",errmsg,exerrval);
+ "Error: failed to get nodal variables in file id %d",
+ exoid);
+ ex_err("ex_get_partial_nodal_var",errmsg,exerrval);
return (EX_FATAL);
}
return (EX_NOERR);
diff --git a/nemesis/ne_gnnnm.c b/exodus/cbind/src/ex_get_partial_node_num_map.c
similarity index 70%
rename from nemesis/ne_gnnnm.c
rename to exodus/cbind/src/ex_get_partial_node_num_map.c
index 2f6c92b..7813006 100644
--- a/nemesis/ne_gnnnm.c
+++ b/exodus/cbind/src/ex_get_partial_node_num_map.c
@@ -34,13 +34,13 @@
*/
/*****************************************************************************
*
-* ne_gnnnm - ne_get_n_node_num_map
+* ne_gnnnm - ex_get_partial_node_num_map
*
* environment - UNIX
*
* entry conditions -
* input parameters:
-* int neid nemesis file id
+* int exoid nemesis file id
*
* exit conditions -
* int* node_map node numbering map array
@@ -55,18 +55,17 @@
#include "exodusII.h"
#include "exodusII_int.h"
-#include "ne_nemesisI.h"
-
/*
* reads the node numbering map from the database
*/
-int ne_get_n_node_num_map (int neid,
- int start_ent,
- int num_ents,
- int *node_map)
+int ex_get_partial_node_num_map (int exoid,
+ int64_t start_ent,
+ int64_t num_ents,
+ void_int *node_map)
{
- int numnodedim, mapid, i, status;
+ int numnodedim, mapid, status;
+ size_t i;
size_t num_nodes, start[1], count[1];
char errmsg[MAX_ERR_LENGTH];
@@ -74,53 +73,61 @@ int ne_get_n_node_num_map (int neid,
/* inquire id's of previously defined dimensions and variables */
- if ((status = nc_inq_dimid (neid, DIM_NUM_NODES, &numnodedim)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_NODES, &numnodedim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to locate number of nodes in file id %d",
- neid);
- ex_err("ne_get_n_node_num_map",errmsg,exerrval);
+ exoid);
+ ex_err("ex_get_partial_node_num_map",errmsg,exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, numnodedim, &num_nodes)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, numnodedim, &num_nodes)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get number of nodes in file id %d",
- neid);
- ex_err("ne_get_n_node_num_map",errmsg,exerrval);
+ exoid);
+ ex_err("ex_get_partial_node_num_map",errmsg,exerrval);
return (EX_FATAL);
}
/* Check input parameters for a valid range of numbers */
if (start_ent < 0 || start_ent > num_nodes) {
fprintf(stderr, "ERROR: Invalid input to function"
- " ne_get_n_node_num_map!\n");
- return -1;
+ " ex_get_partial_node_num_map!\n");
+ return (EX_FATAL);
}
if (num_ents < 0) {
fprintf(stderr, "ERROR: Invalid number of entries in map!\n");
- return -1;
+ return (EX_FATAL);
}
/* start_ent now starts at 1, not 0 */
if ((start_ent + num_ents - 1) > num_nodes) {
fprintf(stderr, "ERROR: request range invalid!\n");
- return -1;
+ return (EX_FATAL);
}
- if ((status = nc_inq_varid (neid, VAR_NODE_NUM_MAP, &mapid)) != NC_NOERR) {
+ if ((status = nc_inq_varid (exoid, VAR_NODE_NUM_MAP, &mapid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Warning: node numbering map not stored in file id %d; returning default map",
- neid);
- ex_err("ne_get_n_node_num_map",errmsg,exerrval);
+ exoid);
+ ex_err("ex_get_partial_node_num_map",errmsg,exerrval);
/* generate default map of 1..n, where n is num_nodes */
- for (i=0; i < num_ents; i++)
- node_map[i] = start_ent+i;
-
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ int64_t *lmap = (int64_t*)node_map;
+ for (i=0; i<num_ents; i++) {
+ lmap[i] = start_ent+i;
+ }
+ } else {
+ int *lmap = (int*)node_map;
+ for (i=0; i<num_ents; i++) {
+ lmap[i] = start_ent+i;
+ }
+ }
return (EX_WARN);
}
@@ -128,14 +135,18 @@ int ne_get_n_node_num_map (int neid,
start[0] = --start_ent;
count[0] = num_ents;
- status = nc_get_vara_int(neid, mapid, start, count, node_map);
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_get_vara_longlong(exoid, mapid, start, count, node_map);
+ } else {
+ status = nc_get_vara_int(exoid, mapid, start, count, node_map);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get node numbering map in file id %d",
- neid);
- ex_err("ne_get_n_node_num_map",errmsg,exerrval);
+ exoid);
+ ex_err("ex_get_partial_node_num_map",errmsg,exerrval);
return (EX_FATAL);
}
return(EX_NOERR);
diff --git a/nemesis/ne_gnns.c b/exodus/cbind/src/ex_get_partial_node_set.c
similarity index 67%
rename from nemesis/ne_gnns.c
rename to exodus/cbind/src/ex_get_partial_node_set.c
index 393286c..739d37e 100644
--- a/nemesis/ne_gnns.c
+++ b/exodus/cbind/src/ex_get_partial_node_set.c
@@ -36,13 +36,13 @@
/*****************************************************************************/
/* Function(s) contained in this file:
*
- * ne_get_n_node_set()
+ * ex_get_partial_node_set()
*
*****************************************************************************
*
* Variable Index:
*
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* node_set_id - ID of node set to read.
* start_node_num - The starting index of the nodes to be read.
* num_nodes - The number of nodes to read in.
@@ -57,18 +57,15 @@
#include "exodusII.h"
#include "exodusII_int.h"
-#include "ne_nemesisI.h"
-#include "ne_nemesisI_int.h"
-
/*
* reads the node list for a single node set
*/
-int ne_get_n_node_set (int neid,
- int node_set_id,
- int start_node_num,
- int num_nodes,
- int *node_set_node_list)
+int ex_get_partial_node_set (int exoid,
+ ex_entity_id node_set_id,
+ int64_t start_node_num,
+ int64_t num_nodes,
+ void_int *node_set_node_list)
{
int dimid, node_list_id, node_set_id_ndx, status;
size_t num_nodes_in_set, start[1], count[1];
@@ -78,49 +75,49 @@ int ne_get_n_node_set (int neid,
/* first check if any node sets are specified */
- if ((status = nc_inq_dimid (neid, DIM_NUM_NS, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_NS, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Warning: no node sets defined in file id %d",
- neid);
- ex_err("ne_get_n_node_set",errmsg,exerrval);
+ exoid);
+ ex_err("ex_get_partial_node_set",errmsg,exerrval);
return (EX_WARN);
}
/* Lookup index of node set id in VAR_NS_IDS array */
- if ((node_set_id_ndx = ex_id_lkup(neid, EX_NODE_SET, node_set_id)) < 0) {
+ if ((node_set_id_ndx = ex_id_lkup(exoid, EX_NODE_SET, node_set_id)) < 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: node set %d is NULL in file id %d",
- node_set_id,neid);
- ex_err("ne_get_n_node_set",errmsg,EX_MSG);
+ "Warning: node set %"PRId64" is NULL in file id %d",
+ node_set_id,exoid);
+ ex_err("ex_get_partial_node_set",errmsg,EX_MSG);
return (EX_WARN);
} else {
sprintf(errmsg,
- "Error: failed to locate node set id %d in %s in file id %d",
- node_set_id,VAR_NS_IDS,neid);
- ex_err("ne_get_n_node_set",errmsg,exerrval);
+ "Error: failed to locate node set %"PRId64" in %s in file id %d",
+ node_set_id,VAR_NS_IDS,exoid);
+ ex_err("ex_get_partial_node_set",errmsg,exerrval);
return (EX_FATAL);
}
}
/* inquire id's of previously defined dimensions and variables */
- if ((status = nc_inq_dimid (neid, DIM_NUM_NOD_NS(node_set_id_ndx), &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_NOD_NS(node_set_id_ndx), &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of nodes in node set %d in file id %d",
- node_set_id,neid);
- ex_err("ne_get_n_node_set",errmsg,exerrval);
+ "Error: failed to locate number of nodes in node set %"PRId64" in file id %d",
+ node_set_id,exoid);
+ ex_err("ex_get_partial_node_set",errmsg,exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid, &num_nodes_in_set)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &num_nodes_in_set)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of nodes in set %d in file id %d",
- node_set_id, neid);
- ex_err("ne_get_n_node_set",errmsg,exerrval);
+ "Error: failed to get number of nodes in set %"PRId64" in file id %d",
+ node_set_id, exoid);
+ ex_err("ex_get_partial_node_set",errmsg,exerrval);
return (EX_FATAL);
}
@@ -128,14 +125,14 @@ int ne_get_n_node_set (int neid,
if (start_node_num < 0 || start_node_num > num_nodes_in_set) {
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: Invalid input");
- ex_err("ne_get_n_node_set",errmsg,exerrval);
+ ex_err("ex_get_partial_node_set",errmsg,exerrval);
return (EX_FATAL);
}
if (num_nodes < 0) {
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: Invalid number of nodes in nodes set!");
- ex_err("ne_get_n_node_set",errmsg,exerrval);
+ ex_err("ex_get_partial_node_set",errmsg,exerrval);
return (EX_FATAL);
}
@@ -143,16 +140,16 @@ int ne_get_n_node_set (int neid,
if ((start_node_num + num_nodes - 1) > num_nodes_in_set) {
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: request larger than number of nodes in set!");
- ex_err("ne_get_n_node_set",errmsg,exerrval);
+ ex_err("ex_get_partial_node_set",errmsg,exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_varid (neid, VAR_NODE_NS(node_set_id_ndx), &node_list_id)) != NC_NOERR) {
+ if ((status = nc_inq_varid (exoid, VAR_NODE_NS(node_set_id_ndx), &node_list_id)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate node set %d node list in file id %d",
- node_set_id,neid);
- ex_err("ne_get_n_node_set",errmsg,exerrval);
+ "Error: failed to locate node set %"PRId64" node list in file id %d",
+ node_set_id,exoid);
+ ex_err("ex_get_partial_node_set",errmsg,exerrval);
return (EX_FATAL);
}
@@ -160,14 +157,18 @@ int ne_get_n_node_set (int neid,
start[0] = --start_node_num;
count[0] = num_nodes;
- status = nc_get_vara_int(neid, node_list_id, start, count, node_set_node_list);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_get_vara_longlong(exoid, node_list_id, start, count, node_set_node_list);
+ } else {
+ status = nc_get_vara_int(exoid, node_list_id, start, count, node_set_node_list);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get node set node list in file id %d",
- neid);
- ex_err("ne_get_n_node_set",errmsg,exerrval);
+ exoid);
+ ex_err("ex_get_partial_node_set",errmsg,exerrval);
return (EX_FATAL);
}
return (EX_NOERR);
diff --git a/nemesis/ne_gnnsd.c b/exodus/cbind/src/ex_get_partial_node_set_df.c
similarity index 68%
rename from nemesis/ne_gnnsd.c
rename to exodus/cbind/src/ex_get_partial_node_set_df.c
index 0a6609e..ebcf832 100644
--- a/nemesis/ne_gnnsd.c
+++ b/exodus/cbind/src/ex_get_partial_node_set_df.c
@@ -37,13 +37,13 @@
/*****************************************************************************/
/* Function(s) contained in this file:
*
- * ne_get_n_node_set_df()
+ * ex_get_partial_node_set_df()
*
*****************************************************************************
*
* Variable Index:
*
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* node_set_id - ID of node set to read.
* start_num - The starting index of the dist fact to be read.
* num_df_to_get - The number of distribution factors to read in.
@@ -58,17 +58,14 @@
#include "exodusII.h"
#include "exodusII_int.h"
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
/*
* reads the distribution factors for a single node set
*/
-int ne_get_n_node_set_df (int neid,
- int node_set_id,
- int start_num,
- int num_df_to_get,
+int ex_get_partial_node_set_df (int exoid,
+ ex_entity_id node_set_id,
+ int64_t start_num,
+ int64_t num_df_to_get,
void *node_set_dist_fact)
{
int status;
@@ -80,50 +77,49 @@ int ne_get_n_node_set_df (int neid,
/* first check if any node sets are specified */
- if ((status = nc_inq_dimid (neid, DIM_NUM_NS, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_NS, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Warning: no node sets defined in file id %d",
- neid);
- ex_err("ne_get_n_node_set_df",errmsg,exerrval);
+ exoid);
+ ex_err("ex_get_partial_node_set_df",errmsg,exerrval);
return (EX_WARN);
}
/* Lookup index of node set id in VAR_NS_IDS array */
- if ((node_set_id_ndx = ex_id_lkup(neid,EX_NODE_SET,node_set_id)) < 0) {
+ if ((node_set_id_ndx = ex_id_lkup(exoid,EX_NODE_SET,node_set_id)) < 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: node set %d is NULL in file id %d",
- node_set_id,neid);
- ex_err("ne_get_n_node_set_df",errmsg,EX_MSG);
+ "Warning: node set %"PRId64" is NULL in file id %d",
+ node_set_id,exoid);
+ ex_err("ex_get_partial_node_set_df",errmsg,EX_MSG);
return (EX_WARN);
} else {
sprintf(errmsg,
- "Error: failed to locate node set id %d in %s in file id %d",
- node_set_id,VAR_NS_IDS,neid);
- ex_err("ne_get_n_node_set_df",errmsg,exerrval);
+ "Error: failed to locate node set %"PRId64" in %s in file id %d",
+ node_set_id,VAR_NS_IDS,exoid);
+ ex_err("ex_get_partial_node_set_df",errmsg,exerrval);
return (EX_FATAL);
}
}
/* inquire id's of previously defined dimensions and variables */
-
- if ((status = nc_inq_dimid (neid, DIM_NUM_NOD_NS(node_set_id_ndx), &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_NOD_NS(node_set_id_ndx), &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of nodes in node set %d in file id %d",
- node_set_id,neid);
- ex_err("ne_get_n_node_set_df",errmsg,exerrval);
+ "Error: failed to locate number of nodes in node set %"PRId64" in file id %d",
+ node_set_id,exoid);
+ ex_err("ex_get_partial_node_set_df",errmsg,exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid, &num_nodes_in_set)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &num_nodes_in_set)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of nodes in node set %d in file id %d",
- node_set_id, neid);
- ex_err("ne_get_n_node_set_df",errmsg,exerrval);
+ "Error: failed to get number of nodes in node set %"PRId64" in file id %d",
+ node_set_id, exoid);
+ ex_err("ex_get_partial_node_set_df",errmsg,exerrval);
return (EX_FATAL);
}
@@ -131,14 +127,14 @@ int ne_get_n_node_set_df (int neid,
if (start_num < 0 || start_num > num_nodes_in_set) {
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: Invalid input");
- ex_err("ne_get_n_node_set_df",errmsg,exerrval);
+ ex_err("ex_get_partial_node_set_df",errmsg,exerrval);
return (EX_FATAL);
}
if (num_df_to_get < 0) {
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: Invalid number of nodes in nodes set!");
- ex_err("ne_get_n_node_set_df",errmsg,exerrval);
+ ex_err("ex_get_partial_node_set_df",errmsg,exerrval);
return (EX_FATAL);
}
@@ -146,16 +142,16 @@ int ne_get_n_node_set_df (int neid,
if ((start_num + num_df_to_get - 1) > num_nodes_in_set) {
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: request larger than number of nodes in set!");
- ex_err("ne_get_n_node_set_df",errmsg,exerrval);
+ ex_err("ex_get_partial_node_set_df",errmsg,exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_varid (neid, VAR_FACT_NS(node_set_id_ndx), &dist_id)) != NC_NOERR) {
+ if ((status = nc_inq_varid (exoid, VAR_FACT_NS(node_set_id_ndx), &dist_id)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Warning: dist factors not stored for node set %d in file id %d",
- node_set_id,neid);
- ex_err("ne_get_n_node_set_df",errmsg,exerrval);
+ "Warning: dist factors not stored for node set %"PRId64" in file id %d",
+ node_set_id,exoid);
+ ex_err("ex_get_partial_node_set_df",errmsg,exerrval);
return (EX_WARN); /* complain - but not too loud */
}
@@ -164,18 +160,18 @@ int ne_get_n_node_set_df (int neid,
start[0] = --start_num;
count[0] = num_df_to_get;
- if (ex_comp_ws(neid) == 4) {
- status = nc_get_vara_float(neid, dist_id, start, count, node_set_dist_fact);
+ if (ex_comp_ws(exoid) == 4) {
+ status = nc_get_vara_float(exoid, dist_id, start, count, node_set_dist_fact);
} else {
- status = nc_get_vara_double(neid, dist_id, start, count, node_set_dist_fact);
+ status = nc_get_vara_double(exoid, dist_id, start, count, node_set_dist_fact);
}
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get distribution factors in file id %d",
- neid);
- ex_err("ne_get_n_node_set_df",errmsg,exerrval);
+ exoid);
+ ex_err("ex_get_partial_node_set_df",errmsg,exerrval);
return (EX_FATAL);
}
return (EX_NOERR);
diff --git a/exodus/cbind/src/exgpem.c b/exodus/cbind/src/ex_get_partial_num_map.c
similarity index 59%
rename from exodus/cbind/src/exgpem.c
rename to exodus/cbind/src/ex_get_partial_num_map.c
index 15b4d26..7905ce6 100644
--- a/exodus/cbind/src/exgpem.c
+++ b/exodus/cbind/src/ex_get_partial_num_map.c
@@ -59,38 +59,65 @@
* reads the element map with specified ID
*/
-int ex_get_partial_elem_map (int exoid,
- int map_id,
- int ent_start,
- int ent_count,
- int *elem_map)
+int ex_get_partial_num_map (int exoid,
+ ex_entity_type map_type,
+ ex_entity_id map_id,
+ int64_t ent_start,
+ int64_t ent_count,
+ void_int *map)
{
int dimid, var_id, id_ndx, status;
- size_t num_elem, start[1], count[1];
+ size_t num_mobj, start[1], count[1];
char errmsg[MAX_ERR_LENGTH];
+ const char* dim_map_size;
+ const char* dim_num_maps;
+
+ switch (map_type) {
+ case EX_NODE_MAP:
+ dim_map_size = DIM_NUM_NODES;
+ dim_num_maps = DIM_NUM_NM;
+ break;
+ case EX_EDGE_MAP:
+ dim_map_size = DIM_NUM_EDGE;
+ dim_num_maps = DIM_NUM_EDM;
+ break;
+ case EX_FACE_MAP:
+ dim_map_size = DIM_NUM_FACE;
+ dim_num_maps = DIM_NUM_FAM;
+ break;
+ case EX_ELEM_MAP:
+ dim_map_size = DIM_NUM_ELEM;
+ dim_num_maps = DIM_NUM_EM;
+ break;
+ default:
+ exerrval = EX_BADPARAM;
+ sprintf( errmsg, "Bad map type (%d) specified", map_type );
+ ex_err( "ex_get_partial_num_map", errmsg, exerrval );
+ return (EX_FATAL);
+ }
exerrval = 0; /* clear error code */
/* See if file contains any elements...*/
- if (nc_inq_dimid (exoid, DIM_NUM_ELEM, &dimid) != NC_NOERR) {
+ if (nc_inq_dimid (exoid, dim_map_size, &dimid) != NC_NOERR) {
return (EX_NOERR);
}
- if ((status = nc_inq_dimlen(exoid, dimid, &num_elem)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &num_mobj)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of elements in file id %d", exoid);
- ex_err("ex_get_partial_elem_map",errmsg,exerrval);
+ "Error: failed to get number of mesh objects in file id %d", exoid);
+ ex_err("ex_get_partial_num_map",errmsg,exerrval);
return (EX_FATAL);
}
/* Check input parameters for a valid range of numbers */
- if (ent_start <= 0 || ent_start > (int)num_elem) {
+ if (ent_start <= 0 || ent_start > (int)num_mobj) {
exerrval = EX_FATAL;
sprintf(errmsg,
"Error: start count is invalid in file id %d",
exoid);
- ex_err("ex_get_partial_elem_map",errmsg,exerrval);
+ ex_err("ex_get_partial_num_map",errmsg,exerrval);
return (EX_FATAL);
}
@@ -99,61 +126,65 @@ int ex_get_partial_elem_map (int exoid,
sprintf(errmsg,
"Error: Invalid count value in file id %d",
exoid);
- ex_err("ex_get_partial_elem_map",errmsg,exerrval);
+ ex_err("ex_get_partial_num_map",errmsg,exerrval);
return (EX_FATAL);
}
- if (ent_start+ent_count-1 > (int)num_elem) {
+ if (ent_start+ent_count-1 > (int)num_mobj) {
exerrval = EX_FATAL;
sprintf(errmsg,
"Error: start+count-1 is larger than element count in file id %d",
exoid);
- ex_err("ex_get_partial_elem_map",errmsg,exerrval);
+ ex_err("ex_get_partial_num_map",errmsg,exerrval);
return (EX_FATAL);
}
- /* first check if any element maps have been defined */
- if ((status = nc_inq_dimid (exoid, DIM_NUM_EM, &dimid)) != NC_NOERR) {
+ /* first check if any maps have been defined */
+ if ((status = nc_inq_dimid (exoid, dim_num_maps, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Warning: no element maps defined in file id %d",
- exoid);
- ex_err("ex_get_partial_elem_map",errmsg,exerrval);
+ "Warning: no %ss defined in file id %d",
+ ex_name_of_object(map_type), exoid);
+ ex_err("ex_get_partial_num_map",errmsg,exerrval);
return (EX_WARN);
}
/* Lookup index of element map id property array */
- id_ndx = ex_id_lkup(exoid,EX_ELEM_MAP,map_id);
+ id_ndx = ex_id_lkup(exoid,map_type,map_id);
if (exerrval != 0) {
sprintf(errmsg,
- "Error: failed to locate element map id %d in %s in file id %d",
- map_id,VAR_EM_PROP(1),exoid);
- ex_err("ex_get_partial_elem_map",errmsg,exerrval);
+ "Error: failed to locate %s id %"PRId64" in id variable in file id %d",
+ ex_name_of_object(map_type),map_id,exoid);
+ ex_err("ex_get_partial_num_map",errmsg,exerrval);
return (EX_FATAL);
}
/* inquire id's of previously defined dimensions and variables */
- if ((status = nc_inq_varid(exoid, VAR_ELEM_MAP(id_ndx), &var_id)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, ex_name_of_map(map_type,id_ndx), &var_id)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate element map %d in file id %d",
- map_id,exoid);
- ex_err("ex_get_partial_elem_map",errmsg,exerrval);
+ "Error: failed to locate %s %"PRId64" in file id %d",
+ ex_name_of_object(map_type),map_id,exoid);
+ ex_err("ex_get_partial_num_map",errmsg,exerrval);
return (EX_FATAL);
}
- /* read in the element map */
+ /* read in the map */
start[0] = ent_start-1;
count[0] = ent_count;
- status = nc_get_vara_int(exoid, var_id, start, count, elem_map);
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_get_vara_longlong(exoid, var_id, start, count, map);
+ } else {
+ status = nc_get_vara_int(exoid, var_id, start, count, map);
+ }
if (status == -1) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get element map in file id %d",
- exoid);
- ex_err("ex_get_partial_elem_map",errmsg,exerrval);
+ "Error: failed to get %s in file id %d",
+ ex_name_of_object(map_type),exoid);
+ ex_err("ex_get_partial_num_map",errmsg,exerrval);
return (EX_FATAL);
}
return (EX_NOERR);
diff --git a/exodus/cbind/src/exgnoatt.c b/exodus/cbind/src/ex_get_partial_one_attr.c
similarity index 84%
rename from exodus/cbind/src/exgnoatt.c
rename to exodus/cbind/src/ex_get_partial_one_attr.c
index 246e35b..6ed7075 100644
--- a/exodus/cbind/src/exgnoatt.c
+++ b/exodus/cbind/src/ex_get_partial_one_attr.c
@@ -34,7 +34,7 @@
*/
/*****************************************************************************
*
-* exgeat - ex_get_n_one_attr
+* exgeat - ex_get_partial_one_attr
*
* entry conditions -
* input parameters:
@@ -67,11 +67,11 @@
*/
/*
*/
-int ex_get_n_one_attr( int exoid,
+int ex_get_partial_one_attr( int exoid,
ex_entity_type obj_type,
- int obj_id,
- int start_num,
- int num_ent,
+ ex_entity_id obj_id,
+ int64_t start_num,
+ int64_t num_ent,
int attrib_index,
void* attrib )
@@ -89,21 +89,23 @@ int ex_get_n_one_attr( int exoid,
exerrval = 0; /* clear error code */
+ if (num_ent == 0)
+ return 0;
/* Determine index of obj_id in vobjids array */
if (obj_type != EX_NODAL) {
obj_id_ndx = ex_id_lkup(exoid,obj_type,obj_id);
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no attributes found for NULL %s %d in file id %d",
+ "Warning: no attributes found for NULL %s %"PRId64" in file id %d",
ex_name_of_object(obj_type),obj_id,exoid);
- ex_err("ex_get_n_one_attr",errmsg,EX_MSG);
+ ex_err("ex_get_partial_one_attr",errmsg,EX_MSG);
return (EX_WARN); /* no attributes for this object */
} else {
sprintf(errmsg,
- "Warning: failed to locate %s id %d in id array in file id %d",
+ "Warning: failed to locate %s id%"PRId64" in id array in file id %d",
ex_name_of_object(obj_type),obj_id, exoid);
- ex_err("ex_get_n_one_attr",errmsg,exerrval);
+ ex_err("ex_get_partial_one_attr",errmsg,exerrval);
return (EX_WARN);
}
}
@@ -160,41 +162,41 @@ int ex_get_n_one_attr( int exoid,
sprintf(errmsg,
"Internal Error: unrecognized object type in switch: %d in file id %d",
obj_type,exoid);
- ex_err("ex_get_n_one_attr",errmsg,EX_MSG);
+ ex_err("ex_get_partial_one_attr",errmsg,EX_MSG);
return (EX_FATAL); /* number of attributes not defined */
}
/* inquire id's of previously defined dimensions */
- if (ex_get_dimension(exoid, dnumobjent,"entries", &num_entries_this_obj, &temp, "ex_get_n_one_attr") != NC_NOERR)
+ if (ex_get_dimension(exoid, dnumobjent,"entries", &num_entries_this_obj, &temp, "ex_get_partial_one_attr") != NC_NOERR)
return EX_FATAL;
- if (start_num + num_ent -1 > (int)num_entries_this_obj) {
+ if (start_num + num_ent -1 > num_entries_this_obj) {
exerrval = EX_BADPARAM;
sprintf(errmsg,
- "Error: start index (%d) + count (%d) is larger than total number of entities (%d) in file id %d",
- start_num, num_ent, (int)num_entries_this_obj, exoid);
- ex_err("ex_get_n_one_attr",errmsg,exerrval);
+ "Error: start index (%"PRId64") + count (%"PRId64") is larger than total number of entities (%"ST_ZU") in file id %d",
+ start_num, num_ent, num_entries_this_obj, exoid);
+ ex_err("ex_get_partial_one_attr",errmsg,exerrval);
return (EX_FATAL);
}
- if (ex_get_dimension(exoid, dnumobjatt,"attributes", &num_attr, &temp, "ex_get_n_one_attr") != NC_NOERR)
+ if (ex_get_dimension(exoid, dnumobjatt,"attributes", &num_attr, &temp, "ex_get_partial_one_attr") != NC_NOERR)
return EX_FATAL;
if (attrib_index < 1 || attrib_index > (int)num_attr) {
exerrval = EX_FATAL;
sprintf(errmsg,
- "Error: Invalid attribute index specified: %d. Valid range is 1 to %d for %s %d in file id %d",
+ "Error: Invalid attribute index specified: %d. Valid range is 1 to %d for %s %"PRId64" in file id %d",
attrib_index, (int)num_attr, ex_name_of_object(obj_type), obj_id, exoid);
- ex_err("ex_get_n_one_attr",errmsg,exerrval);
+ ex_err("ex_get_partial_one_attr",errmsg,exerrval);
return (EX_FATAL);
}
if ((status = nc_inq_varid(exoid, vattrbname, &attrid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate attributes for %s %d in file id %d",
+ "Error: failed to locate attributes for %s %"PRId64" in file id %d",
ex_name_of_object(obj_type),obj_id,exoid);
- ex_err("ex_get_n_one_attr",errmsg,exerrval);
+ ex_err("ex_get_partial_one_attr",errmsg,exerrval);
return (EX_FATAL);
}
@@ -218,9 +220,9 @@ int ex_get_n_one_attr( int exoid,
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get attribute %d for %s %d in file id %d",
+ "Error: failed to get attribute %d for %s %"PRId64" in file id %d",
attrib_index, ex_name_of_object(obj_type), obj_id,exoid);
- ex_err("ex_get_n_one_attr",errmsg,exerrval);
+ ex_err("ex_get_partial_one_attr",errmsg,exerrval);
return (EX_FATAL);
}
return(EX_NOERR);
diff --git a/exodus/cbind/src/exgsetd.c b/exodus/cbind/src/ex_get_partial_set_dist_fact.c
similarity index 73%
copy from exodus/cbind/src/exgsetd.c
copy to exodus/cbind/src/ex_get_partial_set_dist_fact.c
index 66c15d9..dc913dd 100644
--- a/exodus/cbind/src/exgsetd.c
+++ b/exodus/cbind/src/ex_get_partial_set_dist_fact.c
@@ -32,23 +32,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-/*****************************************************************************
-*
-* exgssd - ex_get_set_dist_fact
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-* int set_type type of set
-* int set_id set id
-*
-* exit conditions -
-* float* set_dist_fact array of dist factors for set
-*
-* revision history -
-*
-*
-*****************************************************************************/
#include "exodusII.h"
#include "exodusII_int.h"
@@ -57,14 +40,17 @@
* reads the distribution factors for a single set
*/
-int ex_get_set_dist_fact (int exoid,
- ex_entity_type set_type,
- int set_id,
- void *set_dist_fact)
+int ex_get_partial_set_dist_fact (int exoid,
+ ex_entity_type set_type,
+ ex_entity_id set_id,
+ int64_t offset,
+ int64_t num_to_put,
+ void *set_dist_fact)
{
int dimid, dist_id, set_id_ndx;
int status;
+ size_t start[1], count[1];
char errmsg[MAX_ERR_LENGTH];
char* factptr = NULL;
@@ -76,7 +62,7 @@ int ex_get_set_dist_fact (int exoid,
sprintf(errmsg,
"Warning: no %s sets stored in file id %d",
ex_name_of_object(set_type), exoid);
- ex_err("ex_get_set_dist_fact",errmsg,exerrval);
+ ex_err("ex_get_partial_set_dist_fact",errmsg,exerrval);
return (EX_WARN);
}
@@ -85,15 +71,15 @@ int ex_get_set_dist_fact (int exoid,
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: %s set %d is NULL in file id %d",
+ "Warning: %s set %"PRId64" is NULL in file id %d",
ex_name_of_object(set_type), set_id,exoid);
- ex_err("ex_get_set_dist_fact",errmsg,EX_MSG);
+ ex_err("ex_get_partial_set_dist_fact",errmsg,EX_MSG);
return (EX_WARN);
} else {
sprintf(errmsg,
- "Error: failed to locate %s set id %d in VAR_*S_IDS array in file id %d",
+ "Error: failed to locate %s set %"PRId64" in VAR_*S_IDS array in file id %d",
ex_name_of_object(set_type), set_id,exoid);
- ex_err("ex_get_set_dist_fact",errmsg,exerrval);
+ ex_err("ex_get_partial_set_dist_fact",errmsg,exerrval);
return (EX_FATAL);
}
}
@@ -121,34 +107,36 @@ int ex_get_set_dist_fact (int exoid,
/* not an error for node sets because this is how we check that df's exist */
if (set_type == EX_NODE_SET) {
sprintf(errmsg,
- "Warning: dist factors not stored for %s set %d in file id %d",
+ "Warning: dist factors not stored for %s set %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id, exoid);
- ex_err("ex_get_set_dist_fact",errmsg,exerrval);
+ ex_err("ex_get_partial_set_dist_fact",errmsg,exerrval);
return (EX_WARN); /* complain - but not too loud */
}
/* is an error for other sets */
else {
sprintf(errmsg,
- "Error: failed to locate dist factors list for %s set %d in file id %d",
+ "Error: failed to locate dist factors list for %s set %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
- ex_err("ex_get_set_dist_fact",errmsg,exerrval);
+ ex_err("ex_get_partial_set_dist_fact",errmsg,exerrval);
return (EX_FATAL);
}
}
/* read in the distribution factors array */
+ start[0] = offset-1;
+ count[0] = num_to_put;
if (ex_comp_ws(exoid) == 4) {
- status = nc_get_var_float(exoid, dist_id, set_dist_fact);
+ status = nc_get_vara_float(exoid, dist_id, start, count, set_dist_fact);
} else {
- status = nc_get_var_double(exoid, dist_id, set_dist_fact);
+ status = nc_get_vara_double(exoid, dist_id, start, count, set_dist_fact);
}
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get dist factors list for %s set %d in file id %d",
+ "Error: failed to get dist factors list for %s set %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
- ex_err("ex_get_set_dist_fact",errmsg,exerrval);
+ ex_err("ex_get_partial_set_dist_fact",errmsg,exerrval);
return (EX_FATAL);
}
return (EX_NOERR);
diff --git a/nemesis/ne_gnss.c b/exodus/cbind/src/ex_get_partial_side_set.c
similarity index 62%
rename from nemesis/ne_gnss.c
rename to exodus/cbind/src/ex_get_partial_side_set.c
index b71d307..fb94201 100644
--- a/nemesis/ne_gnss.c
+++ b/exodus/cbind/src/ex_get_partial_side_set.c
@@ -37,13 +37,13 @@
/*****************************************************************************/
/* Function(s) contained in this file:
*
- * ne_get_n_side_set()
+ * ex_get_partial_side_set()
*
*****************************************************************************
*
* Variable Index:
*
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* side_set_id - ID of side set to read.
* start_side_num - The starting index of the sides to be read.
* num_sides - The number of sides to read in.
@@ -59,19 +59,16 @@
#include "exodusII.h"
#include "exodusII_int.h"
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
/*
* reads the side set element list and side set side list for a single side set
*/
-int ne_get_n_side_set (int neid,
- int side_set_id,
- int start_side_num,
- int num_sides,
- int *side_set_elem_list,
- int *side_set_side_list)
+int ex_get_partial_side_set (int exoid,
+ ex_entity_id side_set_id,
+ int64_t start_side_num,
+ int64_t num_sides,
+ void_int *side_set_elem_list,
+ void_int *side_set_side_list)
{
int dimid, elem_list_id, side_list_id, status;
@@ -82,70 +79,67 @@ int ne_get_n_side_set (int neid,
exerrval = 0; /* clear error code */
/* first check if any side sets are specified */
-
- if ((status = nc_inq_dimid (neid, DIM_NUM_SS, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_SS, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Warning: no side sets stored in file id %d",
- neid);
- ex_err("ne_get_n_side_set",errmsg,exerrval);
+ exoid);
+ ex_err("ex_get_partial_side_set",errmsg,exerrval);
return (EX_WARN);
}
/* Lookup index of side set id in VAR_SS_IDS array */
-
- if ((side_set_id_ndx = ex_id_lkup(neid, EX_SIDE_SET, side_set_id)) < 0) {
+ if ((side_set_id_ndx = ex_id_lkup(exoid, EX_SIDE_SET, side_set_id)) < 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: side set %d is NULL in file id %d",
- side_set_id,neid);
- ex_err("ne_get_n_side_set",errmsg,EX_MSG);
+ "Warning: side set %"PRId64" is NULL in file id %d",
+ side_set_id,exoid);
+ ex_err("ex_get_partial_side_set",errmsg,EX_MSG);
return (EX_WARN);
} else {
sprintf(errmsg,
- "Error: failed to locate side set id %d in %s array in file id %d",
- side_set_id, VAR_SS_IDS, neid);
- ex_err("ne_get_n_side_set",errmsg,exerrval);
+ "Error: failed to locate side set id %"PRId64" in %s array in file id %d",
+ side_set_id, VAR_SS_IDS, exoid);
+ ex_err("ex_get_partial_side_set",errmsg,exerrval);
return (EX_FATAL);
}
}
/* inquire id's of previously defined dimensions and variables */
-
- if ((status = nc_inq_dimid (neid, DIM_NUM_SIDE_SS(side_set_id_ndx), &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_SIDE_SS(side_set_id_ndx), &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of sides in side set %d in file id %d",
- side_set_id,neid);
- ex_err("ne_get_n_side_set",errmsg,exerrval);
+ "Error: failed to locate number of sides in side set %"PRId64" in file id %d",
+ side_set_id,exoid);
+ ex_err("ex_get_partial_side_set",errmsg,exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid, &num_side_in_set)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &num_side_in_set)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of sides in side set %d in file id %d",
- side_set_id,neid);
- ex_err("ne_get_n_side_set",errmsg,exerrval);
+ "Error: failed to get number of sides in side set %"PRId64" in file id %d",
+ side_set_id,exoid);
+ ex_err("ex_get_partial_side_set",errmsg,exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_varid(neid, VAR_ELEM_SS(side_set_id_ndx), &elem_list_id)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_ELEM_SS(side_set_id_ndx), &elem_list_id)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate element list for side set %d in file id %d",
- side_set_id,neid);
- ex_err("ne_get_n_side_set",errmsg,exerrval);
+ "Error: failed to locate element list for side set %"PRId64" in file id %d",
+ side_set_id,exoid);
+ ex_err("ex_get_partial_side_set",errmsg,exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_varid (neid, VAR_SIDE_SS(side_set_id_ndx), &side_list_id)) != NC_NOERR) {
+ if ((status = nc_inq_varid (exoid, VAR_SIDE_SS(side_set_id_ndx), &side_list_id)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate side list for side set %d in file id %d",
- side_set_id,neid);
- ex_err("ne_get_n_side_set",errmsg,exerrval);
+ "Error: failed to locate side list for side set %"PRId64" in file id %d",
+ side_set_id,exoid);
+ ex_err("ex_get_partial_side_set",errmsg,exerrval);
return (EX_FATAL);
}
@@ -153,14 +147,14 @@ int ne_get_n_side_set (int neid,
if (start_side_num < 0 || start_side_num > num_side_in_set) {
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: Invalid input");
- ex_err("ne_get_n_side_set",errmsg,exerrval);
+ ex_err("ex_get_partial_side_set",errmsg,exerrval);
return (EX_FATAL);
}
if (num_sides < 0) {
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: Invalid number of elements in side set!");
- ex_err("ne_get_n_side_set",errmsg,exerrval);
+ ex_err("ex_get_partial_side_set",errmsg,exerrval);
return (EX_FATAL);
}
@@ -168,34 +162,41 @@ int ne_get_n_side_set (int neid,
if ((start_side_num + num_sides - 1) > num_side_in_set) {
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: request larger than number of elements in set!");
- ex_err("ne_get_n_side_set",errmsg,exerrval);
+ ex_err("ex_get_partial_side_set",errmsg,exerrval);
return (EX_FATAL);
}
/* read in the element list and side list arrays */
-
start[0] = --start_side_num;
count[0] = num_sides;
- status = nc_get_vara_int(neid, elem_list_id, start, count, side_set_elem_list);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_get_vara_longlong(exoid, elem_list_id, start, count, side_set_elem_list);
+ } else {
+ status = nc_get_vara_int(exoid, elem_list_id, start, count, side_set_elem_list);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get element list for side set %d in file id %d",
- side_set_id,neid);
- ex_err("ne_get_n_side_set",errmsg,exerrval);
+ "Error: failed to get element list for side set %"PRId64" in file id %d",
+ side_set_id,exoid);
+ ex_err("ex_get_partial_side_set",errmsg,exerrval);
return (EX_FATAL);
}
- status = nc_get_vara_int(neid, side_list_id, start, count, side_set_side_list);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_get_vara_longlong(exoid, side_list_id, start, count, side_set_side_list);
+ } else {
+ status = nc_get_vara_int(exoid, side_list_id, start, count, side_set_side_list);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get side list for side set %d in file id %d",
- side_set_id,neid);
- ex_err("ne_get_n_side_set",errmsg,exerrval);
+ "Error: failed to get side list for side set %"PRId64" in file id %d",
+ side_set_id,exoid);
+ ex_err("ex_get_partial_side_set",errmsg,exerrval);
return (EX_FATAL);
}
return (EX_NOERR);
diff --git a/nemesis/ne_gnssd.c b/exodus/cbind/src/ex_get_partial_side_set_df.c
similarity index 67%
rename from nemesis/ne_gnssd.c
rename to exodus/cbind/src/ex_get_partial_side_set_df.c
index 2cd92bc..386f623 100644
--- a/nemesis/ne_gnssd.c
+++ b/exodus/cbind/src/ex_get_partial_side_set_df.c
@@ -37,13 +37,13 @@
/*****************************************************************************/
/* Function(s) contained in this file:
*
- * ne_get_n_side_set_df()
+ * ex_get_partial_side_set_df()
*
*****************************************************************************
*
* Variable Index:
*
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* side_set_id - ID of side set to read.
* start_side_num - The starting index of the sides to be read.
* num_sides - The number of sides to read in.
@@ -58,13 +58,10 @@
#include "exodusII.h"
#include "exodusII_int.h"
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-int ne_get_n_side_set_df (int neid,
- int side_set_id,
- int start_num,
- int num_df_to_get,
+int ex_get_partial_side_set_df (int exoid,
+ ex_entity_id side_set_id,
+ int64_t start_num,
+ int64_t num_df_to_get,
void *side_set_dist_fact)
{
@@ -76,48 +73,48 @@ int ne_get_n_side_set_df (int neid,
/* first check if any side sets are specified */
- if ((status = nc_inq_dimid (neid, DIM_NUM_SS, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_SS, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Warning: no side sets stored in file id %d",
- neid);
- ex_err("ne_get_n_side_set_df",errmsg,exerrval);
+ exoid);
+ ex_err("ex_get_partial_side_set_df",errmsg,exerrval);
return (EX_WARN);
}
/* Lookup index of side set id in VAR_SS_IDS array */
- if ((side_set_id_ndx = ex_id_lkup(neid,EX_SIDE_SET,side_set_id)) < 0) {
+ if ((side_set_id_ndx = ex_id_lkup(exoid,EX_SIDE_SET,side_set_id)) < 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: side set %d is NULL in file id %d",
- side_set_id, neid);
- ex_err("ne_get_n_side_set_df",errmsg,EX_MSG);
+ "Warning: side set %"PRId64" is NULL in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_get_partial_side_set_df",errmsg,EX_MSG);
return (EX_WARN);
} else {
sprintf(errmsg,
- "Error: failed to locate side set id %d in %s array in file id %d",
- side_set_id, VAR_SS_IDS, neid);
- ex_err("ne_get_n_side_set_df",errmsg,exerrval);
+ "Error: failed to locate side set %"PRId64" in %s array in file id %d",
+ side_set_id, VAR_SS_IDS, exoid);
+ ex_err("ex_get_partial_side_set_df",errmsg,exerrval);
return (EX_FATAL);
}
}
/* inquire id's of previously defined dimensions and variables */
- if ((status = nc_inq_dimid (neid, DIM_NUM_DF_SS(side_set_id_ndx), &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_DF_SS(side_set_id_ndx), &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Warning: dist factors not stored for side set %d in file id %d",
- side_set_id,neid);
- ex_err("ne_get_n_side_set_df",errmsg,exerrval);
+ "Warning: dist factors not stored for side set %"PRId64" in file id %d",
+ side_set_id,exoid);
+ ex_err("ex_get_partial_side_set_df",errmsg,exerrval);
return (EX_WARN); /* complain - but not too loud */
}
- if ((status = nc_inq_dimlen (neid, dimid, &num_df_in_set)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen (exoid, dimid, &num_df_in_set)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of dist factors in side set %d in file id %d",
- side_set_id,neid);
- ex_err("ne_get_n_side_set_df",errmsg,exerrval);
+ "Error: failed to get number of dist factors in side set %"PRId64" in file id %d",
+ side_set_id,exoid);
+ ex_err("ex_get_partial_side_set_df",errmsg,exerrval);
return (EX_FATAL);
}
@@ -125,14 +122,14 @@ int ne_get_n_side_set_df (int neid,
if (start_num < 0 || start_num > num_df_in_set) {
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: Invalid input");
- ex_err("ne_get_n_side_set_df",errmsg,exerrval);
+ ex_err("ex_get_partial_side_set_df",errmsg,exerrval);
return (EX_FATAL);
}
if (num_df_to_get < 0) {
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: Invalid number of df's to get!");
- ex_err("ne_get_n_side_set_df",errmsg,exerrval);
+ ex_err("ex_get_partial_side_set_df",errmsg,exerrval);
return (EX_FATAL);
}
@@ -140,16 +137,16 @@ int ne_get_n_side_set_df (int neid,
if ((start_num + num_df_to_get - 1) > num_df_in_set) {
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: request larger than number of df's in set!");
- ex_err("ne_get_n_side_set_df",errmsg,exerrval);
+ ex_err("ex_get_partial_side_set_df",errmsg,exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_varid (neid, VAR_FACT_SS(side_set_id_ndx), &dist_id)) != NC_NOERR) {
+ if ((status = nc_inq_varid (exoid, VAR_FACT_SS(side_set_id_ndx), &dist_id)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate dist factors list for side set %d in file id %d",
- side_set_id,neid);
- ex_err("ne_get_n_side_set_df",errmsg,exerrval);
+ "Error: failed to locate dist factors list for side set %"PRId64" in file id %d",
+ side_set_id,exoid);
+ ex_err("ex_get_partial_side_set_df",errmsg,exerrval);
return (EX_FATAL);
}
@@ -158,18 +155,18 @@ int ne_get_n_side_set_df (int neid,
start[0] = --start_num;
count[0] = num_df_to_get;
- if (ex_comp_ws(neid) == 4) {
- status = nc_get_vara_float (neid, dist_id, start, count, side_set_dist_fact);
+ if (ex_comp_ws(exoid) == 4) {
+ status = nc_get_vara_float (exoid, dist_id, start, count, side_set_dist_fact);
} else {
- status = nc_get_vara_double (neid, dist_id, start, count, side_set_dist_fact);
+ status = nc_get_vara_double (exoid, dist_id, start, count, side_set_dist_fact);
}
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get dist factors list for side set %d in file id %d",
- side_set_id,neid);
- ex_err("ne_get_n_side_set_df",errmsg,exerrval);
+ "Error: failed to get dist factors list for side set %"PRId64" in file id %d",
+ side_set_id,exoid);
+ ex_err("ex_get_partial_side_set_df",errmsg,exerrval);
return (EX_FATAL);
}
return (EX_NOERR);
diff --git a/exodus/cbind/src/exgnvar.c b/exodus/cbind/src/ex_get_partial_var.c
similarity index 72%
rename from exodus/cbind/src/exgnvar.c
rename to exodus/cbind/src/ex_get_partial_var.c
index 54ef953..283e777 100644
--- a/exodus/cbind/src/exgnvar.c
+++ b/exodus/cbind/src/ex_get_partial_var.c
@@ -32,32 +32,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-/*****************************************************************************
-*
-* exgev - ex_get_n_var
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-* int time_step time step number
-* ex_entity_type var_type block/variable type
-* node, edge/face/element block, or
-* node/edge/face/side/element set
-* int var_index variable index
-* int obj_id object id
-* int start_num starting index of the variables to be written
-* int num_ent number of entities to write variables for.
-*
-*
-* exit conditions -
-* float* var_vals array of element variable values
-*
-*
-* revision history -
-* 20061002 - David Thompson - Adapted from ex_get_elem_var
-*
-*
-*****************************************************************************/
#include "exodusII.h"
#include "exodusII_int.h"
@@ -82,23 +56,26 @@
* \param var_vals the values to read
*/
-int ex_get_n_var( int exoid,
+int ex_get_partial_var( int exoid,
int time_step,
ex_entity_type var_type,
int var_index,
- int obj_id,
- int start_index,
- int num_entities,
+ ex_entity_id obj_id,
+ int64_t start_index,
+ int64_t num_entities,
void* var_vals )
{
- int status;
+ int status = 0;
int varid, obj_id_ndx;
size_t start[2], count[2];
char errmsg[MAX_ERR_LENGTH];
+ if (num_entities == 0)
+ return status;
+
if (var_type == EX_NODAL) {
/* FIXME: Special case: ignore obj_id, possible large_file complications, etc. */
- return ex_get_n_nodal_var( exoid, time_step, var_index, start_index, num_entities, var_vals );
+ return ex_get_partial_nodal_var( exoid, time_step, var_index, start_index, num_entities, var_vals );
} else if (var_type == EX_GLOBAL) {
/* FIXME: Special case: all vars stored in 2-D single array. */
return ex_get_glob_vars( exoid, time_step, num_entities, var_vals );
@@ -111,15 +88,15 @@ int ex_get_n_var( int exoid,
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no %s variables for NULL block %d in file id %d",
+ "Warning: no %s variables for NULL block %"PRId64" in file id %d",
ex_name_of_object(var_type), obj_id,exoid);
- ex_err("ex_get_n_var",errmsg,EX_MSG);
+ ex_err("ex_get_partial_var",errmsg,EX_MSG);
return (EX_WARN);
} else {
sprintf(errmsg,
- "Error: failed to locate %s id %d in id variable in file id %d",
+ "Error: failed to locate %s id %"PRId64" in id variable in file id %d",
ex_name_of_object(var_type), obj_id, exoid);
- ex_err("ex_get_n_var",errmsg,exerrval);
+ ex_err("ex_get_partial_var",errmsg,exerrval);
return (EX_FATAL);
}
}
@@ -130,9 +107,9 @@ int ex_get_n_var( int exoid,
obj_id_ndx), &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate %s %d var %d in file id %d",
+ "Error: failed to locate %s %"PRId64" var %d in file id %d",
ex_name_of_object(var_type),obj_id,var_index,exoid);
- ex_err("ex_get_n_var",errmsg,exerrval);
+ ex_err("ex_get_partial_var",errmsg,exerrval);
return (EX_FATAL);
}
@@ -152,9 +129,9 @@ int ex_get_n_var( int exoid,
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get %s %d variable %d in file id %d",
+ "Error: failed to get %s %"PRId64" variable %d in file id %d",
ex_name_of_object(var_type), obj_id, var_index,exoid);
- ex_err("ex_get_n_var",errmsg,exerrval);
+ ex_err("ex_get_partial_var",errmsg,exerrval);
return (EX_FATAL);
}
return (EX_NOERR);
diff --git a/nemesis/ne_gelm.c b/exodus/cbind/src/ex_get_processor_elem_maps.c
similarity index 74%
rename from nemesis/ne_gelm.c
rename to exodus/cbind/src/ex_get_processor_elem_maps.c
index 0d64e09..f891745 100644
--- a/nemesis/ne_gelm.c
+++ b/exodus/cbind/src/ex_get_processor_elem_maps.c
@@ -35,11 +35,11 @@
/*****************************************************************************/
/*****************************************************************************/
/* Function(s) contained in this file:
- * ne_get_elem_map()
+ * ex_get_elem_map()
*
*****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* elem_mapi - Pointer to vector for retrieval of internal
* FEM element IDs.
* elem_mapb - Pointer to vector for retrieval of border
@@ -59,16 +59,13 @@
#include "exodusII.h"
#include "exodusII_int.h"
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-int ne_get_elem_map(int neid,
- int *elem_mapi,
- int *elem_mapb,
- int processor
- )
+int ex_get_processor_elem_maps(int exoid,
+ void_int *elem_mapi,
+ void_int *elem_mapb,
+ int processor
+ )
{
- char *func_name="ne_get_elem_map";
+ const char *func_name="ex_get_processor_elem_maps";
char ftype[2];
int dimid, varid, status;
@@ -79,22 +76,22 @@ int ne_get_elem_map(int neid,
char errmsg[MAX_ERR_LENGTH];
/* Get the file type */
- if (ne_get_file_type(neid, ftype) != EX_NOERR) {
+ if (ex_get_file_type(exoid, ftype) != EX_NOERR) {
exerrval = EX_MSG;
sprintf(errmsg,
"Error: unable to find file type for file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Check the status of the internal element map */
- if ((status = nc_inq_varid(neid, VAR_INT_E_STAT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_INT_E_STAT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_INT_E_STAT, neid);
+ VAR_INT_E_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -104,22 +101,22 @@ int ne_get_elem_map(int neid,
else
start[0] = processor;
- if ((status = nc_get_var1_int(neid, varid, start, &emstat)) != NC_NOERR) {
+ if ((status = nc_get_var1_int(exoid, varid, start, &emstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get status for \"%s\" from file ID %d",
- VAR_INT_E_STAT, neid);
+ VAR_INT_E_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
if (emstat == 1) {
/* get the index */
- if (ne_get_idx(neid, VAR_ELEM_MAP_INT_IDX, varidx, processor) == -1) {
+ if (ex_get_idx(exoid, VAR_ELEM_MAP_INT_IDX, varidx, processor) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_ELEM_MAP_INT_IDX, neid);
+ VAR_ELEM_MAP_INT_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -127,20 +124,20 @@ int ne_get_elem_map(int neid,
if (varidx[1] == -1) {
/* Get the size of the internal element map */
- if ((status = nc_inq_dimid(neid, DIM_NUM_INT_ELEMS, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_INT_ELEMS, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NUM_INT_ELEMS, neid);
+ DIM_NUM_INT_ELEMS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid, count)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, count)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_INT_ELEMS, neid);
+ DIM_NUM_INT_ELEMS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -149,24 +146,28 @@ int ne_get_elem_map(int neid,
}
/* Get the map */
- if ((status = nc_inq_varid(neid, VAR_ELEM_MAP_INT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_ELEM_MAP_INT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_ELEM_MAP_INT, neid);
+ VAR_ELEM_MAP_INT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
start[0] = varidx[0];
count[0] = varidx[1] - varidx[0];
- status = nc_get_vara_int(neid, varid, start, count, elem_mapi);
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_get_vara_longlong(exoid, varid, start, count, elem_mapi);
+ } else {
+ status = nc_get_vara_int(exoid, varid, start, count, elem_mapi);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_ELEM_MAP_INT, neid);
+ VAR_ELEM_MAP_INT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -174,11 +175,11 @@ int ne_get_elem_map(int neid,
} /* End "if (emstat == 1)" */
/* Check the status of the internal element map */
- if ((status = nc_inq_varid(neid, VAR_BOR_E_STAT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_BOR_E_STAT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_BOR_E_STAT, neid);
+ VAR_BOR_E_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -188,22 +189,22 @@ int ne_get_elem_map(int neid,
else
start[0] = processor;
- if ((status = nc_get_var1_int(neid, varid, start, &emstat)) != NC_NOERR) {
+ if ((status = nc_get_var1_int(exoid, varid, start, &emstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get status for \"%s\" from file ID %d",
- VAR_INT_E_STAT, neid);
+ VAR_INT_E_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
if (emstat == 1) {
/* get the index */
- if (ne_get_idx(neid, VAR_ELEM_MAP_BOR_IDX, varidx, processor) == -1) {
+ if (ex_get_idx(exoid, VAR_ELEM_MAP_BOR_IDX, varidx, processor) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_ELEM_MAP_BOR_IDX, neid);
+ VAR_ELEM_MAP_BOR_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -211,20 +212,20 @@ int ne_get_elem_map(int neid,
if (varidx[1] == -1) {
/* Get the size of the border element map */
- if ((status = nc_inq_dimid(neid, DIM_NUM_BOR_ELEMS, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_BOR_ELEMS, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NUM_BOR_ELEMS, neid);
+ DIM_NUM_BOR_ELEMS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid, count)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, count)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_BOR_ELEMS, neid);
+ DIM_NUM_BOR_ELEMS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -233,24 +234,28 @@ int ne_get_elem_map(int neid,
}
/* Get the map */
- if ((status = nc_inq_varid(neid, VAR_ELEM_MAP_BOR, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_ELEM_MAP_BOR, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_ELEM_MAP_BOR, neid);
+ VAR_ELEM_MAP_BOR, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
start[0] = varidx[0];
count[0] = varidx[1] - varidx[0];
- status = nc_get_vara_int(neid, varid, start, count, elem_mapb);
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_get_vara_longlong(exoid, varid, start, count, elem_mapb);
+ } else {
+ status = nc_get_vara_int(exoid, varid, start, count, elem_mapb);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_ELEM_MAP_BOR, neid);
+ VAR_ELEM_MAP_BOR, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
diff --git a/nemesis/ne_gnm.c b/exodus/cbind/src/ex_get_processor_node_maps.c
similarity index 72%
rename from nemesis/ne_gnm.c
rename to exodus/cbind/src/ex_get_processor_node_maps.c
index a49bae4..6fdd997 100644
--- a/nemesis/ne_gnm.c
+++ b/exodus/cbind/src/ex_get_processor_node_maps.c
@@ -35,12 +35,12 @@
/*****************************************************************************/
/*****************************************************************************/
/* Function(s) contained in this file:
- * ne_get_node_map()
+ * ex_get_node_map()
*****************************************************************************
* This function retrieves the nodal map.
*****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* node_mapi - Pointer to vector for retrieval of internal FEM
* nodal IDs.
* node_mapb - Pointer to vector for retrieval of border FEM
@@ -61,17 +61,14 @@
#include "exodusII.h"
#include "exodusII_int.h"
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-int ne_get_node_map(int neid,
- int *node_mapi,
- int *node_mapb,
- int *node_mape,
- int processor
- )
+int ex_get_processor_node_maps(int exoid,
+ void_int *node_mapi,
+ void_int *node_mapb,
+ void_int *node_mape,
+ int processor
+ )
{
- char *func_name="ne_get_node_map";
+ const char *func_name="ex_get_processor_node_maps";
char ftype[2];
int status, varid, dimid;
@@ -85,22 +82,22 @@ int ne_get_node_map(int neid,
exerrval = 0; /* clear error code */
/* Get the file type */
- if (ne_get_file_type(neid, ftype) != EX_NOERR) {
+ if (ex_get_file_type(exoid, ftype) != EX_NOERR) {
exerrval = EX_MSG;
sprintf(errmsg,
"Error: unable to find file type for file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the status of this node map */
- if ((status = nc_inq_varid(neid, VAR_INT_N_STAT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_INT_N_STAT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" from file ID %d",
- VAR_INT_N_STAT, neid);
+ VAR_INT_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -110,22 +107,22 @@ int ne_get_node_map(int neid,
else
start[0] = processor;
- if (nc_get_var1_int(neid, varid, start, &nmstat) != NC_NOERR) {
+ if (nc_get_var1_int(exoid, varid, start, &nmstat) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get status for \"%s\" in file ID %d",
- VAR_INT_N_STAT, neid);
+ VAR_INT_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
if (nmstat == 1) {
/* get the index */
- if (ne_get_idx(neid, VAR_NODE_MAP_INT_IDX, varidx, processor) == -1) {
+ if (ex_get_idx(exoid, VAR_NODE_MAP_INT_IDX, varidx, processor) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_NODE_MAP_INT_IDX, neid);
+ VAR_NODE_MAP_INT_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -133,43 +130,47 @@ int ne_get_node_map(int neid,
/* check if I need to get the dimension */
if (varidx[1] == -1) {
- if ((status = nc_inq_dimid(neid, DIM_NUM_INT_NODES, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_INT_NODES, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NUM_INT_NODES, neid);
+ DIM_NUM_INT_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid, count)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, count)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_INT_NODES, neid);
+ DIM_NUM_INT_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
varidx[1] = count[0];
}
- if ((status = nc_inq_varid(neid, VAR_NODE_MAP_INT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_NODE_MAP_INT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_NODE_MAP_INT, neid);
+ VAR_NODE_MAP_INT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
start[0] = varidx[0];
count[0] = varidx[1] - varidx[0];
- status = nc_get_vara_int(neid, varid, start, count, node_mapi);
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_get_vara_longlong(exoid, varid, start, count, node_mapi);
+ } else {
+ status = nc_get_vara_int(exoid, varid, start, count, node_mapi);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_NODE_MAP_INT, neid);
+ VAR_NODE_MAP_INT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -177,11 +178,11 @@ int ne_get_node_map(int neid,
} /* End "if (nmstat == 1)" */
/* Get the status of this node map */
- if ((status = nc_inq_varid(neid, VAR_BOR_N_STAT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_BOR_N_STAT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" from file ID %d",
- VAR_BOR_N_STAT, neid);
+ VAR_BOR_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -191,22 +192,22 @@ int ne_get_node_map(int neid,
else
start[0] = processor;
- if (nc_get_var1_int(neid, varid, start, &nmstat) != NC_NOERR) {
+ if (nc_get_var1_int(exoid, varid, start, &nmstat) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get status for \"%s\" from file ID %d",
- VAR_BOR_N_STAT, neid);
+ VAR_BOR_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
if (nmstat == 1) {
/* get the index */
- if (ne_get_idx(neid, VAR_NODE_MAP_BOR_IDX, varidx, processor) == -1) {
+ if (ex_get_idx(exoid, VAR_NODE_MAP_BOR_IDX, varidx, processor) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_NODE_MAP_BOR_IDX, neid);
+ VAR_NODE_MAP_BOR_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -214,54 +215,58 @@ int ne_get_node_map(int neid,
/* check if I need to get the dimension */
if (varidx[1] == -1) {
- if ((status = nc_inq_dimid(neid, DIM_NUM_BOR_NODES, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_BOR_NODES, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NUM_BOR_NODES, neid);
+ DIM_NUM_BOR_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid, count)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, count)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_BOR_NODES, neid);
+ DIM_NUM_BOR_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
varidx[1] = count[0];
}
- if ((status = nc_inq_varid(neid, VAR_NODE_MAP_BOR, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_NODE_MAP_BOR, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_NODE_MAP_BOR, neid);
+ VAR_NODE_MAP_BOR, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
start[0] = varidx[0];
count[0] = varidx[1] - varidx[0];
- status = nc_get_vara_int(neid, varid, start, count, node_mapb);
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_get_vara_longlong(exoid, varid, start, count, node_mapb);
+ } else {
+ status = nc_get_vara_int(exoid, varid, start, count, node_mapb);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_NODE_MAP_BOR, neid);
+ VAR_NODE_MAP_BOR, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
} /* End "if (nmstat == 1)" */
/* Get the status of this node map */
- if ((status = nc_inq_varid(neid, VAR_EXT_N_STAT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_EXT_N_STAT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" from file ID %d",
- VAR_EXT_N_STAT, neid);
+ VAR_EXT_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -271,22 +276,22 @@ int ne_get_node_map(int neid,
else
start[0] = processor;
- if (nc_get_var1_int(neid, varid, start, &nmstat) != NC_NOERR) {
+ if (nc_get_var1_int(exoid, varid, start, &nmstat) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get status for \"%s\" from file ID %d",
- VAR_EXT_N_STAT, neid);
+ VAR_EXT_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
if (nmstat == 1) {
/* get the index */
- if (ne_get_idx(neid, VAR_NODE_MAP_EXT_IDX, varidx, processor) == -1) {
+ if (ex_get_idx(exoid, VAR_NODE_MAP_EXT_IDX, varidx, processor) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_NODE_MAP_EXT_IDX, neid);
+ VAR_NODE_MAP_EXT_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -294,43 +299,47 @@ int ne_get_node_map(int neid,
/* check if I need to get the dimension */
if (varidx[1] == -1) {
- if ((status = nc_inq_dimid(neid, DIM_NUM_EXT_NODES, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_EXT_NODES, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NUM_EXT_NODES, neid);
+ DIM_NUM_EXT_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid, count)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, count)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_EXT_NODES, neid);
+ DIM_NUM_EXT_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
varidx[1] = count[0];
}
- if ((status = nc_inq_varid(neid, VAR_NODE_MAP_EXT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_NODE_MAP_EXT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_NODE_MAP_EXT, neid);
+ VAR_NODE_MAP_EXT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
start[0] = varidx[0];
count[0] = varidx[1] - varidx[0];
- status = nc_get_vara_int(neid, varid, start, count, node_mape);
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_get_vara_longlong(exoid, varid, start, count, node_mape);
+ } else {
+ status = nc_get_vara_int(exoid, varid, start, count, node_mape);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_NODE_MAP_EXT, neid);
+ VAR_NODE_MAP_EXT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
diff --git a/exodus/cbind/src/exgp.c b/exodus/cbind/src/ex_get_prop.c
similarity index 91%
rename from exodus/cbind/src/exgp.c
rename to exodus/cbind/src/ex_get_prop.c
index 760ab17..5deb345 100644
--- a/exodus/cbind/src/exgp.c
+++ b/exodus/cbind/src/ex_get_prop.c
@@ -78,15 +78,14 @@ description for ex_get_prop_names().
int ex_get_prop (int exoid,
ex_entity_type obj_type,
- int obj_id,
+ ex_entity_id obj_id,
const char *prop_name,
- int *value)
+ void_int *value)
{
int status;
int num_props, i, propid;
int found = FALSE;
size_t start[1];
- int l_val;
char name[MAX_VAR_NAME_LENGTH+1];
char tmpstr[MAX_STR_LENGTH+1];
@@ -185,14 +184,14 @@ int ex_get_prop (int exoid,
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: %s id %d is NULL in file id %d",
+ "Warning: %s id %"PRId64" is NULL in file id %d",
ex_name_of_object(obj_type), obj_id, exoid);
ex_err("ex_get_prop",errmsg,EX_MSG);
return (EX_WARN);
} else {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate id %d in %s property array in file id %d",
+ "Error: failed to locate id %"PRId64" in %s property array in file id %d",
obj_id, ex_name_of_object(obj_type), exoid);
ex_err("ex_get_prop",errmsg,exerrval);
return (EX_FATAL);
@@ -200,7 +199,23 @@ int ex_get_prop (int exoid,
}
start[0] = start[0] - 1;
- if ((status = nc_get_var1_int (exoid, propid, start, &l_val)) != NC_NOERR) {
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ long long l_val;
+ status = nc_get_var1_longlong (exoid, propid, start, &l_val);
+ if (status == NC_NOERR) {
+ int64_t *val = (int64_t*)value;
+ *val = l_val;
+ }
+ } else {
+ int i_val;
+ status = nc_get_var1_int (exoid, propid, start, &i_val);
+ if (status == NC_NOERR) {
+ int *val = (int*)value;
+ *val = i_val;
+ }
+ }
+
+ if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to read value in %s property array in file id %d",
@@ -209,7 +224,5 @@ int ex_get_prop (int exoid,
return (EX_FATAL);
}
- *value = l_val;
-
return (EX_NOERR);
}
diff --git a/exodus/cbind/src/exgpa.c b/exodus/cbind/src/ex_get_prop_array.c
similarity index 97%
rename from exodus/cbind/src/exgpa.c
rename to exodus/cbind/src/ex_get_prop_array.c
index a9977ed..c423325 100644
--- a/exodus/cbind/src/exgpa.c
+++ b/exodus/cbind/src/ex_get_prop_array.c
@@ -112,7 +112,7 @@ the description for ex_get_prop_names().
int ex_get_prop_array (int exoid,
ex_entity_type obj_type,
const char *prop_name,
- int *values)
+ void_int *values)
{
int num_props, i, propid, status;
int found = FALSE;
@@ -210,7 +210,11 @@ int ex_get_prop_array (int exoid,
}
/* read num_obj values from property variable */
- status = nc_get_var_int(exoid, propid, values);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ status = nc_get_var_longlong(exoid, propid, values);
+ } else {
+ status = nc_get_var_int(exoid, propid, values);
+ }
if (status != NC_NOERR) {
exerrval = status;
diff --git a/exodus/cbind/src/exgpn.c b/exodus/cbind/src/ex_get_prop_names.c
similarity index 98%
rename from exodus/cbind/src/exgpn.c
rename to exodus/cbind/src/ex_get_prop_names.c
index a4b576d..6e101a3 100644
--- a/exodus/cbind/src/exgpn.c
+++ b/exodus/cbind/src/ex_get_prop_names.c
@@ -108,6 +108,7 @@ int ex_get_prop_names (int exoid,
char var_name[12];
size_t att_len;
nc_type att_type;
+ int api_name_size = ex_inquire_int(exoid, EX_INQ_MAX_READ_NAME_LENGTH);
char errmsg[MAX_ERR_LENGTH];
@@ -181,7 +182,7 @@ int ex_get_prop_names (int exoid,
return (EX_FATAL);
}
- if (att_len-1 <= ex_max_name_length) {
+ if (att_len-1 <= api_name_size) {
/* Client has large enough char string to hold text... */
if ((status = nc_get_att_text(exoid, propid, ATT_PROP_NAME, prop_names[i])) != NC_NOERR) {
exerrval = status;
diff --git a/exodus/cbind/src/exgqa.c b/exodus/cbind/src/ex_get_qa.c
similarity index 100%
rename from exodus/cbind/src/exgqa.c
rename to exodus/cbind/src/ex_get_qa.c
diff --git a/exodus/cbind/src/exgset.c b/exodus/cbind/src/ex_get_set.c
similarity index 82%
rename from exodus/cbind/src/exgset.c
rename to exodus/cbind/src/ex_get_set.c
index d4c6191..d33ad8a 100644
--- a/exodus/cbind/src/exgset.c
+++ b/exodus/cbind/src/ex_get_set.c
@@ -61,9 +61,9 @@
int ex_get_set (int exoid,
ex_entity_type set_type,
- int set_id,
- int *set_entry_list,
- int *set_extra_list) /* NULL if dont want to retrieve data */
+ ex_entity_id set_id,
+ void_int *set_entry_list,
+ void_int *set_extra_list) /* NULL if dont want to retrieve data */
{
int dimid, entry_list_id, extra_list_id, status;
@@ -89,14 +89,14 @@ int ex_get_set (int exoid,
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: %s %d is NULL in file id %d",
+ "Warning: %s %"PRId64" is NULL in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_get_set",errmsg,EX_MSG);
return (EX_WARN);
} else {
sprintf(errmsg,
- "Error: failed to locate %s id %d in VAR_*S_IDS array in file id %d",
+ "Error: failed to locate %s id %"PRId64" in VAR_*S_IDS array in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_get_set",errmsg,exerrval);
return (EX_FATAL);
@@ -129,7 +129,7 @@ int ex_get_set (int exoid,
if ((status = nc_inq_varid(exoid, entryptr, &entry_list_id)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate entry list for %s %d in file id %d",
+ "Error: failed to locate entry list for %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_get_set",errmsg,exerrval);
return (EX_FATAL);
@@ -137,15 +137,13 @@ int ex_get_set (int exoid,
/* If client doet not pass in an array to store the
extra list, don't access it at all */
- if (set_extra_list == NULL)
- extraptr = NULL;
/* only do extra list for edge, face and side sets */
- if (extraptr) {
+ if (set_extra_list) {
if ((status = nc_inq_varid (exoid, extraptr, &extra_list_id)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate extra list for %s %d in file id %d",
+ "Error: failed to locate extra list for %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_get_set",errmsg,exerrval);
return (EX_FATAL);
@@ -155,12 +153,16 @@ int ex_get_set (int exoid,
/* read in the entry list and extra list arrays unless they are NULL */
if (set_entry_list) {
- status = nc_get_var_int(exoid, entry_list_id, set_entry_list);
-
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_get_var_longlong(exoid, entry_list_id, set_entry_list);
+ } else {
+ status = nc_get_var_int(exoid, entry_list_id, set_entry_list);
+ }
+
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get entry list for %s %d in file id %d",
+ "Error: failed to get entry list for %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_get_set",errmsg,exerrval);
return (EX_FATAL);
@@ -168,15 +170,19 @@ int ex_get_set (int exoid,
}
/* only do extra list for edge, face and side sets */
- if (extraptr) {
- status = nc_get_var_int(exoid, extra_list_id, set_extra_list);
+ if (set_extra_list) {
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_get_var_longlong(exoid, extra_list_id, set_extra_list);
+ } else {
+ status = nc_get_var_int(exoid, extra_list_id, set_extra_list);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get extra list for %s %d in file id %d",
- ex_name_of_object(set_type), set_id,exoid);
- ex_err("ex_get_set",errmsg,exerrval);
+ "Error: failed to get extra list for %s %"PRId64" in file id %d",
+ ex_name_of_object(set_type), set_id, exoid);
+ ex_err("ex_get_set", errmsg, exerrval);
return (EX_FATAL);
}
}
diff --git a/exodus/cbind/src/exgsetd.c b/exodus/cbind/src/ex_get_set_dist_fact.c
similarity index 92%
rename from exodus/cbind/src/exgsetd.c
rename to exodus/cbind/src/ex_get_set_dist_fact.c
index 66c15d9..b9e6f42 100644
--- a/exodus/cbind/src/exgsetd.c
+++ b/exodus/cbind/src/ex_get_set_dist_fact.c
@@ -59,7 +59,7 @@
int ex_get_set_dist_fact (int exoid,
ex_entity_type set_type,
- int set_id,
+ ex_entity_id set_id,
void *set_dist_fact)
{
@@ -85,13 +85,13 @@ int ex_get_set_dist_fact (int exoid,
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: %s set %d is NULL in file id %d",
+ "Warning: %s set %"PRId64" is NULL in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_get_set_dist_fact",errmsg,EX_MSG);
return (EX_WARN);
} else {
sprintf(errmsg,
- "Error: failed to locate %s set id %d in VAR_*S_IDS array in file id %d",
+ "Error: failed to locate %s set %"PRId64" in VAR_*S_IDS array in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_get_set_dist_fact",errmsg,exerrval);
return (EX_FATAL);
@@ -121,7 +121,7 @@ int ex_get_set_dist_fact (int exoid,
/* not an error for node sets because this is how we check that df's exist */
if (set_type == EX_NODE_SET) {
sprintf(errmsg,
- "Warning: dist factors not stored for %s set %d in file id %d",
+ "Warning: dist factors not stored for %s set %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id, exoid);
ex_err("ex_get_set_dist_fact",errmsg,exerrval);
return (EX_WARN); /* complain - but not too loud */
@@ -129,7 +129,7 @@ int ex_get_set_dist_fact (int exoid,
/* is an error for other sets */
else {
sprintf(errmsg,
- "Error: failed to locate dist factors list for %s set %d in file id %d",
+ "Error: failed to locate dist factors list for %s set %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_get_set_dist_fact",errmsg,exerrval);
return (EX_FATAL);
@@ -146,7 +146,7 @@ int ex_get_set_dist_fact (int exoid,
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get dist factors list for %s set %d in file id %d",
+ "Error: failed to get dist factors list for %s set %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_get_set_dist_fact",errmsg,exerrval);
return (EX_FATAL);
diff --git a/exodus/cbind/src/exgsetp.c b/exodus/cbind/src/ex_get_set_param.c
similarity index 80%
rename from exodus/cbind/src/exgsetp.c
rename to exodus/cbind/src/ex_get_set_param.c
index 3df5f2b..b6a29a8 100644
--- a/exodus/cbind/src/exgsetp.c
+++ b/exodus/cbind/src/ex_get_set_param.c
@@ -62,9 +62,9 @@
int ex_get_set_param (int exoid,
ex_entity_type set_type,
- int set_id,
- int *num_entry_in_set,
- int *num_dist_fact_in_set)
+ ex_entity_id set_id,
+ void_int *num_entry_in_set,
+ void_int *num_dist_fact_in_set)
{
int status;
int varid, dimid, set_id_ndx;
@@ -77,6 +77,17 @@ int ex_get_set_param (int exoid,
exerrval = 0; /* clear error code */
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ if (num_entry_in_set)
+ *(int64_t*)num_entry_in_set = 0;
+ if (num_dist_fact_in_set)
+ *(int64_t*)num_dist_fact_in_set = 0;
+ } else {
+ if (num_entry_in_set)
+ *(int*)num_entry_in_set = 0;
+ if (num_dist_fact_in_set)
+ *(int*)num_dist_fact_in_set = 0;
+ }
/* first check if any sets are specified */
if ((status = nc_inq_dimid(exoid, ex_dim_num_objects(set_type), &dimid)) != NC_NOERR) {
exerrval = status;
@@ -92,12 +103,10 @@ int ex_get_set_param (int exoid,
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) /* NULL set? */
{
- *num_entry_in_set = 0;
- *num_dist_fact_in_set = 0;
return (EX_NOERR);
} else {
sprintf(errmsg,
- "Error: failed to locate %s id %d in id array in file id %d",
+ "Error: failed to locate %s id %"PRId64" in id array in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_get_set_param",errmsg,exerrval);
return (EX_FATAL);
@@ -131,7 +140,14 @@ int ex_get_set_param (int exoid,
if (ex_get_dimension(exoid, numentryptr,"entries", &lnum_entry_in_set,
&dimid, "ex_get_set_param") != NC_NOERR)
return EX_FATAL;
- *num_entry_in_set = lnum_entry_in_set;
+
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ if (num_entry_in_set)
+ *(int64_t*)num_entry_in_set = lnum_entry_in_set;
+ } else {
+ if (num_entry_in_set)
+ *(int*)num_entry_in_set = lnum_entry_in_set;
+ }
/* Inquire value of dimension of number of dist factors for this set.
NOTE: For node sets, because DIM_NUM_DF_NS is not used, we check to see
@@ -141,29 +157,33 @@ int ex_get_set_param (int exoid,
if (set_type == EX_NODE_SET) {
if ((status = nc_inq_varid(exoid, VAR_FACT_NS(set_id_ndx), &varid)) != NC_NOERR) {
- *num_dist_fact_in_set = 0; /* signal dist factor doesn't exist */
if (status == NC_ENOTVAR)
return (EX_NOERR);
else {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate the dist factors for %s %d in file id %d",
+ "Error: failed to locate the dist factors for %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_get_set_param",errmsg,exerrval);
return (EX_FATAL);
}
}
- *num_dist_fact_in_set = lnum_entry_in_set; /* # of df = # of nodes */
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ if (num_dist_fact_in_set)
+ *(int64_t*)num_dist_fact_in_set = lnum_entry_in_set;
+ } else {
+ if (num_dist_fact_in_set)
+ *(int*)num_dist_fact_in_set = lnum_entry_in_set;
+ }
}
else {/* all other set types */
if ((status = nc_inq_dimid(exoid, numdfptr, &dimid)) != NC_NOERR) {
- *num_dist_fact_in_set = 0; /* no distribution factors for this set*/
if (status == NC_EBADDIM)
return (EX_NOERR);
else {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of dist factors in %s %d in file id %d",
+ "Error: failed to locate number of dist factors in %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id, exoid);
ex_err("ex_get_set_param",errmsg,exerrval);
return (EX_FATAL);
@@ -173,12 +193,18 @@ int ex_get_set_param (int exoid,
if ((status = nc_inq_dimlen(exoid, dimid, &lnum_dist_fact_in_set)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of dist factors in %s %d in file id %d",
+ "Error: failed to get number of dist factors in %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id, exoid);
ex_err("ex_get_set_param",errmsg,exerrval);
return (EX_FATAL);
}
- *num_dist_fact_in_set = lnum_dist_fact_in_set;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ if (num_dist_fact_in_set)
+ *(int64_t*)num_dist_fact_in_set = lnum_dist_fact_in_set;
+ } else {
+ if (num_dist_fact_in_set)
+ *(int*)num_dist_fact_in_set = lnum_dist_fact_in_set;
+ }
}
return (EX_NOERR);
diff --git a/exodus/cbind/src/exgtt.c b/exodus/cbind/src/ex_get_sets.c
similarity index 56%
copy from exodus/cbind/src/exgtt.c
copy to exodus/cbind/src/ex_get_sets.c
index 99846a7..a474cb7 100644
--- a/exodus/cbind/src/exgtt.c
+++ b/exodus/cbind/src/ex_get_sets.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 2012 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -32,40 +32,42 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-/*****************************************************************************
-*
-* exgvtt - ex_get_var_tab
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-* int num_blk number of blocks
-* int num_var number of variables
-*
-* exit conditions -
-* int* var_tab element variable truth table array
-*
-*
-*****************************************************************************/
#include <stdlib.h>
#include "exodusII.h"
#include "exodusII_int.h"
-#include <ctype.h>
+int ex_get_sets (int exoid,
+ size_t set_count,
+ struct ex_set *sets)
+{
+ size_t i;
+ int status = EX_NOERR;
+ int stat;
+ for (i=0; i < set_count; i++) {
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ stat = ex_get_set_param(exoid, sets[i].type, sets[i].id,
+ &sets[i].num_entry, &sets[i].num_distribution_factor);
+ } else {
+ /* API expecting 32-bit ints; ex_set structure has 64-bit ints. */
+ int num_entry;
+ int num_dist;
+ stat = ex_get_set_param(exoid, sets[i].type, sets[i].id,
+ &num_entry, &num_dist);
+ sets[i].num_entry = num_entry;
+ sets[i].num_distribution_factor = num_dist;
+ }
+ if (stat != EX_NOERR) status = (status == EX_FATAL) ? EX_FATAL : stat;
-/*!
- * reads the EXODUS II specified variable truth table from the database
- * \deprecated Use ex_get_truth_table()(exoid, obj_type, num_blk, num_var, var_tab)
- */
+ if (stat == EX_NOERR && (sets[i].entry_list != NULL || sets[i].extra_list != NULL)) {
+ stat = ex_get_set(exoid, sets[i].type, sets[i].id, sets[i].entry_list, sets[i].extra_list);
+ if (stat != EX_NOERR) status = (status == EX_FATAL) ? EX_FATAL : stat;
+ }
-int ex_get_var_tab (int exoid,
- const char *var_type,
- int num_blk,
- int num_var,
- int *var_tab)
-{
- ex_entity_type obj_type;
- obj_type = ex_var_type_to_ex_entity_type(*var_type);
- return ex_get_truth_table(exoid, obj_type, num_blk, num_var, var_tab);
+ if (stat == EX_NOERR && sets[i].distribution_factor_list != NULL) {
+ stat = ex_get_set_dist_fact(exoid, sets[i].type, sets[i].id, sets[i].distribution_factor_list);
+ if (stat != EX_NOERR) status = (status == EX_FATAL) ? EX_FATAL : stat;
+ }
+ }
+ return status;
}
diff --git a/exodus/cbind/src/exgss.c b/exodus/cbind/src/ex_get_side_set.c
similarity index 94%
rename from exodus/cbind/src/exgss.c
rename to exodus/cbind/src/ex_get_side_set.c
index df7539c..3e02b26 100644
--- a/exodus/cbind/src/exgss.c
+++ b/exodus/cbind/src/ex_get_side_set.c
@@ -60,9 +60,9 @@
*/
int ex_get_side_set (int exoid,
- int side_set_id,
- int *side_set_elem_list,
- int *side_set_side_list)
+ ex_entity_id side_set_id,
+ void_int *side_set_elem_list,
+ void_int *side_set_side_list)
{
return ex_get_set(exoid, EX_SIDE_SET, side_set_id,
side_set_elem_list, side_set_side_list);
diff --git a/exodus/cbind/src/exgssd.c b/exodus/cbind/src/ex_get_side_set_dist_fact.c
similarity index 97%
copy from exodus/cbind/src/exgssd.c
copy to exodus/cbind/src/ex_get_side_set_dist_fact.c
index 020688d..d2a2d21 100644
--- a/exodus/cbind/src/exgssd.c
+++ b/exodus/cbind/src/ex_get_side_set_dist_fact.c
@@ -58,7 +58,7 @@
*/
int ex_get_side_set_dist_fact (int exoid,
- int side_set_id,
+ ex_entity_id side_set_id,
void *side_set_dist_fact)
{
return ex_get_set_dist_fact(exoid, EX_SIDE_SET, side_set_id,
diff --git a/exodus/cbind/src/exgssi.c b/exodus/cbind/src/ex_get_side_set_ids.c
similarity index 98%
rename from exodus/cbind/src/exgssi.c
rename to exodus/cbind/src/ex_get_side_set_ids.c
index b42604f..9a537c9 100644
--- a/exodus/cbind/src/exgssi.c
+++ b/exodus/cbind/src/ex_get_side_set_ids.c
@@ -57,7 +57,7 @@
*/
int ex_get_side_set_ids (int exoid,
- int *ids)
+ void_int *ids)
{
return ex_get_ids( exoid, EX_SIDE_SET, ids );
}
diff --git a/exodus/cbind/src/ex_get_side_set_node_count.c b/exodus/cbind/src/ex_get_side_set_node_count.c
new file mode 100644
index 0000000..ebb30c9
--- /dev/null
+++ b/exodus/cbind/src/ex_get_side_set_node_count.c
@@ -0,0 +1,623 @@
+/*
+ * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
+ * retains certain rights in this software.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * * Neither the name of Sandia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/*****************************************************************************
+*
+* exgssc - ex_get_side_set_node_count
+*
+* entry conditions -
+* input parameters:
+* int exoid exodus file id
+* int side_set_id side set id
+*
+* exit conditions -
+* int *side_set_node_cnt_list returned array of number of nodes for
+* side or face
+* revision history -
+*
+*****************************************************************************/
+
+#include <ctype.h>
+#include <string.h>
+#include <stdlib.h>
+#include <assert.h>
+#include "exodusII.h"
+#include "exodusII_int.h"
+
+/* Generic error message for element type/node count mapping...*/
+static int el_node_count_error(struct elem_blk_parm elem_blk_parms)
+{
+ char errmsg[MAX_ERR_LENGTH];
+ sprintf(errmsg,
+ "Error: An element of type '%s' with %d nodes is not valid.",
+ elem_blk_parms.elem_type,
+ elem_blk_parms.num_nodes_per_elem);
+ ex_err("ex_get_side_set_node_count",errmsg,EX_MSG);
+ return(EX_FATAL);
+}
+
+int ex_get_side_set_node_count(int exoid,
+ ex_entity_id side_set_id,
+ int *side_set_node_cnt_list)
+{
+ size_t m;
+ int ii, i, j;
+ int num_side_sets, num_elem_blks, num_df, ndim;
+ size_t tot_num_ss_elem = 0;
+ int64_t side, elem;
+ void_int *elem_blk_ids;
+ void_int *ss_elem_ndx;
+ void_int *side_set_elem_list, *side_set_side_list;
+ size_t elem_ctr;
+
+ struct elem_blk_parm *elem_blk_parms;
+
+ char errmsg[MAX_ERR_LENGTH];
+
+ exerrval = 0; /* clear error code */
+
+ /* first check if any side sets are specified */
+ /* inquire how many side sets have been stored */
+ num_side_sets = ex_inquire_int(exoid, EX_INQ_SIDE_SETS);
+ if (num_side_sets < 0) {
+ sprintf(errmsg,
+ "Error: failed to get number of side sets in file id %d",exoid);
+ ex_err("ex_get_side_set_node_count",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+
+ if (num_side_sets == 0) {
+ sprintf(errmsg,
+ "Warning: no side sets defined in file id %d",exoid);
+ ex_err("ex_get_side_set_node_count",errmsg,EX_WARN);
+ return(EX_WARN);
+ }
+
+ /* Lookup index of side set id in VAR_SS_IDS array */
+ ex_id_lkup(exoid,EX_SIDE_SET,side_set_id);
+ if (exerrval != 0)
+ {
+ if (exerrval == EX_NULLENTITY)
+ {
+ sprintf(errmsg,
+ "Warning: side set %"PRId64" is NULL in file id %d",
+ side_set_id,exoid);
+ ex_err("ex_get_side_set_node_count",errmsg,EX_MSG);
+ return (EX_WARN);
+ }
+ else
+ {
+
+ sprintf(errmsg,
+ "Error: failed to locate side set %"PRId64" in VAR_SS_IDS array in file id %d",
+ side_set_id,exoid);
+ ex_err("ex_get_side_set_node_count",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ }
+
+ num_elem_blks = ex_inquire_int(exoid, EX_INQ_ELEM_BLK);
+ if (num_elem_blks < 0) {
+ sprintf(errmsg,
+ "Error: failed to get number of element blocks in file id %d",exoid);
+ ex_err("ex_get_side_set_node_count",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+
+ /* get the dimensionality of the coordinates; this is necessary to
+ distinguish between 2d TRIs and 3d TRIs */
+ ndim = ex_inquire_int(exoid, EX_INQ_DIM);
+ if (ndim < 0) {
+ sprintf(errmsg,
+ "Error: failed to get dimensionality in file id %d",exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+
+ /* First determine the # of elements in the side set*/
+ if ((ex_get_side_set_param(exoid,side_set_id,&tot_num_ss_elem,&num_df)) == -1)
+ {
+ sprintf(errmsg,
+ "Error: failed to get number of elements in side set %"PRId64" in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_get_side_set_node_count",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+
+ /* Allocate space for the side set element list */
+ {
+ int int_size = sizeof(int);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API)
+ int_size = sizeof(int64_t);
+
+ if (!(side_set_elem_list=malloc(tot_num_ss_elem*int_size))) {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for side set element list for file id %d",
+ exoid);
+ ex_err("ex_get_side_set_node_count",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* Allocate space for the side set side list */
+ if (!(side_set_side_list=malloc(tot_num_ss_elem*int_size))) {
+ free(side_set_elem_list);
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for side set side list for file id %d",
+ exoid);
+ ex_err("ex_get_side_set_node_count",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ if (ex_get_side_set(exoid, side_set_id,
+ side_set_elem_list, side_set_side_list) == -1) {
+ free(side_set_elem_list);
+ free(side_set_side_list);
+ sprintf(errmsg,
+ "Error: failed to get side set %"PRId64" in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_get_side_set_node_count",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* Allocate space for the ss element index array */
+ if (!(ss_elem_ndx=malloc(tot_num_ss_elem*int_size))) {
+ free(side_set_elem_list);
+ free(side_set_side_list);
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for side set elem sort array for file id %d",
+ exoid);
+ ex_err("ex_get_side_set_node_count",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ if (int_size == sizeof(int64_t)) {
+ /* Sort side set element list into index array - non-destructive */
+ int64_t *elems = (int64_t*)ss_elem_ndx;
+ for (i=0;i<tot_num_ss_elem;i++) {
+ elems[i] = i; /* init index array to current position */
+ }
+ ex_iqsort64(side_set_elem_list, elems,tot_num_ss_elem);
+ } else {
+ /* Sort side set element list into index array - non-destructive */
+ int *elems = (int*)ss_elem_ndx;
+ for (i=0;i<tot_num_ss_elem;i++) {
+ elems[i] = i; /* init index array to current position */
+ }
+ ex_iqsort(side_set_elem_list, elems,tot_num_ss_elem);
+ }
+ }
+
+ /* Allocate space for the element block ids */
+ {
+ int int_size = sizeof(int);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ int_size = sizeof(int64_t);
+ }
+
+ if (!(elem_blk_ids=malloc(num_elem_blks*int_size))) {
+ exerrval = EX_MEMFAIL;
+ free(ss_elem_ndx);
+ free(side_set_side_list);
+ free(side_set_elem_list);
+ sprintf(errmsg,
+ "Error: failed to allocate space for element block ids for file id %d",
+ exoid);
+ ex_err("ex_get_side_set_node_count",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ if (ex_get_elem_blk_ids(exoid, elem_blk_ids) == -1) {
+ free(elem_blk_ids);
+ free(ss_elem_ndx);
+ free(side_set_side_list);
+ free(side_set_elem_list);
+ sprintf(errmsg,
+ "Error: failed to get element block ids in file id %d",
+ exoid);
+ ex_err("ex_get_side_set_node_count",errmsg,EX_MSG);
+ return(EX_FATAL);
+ }
+ }
+
+ /* Allocate space for the element block params */
+ if (!(elem_blk_parms=malloc(num_elem_blks*sizeof(struct elem_blk_parm)))) {
+ free(elem_blk_ids);
+ free(ss_elem_ndx);
+ free(side_set_side_list);
+ free(side_set_elem_list);
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for element block params for file id %d",
+ exoid);
+ ex_err("ex_get_side_set_node_count",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ elem_ctr = 0;
+ for (i=0; i<num_elem_blks; i++) {
+ ex_entity_id id;
+ ex_block block;
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ id = ((int64_t*)elem_blk_ids)[i];
+ } else {
+ id = ((int*)elem_blk_ids)[i];
+ }
+
+ /* read in an element block parameter */
+ block.type = EX_ELEM_BLOCK;
+ block.id = id;
+ if ((ex_get_block_param (exoid, &block)) == -1) {
+ free(elem_blk_parms);
+ free(elem_blk_ids);
+ free(ss_elem_ndx);
+ free(side_set_side_list);
+ free(side_set_elem_list);
+ sprintf(errmsg,
+ "Error: failed to get element block %"PRId64" parameters in file id %d",
+ block.id, exoid);
+ ex_err("ex_get_side_set_node_count",errmsg,EX_MSG);
+ return(EX_FATAL);
+ }
+
+ elem_blk_parms[i].num_elem_in_blk = block.num_entry;
+ elem_blk_parms[i].num_nodes_per_elem = block.num_nodes_per_entry;
+ elem_blk_parms[i].num_attr = block.num_attribute;
+
+ for (m=0; m < strlen(block.topology); m++) {
+ elem_blk_parms[i].elem_type[m] = toupper(block.topology[m]);
+ }
+ elem_blk_parms[i].elem_type[m] = '\0';
+
+ if (strncmp(elem_blk_parms[i].elem_type,"CIRCLE",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_CIRCLE;
+ elem_blk_parms[i].num_sides = 1;
+ elem_blk_parms[i].num_nodes_per_side[0] = 1;
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"SPHERE",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_SPHERE;
+ elem_blk_parms[i].num_sides = 1;
+ elem_blk_parms[i].num_nodes_per_side[0] = 1;
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"QUAD",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_QUAD;
+ elem_blk_parms[i].num_sides = 4;
+ if (elem_blk_parms[i].num_nodes_per_elem == 4) {
+ elem_blk_parms[i].num_nodes_per_side[0] = 2;
+ elem_blk_parms[i].num_nodes_per_side[1] = 2;
+ elem_blk_parms[i].num_nodes_per_side[2] = 2;
+ elem_blk_parms[i].num_nodes_per_side[3] = 2;
+ } else if (elem_blk_parms[i].num_nodes_per_elem == 5) {
+ elem_blk_parms[i].num_nodes_per_side[0] = 2;
+ elem_blk_parms[i].num_nodes_per_side[1] = 2;
+ elem_blk_parms[i].num_nodes_per_side[2] = 2;
+ elem_blk_parms[i].num_nodes_per_side[3] = 2;
+ } else if (elem_blk_parms[i].num_nodes_per_elem == 9 ||
+ elem_blk_parms[i].num_nodes_per_elem == 8) {
+ elem_blk_parms[i].num_nodes_per_side[0] = 3;
+ elem_blk_parms[i].num_nodes_per_side[1] = 3;
+ elem_blk_parms[i].num_nodes_per_side[2] = 3;
+ elem_blk_parms[i].num_nodes_per_side[3] = 3;
+ } else {
+ return el_node_count_error(elem_blk_parms[i]);
+ }
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"TRIANGLE",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_TRIANGLE;
+ if (ndim == 2) { /* 2d TRIs */
+ elem_blk_parms[i].num_sides = 3;
+ if (elem_blk_parms[i].num_nodes_per_elem == 3) {
+ elem_blk_parms[i].num_nodes_per_side[0] = 2;
+ elem_blk_parms[i].num_nodes_per_side[1] = 2;
+ elem_blk_parms[i].num_nodes_per_side[2] = 2;
+ } else if (elem_blk_parms[i].num_nodes_per_elem == 6) {
+ elem_blk_parms[i].num_nodes_per_side[0] = 3;
+ elem_blk_parms[i].num_nodes_per_side[1] = 3;
+ elem_blk_parms[i].num_nodes_per_side[2] = 3;
+ }
+ } else if (ndim == 3) { /* 3d TRIs -- triangular shell*/
+ elem_blk_parms[i].num_sides = 5; /* 2 Faces and 3 Edges */
+ if (elem_blk_parms[i].num_nodes_per_elem == 3) {
+ elem_blk_parms[i].num_nodes_per_side[0] = 3;
+ elem_blk_parms[i].num_nodes_per_side[1] = 3;
+ elem_blk_parms[i].num_nodes_per_side[2] = 2;
+ elem_blk_parms[i].num_nodes_per_side[3] = 2;
+ elem_blk_parms[i].num_nodes_per_side[4] = 2;
+ } else if (elem_blk_parms[i].num_nodes_per_elem == 6) {
+ elem_blk_parms[i].num_nodes_per_side[0] = 6;
+ elem_blk_parms[i].num_nodes_per_side[1] = 6;
+ elem_blk_parms[i].num_nodes_per_side[2] = 3;
+ elem_blk_parms[i].num_nodes_per_side[3] = 3;
+ elem_blk_parms[i].num_nodes_per_side[4] = 3;
+ } else {
+ return el_node_count_error(elem_blk_parms[i]);
+ }
+ }
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"SHELL",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_SHELL;
+
+ if (elem_blk_parms[i].num_nodes_per_elem == 2) {/* KLUDGE for 2D Shells*/
+ elem_blk_parms[i].num_sides = 2;
+ elem_blk_parms[i].num_nodes_per_side[0] = 2;
+ elem_blk_parms[i].num_nodes_per_side[1] = 2;
+ } else if (elem_blk_parms[i].num_nodes_per_elem == 4) {
+ elem_blk_parms[i].num_sides = 6; /* 2 Faces, 4 Edges */
+ elem_blk_parms[i].num_nodes_per_side[0] = 4;
+ elem_blk_parms[i].num_nodes_per_side[1] = 4;
+ elem_blk_parms[i].num_nodes_per_side[2] = 2;
+ elem_blk_parms[i].num_nodes_per_side[3] = 2;
+ elem_blk_parms[i].num_nodes_per_side[4] = 2;
+ elem_blk_parms[i].num_nodes_per_side[5] = 2;
+ } else if (elem_blk_parms[i].num_nodes_per_elem == 8 ||
+ elem_blk_parms[i].num_nodes_per_elem == 9) {
+ elem_blk_parms[i].num_sides = 6; /* 2 Faces, 4 Edges */
+ elem_blk_parms[i].num_nodes_per_side[0] =
+ elem_blk_parms[i].num_nodes_per_elem; /* 8 or 9 */
+ elem_blk_parms[i].num_nodes_per_side[1] =
+ elem_blk_parms[i].num_nodes_per_elem; /* 8 or 9 */
+ elem_blk_parms[i].num_nodes_per_side[2] = 3;
+ elem_blk_parms[i].num_nodes_per_side[3] = 3;
+ elem_blk_parms[i].num_nodes_per_side[4] = 3;
+ elem_blk_parms[i].num_nodes_per_side[5] = 3;
+ } else {
+ return el_node_count_error(elem_blk_parms[i]);
+ }
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"HEX",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_HEX;
+ elem_blk_parms[i].num_sides = 6;
+ /* determine side set node stride */
+ if (elem_blk_parms[i].num_nodes_per_elem == 8) { /* 8-node bricks */
+ elem_blk_parms[i].num_nodes_per_side[0] = 4;
+ elem_blk_parms[i].num_nodes_per_side[1] = 4;
+ elem_blk_parms[i].num_nodes_per_side[2] = 4;
+ elem_blk_parms[i].num_nodes_per_side[3] = 4;
+ elem_blk_parms[i].num_nodes_per_side[4] = 4;
+ elem_blk_parms[i].num_nodes_per_side[5] = 4;
+ } else if (elem_blk_parms[i].num_nodes_per_elem == 9) { /* 9-node bricks */
+ elem_blk_parms[i].num_nodes_per_side[0] = 4;
+ elem_blk_parms[i].num_nodes_per_side[1] = 4;
+ elem_blk_parms[i].num_nodes_per_side[2] = 4;
+ elem_blk_parms[i].num_nodes_per_side[3] = 4;
+ elem_blk_parms[i].num_nodes_per_side[4] = 4;
+ elem_blk_parms[i].num_nodes_per_side[5] = 4;
+ } else if (elem_blk_parms[i].num_nodes_per_elem == 12) { /* HEXSHELLS */
+ elem_blk_parms[i].num_nodes_per_side[0] = 6;
+ elem_blk_parms[i].num_nodes_per_side[1] = 6;
+ elem_blk_parms[i].num_nodes_per_side[2] = 6;
+ elem_blk_parms[i].num_nodes_per_side[3] = 6;
+ elem_blk_parms[i].num_nodes_per_side[4] = 4;
+ elem_blk_parms[i].num_nodes_per_side[5] = 4;
+ } else if (elem_blk_parms[i].num_nodes_per_elem == 20) { /* 20-node bricks */
+ elem_blk_parms[i].num_nodes_per_side[0] = 8;
+ elem_blk_parms[i].num_nodes_per_side[1] = 8;
+ elem_blk_parms[i].num_nodes_per_side[2] = 8;
+ elem_blk_parms[i].num_nodes_per_side[3] = 8;
+ elem_blk_parms[i].num_nodes_per_side[4] = 8;
+ elem_blk_parms[i].num_nodes_per_side[5] = 8;
+ } else if (elem_blk_parms[i].num_nodes_per_elem == 27) { /* 27-node bricks */
+ elem_blk_parms[i].num_nodes_per_side[0] = 9;
+ elem_blk_parms[i].num_nodes_per_side[1] = 9;
+ elem_blk_parms[i].num_nodes_per_side[2] = 9;
+ elem_blk_parms[i].num_nodes_per_side[3] = 9;
+ elem_blk_parms[i].num_nodes_per_side[4] = 9;
+ elem_blk_parms[i].num_nodes_per_side[5] = 9;
+ } else {
+ return el_node_count_error(elem_blk_parms[i]);
+ }
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"TETRA",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_TETRA;
+ elem_blk_parms[i].num_sides = 4;
+ /* determine side set node stride */
+ if (elem_blk_parms[i].num_nodes_per_elem == 4) {
+ elem_blk_parms[i].num_nodes_per_side[0] = 3;
+ elem_blk_parms[i].num_nodes_per_side[1] = 3;
+ elem_blk_parms[i].num_nodes_per_side[2] = 3;
+ elem_blk_parms[i].num_nodes_per_side[3] = 3;
+ } else if (elem_blk_parms[i].num_nodes_per_elem == 8) {
+ elem_blk_parms[i].num_nodes_per_side[0] = 4;
+ elem_blk_parms[i].num_nodes_per_side[1] = 4;
+ elem_blk_parms[i].num_nodes_per_side[2] = 4;
+ elem_blk_parms[i].num_nodes_per_side[3] = 4;
+ } else if (elem_blk_parms[i].num_nodes_per_elem == 10) {
+ elem_blk_parms[i].num_nodes_per_side[0] = 6;
+ elem_blk_parms[i].num_nodes_per_side[1] = 6;
+ elem_blk_parms[i].num_nodes_per_side[2] = 6;
+ elem_blk_parms[i].num_nodes_per_side[3] = 6;
+ } else {
+ return el_node_count_error(elem_blk_parms[i]);
+ }
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"WEDGE",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_WEDGE;
+ elem_blk_parms[i].num_sides = 5;
+ if (elem_blk_parms[i].num_nodes_per_elem == 6) {
+ elem_blk_parms[i].num_nodes_per_side[0] = 4;
+ elem_blk_parms[i].num_nodes_per_side[1] = 4;
+ elem_blk_parms[i].num_nodes_per_side[2] = 4;
+ elem_blk_parms[i].num_nodes_per_side[3] = 3;
+ elem_blk_parms[i].num_nodes_per_side[4] = 3;
+ } else if (elem_blk_parms[i].num_nodes_per_elem == 15){
+ elem_blk_parms[i].num_nodes_per_side[0] = 8;
+ elem_blk_parms[i].num_nodes_per_side[1] = 8;
+ elem_blk_parms[i].num_nodes_per_side[2] = 8;
+ elem_blk_parms[i].num_nodes_per_side[3] = 6;
+ elem_blk_parms[i].num_nodes_per_side[4] = 6;
+ } else {
+ return el_node_count_error(elem_blk_parms[i]);
+ }
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"PYRAMID",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_PYRAMID;
+ elem_blk_parms[i].num_sides = 5;
+ if (elem_blk_parms[i].num_nodes_per_elem == 5) {
+ elem_blk_parms[i].num_nodes_per_side[0] = 3;
+ elem_blk_parms[i].num_nodes_per_side[1] = 3;
+ elem_blk_parms[i].num_nodes_per_side[2] = 3;
+ elem_blk_parms[i].num_nodes_per_side[3] = 3;
+ elem_blk_parms[i].num_nodes_per_side[4] = 4;
+ } else if (elem_blk_parms[i].num_nodes_per_elem == 13){
+ elem_blk_parms[i].num_nodes_per_side[0] = 6;
+ elem_blk_parms[i].num_nodes_per_side[1] = 6;
+ elem_blk_parms[i].num_nodes_per_side[2] = 6;
+ elem_blk_parms[i].num_nodes_per_side[3] = 6;
+ elem_blk_parms[i].num_nodes_per_side[4] = 8;
+ } else {
+ return el_node_count_error(elem_blk_parms[i]);
+ }
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"BEAM",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_BEAM;
+ elem_blk_parms[i].num_sides = 2;
+
+ if (elem_blk_parms[i].num_nodes_per_elem == 2) {
+ elem_blk_parms[i].num_nodes_per_side[0] = 2;
+ elem_blk_parms[i].num_nodes_per_side[1] = 2;
+ } else if (elem_blk_parms[i].num_nodes_per_elem == 3){
+ elem_blk_parms[i].num_nodes_per_side[0] = 3;
+ elem_blk_parms[i].num_nodes_per_side[1] = 3;
+ } else {
+ return el_node_count_error(elem_blk_parms[i]);
+ }
+ }
+ else if ( (strncmp(elem_blk_parms[i].elem_type,"TRUSS",3) == 0) ||
+ (strncmp(elem_blk_parms[i].elem_type,"BAR",3) == 0) ||
+ (strncmp(elem_blk_parms[i].elem_type,"EDGE",3) == 0) )
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_TRUSS;
+ elem_blk_parms[i].num_sides = 2;
+
+ if (elem_blk_parms[i].num_nodes_per_elem == 2) {
+ elem_blk_parms[i].num_nodes_per_side[0] = 2;
+ elem_blk_parms[i].num_nodes_per_side[1] = 2;
+ } else if (elem_blk_parms[i].num_nodes_per_elem == 3) {
+ elem_blk_parms[i].num_nodes_per_side[0] = 3;
+ elem_blk_parms[i].num_nodes_per_side[1] = 3;
+ } else {
+ return el_node_count_error(elem_blk_parms[i]);
+ }
+ }
+ /* Used for an empty block in a parallel decomposition */
+ else if (strncmp(elem_blk_parms[i].elem_type,"NULL",3) == 0) {
+ elem_blk_parms[i].elem_type_val = EX_EL_NULL_ELEMENT;
+ elem_blk_parms[i].num_sides = 0;
+ elem_blk_parms[i].num_nodes_per_side[0] = 0;
+ elem_blk_parms[i].num_elem_in_blk = 0;
+ } else {
+ /* unsupported element type; no problem if no sides specified for
+ this element block */
+ elem_blk_parms[i].elem_type_val = EX_EL_UNK;
+ elem_blk_parms[i].num_sides = 0;
+ elem_blk_parms[i].num_nodes_per_side[0] = 0;
+ }
+
+ elem_blk_parms[i].elem_blk_id = id; /* save id */
+ elem_ctr += elem_blk_parms[i].num_elem_in_blk;
+ elem_blk_parms[i].elem_ctr = elem_ctr; /* save elem number max */
+ }
+
+
+ /* Finally... Create the list of node counts for each face in the
+ * side set.
+ */
+
+ j = 0; /* The current element block... */
+ for (ii=0;ii<tot_num_ss_elem;ii++) {
+
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ i = ((int64_t*)ss_elem_ndx)[ii];
+ elem = ((int64_t*)side_set_elem_list)[i];
+ side = ((int64_t*)side_set_side_list)[i]-1; /* Convert to 0-based sides */
+ } else {
+ i = ((int*)ss_elem_ndx)[ii];
+ elem = ((int*)side_set_elem_list)[i];
+ side = ((int*)side_set_side_list)[i]-1; /* Convert to 0-based sides */
+ }
+
+ /*
+ * Since the elements are being accessed in sorted, order, the
+ * block that contains the elements must progress sequentially
+ * from block 0 to block[num_elem_blks-1]. Once we find an element
+ * not in this block, find a following block that contains it...
+ */
+ for ( ; j<num_elem_blks; j++) {
+ if (elem <= elem_blk_parms[j].elem_ctr) {
+ break;
+ }
+ }
+
+ if (j < num_elem_blks) {
+ assert(side < elem_blk_parms[j].num_sides);
+ side_set_node_cnt_list[i] = elem_blk_parms[j].num_nodes_per_side[side];
+ } else {
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Error: Invalid element number %"PRId64" found in side set %"PRId64" in file %d",
+ elem, side_set_id, exoid);
+ free(elem_blk_parms);
+ free(elem_blk_ids);
+ free(ss_elem_ndx);
+ free(side_set_side_list);
+ free(side_set_elem_list);
+ ex_err("ex_get_side_set_node_count",errmsg,EX_MSG);
+ return (EX_FATAL);
+ }
+ }
+
+ /* All done: release connectivity array space, element block ids
+ * array, element block parameters array, and side set element index
+ * array
+ */
+ free(elem_blk_ids);
+ free(elem_blk_parms);
+ free(ss_elem_ndx);
+ free(side_set_side_list);
+ free(side_set_elem_list);
+
+ return(EX_NOERR);
+}
diff --git a/exodus/cbind/src/ex_get_side_set_node_list.c b/exodus/cbind/src/ex_get_side_set_node_list.c
new file mode 100644
index 0000000..bd19303
--- /dev/null
+++ b/exodus/cbind/src/ex_get_side_set_node_list.c
@@ -0,0 +1,1037 @@
+/*
+ * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
+ * retains certain rights in this software.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * * Neither the name of Sandia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/*****************************************************************************
+*
+* exgssn - ex_get_side_set_node_list
+*
+* entry conditions -
+* input parameters:
+* int exoid exodus file id
+* int side_set_id side set id
+*
+* exit conditions -
+* int *side_set_node_cnt_list returned array of number of nodes for
+* side or face
+* int *side_set_node_list array of nodes
+*
+* revision history -
+*
+*
+*****************************************************************************/
+
+#include <ctype.h>
+#include <string.h>
+#include <stdlib.h>
+#include "exodusII.h"
+#include "exodusII_int.h"
+/*!
+ * This routine is designed to read the Exodus II V 2.0 side set side
+ * definition and return a ExodusI style side set node definition.
+ */
+static void* safe_free(void* array)
+{
+ if (array != 0) free(array);
+ return 0;
+}
+
+static void set_count(int exoid, void_int *cnt, size_t ndx, size_t val)
+{
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ ((int64_t*)cnt)[ndx] = val;
+ } else {
+ ((int*)cnt)[ndx] = val;
+ }
+}
+
+static void get_nodes(int exoid, void_int *to, size_t ito, void_int *from, size_t ifrom)
+{
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ ((int64_t*)to)[ito] = ((int64_t*)from)[ifrom];
+ } else {
+ ((int*)to)[ito] = ((int*)from)[ifrom];
+ }
+}
+
+int ex_get_side_set_node_list(int exoid,
+ ex_entity_id side_set_id,
+ void_int *side_set_node_cnt_list,
+ void_int *side_set_node_list)
+{
+ size_t m;
+ size_t i, j;
+ int64_t elem, side;
+ int64_t num_side_sets, num_elem_blks, num_df, ndim;
+ int64_t tot_num_elem = 0, tot_num_ss_elem = 0, elem_num = 0;
+ size_t connect_offset, side_num, node_pos;
+ void_int *elem_blk_ids = NULL;
+ void_int *connect = NULL;
+ void_int *ss_elem_ndx = NULL;
+ void_int *ss_elem_node_ndx = NULL;
+ void_int *ss_parm_ndx = NULL;
+ void_int *side_set_elem_list = NULL;
+ void_int *side_set_side_list = NULL;
+ size_t elem_ctr, node_ctr, elem_num_pos;
+ size_t num_nodes_per_elem;
+ int int_size, ids_size;
+
+ int err_stat = EX_NOERR;
+ int status;
+
+ struct elem_blk_parm *elem_blk_parms = NULL;
+
+ /* side to node translation tables -
+ These tables are used to look up the side number based on the
+ first and second node in the side/face list. The side node order
+ is found in the original Exodus document, SAND87-2997. The element
+ node order is found in the ExodusII document, SAND92-2137. These
+ tables were generated by following the right-hand rule for determining
+ the outward normal.
+ */
+ /* triangle */
+ static int tri_table[3][3] = {
+ /* 1 2 3 side */
+ {1,2,4}, {2,3,5}, {3,1,6} /* nodes */
+ };
+
+ /* triangle 3d */
+ static int tri3_table[5][7] = {
+ /* 1 2 side */
+ {1,2,3,4,5,6,7}, {3,2,1,6,5,4,7}, /* nodes */
+ /* 3 4 5 side */
+ {1,2,4,0,0,0,0}, {2,3,5,0,0,0,0}, {3,1,6,0,0,0,0} /* nodes */
+ };
+
+ /* quad */
+ static int quad_table[4][3] = {
+ /* 1 2 3 4 side */
+ {1,2,5}, {2,3,6}, {3,4,7}, {4,1,8} /* nodes */
+ };
+
+ /* shell */
+ static int shell_table[6][8] = {
+ /* 1 2 side */
+ {1,2,3,4,5,6,7,8}, {1,4,3,2,8,7,6,5} , /* nodes */
+ /* 3 4 side */
+ {1,2,5,0,0,0,0,0}, {2,3,6,0,0,0,0,0} , /* nodes */
+ /* 5 6 side */
+ {3,4,7,0,0,0,0,0}, {4,1,8,0,0,0,0,0} /* nodes */
+ };
+
+ /* tetra */
+ static int tetra_table[4][6] = {
+ /* 1 2 3 4 side */
+ {1,2,4,5,9,8}, {2,3,4,6,10,9}, {1,4,3,8,10,7}, {1,3,2,7,6,5} /* nodes */
+ };
+
+ /* wedge */
+ static int wedge_table[5][8] = {
+ /* 1 2 3 side */
+ {1,2,5,4,7,11,13,10}, {2,3,6,5,8,12,14,11}, {1,4,6,3,10,15,12,9},
+ /* 4 5 side */
+ {1,3,2,0,9,8,7,0}, {4,5,6,0,13,14,15,0} /* nodes */
+ };
+
+ /* hex */
+ static int hex_table[6][9] = {
+ /* 1 2 side */
+ {1,2,6,5,9,14,17,13,26}, {2,3,7,6,10,15,18,14,25}, /* nodes */
+ /* 3 4 side */
+ {3,4,8,7,11,16,19,15,27}, {1,5,8,4,13,20,16,12,24}, /* nodes */
+ /* 5 6 side */
+ {1,4,3,2,12,11,10,9,22}, {5,6,7,8,17,18,19,20,23} /* nodes */
+ };
+
+ /* pyramid */
+ static int pyramid_table[5][8] = {
+ /* 1 2 3 side */
+ {1,2,5,0,6,11,10,0}, {2,3,5,0,7,12,11,0}, {3,4,5,0,8,13,12,0}, /* nodes */
+ /* 4 5 side */
+ {1,5,4,0,10,13,9,0}, {1,4,3,2,9,8,7,6} /* nodes */
+ };
+
+
+ char errmsg[MAX_ERR_LENGTH];
+
+ exerrval = 0; /* clear error code */
+
+ /* first check if any side sets are specified */
+ /* inquire how many side sets have been stored */
+
+ num_side_sets = ex_inquire_int(exoid, EX_INQ_SIDE_SETS);
+ if (num_side_sets < 0) {
+ sprintf(errmsg,
+ "Error: failed to get number of side sets in file id %d",exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+
+ if (num_side_sets == 0) {
+ sprintf(errmsg,
+ "Warning: no side sets defined in file id %d",exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,EX_WARN);
+ return(EX_WARN);
+ }
+
+ /* Lookup index of side set id in VAR_SS_IDS array */
+ ex_id_lkup(exoid,EX_SIDE_SET,side_set_id);
+ if (exerrval != 0) {
+ if (exerrval == EX_NULLENTITY) {
+ sprintf(errmsg,
+ "Warning: side set %"PRId64" is NULL in file id %d",
+ side_set_id,exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,EX_MSG);
+ return (EX_WARN);
+ }
+ else {
+
+ sprintf(errmsg,
+ "Error: failed to locate side set %"PRId64" in VAR_SS_IDS array in file id %d",
+ side_set_id,exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ }
+
+ num_elem_blks = ex_inquire_int(exoid, EX_INQ_ELEM_BLK);
+ if (num_elem_blks < 0) {
+ sprintf(errmsg,
+ "Error: failed to get number of element blocks in file id %d",exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+
+ tot_num_elem = ex_inquire_int(exoid, EX_INQ_ELEM);
+ if (tot_num_elem < 0) {
+ sprintf(errmsg,
+ "Error: failed to get total number of elements in file id %d",exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+
+ /* get the dimensionality of the coordinates; this is necessary to
+ distinguish between 2d TRIs and 3d TRIs */
+ ndim = ex_inquire_int(exoid, EX_INQ_DIM);
+ if (ndim < 0) {
+ sprintf(errmsg,
+ "Error: failed to get dimensionality in file id %d",exoid);
+ ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+
+ int_size = sizeof(int);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ int_size = sizeof(int64_t);
+ }
+
+ ids_size = sizeof(int);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ ids_size = sizeof(int64_t);
+ }
+
+ /* First determine the # of elements in the side set*/
+ if (int_size == sizeof(int64_t)) {
+ status = ex_get_set_param(exoid,EX_SIDE_SET, side_set_id,&tot_num_ss_elem,&num_df);
+ } else {
+ int tot, df;
+ status = ex_get_set_param(exoid,EX_SIDE_SET, side_set_id,&tot,&df);
+ tot_num_ss_elem = tot;
+ num_df = df;
+ }
+
+ if (status != EX_NOERR) {
+ sprintf(errmsg,
+ "Error: failed to get number of elements in side set %"PRId64" in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+
+ /* Allocate space for the side set element list */
+ if (!(side_set_elem_list=malloc(tot_num_ss_elem*int_size))) {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for side set element list for file id %d",
+ exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* Allocate space for the side set side list */
+ if (!(side_set_side_list=malloc(tot_num_ss_elem*int_size))) {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for side set side list for file id %d",
+ exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ if (ex_get_set(exoid, EX_SIDE_SET, side_set_id,
+ side_set_elem_list, side_set_side_list) == -1) {
+ safe_free(side_set_elem_list);
+ safe_free(side_set_side_list);
+ sprintf(errmsg,
+ "Error: failed to get side set %"PRId64" in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* Allocate space for the ss element index array */
+ if (!(ss_elem_ndx= malloc(tot_num_ss_elem*int_size))) {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for side set elem sort array for file id %d",
+ exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ /* Sort side set element list into index array - non-destructive */
+ if (int_size == sizeof(int64_t)) {
+ /* Sort side set element list into index array - non-destructive */
+ int64_t *elems = (int64_t*)ss_elem_ndx;
+ for (i=0;i<tot_num_ss_elem;i++) {
+ elems[i] = i; /* init index array to current position */
+ }
+ ex_iqsort64(side_set_elem_list, ss_elem_ndx,tot_num_ss_elem);
+ } else {
+ /* Sort side set element list into index array - non-destructive */
+ int *elems = (int*)ss_elem_ndx;
+ for (i=0;i<tot_num_ss_elem;i++) {
+ elems[i] = i; /* init index array to current position */
+ }
+ ex_iqsort(side_set_elem_list, ss_elem_ndx,tot_num_ss_elem);
+ }
+
+ /* Allocate space for the element block ids */
+ if (!(elem_blk_ids= malloc(num_elem_blks*ids_size))) {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for element block ids for file id %d",
+ exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ if (ex_get_elem_blk_ids(exoid, elem_blk_ids) == -1) {
+ sprintf(errmsg,
+ "Error: failed to get element block ids in file id %d",
+ exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,EX_MSG);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ /* Allocate space for the element block params */
+ if (!(elem_blk_parms= malloc(num_elem_blks*sizeof(struct elem_blk_parm)))) {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for element block params for file id %d",
+ exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ elem_ctr = 0;
+ for (i=0; i<num_elem_blks; i++) {
+ ex_block block;
+
+ if (ids_size == sizeof(int64_t)) {
+ block.id = ((int64_t*)elem_blk_ids)[i];
+ } else {
+ block.id = ((int*)elem_blk_ids)[i];
+ }
+ block.type = EX_ELEM_BLOCK;
+
+ /* read in an element block parameter */
+ if ((ex_get_block_param (exoid, &block)) == -1) {
+ sprintf(errmsg,
+ "Error: failed to get element block %"PRId64" parameters in file id %d",
+ block.id, exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,EX_MSG);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ elem_blk_parms[i].num_elem_in_blk = block.num_entry;
+ elem_blk_parms[i].num_nodes_per_elem = block.num_nodes_per_entry;
+ elem_blk_parms[i].num_attr = block.num_attribute;
+ elem_blk_parms[i].elem_blk_id = block.id;
+
+ for (m=0; m < strlen(block.topology); m++) {
+ elem_blk_parms[i].elem_type[m] = toupper(block.topology[m]);
+ }
+ elem_blk_parms[i].elem_type[m] = '\0';
+
+ if (strncmp(elem_blk_parms[i].elem_type,"CIRCLE",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_CIRCLE;
+ /* set side set node stride */
+ elem_blk_parms[i].num_nodes_per_side[0] = 1;
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"SPHERE",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_SPHERE;
+ /* set side set node stride */
+ elem_blk_parms[i].num_nodes_per_side[0] = 1;
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"QUAD",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_QUAD;
+ /* determine side set node stride */
+ if (elem_blk_parms[i].num_nodes_per_elem == 4)
+ elem_blk_parms[i].num_nodes_per_side[0] = 2;
+ else if (elem_blk_parms[i].num_nodes_per_elem == 5)
+ elem_blk_parms[i].num_nodes_per_side[0] = 2;
+ else
+ elem_blk_parms[i].num_nodes_per_side[0] = 3;
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"TRIANGLE",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_TRIANGLE;
+ /* set default side set node stride */
+ if (ndim == 2) /* 2d TRIs */
+ {
+ if (elem_blk_parms[i].num_nodes_per_elem == 3)
+ elem_blk_parms[i].num_nodes_per_side[0] = 2;
+ else
+ elem_blk_parms[i].num_nodes_per_side[0] = 3;
+ }
+ else if (ndim == 3) /* 3d TRIs */
+ {
+ if (elem_blk_parms[i].num_nodes_per_elem == 3)
+ elem_blk_parms[i].num_nodes_per_side[0] = 3;
+ else
+ elem_blk_parms[i].num_nodes_per_side[0] = 6;
+ }
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"SHELL",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_SHELL;
+ /* determine side set node stride */
+ if (elem_blk_parms[i].num_nodes_per_elem == 2) /* KLUDGE for 2D Shells*/
+ elem_blk_parms[i].num_nodes_per_side[0] = 2;
+ else if (elem_blk_parms[i].num_nodes_per_elem == 4)
+ elem_blk_parms[i].num_nodes_per_side[0] = 4;
+ else
+ elem_blk_parms[i].num_nodes_per_side[0] = 8;
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"HEX",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_HEX;
+ /* determine side set node stride */
+ if (elem_blk_parms[i].num_nodes_per_elem == 8) /* 8-node bricks */
+ elem_blk_parms[i].num_nodes_per_side[0] = 4;
+ else if (elem_blk_parms[i].num_nodes_per_elem == 9) /* 9-node bricks */
+ elem_blk_parms[i].num_nodes_per_side[0] = 4;
+ else if (elem_blk_parms[i].num_nodes_per_elem == 12) /* HEXSHELLS */
+ elem_blk_parms[i].num_nodes_per_side[0] = 4;
+ else if (elem_blk_parms[i].num_nodes_per_elem == 27) /* 27-node bricks */
+ elem_blk_parms[i].num_nodes_per_side[0] = 9;
+ else
+ elem_blk_parms[i].num_nodes_per_side[0] = 8;
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"TETRA",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_TETRA;
+ /* determine side set node stride */
+ if (elem_blk_parms[i].num_nodes_per_elem == 4)
+ elem_blk_parms[i].num_nodes_per_side[0] = 3;
+ else if (elem_blk_parms[i].num_nodes_per_elem == 8)
+ elem_blk_parms[i].num_nodes_per_side[0] = 4;
+ else
+ elem_blk_parms[i].num_nodes_per_side[0] = 6;
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"WEDGE",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_WEDGE;
+ /* determine side set node stride */
+ if (elem_blk_parms[i].num_nodes_per_elem == 6)
+ elem_blk_parms[i].num_nodes_per_side[0] = 4;
+ else
+ elem_blk_parms[i].num_nodes_per_side[0] = 8;
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"PYRAMID",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_PYRAMID;
+ /* determine side set node stride */
+ if (elem_blk_parms[i].num_nodes_per_elem == 5)
+ elem_blk_parms[i].num_nodes_per_side[0] = 4;
+ else
+ elem_blk_parms[i].num_nodes_per_side[0] = 8;
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"BEAM",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_BEAM;
+ /* determine side set node stride */
+ if (elem_blk_parms[i].num_nodes_per_elem == 2)
+ elem_blk_parms[i].num_nodes_per_side[0] = 2;
+ else
+ elem_blk_parms[i].num_nodes_per_side[0] = 3;
+ }
+ else if ( (strncmp(elem_blk_parms[i].elem_type,"TRUSS",3) == 0) ||
+ (strncmp(elem_blk_parms[i].elem_type,"BAR",3) == 0) ||
+ (strncmp(elem_blk_parms[i].elem_type,"EDGE",3) == 0) )
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_TRUSS;
+ /* determine side set node stride */
+ if (elem_blk_parms[i].num_nodes_per_elem == 2)
+ elem_blk_parms[i].num_nodes_per_side[0] = 2;
+ else
+ elem_blk_parms[i].num_nodes_per_side[0] = 3;
+ }
+ else if (strncmp(elem_blk_parms[i].elem_type,"NULL",3) == 0)
+ {
+ elem_blk_parms[i].elem_type_val = EX_EL_NULL_ELEMENT;
+ elem_blk_parms[i].num_nodes_per_side[0] = 0;
+ elem_blk_parms[i].num_elem_in_blk = 0;
+ }
+ else
+ { /* unsupported element type; no problem if no sides specified for
+ this element block */
+ elem_blk_parms[i].elem_type_val = EX_EL_UNK;
+ elem_blk_parms[i].num_nodes_per_side[0] = 0;
+ }
+ elem_blk_parms[i].elem_blk_id = block.id; /* save id */
+ elem_ctr += elem_blk_parms[i].num_elem_in_blk;
+ elem_blk_parms[i].elem_ctr = elem_ctr; /* save elem number max */
+ }
+
+
+ /* Allocate space for the ss element to element block parameter index array */
+ if (!(ss_parm_ndx=malloc(tot_num_ss_elem*int_size)))
+ {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for side set elem parms index for file id %d",
+ exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+
+ /* Allocate space for the ss element to node list index array */
+ if (!(ss_elem_node_ndx=malloc(tot_num_ss_elem*int_size)))
+ {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for side set elem to node index for file id %d",
+ exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ /* Build side set element to node list index and side set element
+ parameter index.
+ */
+ node_ctr = 0;
+ for (i=0;i<tot_num_ss_elem;i++) {
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ elem = ((int64_t*)side_set_elem_list)[i];
+ side = ((int64_t*)side_set_side_list)[i];
+ } else {
+ elem = ((int*)side_set_elem_list)[i];
+ side = ((int*)side_set_side_list)[i];
+ }
+
+ for (j=0; j<num_elem_blks; j++) {
+ if (elem_blk_parms[j].elem_type_val != EX_EL_NULL_ELEMENT)
+ if (elem <= elem_blk_parms[j].elem_ctr)
+ break;
+ }
+
+ if (j >= num_elem_blks) {
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Error: Invalid element number %"PRId64" found in side set %"PRId64" in file %d",
+ elem, side_set_id, exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,EX_MSG);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ if (int_size == sizeof(int64_t)) {
+ ((int64_t*)ss_parm_ndx)[i] = j; /* assign parameter block index */
+ ((int64_t*)ss_elem_node_ndx)[i] = node_ctr; /* assign node list index */
+ } else {
+ ((int*)ss_parm_ndx)[i] = j; /* assign parameter block index */
+ ((int*)ss_elem_node_ndx)[i] = node_ctr; /* assign node list index */
+ }
+
+ /* Update node_ctr (which points to next node in chain */
+
+ /* WEDGEs with 3 node sides (side 4 or 5) are special cases */
+ if (elem_blk_parms[j].elem_type_val == EX_EL_WEDGE &&
+ (side == 4 || side == 5))
+ {
+ if (elem_blk_parms[j].num_nodes_per_elem == 6)
+ node_ctr += 3; /* 3 node side */
+ else
+ node_ctr += 6; /* 6 node side */
+ }
+ /* PYRAMIDSs with 3 node sides (sides 1,2,3,4) are also special */
+ else if (elem_blk_parms[j].elem_type_val == EX_EL_PYRAMID &&
+ (side < 5))
+ {
+ if (elem_blk_parms[j].num_nodes_per_elem == 5)
+ node_ctr += 3; /* 3 node side */
+ else
+ node_ctr += 6; /* 6 node side */
+ }
+ /* side numbers 3,4,5,6 for SHELLs are also special */
+ else if (elem_blk_parms[j].elem_type_val == EX_EL_SHELL &&
+ (side > 2 ))
+ {
+ if (elem_blk_parms[j].num_nodes_per_elem == 4)
+ node_ctr += 2; /* 2 node side */
+ else
+ node_ctr += 3; /* 3 node side */
+ }
+ /* side numbers 3,4,5 for 3d TRIs are also special */
+ else if (elem_blk_parms[j].elem_type_val == EX_EL_TRIANGLE &&
+ ndim == 3 &&
+ side > 2 )
+ {
+ if (elem_blk_parms[j].num_nodes_per_elem == 3) /* 3-node TRI */
+ node_ctr += 2; /* 2 node side */
+ else /* 6-node TRI */
+ node_ctr += 3; /* 3 node side */
+ }
+ else /* all other element types */
+ node_ctr += elem_blk_parms[j].num_nodes_per_side[0];
+ }
+
+ /* All setup, ready to go ... */
+
+ elem_ctr=0;
+
+ for (j=0; j < tot_num_ss_elem; j++) {
+ int64_t elem_ndx;
+ size_t parm_ndx;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ elem_ndx = ((int64_t*)ss_elem_ndx)[j];
+ elem = ((int64_t*)side_set_elem_list)[elem_ndx];
+ side = ((int64_t*)side_set_side_list)[elem_ndx];
+ parm_ndx = ((int64_t*)ss_parm_ndx)[elem_ndx];
+ } else {
+ elem_ndx = ((int*)ss_elem_ndx)[j];
+ elem = ((int*)side_set_elem_list)[elem_ndx];
+ side = ((int*)side_set_side_list)[elem_ndx];
+ parm_ndx = ((int*)ss_parm_ndx)[elem_ndx];
+ }
+
+ if (elem > elem_ctr) {
+ /* release connectivity array space and get next one */
+ if (elem_ctr > 0) {
+ safe_free(connect);
+ }
+
+ /* Allocate space for the connectivity array for new element block */
+ if (!(connect=malloc(elem_blk_parms[parm_ndx].num_elem_in_blk*
+ elem_blk_parms[parm_ndx].num_nodes_per_elem*
+ int_size)))
+ {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for connectivity array for file id %d",
+ exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ /* get connectivity array */
+ if (ex_get_elem_conn(exoid,
+ elem_blk_parms[parm_ndx].elem_blk_id,
+ connect) == -1)
+ {
+ sprintf(errmsg,
+ "Error: failed to allocate space for connectivity array for file id %d",
+ exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+ elem_ctr = elem_blk_parms[parm_ndx].elem_ctr;
+ }
+ /* For each side in side set, use the appropriate lookup table to
+ determine the nodes from the connect array. */
+
+ elem_num = elem-1;/* element number 0-based*/
+ /* calculate the relative element number position in it's block*/
+
+ elem_num_pos = elem_num -
+ (elem_blk_parms[parm_ndx].elem_ctr -
+ elem_blk_parms[parm_ndx].num_elem_in_blk);
+
+ /* calculate the beginning of the node list for this element by
+ using the ss_elem_node_ndx index into the side_sets_node_index
+ and adding the element number position * number of nodes per elem */
+
+ num_nodes_per_elem = elem_blk_parms[parm_ndx].num_nodes_per_elem;
+ connect_offset = num_nodes_per_elem*elem_num_pos;
+ side_num = side-1;
+
+ if (int_size == sizeof(int64_t)) {
+ node_pos = ((int64_t*)ss_elem_node_ndx)[elem_ndx];
+ } else {
+ node_pos = ((int*)ss_elem_node_ndx)[elem_ndx];
+ }
+
+ switch (elem_blk_parms[parm_ndx].elem_type_val)
+ {
+ case EX_EL_CIRCLE:
+ case EX_EL_SPHERE:
+ { /* Note: no side-node lookup table is used for this simple case */
+ get_nodes(exoid, side_set_node_list, node_pos, connect, connect_offset);
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 1); /* 1 node object */
+ break;
+ }
+ case EX_EL_TRUSS:
+ case EX_EL_BEAM:
+ { /* Note: no side-node lookup table is used for this simple case */
+ for (i=0; i < num_nodes_per_elem; i++) {
+ get_nodes(exoid, side_set_node_list, node_pos+i, connect, connect_offset+i);
+ }
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, num_nodes_per_elem);
+ break;
+ }
+ case EX_EL_TRIANGLE:
+ {
+ if (side_num+1 < 1 || side_num+1 > 5) /* side number range check */
+ {
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Error: Invalid triangle edge number %"ST_ZU" in file id %d",
+ side_num+1, exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ if (ndim == 2) /* 2d TRIs */
+ {
+ get_nodes(exoid, side_set_node_list, node_pos, connect, connect_offset+tri_table[side_num][0]-1);
+ get_nodes(exoid, side_set_node_list, node_pos+1, connect, connect_offset+tri_table[side_num][1]-1);
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 2); /* 2 node object */
+ if (num_nodes_per_elem > 3) /* 6-node TRI */
+ {
+ get_nodes(exoid, side_set_node_list, node_pos+2, connect, connect_offset+tri_table[side_num][2]-1);
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 3); /* 3 node object */
+ }
+ }
+ else if (ndim == 3) /* 3d TRIs */
+ {
+ get_nodes(exoid, side_set_node_list, node_pos, connect, connect_offset+tri3_table[side_num][0]-1);
+ get_nodes(exoid, side_set_node_list, node_pos+1, connect, connect_offset+tri3_table[side_num][1]-1);
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 2); /* 2 node object */
+ if (side_num+1 <= 2) /* 3- or 6-node face */
+ {
+ if (num_nodes_per_elem == 3) /* 3-node face */
+ {
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 3); /* 3 node object */
+ get_nodes(exoid, side_set_node_list, node_pos+2, connect, connect_offset+tri3_table[side_num][2]-1);
+ }
+ else /* 6-node face */
+ {
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 6); /* 6 node object */
+ get_nodes(exoid, side_set_node_list, node_pos+2, connect, connect_offset+tri3_table[side_num][2]-1);
+ get_nodes(exoid, side_set_node_list, node_pos+3, connect, connect_offset+tri3_table[side_num][3]-1);
+ get_nodes(exoid, side_set_node_list, node_pos+4, connect, connect_offset+tri3_table[side_num][4]-1);
+ get_nodes(exoid, side_set_node_list, node_pos+5, connect, connect_offset+tri3_table[side_num][5]-1);
+ }
+ }
+ else /* 2- or 3-node edge */
+ {
+ if (num_nodes_per_elem > 3) /* 3-node edge */
+ {
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 3); /* 3 node object */
+ get_nodes(exoid, side_set_node_list, node_pos+2, connect, connect_offset+tri3_table[side_num][2]-1);
+ }
+ }
+ }
+ break;
+ }
+ case EX_EL_QUAD:
+ {
+ if (side_num+1 < 1 || side_num+1 > 4) /* side number range check */
+ {
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Error: Invalid quad edge number %"ST_ZU" in file id %d",
+ side_num+1, exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ get_nodes(exoid, side_set_node_list, node_pos+0, connect, connect_offset+quad_table[side_num][0]-1);
+ get_nodes(exoid, side_set_node_list, node_pos+1, connect, connect_offset+quad_table[side_num][1]-1);
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 2); /* 2 node object */
+ if (num_nodes_per_elem > 5)
+ {
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 3); /* 3 node object */
+ get_nodes(exoid, side_set_node_list, node_pos+2, connect, connect_offset+quad_table[side_num][2]-1);
+ }
+ break;
+ }
+ case EX_EL_SHELL:
+ {
+ if (side_num+1 < 1 || side_num+1 > 6) /* side number range check */
+ {
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Error: Invalid shell face number %"ST_ZU" in file id %d",
+ side_num+1, exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ get_nodes(exoid, side_set_node_list, node_pos+0, connect, connect_offset+shell_table[side_num][0]-1);
+ get_nodes(exoid, side_set_node_list, node_pos+1, connect, connect_offset+shell_table[side_num][1]-1);
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 2); /* 2 node object */
+ if (num_nodes_per_elem > 2) /*** KLUDGE for 2D shells ***/
+ {
+ if (side_num+1 <= 2) /* 4-node face */
+ {
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 4); /* 4 node object */
+ get_nodes(exoid, side_set_node_list, node_pos+2, connect, connect_offset+shell_table[side_num][2]-1);
+ get_nodes(exoid, side_set_node_list, node_pos+3, connect, connect_offset+shell_table[side_num][3]-1);
+ }
+ }
+ if (num_nodes_per_elem == 8)
+ {
+ if (side_num+1 <= 2) /* 8-node face */
+ {
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 8); /* 8 node object */
+ get_nodes(exoid, side_set_node_list, node_pos+4, connect, connect_offset+shell_table[side_num][4]-1);
+ get_nodes(exoid, side_set_node_list, node_pos+5, connect, connect_offset+shell_table[side_num][5]-1);
+ get_nodes(exoid, side_set_node_list, node_pos+6, connect, connect_offset+shell_table[side_num][6]-1);
+ get_nodes(exoid, side_set_node_list, node_pos+7, connect, connect_offset+shell_table[side_num][7]-1);
+ }
+ else
+ {
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 3); /* 3 node edge */
+ get_nodes(exoid, side_set_node_list, node_pos+2, connect, connect_offset+shell_table[side_num][2]-1);
+ }
+ }
+ break;
+ }
+ case EX_EL_TETRA:
+ {
+ if (side_num+1 < 1 || side_num+1 > 4) /* side number range check */
+ {
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Error: Invalid tetra face number %"ST_ZU" in file id %d",
+ side_num+1, exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ get_nodes(exoid, side_set_node_list, node_pos+0, connect, connect_offset+tetra_table[side_num][0]-1);
+ get_nodes(exoid, side_set_node_list, node_pos+1, connect, connect_offset+tetra_table[side_num][1]-1);
+ get_nodes(exoid, side_set_node_list, node_pos+2, connect, connect_offset+tetra_table[side_num][2]-1);
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 3); /* 3 node object */
+ if (num_nodes_per_elem == 8)
+ {
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 4); /* 4 node object */
+ get_nodes(exoid, side_set_node_list, node_pos+3, connect, connect_offset+tetra_table[side_num][3]-1);
+ }
+ else if (num_nodes_per_elem > 8)
+ {
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 6); /* 6 node object */
+ get_nodes(exoid, side_set_node_list, node_pos+3, connect, connect_offset+tetra_table[side_num][3]-1);
+ get_nodes(exoid, side_set_node_list, node_pos+4, connect, connect_offset+tetra_table[side_num][4]-1);
+ get_nodes(exoid, side_set_node_list, node_pos+5, connect, connect_offset+tetra_table[side_num][5]-1);
+ }
+ break;
+ }
+ case EX_EL_WEDGE:
+ {
+ if (side_num+1 < 1 || side_num+1 > 5) /* side number range check */
+ {
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Error: Invalid wedge face number %"ST_ZU" in file id %d",
+ side_num+1, exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ get_nodes(exoid, side_set_node_list, node_pos++, connect, connect_offset+wedge_table[side_num][0]-1);
+ get_nodes(exoid, side_set_node_list, node_pos++, connect, connect_offset+wedge_table[side_num][1]-1);
+ get_nodes(exoid, side_set_node_list, node_pos++, connect, connect_offset+wedge_table[side_num][2]-1);
+
+ if (wedge_table[side_num][3] == 0) { /* degenerate side? */
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 3); /* 3 node side */
+ }
+ else
+ {
+ get_nodes(exoid, side_set_node_list, node_pos++, connect, connect_offset+wedge_table[side_num][3]-1);
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 4); /* 4 node side */
+ }
+
+
+ if (num_nodes_per_elem > 6)
+ {
+ get_nodes(exoid, side_set_node_list, node_pos++, connect, connect_offset+wedge_table[side_num][4]-1);
+ get_nodes(exoid, side_set_node_list, node_pos++, connect, connect_offset+wedge_table[side_num][5]-1);
+ get_nodes(exoid, side_set_node_list, node_pos++, connect, connect_offset+wedge_table[side_num][6]-1);
+
+ if (wedge_table[side_num][7] == 0) /* degenerate side? */
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 7); /* 6 node side */
+ else
+ {
+ get_nodes(exoid, side_set_node_list, node_pos++, connect, connect_offset+wedge_table[side_num][7]-1);
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 8); /* 8 node side */
+ }
+ }
+ break;
+ }
+ case EX_EL_PYRAMID:
+ {
+ if (side_num+1 < 1 || side_num+1 > 5) /* side number range check */
+ {
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Error: Invalid pyramid face number %"ST_ZU" in file id %d",
+ side_num+1, exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ get_nodes(exoid, side_set_node_list, node_pos++, connect, connect_offset+pyramid_table[side_num][0]-1);
+ get_nodes(exoid, side_set_node_list, node_pos++, connect, connect_offset+pyramid_table[side_num][1]-1);
+ get_nodes(exoid, side_set_node_list, node_pos++, connect, connect_offset+pyramid_table[side_num][2]-1);
+
+ if (pyramid_table[side_num][3] == 0) { /* degenerate side? */
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 3); /* 3 node side */
+ }
+ else
+ {
+ get_nodes(exoid, side_set_node_list, node_pos++, connect, connect_offset+pyramid_table[side_num][3]-1);
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 4); /* 4 node side */
+ }
+
+
+ if (num_nodes_per_elem > 5)
+ {
+ get_nodes(exoid, side_set_node_list, node_pos++, connect, connect_offset+pyramid_table[side_num][4]-1);
+ get_nodes(exoid, side_set_node_list, node_pos++, connect, connect_offset+pyramid_table[side_num][5]-1);
+ get_nodes(exoid, side_set_node_list, node_pos++, connect, connect_offset+pyramid_table[side_num][6]-1);
+
+ if (pyramid_table[side_num][7] == 0) /* degenerate side? */
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 7); /* 6 node side */
+ else
+ {
+ get_nodes(exoid, side_set_node_list, node_pos++, connect, connect_offset+pyramid_table[side_num][7]-1);
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 8); /* 8 node side */
+ }
+ }
+ break;
+ }
+ case EX_EL_HEX:
+ {
+ if (side_num+1 < 1 || side_num+1 > 6) /* side number range check */
+ {
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Error: Invalid hex face number %"ST_ZU" in file id %d",
+ side_num+1, exoid);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ err_stat = EX_FATAL;
+ goto cleanup;
+ }
+
+ get_nodes(exoid, side_set_node_list, node_pos+0, connect, connect_offset+hex_table[side_num][0]-1);
+ get_nodes(exoid, side_set_node_list, node_pos+1, connect, connect_offset+hex_table[side_num][1]-1);
+ get_nodes(exoid, side_set_node_list, node_pos+2, connect, connect_offset+hex_table[side_num][2]-1);
+ get_nodes(exoid, side_set_node_list, node_pos+3, connect, connect_offset+hex_table[side_num][3]-1);
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 4); /* 4 node object */
+ if (num_nodes_per_elem > 12) /* more nodes than HEXSHELL */
+ {
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 8); /* 8 node object */
+ get_nodes(exoid, side_set_node_list, node_pos+4, connect, connect_offset+hex_table[side_num][4]-1);
+ get_nodes(exoid, side_set_node_list, node_pos+5, connect, connect_offset+hex_table[side_num][5]-1);
+ get_nodes(exoid, side_set_node_list, node_pos+6, connect, connect_offset+hex_table[side_num][6]-1);
+ get_nodes(exoid, side_set_node_list, node_pos+7, connect, connect_offset+hex_table[side_num][7]-1);
+ }
+ if (num_nodes_per_elem == 27) /* 27-node brick */
+ {
+ set_count(exoid, side_set_node_cnt_list, elem_ndx, 9); /* 9 node object */
+ get_nodes(exoid, side_set_node_list, node_pos+8, connect, connect_offset+hex_table[side_num][8]-1);
+ }
+ break;
+ }
+ default:
+ {
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Error: %s is an unsupported element type",
+ elem_blk_parms[parm_ndx].elem_type);
+ ex_err("ex_get_side_set_node_list",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+ }
+ }
+
+
+ /* All done: release connectivity array space, element block ids array,
+ element block parameters array, and side set element index array */
+ cleanup:
+ safe_free(connect);
+ safe_free(ss_parm_ndx);
+ safe_free(elem_blk_ids);
+ safe_free(elem_blk_parms);
+ safe_free(ss_elem_ndx);
+ safe_free(ss_elem_node_ndx);
+ safe_free(side_set_side_list);
+ safe_free(side_set_elem_list);
+
+ return(err_stat);
+}
diff --git a/exodus/cbind/src/exgsnl.c b/exodus/cbind/src/ex_get_side_set_node_list_len.c
similarity index 61%
rename from exodus/cbind/src/exgsnl.c
rename to exodus/cbind/src/ex_get_side_set_node_list_len.c
index 14b3741..7754e42 100644
--- a/exodus/cbind/src/exgsnl.c
+++ b/exodus/cbind/src/ex_get_side_set_node_list_len.c
@@ -55,6 +55,8 @@
#include "exodusII.h"
#include "exodusII_int.h"
+static void *safe_free(void *array);
+
/*!
* This routine is designed to read the Exodus II V 2.0 side set side
* definition and return the length of a ExodusI style side set node list.
@@ -64,70 +66,73 @@
*/
int ex_get_side_set_node_list_len(int exoid,
- int side_set_id,
- int *side_set_node_list_len)
+ ex_entity_id side_set_id,
+ void_int *side_set_node_list_len)
{
- int i, j;
+ size_t i, j;
size_t m;
- int num_side_sets, num_elem_blks, num_df, ndim;
- int tot_num_elem = 0, tot_num_ss_elem = 0;
- int *elem_blk_ids;
- int *ss_elem_ndx;
- int *side_set_elem_list, *side_set_side_list;
+ int64_t num_side_sets, num_elem_blks, num_df, ndim;
+ size_t list_len = 0;
+ int64_t tot_num_elem = 0, tot_num_ss_elem = 0;
+ void_int *elem_blk_ids;
+ int *ss_elem_ndx = NULL;
+ int64_t *ss_elem_ndx_64 = NULL;
+
+ void_int *side_set_elem_list;
+ void_int *side_set_side_list;
int elem_ctr;
- int num_elem_in_blk, num_nodes_per_elem, num_attr;
- float fdum;
- char *cdum, elem_type[MAX_STR_LENGTH+1];
-
+ int status;
+
struct elem_blk_parm *elem_blk_parms;
char errmsg[MAX_ERR_LENGTH];
exerrval = 0; /* clear error code */
- cdum = 0; /* initialize even though it is not used */
-
- *side_set_node_list_len = 0; /* default value */
-/* first check if any side sets are specified */
-/* inquire how many side sets have been stored */
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API)
+ *(int64_t*)side_set_node_list_len = 0; /* default value */
+ else
+ *(int*)side_set_node_list_len = 0; /* default value */
+
+ /* first check if any side sets are specified */
+ /* inquire how many side sets have been stored */
/* get the dimensionality of the coordinates; this is necessary to
distinguish between 2d TRIs and 3d TRIs */
- if ((ex_inquire(exoid, EX_INQ_DIM, &ndim, &fdum, cdum)) == -1)
- {
+ ndim = ex_inquire_int(exoid, EX_INQ_DIM);
+ if (ndim < 0) {
sprintf(errmsg,
"Error: failed to get dimensionality in file id %d",exoid);
ex_err("ex_get_side_set_node_list_len",errmsg,exerrval);
return(EX_FATAL);
}
- if ((ex_inquire(exoid, EX_INQ_ELEM, &tot_num_elem, &fdum, cdum)) == -1)
- {
+ tot_num_elem = ex_inquire_int(exoid, EX_INQ_ELEM);
+ if (tot_num_elem < 0) {
sprintf(errmsg,
"Error: failed to get total number of elements in file id %d",exoid);
ex_err("ex_get_side_set_node_list_len",errmsg,exerrval);
return(EX_FATAL);
}
- if ((ex_inquire(exoid, EX_INQ_ELEM_BLK, &num_elem_blks, &fdum, cdum)) == -1)
- {
+ num_elem_blks = ex_inquire_int(exoid, EX_INQ_ELEM_BLK);
+ if (num_elem_blks < 0) {
sprintf(errmsg,
"Error: failed to get number of element blocks in file id %d",exoid);
ex_err("ex_get_side_set_node_list_len",errmsg,exerrval);
return(EX_FATAL);
}
- if ((ex_inquire(exoid, EX_INQ_SIDE_SETS, &num_side_sets, &fdum, cdum)) == -1)
- {
+ num_side_sets = ex_inquire_int(exoid, EX_INQ_SIDE_SETS);
+ if (num_side_sets < 0) {
sprintf(errmsg,
"Error: failed to get number of side sets in file id %d",exoid);
ex_err("ex_get_side_set_node_list_len",errmsg,exerrval);
return(EX_FATAL);
}
- if (num_side_sets == 0)
- {
+ if (num_side_sets == 0) {
sprintf(errmsg,
"Warning: no side sets defined in file id %d",exoid);
ex_err("ex_get_side_set_node_list_len",errmsg,EX_WARN);
@@ -135,10 +140,19 @@ int ex_get_side_set_node_list_len(int exoid,
}
/* First determine the # of elements in the side set*/
- if ((ex_get_side_set_param(exoid,side_set_id,&tot_num_ss_elem,&num_df)) == -1)
- {
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = ex_get_side_set_param(exoid,side_set_id,&tot_num_ss_elem,&num_df);
+ } else {
+ int tot;
+ int df;
+ status = ex_get_side_set_param(exoid,side_set_id,&tot,&df);
+ tot_num_ss_elem = tot;
+ num_df = df;
+ }
+
+ if (status != NC_NOERR) {
sprintf(errmsg,
- "Error: failed to get number of elements in side set %d in file id %d",
+ "Error: failed to get number of elements in side set %"PRId64" in file id %d",
side_set_id, exoid);
ex_err("ex_get_side_set_node_list_len",errmsg,exerrval);
return(EX_FATAL);
@@ -150,99 +164,121 @@ int ex_get_side_set_node_list_len(int exoid,
/* Minor optimization/kluge -- If num_df is nonzero, or 1 per face
then assume that it matches the number of nodes in the sideset... */
if (num_df > 0 && num_df != tot_num_ss_elem) {
- *side_set_node_list_len = num_df;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API)
+ *(int64_t*)side_set_node_list_len = num_df;
+ else
+ *(int*)side_set_node_list_len = num_df;
return(EX_NOERR);
}
/* Allocate space for the side set element list */
- if (!(side_set_elem_list=malloc(tot_num_ss_elem*sizeof(int))))
{
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for side set element list for file id %d",
- exoid);
- ex_err("ex_get_side_set_node_list_len",errmsg,exerrval);
- return (EX_FATAL);
- }
+ int int_size = sizeof(int);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API)
+ int_size = sizeof(int64_t);
+ if (!(side_set_elem_list=malloc(tot_num_ss_elem*int_size))) {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for side set element list for file id %d",
+ exoid);
+ ex_err("ex_get_side_set_node_list_len",errmsg,exerrval);
+ return (EX_FATAL);
+ }
- /* Allocate space for the side set side list */
- if (!(side_set_side_list=malloc(tot_num_ss_elem*sizeof(int))))
- {
- free(side_set_elem_list);
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for side set side list for file id %d",
- exoid);
- ex_err("ex_get_side_set_node_list_len",errmsg,exerrval);
- return (EX_FATAL);
- }
+ /* Allocate space for the side set side list */
+ if (!(side_set_side_list=malloc(tot_num_ss_elem*int_size))) {
+ safe_free(side_set_elem_list);
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for side set side list for file id %d",
+ exoid);
+ ex_err("ex_get_side_set_node_list_len",errmsg,exerrval);
+ return (EX_FATAL);
+ }
- if (ex_get_side_set(exoid, side_set_id,
- side_set_elem_list, side_set_side_list) == -1)
- {
- free(side_set_elem_list);
- free(side_set_side_list);
- sprintf(errmsg,
- "Error: failed to get side set %d in file id %d",
- side_set_id, exoid);
- ex_err("ex_get_side_set_node_list_len",errmsg,exerrval);
- return (EX_FATAL);
- }
+ if (ex_get_side_set(exoid, side_set_id,
+ side_set_elem_list, side_set_side_list) != NC_NOERR) {
+ safe_free(side_set_elem_list);
+ safe_free(side_set_side_list);
+ sprintf(errmsg,
+ "Error: failed to get side set %"PRId64" in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_get_side_set_node_list_len",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* Allocate space for the ss element index array */
+ if (int_size == sizeof(int64_t)) {
+ ss_elem_ndx_64=malloc(tot_num_ss_elem*int_size);
+ } else {
+ ss_elem_ndx =malloc(tot_num_ss_elem*int_size);
+ }
- /* Allocate space for the ss element index array */
- if (!(ss_elem_ndx=malloc(tot_num_ss_elem*sizeof(int))))
- {
- free(side_set_elem_list);
- free(side_set_side_list);
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for side set elem sort array for file id %d",
- exoid);
- ex_err("ex_get_side_set_node_list_len",errmsg,exerrval);
- return (EX_FATAL);
+ if (ss_elem_ndx_64==NULL && ss_elem_ndx == NULL) {
+ safe_free(side_set_elem_list);
+ safe_free(side_set_side_list);
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate space for side set elem sort array for file id %d",
+ exoid);
+ ex_err("ex_get_side_set_node_list_len",errmsg,exerrval);
+ return (EX_FATAL);
+ }
}
/* Sort side set element list into index array - non-destructive */
- for (i=0;i<tot_num_ss_elem;i++)
- ss_elem_ndx[i] = i; /* init index array to current position */
-
- ex_iqsort(side_set_elem_list, ss_elem_ndx,tot_num_ss_elem);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ for (i=0;i<tot_num_ss_elem;i++)
+ ss_elem_ndx_64[i] = i; /* init index array to current position */
+ ex_iqsort64(side_set_elem_list, ss_elem_ndx_64,tot_num_ss_elem);
+ } else {
+ for (i=0;i<tot_num_ss_elem;i++)
+ ss_elem_ndx[i] = i; /* init index array to current position */
+ ex_iqsort(side_set_elem_list, ss_elem_ndx,tot_num_ss_elem);
+ }
/* Allocate space for the element block ids */
- if (!(elem_blk_ids=malloc(num_elem_blks*sizeof(int))))
{
- exerrval = EX_MEMFAIL;
- free(ss_elem_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- sprintf(errmsg,
- "Error: failed to allocate space for element block ids for file id %d",
- exoid);
- ex_err("ex_get_side_set_node_list_len",errmsg,exerrval);
- return (EX_FATAL);
- }
+ int int_size = sizeof(int);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ int_size = sizeof(int64_t);
+ }
- if (ex_get_elem_blk_ids(exoid, elem_blk_ids))
- {
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
+ if (!(elem_blk_ids=malloc(num_elem_blks*int_size))) {
+ exerrval = EX_MEMFAIL;
+ safe_free(ss_elem_ndx);
+ safe_free(ss_elem_ndx_64);
+ safe_free(side_set_side_list);
+ safe_free(side_set_elem_list);
+ sprintf(errmsg,
+ "Error: failed to allocate space for element block ids for file id %d",
+ exoid);
+ ex_err("ex_get_side_set_node_list_len",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ }
+
+ if (ex_get_elem_blk_ids(exoid, elem_blk_ids)) {
+ safe_free(elem_blk_ids);
+ safe_free(ss_elem_ndx);
+ safe_free(ss_elem_ndx_64);
+ safe_free(side_set_side_list);
+ safe_free(side_set_elem_list);
sprintf(errmsg,
- "Error: failed to get element block ids in file id %d",
+ "Error: failed to get element block ids in file id %d",
exoid);
ex_err("ex_get_side_set_node_list_len",errmsg,EX_MSG);
return(EX_FATAL);
}
/* Allocate space for the element block params */
- if (!(elem_blk_parms=malloc(num_elem_blks*sizeof(struct elem_blk_parm))))
- {
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
+ if (!(elem_blk_parms=malloc(num_elem_blks*sizeof(struct elem_blk_parm)))) {
+ safe_free(elem_blk_ids);
+ safe_free(ss_elem_ndx);
+ safe_free(ss_elem_ndx_64);
+ safe_free(side_set_side_list);
+ safe_free(side_set_elem_list);
exerrval = EX_MEMFAIL;
sprintf(errmsg,
"Error: failed to allocate space for element block params for file id %d",
@@ -252,36 +288,40 @@ int ex_get_side_set_node_list_len(int exoid,
}
elem_ctr = 0;
- for (i=0; i<num_elem_blks; i++)
- {
+ for (i=0; i<num_elem_blks; i++) {
+ ex_block block;
+ block.type = EX_ELEM_BLOCK;
+
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ block.id = ((int64_t*)elem_blk_ids)[i];
+ } else {
+ block.id = ((int*)elem_blk_ids)[i];
+ }
+
/* read in an element block parameter */
- if ((ex_get_elem_block (exoid,
- elem_blk_ids[i],
- elem_type,
- &num_elem_in_blk,
- &num_nodes_per_elem,
- &num_attr)) == -1)
- {
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
+ if ((ex_get_block_param (exoid, &block)) != NC_NOERR) {
+ safe_free(elem_blk_parms);
+ safe_free(elem_blk_ids);
+ safe_free(ss_elem_ndx);
+ safe_free(ss_elem_ndx_64);
+ safe_free(side_set_side_list);
+ safe_free(side_set_elem_list);
sprintf(errmsg,
- "Error: failed to get element block %d parameters in file id %d",
- elem_blk_ids[i], exoid);
+ "Error: failed to get element block %"PRId64" parameters in file id %d",
+ block.id, exoid);
ex_err("ex_get_side_set_node_list_len",errmsg,EX_MSG);
return(EX_FATAL);
}
- elem_blk_parms[i].num_elem_in_blk = num_elem_in_blk;
- elem_blk_parms[i].num_nodes_per_elem = num_nodes_per_elem;
- elem_blk_parms[i].num_attr = num_attr;
- elem_blk_parms[i].elem_blk_id = elem_blk_ids[i];
+ elem_blk_parms[i].num_elem_in_blk = block.num_entry;
+ elem_blk_parms[i].num_nodes_per_elem = block.num_nodes_per_entry;
+ elem_blk_parms[i].num_attr = block.num_attribute;
+ elem_blk_parms[i].elem_blk_id = block.id;
- for (m=0; m < strlen(elem_type); m++)
- elem_blk_parms[i].elem_type[m] = toupper(elem_type[m]);
- elem_blk_parms[i].elem_type[m] = EX_EL_NULL_ELEMENT;
+ for (m=0; m < strlen(block.topology); m++) {
+ elem_blk_parms[i].elem_type[m] = toupper(block.topology[m]);
+ }
+ elem_blk_parms[i].elem_type[m] = '\0';
if (strncmp(elem_blk_parms[i].elem_type,"CIRCLE",3) == 0)
{
@@ -419,26 +459,37 @@ int ex_get_side_set_node_list_len(int exoid,
/* Walk through element list and keep a running count of the node length */
- *side_set_node_list_len = 0;
+ list_len = 0;
for (i=0;i<tot_num_ss_elem;i++)
{
+ size_t elem;
+ size_t side;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ elem = ((int64_t*)side_set_elem_list)[i];
+ side = ((int64_t*)side_set_side_list)[i];
+ } else {
+ elem = ((int*)side_set_elem_list)[i];
+ side = ((int*)side_set_side_list)[i];
+ }
+
for (j=0; j<num_elem_blks; j++)
{
if (elem_blk_parms[j].elem_type_val != EX_EL_NULL_ELEMENT)
- if (side_set_elem_list[i] <= elem_blk_parms[j].elem_ctr)
+ if (elem <= elem_blk_parms[j].elem_ctr)
break; /* stop because we found the parameters for this element */
}
if (j >= num_elem_blks)
{
exerrval = EX_BADPARAM;
sprintf(errmsg,
- "Error: Invalid element number %d found in side set %d in file %d",
- side_set_elem_list[i], side_set_id, exoid);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
+ "Error: Invalid element number %"ST_ZU" found in side set %"PRId64" in file %d",
+ elem, side_set_id, exoid);
+ safe_free(elem_blk_parms);
+ safe_free(elem_blk_ids);
+ safe_free(ss_elem_ndx);
+ safe_free(ss_elem_ndx_64);
+ safe_free(side_set_side_list);
+ safe_free(side_set_elem_list);
ex_err("ex_get_side_set_node_list_len",errmsg,EX_MSG);
return (EX_FATAL);
}
@@ -447,66 +498,78 @@ int ex_get_side_set_node_list_len(int exoid,
/* WEDGEs with 3 node sides (side 4 or 5) are special cases */
if (elem_blk_parms[j].elem_type_val == EX_EL_WEDGE &&
- (side_set_side_list[i] == 4 || side_set_side_list[i] == 5))
+ (side == 4 || side == 5))
{
if (elem_blk_parms[j].num_nodes_per_elem == 6)
- *side_set_node_list_len += 3; /* 3 node side */
+ list_len += 3; /* 3 node side */
else
- *side_set_node_list_len += 6; /* 6 node side */
+ list_len += 6; /* 6 node side */
}
/* PYRAMIDSs with 3 node sides (sides 1,2,3,4) are also special */
else if (elem_blk_parms[j].elem_type_val == EX_EL_PYRAMID &&
- (side_set_side_list[i] < 5))
+ (side < 5))
{
if (elem_blk_parms[j].num_nodes_per_elem == 5)
- *side_set_node_list_len += 3; /* 3 node side */
+ list_len += 3; /* 3 node side */
else
- *side_set_node_list_len += 6; /* 6 node side */
+ list_len += 6; /* 6 node side */
}
/* side numbers 3,4,5,6 for SHELLs are also special */
else if (elem_blk_parms[j].elem_type_val == EX_EL_SHELL &&
- (side_set_side_list[i] > 2 ))
+ (side > 2 ))
{
if (elem_blk_parms[j].num_nodes_per_elem == 4)
- *side_set_node_list_len += 2; /* 2 node side */
+ list_len += 2; /* 2 node side */
else
- *side_set_node_list_len += 3; /* 3 node side */
+ list_len += 3; /* 3 node side */
}
/* sides 3, 4, and 5 of 3d TRIs are special cases */
else if (elem_blk_parms[j].elem_type_val == EX_EL_TRIANGLE &&
- ndim == 3 &&
- side_set_side_list[i] > 2 )
+ ndim == 3 && side > 2 )
{
if (elem_blk_parms[j].num_nodes_per_elem == 3) /* 3-node TRI */
- *side_set_node_list_len += 2; /* 2 node side */
+ list_len += 2; /* 2 node side */
else /* 6-node TRI */
- *side_set_node_list_len += 3; /* 3 node side */
+ list_len += 3; /* 3 node side */
}
else if (elem_blk_parms[j].elem_type_val == EX_EL_UNK)
{
exerrval = EX_BADPARAM;
sprintf(errmsg,
- "Error: %s in elem block %d is an unsupported element type",
+ "Error: %s in elem block %"PRId64" is an unsupported element type",
elem_blk_parms[i].elem_type, elem_blk_parms[i].elem_blk_id);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
+ safe_free(elem_blk_parms);
+ safe_free(elem_blk_ids);
+ safe_free(ss_elem_ndx);
+ safe_free(ss_elem_ndx_64);
+ safe_free(side_set_side_list);
+ safe_free(side_set_elem_list);
ex_err("ex_get_side_set_node_list_len",errmsg,EX_MSG);
return (EX_FATAL);
}
else /* all other element types */
- *side_set_node_list_len += elem_blk_parms[j].num_nodes_per_side[0];
+ list_len += elem_blk_parms[j].num_nodes_per_side[0];
}
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API)
+ *(int64_t*)side_set_node_list_len = list_len;
+ else
+ *(int*)side_set_node_list_len = list_len;
+
/* All done: release element block ids array,
element block parameters array, and side set element index array */
- free(elem_blk_ids);
- free(elem_blk_parms);
- free(ss_elem_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
+ safe_free(elem_blk_ids);
+ safe_free(elem_blk_parms);
+ safe_free(ss_elem_ndx);
+ safe_free(ss_elem_ndx_64);
+ safe_free(side_set_side_list);
+ safe_free(side_set_elem_list);
return(EX_NOERR);
}
+
+static void *safe_free(void *array)
+{
+ if (array != 0) free(array);
+ return 0;
+}
diff --git a/exodus/cbind/src/exgsp.c b/exodus/cbind/src/ex_get_side_set_param.c
similarity index 94%
copy from exodus/cbind/src/exgsp.c
copy to exodus/cbind/src/ex_get_side_set_param.c
index 71cbf07..1f584e2 100644
--- a/exodus/cbind/src/exgsp.c
+++ b/exodus/cbind/src/ex_get_side_set_param.c
@@ -65,9 +65,9 @@
*/
int ex_get_side_set_param (int exoid,
- int side_set_id,
- int *num_side_in_set,
- int *num_dist_fact_in_set)
+ ex_entity_id side_set_id,
+ void_int *num_side_in_set,
+ void_int *num_dist_fact_in_set)
{
return ex_get_set_param(exoid, EX_SIDE_SET, side_set_id,
num_side_in_set, num_dist_fact_in_set);
diff --git a/nemesis/ne_gsspg.c b/exodus/cbind/src/ex_get_ss_param_global.c
similarity index 77%
rename from nemesis/ne_gsspg.c
rename to exodus/cbind/src/ex_get_ss_param_global.c
index 38d391c..97f010d 100644
--- a/nemesis/ne_gsspg.c
+++ b/exodus/cbind/src/ex_get_ss_param_global.c
@@ -36,12 +36,12 @@
/*****************************************************************************/
/*****************************************************************************/
/* Function(s) contained in this file:
- * ne_get_ss_param_global()
+ * ex_get_ss_param_global()
*****************************************************************************
* This function retrieves the global side-set parameters.
*****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* global_ids - Pointer to a vector of global node-set IDs.
* side_cnts - Pointer to a vector of global node counts in
* each global node set.
@@ -59,16 +59,13 @@
#include <exodusII.h>
#include <exodusII_int.h>
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-int ne_get_ss_param_global(int neid,
- int *global_ids,
- int *side_cnts,
- int *df_cnts
+int ex_get_ss_param_global(int exoid,
+ void_int *global_ids,
+ void_int *side_cnts,
+ void_int *df_cnts
)
{
- char *func_name="ne_get_ss_param_global";
+ const char *func_name="ex_get_ss_param_global";
int varid, status;
char errmsg[MAX_ERR_LENGTH];
@@ -77,23 +74,27 @@ int ne_get_ss_param_global(int neid,
exerrval = 0; /* clear error code */
/* Get the variable ID for the vector of global side set IDs */
- if ((status = nc_inq_varid(neid, VAR_SS_IDS_GLOBAL, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_SS_IDS_GLOBAL, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_SS_IDS_GLOBAL, neid);
+ VAR_SS_IDS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the vector of side set IDs */
- status = nc_get_var_int(neid, varid, global_ids);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ status = nc_get_var_longlong(exoid, varid, global_ids);
+ } else {
+ status = nc_get_var_int(exoid, varid, global_ids);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_SS_IDS_GLOBAL, neid);
+ VAR_SS_IDS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -101,23 +102,27 @@ int ne_get_ss_param_global(int neid,
/* Get the variable ID for the vector of global side set side count */
if (side_cnts != NULL) {
- if ((status = nc_inq_varid(neid, VAR_SS_SIDE_CNT_GLOBAL, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_SS_SIDE_CNT_GLOBAL, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_SS_SIDE_CNT_GLOBAL, neid);
+ VAR_SS_SIDE_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the vector of side set side counts */
- status = nc_get_var_int(neid, varid, side_cnts);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_get_var_longlong(exoid, varid, side_cnts);
+ } else {
+ status = nc_get_var_int(exoid, varid, side_cnts);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_SS_SIDE_CNT_GLOBAL, neid);
+ VAR_SS_SIDE_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -127,23 +132,27 @@ int ne_get_ss_param_global(int neid,
/* Get the variable ID for the vector of global side set dist. fact count */
if (df_cnts != NULL) {
- if ((status = nc_inq_varid(neid, VAR_SS_DF_CNT_GLOBAL, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_SS_DF_CNT_GLOBAL, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_SS_DF_CNT_GLOBAL, neid);
+ VAR_SS_DF_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the vector of side set dist. fact counts */
- status = nc_get_var_int(neid, varid, df_cnts);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_get_var_longlong(exoid, varid, df_cnts);
+ } else {
+ status = nc_get_var_int(exoid, varid, df_cnts);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_SS_DF_CNT_GLOBAL, neid);
+ VAR_SS_DF_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
diff --git a/exodus/cbind/src/exgssv.c b/exodus/cbind/src/ex_get_sset_var.c
similarity index 96%
rename from exodus/cbind/src/exgssv.c
rename to exodus/cbind/src/ex_get_sset_var.c
index 1087dd7..7390a1a 100644
--- a/exodus/cbind/src/exgssv.c
+++ b/exodus/cbind/src/ex_get_sset_var.c
@@ -67,8 +67,8 @@
int ex_get_sset_var (int exoid,
int time_step,
int sset_var_index,
- int sset_id,
- int num_side_this_sset,
+ ex_entity_id sset_id,
+ int64_t num_side_this_sset,
void *sset_var_vals)
{
return ex_get_var(exoid, time_step, EX_SIDE_SET, sset_var_index,
diff --git a/exodus/cbind/src/exgsstt.c b/exodus/cbind/src/ex_get_sset_var_tab.c
similarity index 100%
rename from exodus/cbind/src/exgsstt.c
rename to exodus/cbind/src/ex_get_sset_var_tab.c
diff --git a/exodus/cbind/src/exgtim.c b/exodus/cbind/src/ex_get_time.c
similarity index 100%
rename from exodus/cbind/src/exgtim.c
rename to exodus/cbind/src/ex_get_time.c
diff --git a/exodus/cbind/src/exgvartab.c b/exodus/cbind/src/ex_get_truth_table.c
similarity index 100%
rename from exodus/cbind/src/exgvartab.c
rename to exodus/cbind/src/ex_get_truth_table.c
diff --git a/exodus/cbind/src/exgvar.c b/exodus/cbind/src/ex_get_var.c
similarity index 92%
rename from exodus/cbind/src/exgvar.c
rename to exodus/cbind/src/ex_get_var.c
index 95b16cb..49522a6 100644
--- a/exodus/cbind/src/exgvar.c
+++ b/exodus/cbind/src/ex_get_var.c
@@ -71,8 +71,8 @@ int ex_get_var( int exoid,
int time_step,
ex_entity_type var_type,
int var_index,
- int obj_id,
- int num_entry_this_obj,
+ ex_entity_id obj_id,
+ int64_t num_entry_this_obj,
void* var_vals )
{
int status;
@@ -95,13 +95,13 @@ int ex_get_var( int exoid,
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no %s variables for NULL block %d in file id %d",
+ "Warning: no %s variables for NULL block %"PRId64" in file id %d",
ex_name_of_object(var_type), obj_id,exoid);
ex_err("ex_get_var",errmsg,EX_MSG);
return (EX_WARN);
} else {
sprintf(errmsg,
- "Error: failed to locate %s id %d in id variable in file id %d",
+ "Error: failed to locate %s id %"PRId64" in id variable in file id %d",
ex_name_of_object(var_type), obj_id, exoid);
ex_err("ex_get_var",errmsg,exerrval);
return (EX_FATAL);
@@ -114,7 +114,7 @@ int ex_get_var( int exoid,
obj_id_ndx), &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate %s %d var %d in file id %d",
+ "Error: failed to locate %s %"PRId64" var %d in file id %d",
ex_name_of_object(var_type),obj_id,var_index,exoid);
ex_err("ex_get_var",errmsg,exerrval);
return (EX_FATAL);
@@ -136,7 +136,7 @@ int ex_get_var( int exoid,
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get %s %d variable %d in file id %d",
+ "Error: failed to get %s %"PRId64" variable %d in file id %d",
ex_name_of_object(var_type), obj_id, var_index,exoid);
ex_err("ex_get_var",errmsg,exerrval);
return (EX_FATAL);
diff --git a/exodus/cbind/src/exgvnm.c b/exodus/cbind/src/ex_get_var_name.c
similarity index 100%
rename from exodus/cbind/src/exgvnm.c
rename to exodus/cbind/src/ex_get_var_name.c
diff --git a/exodus/cbind/src/exgvan.c b/exodus/cbind/src/ex_get_var_names.c
similarity index 100%
rename from exodus/cbind/src/exgvan.c
rename to exodus/cbind/src/ex_get_var_names.c
diff --git a/exodus/cbind/src/exgvp.c b/exodus/cbind/src/ex_get_var_param.c
similarity index 100%
rename from exodus/cbind/src/exgvp.c
rename to exodus/cbind/src/ex_get_var_param.c
diff --git a/exodus/cbind/src/exgtt.c b/exodus/cbind/src/ex_get_var_tab.c
similarity index 100%
rename from exodus/cbind/src/exgtt.c
rename to exodus/cbind/src/ex_get_var_tab.c
diff --git a/exodus/cbind/src/exgvart.c b/exodus/cbind/src/ex_get_var_time.c
similarity index 83%
rename from exodus/cbind/src/exgvart.c
rename to exodus/cbind/src/ex_get_var_time.c
index 306792d..1e7dd9f 100644
--- a/exodus/cbind/src/exgvart.c
+++ b/exodus/cbind/src/ex_get_var_time.c
@@ -69,19 +69,17 @@
int ex_get_var_time( int exoid,
ex_entity_type var_type,
int var_index,
- int id,
+ int64_t id,
int beg_time_step,
int end_time_step,
void* var_vals )
{
int dimid, varid, numel = 0, offset;
int status;
- int *obj_ids, *stat_vals;
+ int *stat_vals;
size_t num_obj, i;
size_t num_entries_this_obj = 0;
size_t start[2], count[2];
- float fdum;
- char *cdum;
char errmsg[MAX_ERR_LENGTH];
const char* varobjids;
const char* varobstat;
@@ -132,8 +130,6 @@ int ex_get_var_time( int exoid,
exerrval = 0; /* clear error code */
- cdum = 0; /* initialize even though it is not used */
-
/* assume entry number is 1-based (the first entry of an object is 1, not 0);
* adjust so it is 0-based
*/
@@ -150,18 +146,8 @@ int ex_get_var_time( int exoid,
/* don't think we need this anymore since the netcdf variable names
associated with objects don't contain the object ids */
- if (!(obj_ids = malloc(num_obj*sizeof(int)))) {
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate memory for %s ids for file id %d",
- ex_name_of_object(var_type),exoid);
- ex_err("ex_get_var_time",errmsg,exerrval);
- return (EX_FATAL);
- }
-
if ((status = nc_inq_varid (exoid, varobjids, &varid )) != NC_NOERR) {
exerrval = status;
- free(obj_ids);
sprintf(errmsg,
"Error: failed to locate %s ids in file id %d",
ex_name_of_object(var_type),exoid);
@@ -169,19 +155,9 @@ int ex_get_var_time( int exoid,
return (EX_FATAL);
}
- if ((status = nc_get_var_int(exoid, varid, obj_ids)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get %s ids from file id %d",
- ex_name_of_object(var_type),exoid);
- ex_err("ex_get_var_time",errmsg,exerrval);
- return (EX_FATAL);
- }
-
/* allocate space for stat array */
if (!(stat_vals = malloc((int)num_obj*sizeof(int)))) {
exerrval = EX_MEMFAIL;
- free (obj_ids);
sprintf(errmsg,
"Error: failed to allocate memory for %s status array for file id %d",
ex_name_of_object(var_type),exoid);
@@ -196,7 +172,6 @@ int ex_get_var_time( int exoid,
if ((status = nc_get_var_int(exoid, varid, stat_vals)) != NC_NOERR) {
exerrval = status;
- free (obj_ids);
free(stat_vals);
sprintf(errmsg,
"Error: failed to get %s status array from file id %d",
@@ -223,22 +198,20 @@ int ex_get_var_time( int exoid,
if ((status = nc_inq_dimid(exoid, ex_dim_num_entries_in_object(var_type,i+1), &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of entries in %s %d in file id %d",
- ex_name_of_object(var_type), obj_ids[i], exoid);
+ "Error: failed to locate number of entries in %"ST_ZU"th %s in file id %d",
+ i, ex_name_of_object(var_type), exoid);
ex_err("ex_get_var_time",errmsg,exerrval);
free(stat_vals);
- free(obj_ids);
return (EX_FATAL);
}
if ((status = nc_inq_dimlen(exoid, dimid, &num_entries_this_obj)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of entries in %s %d in file id %d",
- ex_name_of_object(var_type), obj_ids[i], exoid);
+ "Error: failed to get number of entries in %"ST_ZU"th %s in file id %d",
+ i, ex_name_of_object(var_type), exoid);
ex_err("ex_get_var_time",errmsg,exerrval);
free(stat_vals);
- free(obj_ids);
return (EX_FATAL);
}
} /* End NULL object check */
@@ -250,22 +223,20 @@ int ex_get_var_time( int exoid,
if ((status = nc_inq_dimid(exoid,ex_dim_num_entries_in_object(var_type,i+1), &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of entries in %s %d in file id %d",
- ex_name_of_object(var_type), obj_ids[i], exoid);
+ "Error: failed to locate number of entries in %"ST_ZU"th %s in file id %d",
+ i, ex_name_of_object(var_type), exoid);
ex_err("ex_get_var_time",errmsg,exerrval);
free(stat_vals);
- free(obj_ids);
return (EX_FATAL);
}
if ((status = nc_inq_dimlen(exoid, dimid, &num_entries_this_obj)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of entries in %s %d in file id %d",
- ex_name_of_object(var_type), obj_ids[i], exoid);
+ "Error: failed to get number of entries in %"ST_ZU"th %s in file id %d",
+ i, ex_name_of_object(var_type), exoid);
ex_err("ex_get_var_time",errmsg,exerrval);
free(stat_vals);
- free(obj_ids);
return (EX_FATAL);
}
numel += num_entries_this_obj;
@@ -274,20 +245,17 @@ int ex_get_var_time( int exoid,
offset = id - (numel - num_entries_this_obj);
/* inquire previously defined variable */
-
if ((status = nc_inq_varid(exoid,ex_name_var_of_object(var_type,var_index,i+1), &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate variable %d for %s %d in file id %d",
- var_index,ex_name_of_object(var_type),obj_ids[i],exoid);
+ "Error: failed to locate variable %"ST_ZU" for %dth %s in file id %d",
+ i, var_index,ex_name_of_object(var_type),exoid);
ex_err("ex_get_var_time",errmsg,exerrval);
free(stat_vals);
- free(obj_ids);
return (EX_FATAL);
}
free(stat_vals);
- free(obj_ids);
/* read values of object variable */
start[0] = --beg_time_step;
@@ -298,14 +266,7 @@ int ex_get_var_time( int exoid,
* database inquire function to get the number of time steps; the ending
* time step number is 1 less due to 0 based array indexing in C
*/
- if ((status = ex_inquire (exoid, EX_INQ_TIME, &end_time_step, &fdum, cdum)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get maximum time step in file id %d",
- exoid);
- ex_err("ex_get_var_time",errmsg,exerrval);
- return (EX_FATAL);
- }
+ end_time_step = ex_inquire_int (exoid, EX_INQ_TIME);
}
end_time_step--;
diff --git a/exodus/cbind/src/exgvarnam.c b/exodus/cbind/src/ex_get_variable_name.c
similarity index 96%
rename from exodus/cbind/src/exgvarnam.c
rename to exodus/cbind/src/ex_get_variable_name.c
index 049d08e..b9d5843 100644
--- a/exodus/cbind/src/exgvarnam.c
+++ b/exodus/cbind/src/ex_get_variable_name.c
@@ -121,7 +121,8 @@ int ex_get_variable_name (int exoid,
/* read the variable name */
{
int db_name_size = ex_inquire_int(exoid, EX_INQ_DB_MAX_ALLOWED_NAME_LENGTH);
- int name_size = db_name_size < ex_max_name_length ? db_name_size : ex_max_name_length;
+ int api_name_size = ex_inquire_int(exoid, EX_INQ_MAX_READ_NAME_LENGTH);
+ int name_size = db_name_size < api_name_size ? db_name_size : api_name_size;
status = ex_get_name_internal(exoid, varid, var_num-1, var_name, name_size, obj_type, "ex_get_variable_name");
if (status != NC_NOERR) {
diff --git a/exodus/cbind/src/exgvarnams.c b/exodus/cbind/src/ex_get_variable_names.c
similarity index 100%
rename from exodus/cbind/src/exgvarnams.c
rename to exodus/cbind/src/ex_get_variable_names.c
diff --git a/exodus/cbind/src/exgvarparam.c b/exodus/cbind/src/ex_get_variable_param.c
similarity index 100%
rename from exodus/cbind/src/exgvarparam.c
rename to exodus/cbind/src/ex_get_variable_param.c
diff --git a/exodus/cbind/src/exinq.c b/exodus/cbind/src/ex_inquire.c
similarity index 87%
rename from exodus/cbind/src/exinq.c
rename to exodus/cbind/src/ex_inquire.c
index 5e83063..36cbd2c 100644
--- a/exodus/cbind/src/exinq.c
+++ b/exodus/cbind/src/ex_inquire.c
@@ -40,11 +40,7 @@
#include "exodusII_int.h"
/*!
-\fn{int ex_inquire (int exoid,
- int req_info,
- int *ret_int,
- void *ret_float,
- char *ret_char)}
+\fn{int ex_inquire (int exoid, int req_info, void_int *ret_int, float *ret_float, char *ret_char)}
The function ex_inquire() is used to inquire values of certain
data entities in an exodus file. Memory must be allocated for the
@@ -243,7 +239,7 @@ num_props = ex_inquire_int(exoid, EX_INQ_EB_PROP);
*/
/*! \cond INTERNAL */
-static int ex_get_dimension_value(int exoid, int *var, int default_value, const char *dimension_name, int missing_ok)
+static int ex_get_dimension_value(int exoid, int64_t *var, int default_value, const char *dimension_name, int missing_ok)
{
int status;
char errmsg[MAX_ERR_LENGTH];
@@ -272,11 +268,11 @@ static int ex_get_dimension_value(int exoid, int *var, int default_value, const
ex_err("ex_inquire",errmsg,exerrval);
return (EX_FATAL);
}
- *var = (int)idum;
+ *var = idum;
return (EX_NOERR);
}
-static int ex_get_concat_set_len(int exoid, int *set_length, const char *set_name,
+static int ex_get_concat_set_len(int exoid, int64_t *set_length, const char *set_name,
ex_entity_type set_type, const char *set_num_dim,
const char *set_stat_var, const char *set_size_root,
int missing_ok)
@@ -288,7 +284,6 @@ static int ex_get_concat_set_len(int exoid, int *set_length, const char *set_nam
int dimid, varid;
size_t num_sets;
int *stat_vals = NULL;
- int *ids = NULL;
*set_length = 0; /* default return value */
@@ -303,28 +298,9 @@ static int ex_get_concat_set_len(int exoid, int *set_length, const char *set_nam
return (EX_FATAL);
}
- if (!(ids = malloc(num_sets*sizeof(int)))) {
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate memory for %s set ids for file id %d",
- set_name, exoid);
- ex_err("ex_inquire",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- if (ex_get_ids (exoid, set_type, ids) == EX_FATAL) {
- sprintf(errmsg,
- "Error: failed to get %s set ids in file id %d",
- set_name, exoid);
- ex_err("ex_inquire",errmsg,exerrval);
- free(ids);
- return (EX_FATAL);
- }
-
/* Allocate space for stat array */
if (!(stat_vals = malloc((int)num_sets*sizeof(int)))) {
exerrval = EX_MEMFAIL;
- free (ids);
sprintf(errmsg,
"Error: failed to allocate memory for %s set status array for file id %d",
set_name, exoid);
@@ -338,7 +314,6 @@ static int ex_get_concat_set_len(int exoid, int *set_length, const char *set_nam
to be backward compatible */
if ((status = nc_get_var_int(exoid, varid, stat_vals)) != NC_NOERR) {
exerrval = status;
- free (ids);
free(stat_vals);
sprintf(errmsg,
"Error: failed to get %s set status array from file id %d",
@@ -360,34 +335,21 @@ static int ex_get_concat_set_len(int exoid, int *set_length, const char *set_nam
idum = 0;
} else {
*set_length = 0;
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate %s set %d in file id %d",
- set_name, ids[i],exoid);
- ex_err("ex_inquire",errmsg,exerrval);
free(stat_vals);
- free(ids);
return (EX_FATAL);
}
} else {
if ((status = nc_inq_dimlen (exoid, dimid, &idum)) != NC_NOERR) {
*set_length = 0;
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get size of %s set %d in file id %d",
- set_name, ids[i], exoid);
- ex_err("ex_inquire",errmsg,exerrval);
free(stat_vals);
- free(ids);
return (EX_FATAL);
}
}
- *set_length += (int)idum;
+ *set_length += idum;
}
free(stat_vals);
- free (ids);
}
return (EX_NOERR);
}
@@ -418,25 +380,14 @@ int num_block = ex_inquire_int(exoid, EX_INQ_ELEM_BLK);
*/
-int ex_inquire_int (int exoid, int req_info)
-{
- char *cdummy = NULL; /* Needed just for function call, unused. */
- float fdummy = 0; /* Needed just for function call, unused. */
- int ret_val = 0;
- int error = ex_inquire(exoid, req_info, &ret_val, &fdummy, cdummy);
- if (error < 0)
- ret_val = error;
-
- return ret_val;
-}
-
-int ex_inquire (int exoid,
- int req_info,
- int *ret_int,
- void *ret_float,
- char *ret_char)
+static int ex_inquire_internal (int exoid,
+ int req_info,
+ int64_t *ret_int,
+ float *ret_float,
+ char *ret_char)
{
- int dimid, varid, tmp_num, *ids;
+ int dimid, varid, tmp_num;
+ void_int *ids = NULL;
size_t i;
size_t ldum = 0;
size_t num_sets, idum;
@@ -447,8 +398,16 @@ int ex_inquire (int exoid,
exerrval = 0; /* clear error code */
- if (ret_char) *ret_char = '\0';
- if (ret_int) *ret_int = 0;
+ if (ret_char) *ret_char = '\0'; /* Only needs to be non-null for TITLE */
+
+ if (!ret_int) {
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Warning: integer argument is NULL which is not allowed.");
+ ex_err("ex_inquire",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
switch (req_info) {
case EX_INQ_FILE_TYPE:
@@ -463,6 +422,14 @@ int ex_inquire (int exoid,
case EX_INQ_API_VERS:
/* returns the EXODUS II API version number */
+ if (!ret_float) {
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Warning: float argument is NULL for EX_INQ_API_VERS which is not allowed.");
+ ex_err("ex_inquire",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
if (nc_get_att_float(exoid, NC_GLOBAL, ATT_API_VERSION, ret_float) != NC_NOERR)
{ /* try old (prior to db version 2.02) attribute name */
if ((status = nc_get_att_float (exoid, NC_GLOBAL, ATT_API_VERSION_BLANK,ret_float)) != NC_NOERR) {
@@ -478,6 +445,14 @@ int ex_inquire (int exoid,
case EX_INQ_DB_VERS:
/* returns the EXODUS II database version number */
+ if (!ret_float) {
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Warning: float argument is NULL for EX_INQ_DB_VERS which is not allowed.");
+ ex_err("ex_inquire",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
if ((status = nc_get_att_float (exoid, NC_GLOBAL, ATT_VERSION, ret_float)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
@@ -490,10 +465,9 @@ int ex_inquire (int exoid,
case EX_INQ_LIB_VERS:
/* returns the EXODUS II Library version number */
if (ret_float)
- flt_cvt((float *)ret_float, EX_API_VERS);
+ flt_cvt(ret_float, EX_API_VERS);
- if (ret_int)
- *ret_int = EX_API_VERS_NODOT;
+ *ret_int = EX_API_VERS_NODOT;
break;
case EX_INQ_DB_MAX_ALLOWED_NAME_LENGTH:
@@ -537,33 +511,52 @@ int ex_inquire (int exoid,
status = nc_inq_att(exoid, NC_GLOBAL, ATT_MAX_NAME_LENGTH, &att_type, &att_len);
if (status == NC_NOERR && att_type == NC_INT) {
/* The attribute exists, return it... */
- status = nc_get_att_int(exoid, NC_GLOBAL, ATT_MAX_NAME_LENGTH, ret_int);
+ nc_get_att_longlong(exoid, NC_GLOBAL, ATT_MAX_NAME_LENGTH, (long long*)ret_int);
}
}
break;
case EX_INQ_MAX_READ_NAME_LENGTH:
- /* Returns the user-specified maximum size of names that will be
- * returned to the user by any of the ex_get_ routines. If the
- * name is longer than this value, it will be truncated. The
- * default if not set by the client is 32 characters. The value
- * does not include the trailing null.
- */
- *ret_int = ex_max_name_length;
+ {
+ /* Returns the user-specified maximum size of names that will be
+ * returned to the user by any of the ex_get_ routines. If the
+ * name is longer than this value, it will be truncated. The
+ * default if not set by the client is 32 characters. The value
+ * does not include the trailing null.
+ */
+ struct file_item* file = ex_find_file_item(exoid);
+
+ if (!file ) {
+ exerrval = EX_BADFILEID;
+ sprintf(errmsg,"Error: unknown file id %d for ex_inquire_int().",exoid);
+ ex_err("ex_intquire",errmsg,exerrval);
+ *ret_int = 0;
+ }
+ else {
+ *ret_int = file->maximum_name_length;
+ }
+ }
break;
case EX_INQ_TITLE:
- /* returns the title of the database */
- if ((status = nc_get_att_text (exoid, NC_GLOBAL, ATT_TITLE, tmp_title)) != NC_NOERR) {
- *ret_char = '\0';
- exerrval = status;
+ if (!ret_char) {
sprintf(errmsg,
- "Error: failed to get database title for file id %d", exoid);
+ "Error: Requested title, but character pointer was null for file id %d", exoid);
ex_err("ex_inquire",errmsg,exerrval);
return (EX_FATAL);
} else {
- strncpy(ret_char, tmp_title, MAX_LINE_LENGTH+1);
- ret_char[MAX_LINE_LENGTH] = '\0';
+ /* returns the title of the database */
+ if ((status = nc_get_att_text (exoid, NC_GLOBAL, ATT_TITLE, tmp_title)) != NC_NOERR) {
+ *ret_char = '\0';
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to get database title for file id %d", exoid);
+ ex_err("ex_inquire",errmsg,exerrval);
+ return (EX_FATAL);
+ } else {
+ strncpy(ret_char, tmp_title, MAX_LINE_LENGTH+1);
+ ret_char[MAX_LINE_LENGTH] = '\0';
+ }
}
break;
@@ -617,7 +610,6 @@ int ex_inquire (int exoid,
/*
Determine the concatenated node sets distribution factor length:
- 1. Get the node set ids list.
2. Check see if the dist factor variable for a node set id exists.
3. If it exists, goto step 4, else the length is zero.
4. Get the dimension of the number of nodes in the node set -0
@@ -638,27 +630,6 @@ int ex_inquire (int exoid,
}
- if (!(ids = malloc(num_sets*sizeof(int))))
- {
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate memory for node set ids for file id %d",
- exoid);
- ex_err("ex_inquire",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- if (ex_get_node_set_ids (exoid, ids) == EX_FATAL)
- {
- sprintf(errmsg,
- "Error: failed to get node sets in file id %d",
- exoid);
- /* pass back error code from ex_get_node_set_ids (in exerrval) */
- ex_err("ex_inquire",errmsg,exerrval);
- free (ids);
- return (EX_FATAL);
- }
-
for (i=0; i<num_sets; i++) {
if ((status = nc_inq_varid (exoid, VAR_FACT_NS(i+1), &varid)) != NC_NOERR) {
if (status == NC_ENOTVAR) {
@@ -667,10 +638,9 @@ int ex_inquire (int exoid,
*ret_int = 0;
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of dist fact for node set %d in file id %d",
- ids[i], exoid);
+ "Error: failed to locate number of dist fact for %"ST_ZU"'th node set in file id %d",
+ i, exoid);
ex_err("ex_inquire",errmsg,exerrval);
- free (ids);
return (EX_FATAL);
}
} else {
@@ -678,26 +648,23 @@ int ex_inquire (int exoid,
*ret_int = 0;
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of nodes in node set %d in file id %d",
- ids[i], exoid);
+ "Error: failed to locate number of nodes in %"ST_ZU"'th node set in file id %d",
+ i, exoid);
ex_err("ex_inquire",errmsg,exerrval);
- free (ids);
return (EX_FATAL);
}
if ((status = nc_inq_dimlen (exoid, dimid, &idum)) != NC_NOERR) {
*ret_int = 0;
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of nodes in node set %d in file id %d",
- ids[i],exoid);
+ "Error: failed to get number of nodes in %"ST_ZU"'th node set in file id %d",
+ i,exoid);
ex_err("ex_inquire",errmsg,exerrval);
- free(ids);
return (EX_FATAL);
}
}
*ret_int += idum;
}
- free(ids);
}
break;
@@ -727,7 +694,7 @@ int ex_inquire (int exoid,
}
- if (!(ids = malloc(num_sets*sizeof(int)))) {
+ if (!(ids = malloc(num_sets*sizeof(int64_t)))) { /* May be getting 2x what is needed, but should be OK */
exerrval = EX_MEMFAIL;
sprintf(errmsg,
"Error: failed to allocate memory for side set ids for file id %d",
@@ -778,15 +745,21 @@ int ex_inquire (int exoid,
/* walk id list, get each side set node length and sum for total */
for (i=0; i<num_sets; i++) {
+ ex_entity_id id;
if (stat_vals[i] == 0) /* is this object null? */
continue;
- if ((status = ex_get_side_set_node_list_len(exoid, ids[i], &tmp_num)) != NC_NOERR) {
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API)
+ id = ((int64_t*)ids)[i];
+ else
+ id = ((int*)ids)[i];
+
+ if ((status = ex_get_side_set_node_list_len(exoid, id, &tmp_num)) != NC_NOERR) {
*ret_int = 0;
exerrval = status;
sprintf(errmsg,
- "Error: failed to side set %d node length in file id %d",
- ids[i],exoid);
+ "Error: failed to side set %"PRId64" node length in file id %d",
+ id,exoid);
ex_err("ex_inquire",errmsg,exerrval);
free(stat_vals);
free(ids);
@@ -833,26 +806,6 @@ int ex_inquire (int exoid,
return (EX_FATAL);
}
-
- if (!(ids = malloc(num_sets*sizeof(int)))) {
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate memory for side set ids for file id %d",
- exoid);
- ex_err("ex_inquire",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- if (ex_get_side_set_ids (exoid, ids) == EX_FATAL) {
- sprintf(errmsg,
- "Error: failed to get side sets in file id %d",
- exoid);
- /* pass back error code from ex_get_side_set_ids (in exerrval) */
- ex_err("ex_inquire",errmsg,exerrval);
- free (ids);
- return (EX_FATAL);
- }
-
for (i=0; i<num_sets; i++) {
if ((status = nc_inq_dimid (exoid, DIM_NUM_DF_SS(i+1), &dimid)) != NC_NOERR) {
if (status == NC_EBADDIM) {
@@ -861,10 +814,9 @@ int ex_inquire (int exoid,
*ret_int = 0;
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of dist fact for side set %d in file id %d",
- ids[i], exoid);
+ "Error: failed to locate number of dist fact for %"ST_ZU"'th side set in file id %d",
+ i, exoid);
ex_err("ex_inquire",errmsg,exerrval);
- free (ids);
return (EX_FATAL);
}
} else {
@@ -872,16 +824,14 @@ int ex_inquire (int exoid,
*ret_int = 0;
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of dist factors in side set %d in file id %d",
- ids[i], exoid);
+ "Error: failed to get number of dist factors in %"ST_ZU"'th side set in file id %d",
+ i, exoid);
ex_err("ex_inquire",errmsg,exerrval);
- free (ids);
return (EX_FATAL);
}
}
*ret_int += ldum;
}
- free (ids);
}
break;
@@ -1064,3 +1014,34 @@ int ex_inquire (int exoid,
}
return (EX_NOERR);
}
+
+int64_t ex_inquire_int (int exoid, int req_info)
+{
+ char *cdummy = NULL; /* Needed just for function call, unused. */
+ float fdummy = 0; /* Needed just for function call, unused. */
+ int64_t ret_val = 0;
+ int error = ex_inquire_internal(exoid, req_info, &ret_val, &fdummy, cdummy);
+ if (error < 0)
+ ret_val = error;
+
+ return ret_val;
+}
+
+int ex_inquire (int exoid,
+ int req_info,
+ void_int *ret_int,
+ float *ret_float,
+ char *ret_char)
+{
+ if (ex_int64_status(exoid) & EX_INQ_INT64_API) {
+ return ex_inquire_internal(exoid, req_info, ret_int, ret_float, ret_char);
+ } else {
+ /* ret_int is a 32-bit int */
+ int64_t tmp_int;
+ int *return_int = ret_int;
+ int ierr = ex_inquire_internal(exoid, req_info, &tmp_int, ret_float, ret_char);
+ *return_int = (int)tmp_int;
+ return ierr;
+ }
+}
+
diff --git a/nemesis/ne_util.c b/exodus/cbind/src/ex_ne_util.c
similarity index 62%
rename from nemesis/ne_util.c
rename to exodus/cbind/src/ex_ne_util.c
index b028e1e..cb2b0b8 100644
--- a/nemesis/ne_util.c
+++ b/exodus/cbind/src/ex_ne_util.c
@@ -38,13 +38,13 @@
/*****************************************************************************/
/* Function(s) contained in this file:
*
- * ne_leavedef()
- * ne_catstr2()
+ * ex_leavedef()
+ * ex_catstrn12()
* ne_id_lkup()
- * ne_get_file_type()
- * ne_put_version()
+ * ex_get_file_type()
+ * ex_put_nemesis_version()
* ne_check_file_version()
- * ne_get_idx()
+ * ex_get_idx()
*
*****************************************************************************
* Much of this code is a modified version of what is found in NemesisI.
@@ -64,24 +64,21 @@
#include <exodusII.h>
#include <exodusII_int.h>
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
/* Global variables */
char *ne_ret_string;
-int ne_leavedef(int neid,
- char *call_rout
+int ex_leavedef(int exoid,
+ const char *call_rout
)
{
char errmsg[MAX_ERR_LENGTH];
int status;
- if ((status = nc_enddef(neid)) != NC_NOERR) {
+ if ((status = nc_enddef(exoid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to end define mode for file id %d",
- neid);
+ exoid);
ex_err(call_rout, errmsg, exerrval);
return (EX_FATAL);
@@ -92,12 +89,12 @@ int ne_leavedef(int neid,
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
-char *ne_catstr2(char *name,
+char *ex_catstrn12(char *name,
int num1,
int num2
)
{
- char *func_name="ne_catstr2";
+ const char *func_name="ex_catstrn12";
char errmsg[MAX_ERR_LENGTH];
@@ -132,26 +129,26 @@ char *ne_catstr2(char *name,
/* Note: This function assumes a 1-d vector of data for "ne_var_name".
*/
/*****************************************************************************/
-int ne_id_lkup(int neid, char *ne_var_name, int64_t *idx, int ne_var_id)
+int ne_id_lkup(int exoid, const char *ne_var_name, int64_t *idx, ex_entity_id ne_var_id)
{
- char *func_name="ne_id_lkup";
+ const char *func_name="ne_id_lkup";
int status;
int varid, ndims, dimid[1], ret=-1;
nc_type var_type;
- size_t index, length, start[1];
- size_t begin, end;
- int id_val;
+ size_t length, start[1];
+ int64_t my_index, begin, end;
+ long long id_val;
char errmsg[MAX_ERR_LENGTH];
exerrval = 0; /* clear error code */
- if ((status = nc_inq_varid(neid, ne_var_name, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, ne_var_name, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- ne_var_name, neid);
+ ne_var_name, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -159,22 +156,22 @@ int ne_id_lkup(int neid, char *ne_var_name, int64_t *idx, int ne_var_id)
/* check if I need the length for this varible */
if (idx[1] == -1) {
/* Get the dimension IDs for this variable */
- if ((status = nc_inq_var(neid, varid, (char *) 0, &var_type, &ndims,
+ if ((status = nc_inq_var(exoid, varid, (char *) 0, &var_type, &ndims,
dimid, (int *) 0)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for variable \"%s\" in file ID %d",
- ne_var_name, neid);
+ ne_var_name, exoid);
ex_err(func_name, errmsg, exerrval);
return -1;
}
/* Get the length of this variable */
- if ((status = nc_inq_dimlen(neid, dimid[0], &length)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid[0], &length)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension for variable \"%s\" in file ID %d",
- ne_var_name, neid);
+ ne_var_name, exoid);
ex_err(func_name, errmsg, exerrval);
return -1;
}
@@ -186,19 +183,21 @@ int ne_id_lkup(int neid, char *ne_var_name, int64_t *idx, int ne_var_id)
end = idx[1];
/* Find the index by looping over each entry */
- for(index=begin; index < end; index++) {
- start[0] = index;
- if ((status = nc_get_var1_int(neid, varid, start, &id_val)) != NC_NOERR) {
+ for(my_index=begin; my_index < end; my_index++) {
+ start[0] = my_index;
+ status = nc_get_var1_longlong(exoid, varid, start, &id_val);
+
+ if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable \"%s\" in file ID %d",
- ne_var_name, neid);
+ ne_var_name, exoid);
ex_err(func_name, errmsg, exerrval);
return -1;
}
if (id_val == ne_var_id) {
- ret = (int) index;
+ ret = (int) my_index;
break;
}
}
@@ -212,11 +211,11 @@ int ne_id_lkup(int neid, char *ne_var_name, int64_t *idx, int ne_var_id)
/* This function retrieves the file type from a Nemesis file.
*/
/*****************************************************************************/
-int ne_get_file_type(int neid,
+int ex_get_file_type(int exoid,
char *ftype
)
{
- char *func_name="ne_get_file_type";
+ const char *func_name="ex_get_file_type";
int status;
int varid;
@@ -226,7 +225,7 @@ int ne_get_file_type(int neid,
exerrval = 0; /* clear error code */
- if ((status = nc_inq_varid(neid, VAR_FILE_TYPE, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_FILE_TYPE, &varid)) != NC_NOERR) {
/* If no file type is found, assume parallel */
ftype[0] = 'p';
@@ -235,11 +234,11 @@ int ne_get_file_type(int neid,
return (EX_NOERR);
}
- if ((status = nc_get_var1_int(neid, varid, NULL, &lftype)) != NC_NOERR) {
+ if ((status = nc_get_var1_int(exoid, varid, NULL, &lftype)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_FILE_TYPE, neid);
+ VAR_FILE_TYPE, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -257,9 +256,9 @@ int ne_get_file_type(int neid,
/* This function outputs the Nemesis version information to the file.
*/
/*****************************************************************************/
-int ne_put_version(int neid)
+int ex_put_nemesis_version(int exoid)
{
- char *func_name="ne_put_version";
+ const char *func_name="ex_put_nemesis_version";
int status;
float file_ver, api_ver;
@@ -271,26 +270,26 @@ int ne_put_version(int neid)
api_ver = NEMESIS_API_VERSION;
/* Check to see if the nemesis file version is already in the file */
- if (nc_get_att_float(neid, NC_GLOBAL, "nemesis_file_version", &file_ver) != NC_NOERR) {
+ if (nc_get_att_float(exoid, NC_GLOBAL, "nemesis_file_version", &file_ver) != NC_NOERR) {
/* Output the Nemesis file version */
- if ((status = nc_put_att_float(neid, NC_GLOBAL, "nemesis_file_version", NC_FLOAT,
+ if ((status = nc_put_att_float(exoid, NC_GLOBAL, "nemesis_file_version", NC_FLOAT,
1, &file_ver)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output nemesis file version in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Output the Nemesis API version */
- if ((status = nc_put_att_float(neid, NC_GLOBAL, "nemesis_api_version", NC_FLOAT,
+ if ((status = nc_put_att_float(exoid, NC_GLOBAL, "nemesis_api_version", NC_FLOAT,
1, &api_ver)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output nemesis api version in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -304,9 +303,10 @@ int ne_put_version(int neid)
/* This function checks that the version info is correct.
*/
/*****************************************************************************/
-int ne_check_file_version(int neid)
+int ne_check_file_version(int exoid)
{
- char *func_name="ne_check_file_version";
+#if 0
+ const char *func_name="ne_check_file_version";
float file_ver;
@@ -316,11 +316,11 @@ int ne_check_file_version(int neid)
exerrval = 0; /* clear error code */
/* Get the file version */
- if ((status = nc_get_att_float(neid, NC_GLOBAL, "nemesis_file_version", &file_ver)) != NC_NOERR) {
+ if ((status = nc_get_att_float(exoid, NC_GLOBAL, "nemesis_file_version", &file_ver)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get the nemesis file version from file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -328,10 +328,11 @@ int ne_check_file_version(int neid)
if (fabs(NEMESIS_FILE_VERSION-file_ver) > 0.001) {
exerrval = EX_MSG;
sprintf(errmsg,
- "Error: Nemesis version mismatch in file ID %d!\n", neid);
+ "Error: Nemesis version mismatch in file ID %d!\n", exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
+#endif
return (EX_NOERR);
}
@@ -343,29 +344,33 @@ int ne_check_file_version(int neid)
* position given.
*/
/*****************************************************************************/
-int ne_get_idx(int neid, char *ne_var_name, int64_t *index, int pos)
+int ex_get_idx(int exoid, const char *ne_var_name, int64_t *my_index, int pos)
{
- char *func_name="ne_get_idx";
+ const char *func_name="ex_get_idx";
int status;
int varid;
size_t start[1], count[1];
+#if defined(NC_NETCDF4)
long long varidx[2];
+#else
+ int varidx[2];
+#endif
char errmsg[MAX_ERR_LENGTH];
/*-----------------------------Execution begins-----------------------------*/
exerrval = 0; /* clear error code */
/* set default values for idx */
- index[0] = 0;
- index[1] = -1;
+ my_index[0] = 0;
+ my_index[1] = -1;
/*
* assume that if there is an error returned, that this
* means that this is a parallel file, and the index does
* not exists. This is not an error
*/
- if ((status = nc_inq_varid(neid, ne_var_name, &varid)) == NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, ne_var_name, &varid)) == NC_NOERR) {
/* check if we are at the beginning of the index vector */
if (pos == 0) {
start[0] = pos;
@@ -375,165 +380,34 @@ int ne_get_idx(int neid, char *ne_var_name, int64_t *index, int pos)
count[0] = 2;
}
- status = nc_get_vara_longlong(neid, varid, start, count, varidx);
+#if defined(NC_NETCDF4)
+ status = nc_get_vara_longlong(exoid, varid, start, count, varidx);
+#else
+ status = nc_get_vara_int(exoid, varid, start, count, varidx);
+#endif
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable \"%s\" in file ID %d",
- ne_var_name, neid);
+ ne_var_name, exoid);
ex_err(func_name, errmsg, exerrval);
return -1;
}
if (pos == 0) {
- index[0] = 0;
- index[1] = varidx[0];
+ my_index[0] = 0;
+ my_index[1] = varidx[0];
} else {
- index[0] = varidx[0];
- index[1] = varidx[1];
+ my_index[0] = varidx[0];
+ my_index[1] = varidx[1];
}
}
return 1;
}
-int ne_get_proc_count(int neid)
-{
- int status;
- int dimid;
- size_t ltemp;
- int proc_count = -1;
-
- if ((status = nc_inq_dimid(neid, DIM_NUM_PROCS, &dimid)) != NC_NOERR) {
- return (-1);
- }
-
- /* Get the value of the number of processors */
- if ((status = nc_inq_dimlen(neid, dimid, <emp)) != NC_NOERR) {
- return (-1);
- }
- proc_count = ltemp;
- return proc_count;
-}
-
-struct ne_stat_struct {
- int neid;
+struct ex_stat_struct {
+ int exoid;
int *stats;
size_t num;
-} ne_stat_struct;
-
-static struct ne_stat_struct *nem_int_e_maps = 0;
-static struct ne_stat_struct *nem_bor_e_maps = 0;
-static struct ne_stat_struct *nem_int_n_maps = 0;
-static struct ne_stat_struct *nem_bor_n_maps = 0;
-static struct ne_stat_struct *nem_ext_n_maps = 0;
-
-int ne_fill_map_status(int neid,
- char *stat_var,
- int *stat_array)
-{
- int status;
- int varid;
- char errmsg[MAX_ERR_LENGTH];
- char *func_name = "ne_fill_map_status(internal function)";
-
- /* Now query the map status and fill the array. */
- if ((status = nc_inq_varid(neid, stat_var, &varid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to find variable ID for \"%s\" from file ID %d",
- VAR_INT_N_STAT, neid);
- ex_err(func_name, errmsg, exerrval);
- return (EX_FATAL);
- }
-
- if ((status = nc_get_var_int(neid, varid, stat_array)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get status for \"%s\" from file %d",
- VAR_INT_N_STAT, neid);
- ex_err(func_name, errmsg, exerrval);
- return (EX_FATAL);
- }
- return (EX_NOERR);
-}
-
-int ne_get_map_status(int neid,
- char *stat_var,
- int proc_id,
- int *stat)
-{
- int num_procs = 0;
-
- struct ne_stat_struct *maps = 0;
- if (strcmp(stat_var, VAR_INT_N_STAT ) == 0) {
- if (nem_int_n_maps == 0) {
- nem_int_n_maps = malloc(sizeof(ne_stat_struct));
- num_procs = ne_get_proc_count(neid);
- nem_int_n_maps->stats = malloc(sizeof(int) * num_procs);
-
- ne_fill_map_status(neid, stat_var, nem_int_n_maps->stats);
- }
- maps = nem_int_n_maps;
- maps->neid = neid;
- maps->num = num_procs;
- }
- else if (strcmp(stat_var, VAR_BOR_N_STAT ) == 0) {
- if (nem_bor_n_maps == 0) {
- nem_bor_n_maps = malloc(sizeof(ne_stat_struct));
- num_procs = ne_get_proc_count(neid);
- nem_bor_n_maps->stats = malloc(sizeof(int) * num_procs);
-
- ne_fill_map_status(neid, stat_var, nem_bor_n_maps->stats);
- }
- maps = nem_bor_n_maps;
- maps->neid = neid;
- maps->num = num_procs;
- }
- else if (strcmp(stat_var, VAR_EXT_N_STAT ) == 0) {
- if (nem_ext_n_maps == 0) {
- nem_ext_n_maps = malloc(sizeof(ne_stat_struct));
- num_procs = ne_get_proc_count(neid);
- nem_ext_n_maps->stats = malloc(sizeof(int) * num_procs);
-
- ne_fill_map_status(neid, stat_var, nem_ext_n_maps->stats);
- }
- maps = nem_ext_n_maps;
- maps->neid = neid;
- maps->num = num_procs;
- }
- else if (strcmp(stat_var, VAR_INT_E_STAT ) == 0) {
- if (nem_int_e_maps == 0) {
- nem_int_e_maps = malloc(sizeof(ne_stat_struct));
- num_procs = ne_get_proc_count(neid);
- nem_int_e_maps->stats = malloc(sizeof(int) * num_procs);
-
- ne_fill_map_status(neid, stat_var, nem_int_e_maps->stats);
- }
- maps = nem_int_e_maps;
- maps->neid = neid;
- maps->num = num_procs;
- }
- else if (strcmp(stat_var, VAR_BOR_E_STAT ) == 0) {
- if (nem_bor_e_maps == 0) {
- nem_bor_e_maps = malloc(sizeof(ne_stat_struct));
- num_procs = ne_get_proc_count(neid);
- nem_bor_e_maps->stats = malloc(sizeof(int) * num_procs);
-
- ne_fill_map_status(neid, stat_var, nem_bor_e_maps->stats);
- }
- maps = nem_bor_e_maps;
- maps->neid = neid;
- maps->num = num_procs;
- }
-
- exerrval = 0; /* clear error code */
-
- if (maps != 0) {
- *stat = maps->stats[proc_id];
- return(EX_NOERR);
- } else {
- return(EX_FATAL);
- }
-}
-
+} ex_stat_struct;
diff --git a/exodus/cbind/src/exopen.c b/exodus/cbind/src/ex_open.c
similarity index 53%
rename from exodus/cbind/src/exopen.c
rename to exodus/cbind/src/ex_open.c
index 4ac3124..e61df79 100644
--- a/exodus/cbind/src/exopen.c
+++ b/exodus/cbind/src/ex_open.c
@@ -114,6 +114,8 @@ exoid = ex_open ("test.exo", \co{filename path}
\endcode
*/
+static int warning_output = 0;
+
int ex_open_int (const char *path,
int mode,
int *comp_ws,
@@ -121,175 +123,187 @@ int ex_open_int (const char *path,
float *version,
int run_version)
{
- int exoid;
- int status, stat_att, stat_dim;
- nc_type att_type = NC_NAT;
- size_t att_len = 0;
- int old_fill;
- int file_wordsize;
- int dim_str_name;
- char errmsg[MAX_ERR_LENGTH];
+ int exoid;
+ int status, stat_att, stat_dim;
+ nc_type att_type = NC_NAT;
+ size_t att_len = 0;
+ int old_fill;
+ int file_wordsize;
+ int dim_str_name;
+ int int64_status = 0;
+
+ char errmsg[MAX_ERR_LENGTH];
exerrval = 0; /* clear error code */
-/* set error handling mode to no messages, non-fatal errors */
+ /* set error handling mode to no messages, non-fatal errors */
ex_opts(exoptval); /* call required to set ncopts first time through */
- if (run_version != EX_API_VERS_NODOT) {
+ if (run_version != EX_API_VERS_NODOT && warning_output == 0) {
int run_version_major = run_version / 100;
int run_version_minor = run_version % 100;
int lib_version_major = EX_API_VERS_NODOT / 100;
int lib_version_minor = EX_API_VERS_NODOT % 100;
fprintf(stderr, "EXODUS: Warning: This code was compiled with exodus version %d.%02d,\n but was linked with exodus library version %d.%02d\n This is probably an error in the build process of this code.\n",
run_version_major, run_version_minor, lib_version_major, lib_version_minor);
+ warning_output = 1;
}
- if (mode == EX_READ) { /* READ ONLY */
+
+ if ((mode & EX_READ) && (mode & EX_WRITE)) {
+ exerrval = EX_BADFILEMODE;
+ sprintf(errmsg,"Error: Cannot specify both EX_READ and EX_WRITE");
+ ex_err("ex_open",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* The EX_READ mode is the default if EX_WRITE is not specified... */
+ if (!(mode & EX_WRITE)) { /* READ ONLY */
#if defined(__LIBCATAMOUNT__)
if ((status = nc_open (path, NC_NOWRITE, &exoid)) != NC_NOERR)
#else
- if ((status = nc_open (path, NC_NOWRITE|NC_SHARE, &exoid)) != NC_NOERR)
+ if ((status = nc_open (path, NC_NOWRITE|NC_SHARE, &exoid)) != NC_NOERR)
#endif
- {
- /* NOTE: netCDF returns an id of -1 on an error - but no error code! */
- if (status == 0) {
- exerrval = EX_FATAL;
- }
- else {
- /* It is possible that the user is trying to open a netcdf4
- file, but the netcdf4 capabilities aren't available in the
- netcdf linked to this library. Note that we can't just use a
- compile-time define since we could be using a shareable
- netcdf library, so the netcdf4 capabilities aren't known
- until runtime...
+ {
+ /* NOTE: netCDF returns an id of -1 on an error - but no error code! */
+ if (status == 0) {
+ exerrval = EX_FATAL;
+ }
+ else {
+ /* It is possible that the user is trying to open a netcdf4
+ file, but the netcdf4 capabilities aren't available in the
+ netcdf linked to this library. Note that we can't just use a
+ compile-time define since we could be using a shareable
+ netcdf library, so the netcdf4 capabilities aren't known
+ until runtime...
- Netcdf-4.X does not (yet?) have a function that can be
- queried to determine whether the library being used was
- compiled with --enable-netcdf4, so that isn't very
- helpful..
+ Netcdf-4.X does not (yet?) have a function that can be
+ queried to determine whether the library being used was
+ compiled with --enable-netcdf4, so that isn't very
+ helpful..
- At this time, query the beginning of the file and see if it
- is an HDF-5 file and if it is assume that the open failure
- is due to the netcdf library not enabling netcdf4 features...
- */
- int type = 0;
- ex_check_file_type(path, &type);
+ At this time, query the beginning of the file and see if it
+ is an HDF-5 file and if it is assume that the open failure
+ is due to the netcdf library not enabling netcdf4 features...
+ */
+ int type = 0;
+ ex_check_file_type(path, &type);
- if (type == 5) {
- /* This is an hdf5 (netcdf4) file. Since the nc_open failed,
- the assumption is that the netcdf doesn't have netcdf4
- capabilities enabled. Tell the user...
- */
- fprintf(stderr,
- "EXODUS: Error: Attempting to open the netcdf-4 file: '%s'\n\twith a netcdf library that does not support netcdf-4\n",
- path);
- }
- exerrval = status;
- }
- sprintf(errmsg,"Error: failed to open %s read only",path);
- ex_err("ex_open",errmsg,exerrval);
- return(EX_FATAL);
- }
+ if (type == 5) {
+ /* This is an hdf5 (netcdf4) file. Since the nc_open failed,
+ the assumption is that the netcdf doesn't have netcdf4
+ capabilities enabled. Tell the user...
+ */
+ fprintf(stderr,
+ "EXODUS: Error: Attempting to open the netcdf-4 file:\n\t'%s'\n\twith a netcdf library that does not support netcdf-4\n",
+ path);
+ }
+ exerrval = status;
+ }
+ sprintf(errmsg,"Error: failed to open %s read only",path);
+ ex_err("ex_open",errmsg,exerrval);
+ return(EX_FATAL);
+ }
}
-
- else if (mode == EX_WRITE) /* READ/WRITE */
- {
+ else /* (mode & EX_WRITE) READ/WRITE */
+ {
#if defined(__LIBCATAMOUNT__)
- if ((status = nc_open (path, NC_WRITE, &exoid)) != NC_NOERR)
+ if ((status = nc_open (path, NC_WRITE, &exoid)) != NC_NOERR)
#else
- if ((status = nc_open (path, NC_WRITE|NC_SHARE, &exoid)) != NC_NOERR)
+ if ((status = nc_open (path, NC_WRITE|NC_SHARE, &exoid)) != NC_NOERR)
#endif
- {
- /* NOTE: netCDF returns an id of -1 on an error - but no error code! */
- if (status == 0)
- exerrval = EX_FATAL;
- else
- exerrval = status;
- sprintf(errmsg,"Error: failed to open %s write only",path);
- ex_err("ex_open",errmsg,exerrval);
- return(EX_FATAL);
- }
-
- /* turn off automatic filling of netCDF variables */
- if ((status = nc_set_fill (exoid, NC_NOFILL, &old_fill)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to set nofill mode in file id %d",
- exoid);
- ex_err("ex_open", errmsg, exerrval);
- return (EX_FATAL);
- }
+ {
+ /* NOTE: netCDF returns an id of -1 on an error - but no error code! */
+ if (status == 0)
+ exerrval = EX_FATAL;
+ else
+ exerrval = status;
+ sprintf(errmsg,"Error: failed to open %s write only",path);
+ ex_err("ex_open",errmsg,exerrval);
+ return(EX_FATAL);
+ }
- stat_att = nc_inq_att(exoid, NC_GLOBAL, ATT_MAX_NAME_LENGTH, &att_type, &att_len);
- stat_dim = nc_inq_dimid(exoid, DIM_STR_NAME, &dim_str_name);
- if(stat_att != NC_NOERR || stat_dim != NC_NOERR) {
- nc_redef(exoid);
- if (stat_att != NC_NOERR) {
- int max_so_far = 32;
- status=nc_put_att_int(exoid, NC_GLOBAL, ATT_MAX_NAME_LENGTH, NC_INT, 1, &max_so_far);
+ /* turn off automatic filling of netCDF variables */
+ if ((status = nc_set_fill (exoid, NC_NOFILL, &old_fill)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to set nofill mode in file id %d",
+ exoid);
+ ex_err("ex_open", errmsg, exerrval);
+ return (EX_FATAL);
}
- /* If the DIM_STR_NAME variable does not exist on the database, we need to add it now. */
- if(stat_dim != NC_NOERR) {
- /* Not found; set to default value of 32+1. */
- int max_name = ex_max_name_length < 32 ? 32 : ex_max_name_length;
- status = nc_def_dim(exoid, DIM_STR_NAME, max_name+1, &dim_str_name);
+ stat_att = nc_inq_att(exoid, NC_GLOBAL, ATT_MAX_NAME_LENGTH, &att_type, &att_len);
+ stat_dim = nc_inq_dimid(exoid, DIM_STR_NAME, &dim_str_name);
+ if(stat_att != NC_NOERR || stat_dim != NC_NOERR) {
+ nc_redef(exoid);
+ if (stat_att != NC_NOERR) {
+ int max_so_far = 32;
+ nc_put_att_int(exoid, NC_GLOBAL, ATT_MAX_NAME_LENGTH, NC_INT, 1, &max_so_far);
+ }
+
+ /* If the DIM_STR_NAME variable does not exist on the database, we need to add it now. */
+ if(stat_dim != NC_NOERR) {
+ /* Not found; set to default value of 32+1. */
+ int max_name = ex_default_max_name_length < 32 ? 32 : ex_default_max_name_length;
+ nc_def_dim(exoid, DIM_STR_NAME, max_name+1, &dim_str_name);
+ }
+ nc_enddef (exoid);
}
- nc_enddef (exoid);
}
- }
- else
- {
- exerrval = EX_BADFILEMODE;
- sprintf(errmsg,"Error: invalid file open mode: %d",mode);
- ex_err("ex_open",errmsg,exerrval);
- return (EX_FATAL);
- }
-/* determine version of EXODUS II file, and the word size of
- * floating point values stored in the file
- */
+ /* determine version of EXODUS II file, and the word size of
+ * floating point and integer values stored in the file
+ */
if ((status = nc_get_att_float(exoid, NC_GLOBAL, ATT_VERSION, version)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,"Error: failed to get database version for file id: %d",
- exoid);
- ex_err("ex_open",errmsg,exerrval);
- return(EX_FATAL);
- }
+ exerrval = status;
+ sprintf(errmsg,"Error: failed to get database version for file id: %d",
+ exoid);
+ ex_err("ex_open",errmsg,exerrval);
+ return(EX_FATAL);
+ }
-/* check ExodusII file version - old version 1.x files are not supported */
- if (*version < 2.0) {
- exerrval = EX_FATAL;
- sprintf(errmsg,"Error: Unsupported file version %.2f in file id: %d",
- *version, exoid);
- ex_err("ex_open",errmsg,exerrval);
- return(EX_FATAL);
- }
+ /* check ExodusII file version - old version 1.x files are not supported */
+ if (*version < 2.0) {
+ exerrval = EX_FATAL;
+ sprintf(errmsg,"Error: Unsupported file version %.2f in file id: %d",
+ *version, exoid);
+ ex_err("ex_open",errmsg,exerrval);
+ return(EX_FATAL);
+ }
- if (nc_get_att_int (exoid, NC_GLOBAL, ATT_FLT_WORDSIZE, &file_wordsize) != NC_NOERR)
- { /* try old (prior to db version 2.02) attribute name */
- if (nc_get_att_int (exoid,NC_GLOBAL,ATT_FLT_WORDSIZE_BLANK,&file_wordsize) != NC_NOERR)
- {
- exerrval = EX_FATAL;
- sprintf(errmsg,"Error: failed to get file wordsize from file id: %d",
- exoid);
- ex_err("ex_open",errmsg,exerrval);
- return(exerrval);
- }
- }
-
-/* initialize floating point size conversion.
- */
+ if (nc_get_att_int (exoid, NC_GLOBAL, ATT_FLT_WORDSIZE, &file_wordsize) != NC_NOERR)
+ { /* try old (prior to db version 2.02) attribute name */
+ if (nc_get_att_int (exoid,NC_GLOBAL,ATT_FLT_WORDSIZE_BLANK,&file_wordsize) != NC_NOERR)
+ {
+ exerrval = EX_FATAL;
+ sprintf(errmsg,"Error: failed to get file wordsize from file id: %d",
+ exoid);
+ ex_err("ex_open",errmsg,exerrval);
+ return(exerrval);
+ }
+ }
- if (ex_conv_ini( exoid, comp_ws, io_ws, file_wordsize ) != EX_NOERR ) {
- exerrval = EX_FATAL;
- sprintf(errmsg,
- "Error: failed to init conversion routines in file id %d",
+ /* See if int64 status attribute exists and if so, what data is stored as int64
+ * Older files don't have the attribute, so it is not an error if it is missing
+ */
+ if (nc_get_att_int (exoid, NC_GLOBAL, ATT_INT64_STATUS, &int64_status) != NC_NOERR) {
+ int64_status = 0; /* Just in case it gets munged by a failed get_att_int call */
+ }
+
+ /* Merge in API int64 status flags as specified by caller of function... */
+ int64_status |= (mode & EX_ALL_INT64_API);
+
+ /* initialize floating point and integer size conversion. */
+ if (ex_conv_ini( exoid, comp_ws, io_ws, file_wordsize, int64_status ) != EX_NOERR ) {
+ exerrval = EX_FATAL;
+ sprintf(errmsg,
+ "Error: failed to initialize conversion routines in file id %d",
exoid);
- ex_err("ex_open", errmsg, exerrval);
- return (EX_FATAL);
- }
+ ex_err("ex_open", errmsg, exerrval);
+ return (EX_FATAL);
+ }
- return (exoid);
+ return (exoid);
}
diff --git a/exodus/cbind/src/ex_open_par.c b/exodus/cbind/src/ex_open_par.c
new file mode 100644
index 0000000..4320f70
--- /dev/null
+++ b/exodus/cbind/src/ex_open_par.c
@@ -0,0 +1,318 @@
+/*
+ * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
+ * retains certain rights in this software.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * * Neither the name of Sandia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/*****************************************************************************
+*
+* exopen - ex_open
+*
+* entry conditions -
+* input parameters:
+* char* path exodus filename path
+* int mode access mode w/r
+*
+* exit conditions -
+* int exoid exodus file id
+* int* comp_ws computer word size
+* int* io_ws storage word size
+* float* version EXODUSII interface version number
+*
+* revision history -
+*
+*
+*****************************************************************************/
+
+#include <stdio.h>
+#include <mpi.h>
+
+#include "netcdf_par.h"
+#include "exodusII.h"
+#include "exodusII_int.h"
+
+/*!
+
+The function ex_open() opens an existing exodus file and returns
+an ID that can subsequently be used to refer to the file, the word
+size of the floating point values stored in the file, and the version
+of the exodus database (returned as a ``float'', regardless of the
+compute or I/O word size). Multiple files may be ``open'' simultaneously.
+
+\return In case of an error, ex_open() returns a negative
+number. Possible causes of errors include:
+ - The specified file does not exist.
+ - The mode specified is something other than the predefined constant \fparam{EX_READ} or \fparam{EX_WRITE}.
+ - Database version is earlier than 2.0.
+
+\param path The file name of the exodus file. This can be given as either an
+ absolute path name (from the root of the file system) or a relative
+ path name (from the current directory).
+
+\param mode Access mode. Use one of the following predefined constants:
+ - \fparam{EX_READ} To open the file just for reading.
+ - \fparam{EX_WRITE} To open the file for writing and reading.
+
+\param[in,out] comp_ws The word size in bytes (0, 4 or 8) of the floating point variables
+ used in the application program. If 0 (zero) is passed, the default
+ size of floating point values for the machine will be used and
+ returned in this variable. WARNING: all exodus functions requiring
+ reals must be passed reals declared with this passed in or returned
+ compute word size (4 or 8).
+
+
+\param[in,out] io_ws The word size in bytes (0, 4 or 8) of the floating
+ point data as they are stored in the exodus file. If the word
+ size does not match the word size of data stored in the file,
+ a fatal error is returned. If this argument is 0, the word size
+ of the floating point data already stored in the file is returned.
+
+\param[out] version Returned exodus database version number.
+
+The following opens an exodus file named \file{test.exo} for read
+only, using default settings for compute and I/O word sizes:
+
+\code
+#include "exodusII.h"
+int CPU_word_size,IO_word_size, exoid;
+float version;
+
+CPU_word_size = sizeof(float); \co{float or double}
+IO_word_size = 0; \co{use what is stored in file}
+
+\comment{open exodus files}
+exoid = ex_open ("test.exo", \co{filename path}
+ EX_READ, \co{access mode = READ}
+ &CPU_word_size, \co{CPU word size}
+ &IO_word_size, \co{IO word size}
+ &version); \co{ExodusII library version}
+\endcode
+ */
+
+static int warning_output = 0;
+
+int ex_open_par_int (const char *path,
+ int mode,
+ int *comp_ws,
+ int *io_ws,
+ float *version,
+ MPI_Comm comm,
+ MPI_Info info,
+ int run_version)
+{
+ int exoid;
+ int status, stat_att, stat_dim;
+ nc_type att_type = NC_NAT;
+ size_t att_len = 0;
+ int old_fill;
+ int file_wordsize;
+ int dim_str_name;
+ int int64_status = 0;
+ int pariomode = NC_MPIPOSIX;
+
+ char errmsg[MAX_ERR_LENGTH];
+
+ exerrval = 0; /* clear error code */
+
+ /* set error handling mode to no messages, non-fatal errors */
+ ex_opts(exoptval); /* call required to set ncopts first time through */
+
+ if (run_version != EX_API_VERS_NODOT && warning_output == 0) {
+ int run_version_major = run_version / 100;
+ int run_version_minor = run_version % 100;
+ int lib_version_major = EX_API_VERS_NODOT / 100;
+ int lib_version_minor = EX_API_VERS_NODOT % 100;
+ fprintf(stderr, "EXODUS: Warning: This code was compiled with exodus version %d.%02d,\n but was linked with exodus library version %d.%02d\n This is probably an error in the build process of this code.\n",
+ run_version_major, run_version_minor, lib_version_major, lib_version_minor);
+ warning_output = 1;
+ }
+
+
+ if ((mode & EX_READ) && (mode & EX_WRITE)) {
+ exerrval = EX_BADFILEMODE;
+ sprintf(errmsg,"Error: Cannot specify both EX_READ and EX_WRITE");
+ ex_err("ex_open",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* Check parallel io mode. Valid is NC_MPIPOSIX or NC_MPIIO or NC_PNETCDF
+ * Exodus uses different flag values; map to netcdf values
+ */
+ if (mode & EX_MPIPOSIX)
+ pariomode = NC_MPIPOSIX;
+ else if (mode & EX_MPIIO)
+ pariomode = NC_MPIIO;
+ else if (mode & EX_PNETCDF)
+ pariomode = NC_PNETCDF;
+
+
+ /* The EX_READ mode is the default if EX_WRITE is not specified... */
+ if (!(mode & EX_WRITE)) { /* READ ONLY */
+ if ((status = nc_open_par (path, NC_NOWRITE|NC_SHARE|pariomode, comm, info, &exoid)) != NC_NOERR)
+ {
+ /* NOTE: netCDF returns an id of -1 on an error - but no error code! */
+ if (status == 0) {
+ exerrval = EX_FATAL;
+ }
+ else {
+ /* It is possible that the user is trying to open a netcdf4
+ file, but the netcdf4 capabilities aren't available in the
+ netcdf linked to this library. Note that we can't just use a
+ compile-time define since we could be using a shareable
+ netcdf library, so the netcdf4 capabilities aren't known
+ until runtime...
+
+ Netcdf-4.X does not (yet?) have a function that can be
+ queried to determine whether the library being used was
+ compiled with --enable-netcdf4, so that isn't very
+ helpful..
+
+ At this time, query the beginning of the file and see if it
+ is an HDF-5 file and if it is assume that the open failure
+ is due to the netcdf library not enabling netcdf4 features...
+ */
+ int type = 0;
+ ex_check_file_type(path, &type);
+
+ if (type == 5) {
+ /* This is an hdf5 (netcdf4) file. Since the nc_open failed,
+ the assumption is that the netcdf doesn't have netcdf4
+ capabilities enabled. Tell the user...
+ */
+ fprintf(stderr,
+ "EXODUS: Error: Attempting to open the netcdf-4 file:\n\t'%s'\n\twith a netcdf library that does not support netcdf-4\n",
+ path);
+ }
+ exerrval = status;
+ }
+ sprintf(errmsg,"Error: failed to open %s read only",path);
+ ex_err("ex_open",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+ }
+ else /* (mode & EX_WRITE) READ/WRITE */
+ {
+ if ((status = nc_open_par (path, NC_WRITE|NC_SHARE|pariomode, comm, info, &exoid)) != NC_NOERR)
+ {
+ /* NOTE: netCDF returns an id of -1 on an error - but no error code! */
+ if (status == 0)
+ exerrval = EX_FATAL;
+ else
+ exerrval = status;
+ sprintf(errmsg,"Error: failed to open %s write only",path);
+ ex_err("ex_open",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+
+ /* turn off automatic filling of netCDF variables */
+ if ((status = nc_set_fill (exoid, NC_NOFILL, &old_fill)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to set nofill mode in file id %d",
+ exoid);
+ ex_err("ex_open", errmsg, exerrval);
+ return (EX_FATAL);
+ }
+
+ stat_att = nc_inq_att(exoid, NC_GLOBAL, ATT_MAX_NAME_LENGTH, &att_type, &att_len);
+ stat_dim = nc_inq_dimid(exoid, DIM_STR_NAME, &dim_str_name);
+ if(stat_att != NC_NOERR || stat_dim != NC_NOERR) {
+ nc_redef(exoid);
+ if (stat_att != NC_NOERR) {
+ int max_so_far = 32;
+ nc_put_att_int(exoid, NC_GLOBAL, ATT_MAX_NAME_LENGTH, NC_INT, 1, &max_so_far);
+ }
+
+ /* If the DIM_STR_NAME variable does not exist on the database, we need to add it now. */
+ if(stat_dim != NC_NOERR) {
+ /* Not found; set to default value of 32+1. */
+ int max_name = ex_default_max_name_length < 32 ? 32 : ex_default_max_name_length;
+ nc_def_dim(exoid, DIM_STR_NAME, max_name+1, &dim_str_name);
+ }
+ nc_enddef (exoid);
+ }
+ }
+
+ /* determine version of EXODUS II file, and the word size of
+ * floating point and integer values stored in the file
+ */
+
+ if ((status = nc_get_att_float(exoid, NC_GLOBAL, ATT_VERSION, version)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,"Error: failed to get database version for file id: %d",
+ exoid);
+ ex_err("ex_open",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+
+ /* check ExodusII file version - old version 1.x files are not supported */
+ if (*version < 2.0) {
+ exerrval = EX_FATAL;
+ sprintf(errmsg,"Error: Unsupported file version %.2f in file id: %d",
+ *version, exoid);
+ ex_err("ex_open",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+
+ if (nc_get_att_int (exoid, NC_GLOBAL, ATT_FLT_WORDSIZE, &file_wordsize) != NC_NOERR)
+ { /* try old (prior to db version 2.02) attribute name */
+ if (nc_get_att_int (exoid,NC_GLOBAL,ATT_FLT_WORDSIZE_BLANK,&file_wordsize) != NC_NOERR)
+ {
+ exerrval = EX_FATAL;
+ sprintf(errmsg,"Error: failed to get file wordsize from file id: %d",
+ exoid);
+ ex_err("ex_open",errmsg,exerrval);
+ return(exerrval);
+ }
+ }
+
+ /* See if int64 status attribute exists and if so, what data is stored as int64
+ * Older files don't have the attribute, so it is not an error if it is missing
+ */
+ if (nc_get_att_int (exoid, NC_GLOBAL, ATT_INT64_STATUS, &int64_status) != NC_NOERR) {
+ int64_status = 0; /* Just in case it gets munged by a failed get_att_int call */
+ }
+
+ /* Merge in API int64 status flags as specified by caller of function... */
+ int64_status |= (mode & EX_ALL_INT64_API);
+
+ /* initialize floating point and integer size conversion. */
+ if (ex_conv_ini( exoid, comp_ws, io_ws, file_wordsize, int64_status ) != EX_NOERR ) {
+ exerrval = EX_FATAL;
+ sprintf(errmsg,
+ "Error: failed to initialize conversion routines in file id %d",
+ exoid);
+ ex_err("ex_open", errmsg, exerrval);
+ return (EX_FATAL);
+ }
+
+ return (exoid);
+}
diff --git a/exodus/cbind/src/exopts.c b/exodus/cbind/src/ex_opts.c
similarity index 97%
rename from exodus/cbind/src/exopts.c
rename to exodus/cbind/src/ex_opts.c
index 594526d..07f90d3 100644
--- a/exodus/cbind/src/exopts.c
+++ b/exodus/cbind/src/ex_opts.c
@@ -37,7 +37,7 @@
#include "exodusII_int.h"
/*! \cond INTERNAL */
-int ex_max_name_length = 32; /* For default compatibility with older clients */
+int ex_default_max_name_length = 32; /* For default compatibility with older clients */
#if defined(VERBOSE)
int exoptval = EX_VERBOSE; /* loud mode: set EX_VERBOSE */
diff --git a/exodus/cbind/src/expvpa.c b/exodus/cbind/src/ex_put_all_var_param.c
similarity index 100%
rename from exodus/cbind/src/expvpa.c
rename to exodus/cbind/src/ex_put_all_var_param.c
diff --git a/exodus/cbind/src/expvpax.c b/exodus/cbind/src/ex_put_all_var_param_ext.c
similarity index 90%
rename from exodus/cbind/src/expvpax.c
rename to exodus/cbind/src/ex_put_all_var_param_ext.c
index 2b827f2..1b8a5af 100644
--- a/exodus/cbind/src/expvpax.c
+++ b/exodus/cbind/src/ex_put_all_var_param_ext.c
@@ -57,7 +57,7 @@ static int define_variable_name_variable(int exoid, const char *VARIABLE, int di
static int *get_status_array(int exoid, int count, const char *VARIABLE, const char *label);
static int put_truth_table(int exoid, int varid, int *table, const char *label);
static int define_truth_table(ex_entity_type obj_type, int exoid, int num_ent, int num_var,
- int *var_tab, int *status, int *ids, const char *label);
+ int *var_tab, int *status, void_int *ids, const char *label);
#define EX_GET_IDS_STATUS(TNAME,NUMVAR,DNAME,DID,DVAL,VIDS,EIDS,VSTAT,VSTATVAL) \
if (NUMVAR > 0) { \
@@ -66,7 +66,7 @@ static int define_truth_table(ex_entity_type obj_type, int exoid, int num_ent, i
goto error_ret; \
\
/* get element block IDs */ \
- if (!(VIDS = malloc(DVAL*sizeof(int)))) { \
+ if (!(VIDS = malloc(DVAL*sizeof(int64_t)))) { \
exerrval = EX_MEMFAIL; \
sprintf(errmsg, \
"Error: failed to allocate memory for " TNAME " id array for file id %d", \
@@ -108,14 +108,14 @@ int ex_put_all_var_param_ext ( int exoid,
int edblk_varid, fablk_varid, eblk_varid, nset_varid,
eset_varid, fset_varid, sset_varid, elset_varid, varid;
- int* eblk_ids = 0;
- int* edblk_ids = 0;
- int* fablk_ids = 0;
- int* nset_ids = 0;
- int* eset_ids = 0;
- int* fset_ids = 0;
- int* sset_ids = 0;
- int* elset_ids = 0;
+ void_int* eblk_ids = 0;
+ void_int* edblk_ids = 0;
+ void_int* fablk_ids = 0;
+ void_int* nset_ids = 0;
+ void_int* eset_ids = 0;
+ void_int* fset_ids = 0;
+ void_int* sset_ids = 0;
+ void_int* elset_ids = 0;
int* eblk_stat = 0;
int* edblk_stat = 0;
@@ -143,14 +143,7 @@ int ex_put_all_var_param_ext ( int exoid,
}
if ((status = nc_inq_dimid (exoid, DIM_NUM_NODES, &num_nod_dim)) != NC_NOERR) {
- if (vp->num_node > 0) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate number of nodes in file id %d",
- exoid);
- ex_err("ex_put_all_var_param_ext",errmsg,exerrval);
- goto error_ret;
- }
+ num_nod_dim = -1; /* There is probably no nodes on this file */
}
/* Check this now so we can use it later without checking for errors */
@@ -188,22 +181,22 @@ int ex_put_all_var_param_ext ( int exoid,
dims[0] = time_dim;
dims[1] = dimid;
- if ((status = nc_def_var (exoid, VAR_GLO_VAR, nc_flt_code(exoid), 2, dims, &varid)) != NC_NOERR)
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to define global variables in file id %d",
- exoid);
- ex_err("ex_put_all_var_param_ext",errmsg,exerrval);
- goto error_ret; /* exit define mode and return */
- }
+ if ((status = nc_def_var (exoid, VAR_GLO_VAR, nc_flt_code(exoid), 2, dims, &varid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to define global variables in file id %d",
+ exoid);
+ ex_err("ex_put_all_var_param_ext",errmsg,exerrval);
+ goto error_ret; /* exit define mode and return */
+ }
+ ex_compress_variable(exoid, varid, 2);
/* Now define global variable name variable */
if (define_variable_name_variable(exoid, VAR_NAME_GLO_VAR, dimid, "global") != NC_NOERR)
goto error_ret;
}
- if (vp->num_node > 0) {
+ if (vp->num_node > 0 && num_nod_dim > 0) {
/*
* There are two ways to store the nodal variables. The old way *
* was a blob (#times,#vars,#nodes), but that was exceeding the
@@ -238,15 +231,15 @@ int ex_put_all_var_param_ext ( int exoid,
dims[0] = time_dim;
dims[1] = num_nod_dim;
if ((status = nc_def_var(exoid, VAR_NOD_VAR_NEW(i),
- nc_flt_code(exoid), 2, dims, &varid)) != NC_NOERR)
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to define nodal variable %d in file id %d",
- i, exoid);
- ex_err("ex_put_var_param",errmsg,exerrval);
- goto error_ret; /* exit define mode and return */
- }
+ nc_flt_code(exoid), 2, dims, &varid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to define nodal variable %d in file id %d",
+ i, exoid);
+ ex_err("ex_put_var_param",errmsg,exerrval);
+ goto error_ret; /* exit define mode and return */
+ }
+ ex_compress_variable(exoid, varid, 2);
}
}
@@ -382,7 +375,7 @@ int ex_put_all_var_param_ext ( int exoid,
return(EX_FATAL);
}
-int define_dimension(int exoid, const char *DIMENSION, int count, const char *label, int *dimid)
+static int define_dimension(int exoid, const char *DIMENSION, int count, const char *label, int *dimid)
{
char errmsg[MAX_ERR_LENGTH];
int status;
@@ -403,7 +396,7 @@ int define_dimension(int exoid, const char *DIMENSION, int count, const char *la
return status;
}
-int define_variable_name_variable(int exoid, const char *VARIABLE, int dimension, const char *label)
+static int define_variable_name_variable(int exoid, const char *VARIABLE, int dimension, const char *label)
{
char errmsg[MAX_ERR_LENGTH];
int dims[2];
@@ -432,7 +425,7 @@ int define_variable_name_variable(int exoid, const char *VARIABLE, int dimension
return status;
}
-int *get_status_array(int exoid, int var_count, const char *VARIABLE, const char *label)
+static int *get_status_array(int exoid, int var_count, const char *VARIABLE, const char *label)
{
char errmsg[MAX_ERR_LENGTH];
int varid;
@@ -455,7 +448,7 @@ int *get_status_array(int exoid, int var_count, const char *VARIABLE, const char
if ((status = nc_get_var_int(exoid, varid, stat_vals)) != NC_NOERR) {
exerrval = status;
- stat_vals = safe_free(stat_vals);
+ safe_free(stat_vals);
sprintf(errmsg,
"Error: failed to get %s status array from file id %d",
label, exoid);
@@ -471,13 +464,13 @@ int *get_status_array(int exoid, int var_count, const char *VARIABLE, const char
return stat_vals;
}
-void *safe_free(void *array)
+static void *safe_free(void *array)
{
if (array != 0) free(array);
return 0;
}
-int put_truth_table(int exoid, int varid, int *table, const char *label)
+static int put_truth_table(int exoid, int varid, int *table, const char *label)
{
int iresult = 0;
char errmsg[MAX_ERR_LENGTH];
@@ -494,8 +487,8 @@ int put_truth_table(int exoid, int varid, int *table, const char *label)
return iresult;
}
-int define_truth_table(ex_entity_type obj_type, int exoid, int num_ent, int num_var,
- int *var_tab, int *status_tab, int *ids, const char *label)
+static int define_truth_table(ex_entity_type obj_type, int exoid, int num_ent, int num_var,
+ int *var_tab, int *status_tab, void_int *ids, const char *label)
{
char errmsg[MAX_ERR_LENGTH];
int k = 0;
@@ -516,6 +509,12 @@ int define_truth_table(ex_entity_type obj_type, int exoid, int num_ent, int num_
}
for (i=0; i<num_ent; i++) {
+ int64_t id;
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API)
+ id = ((int64_t*)ids)[i];
+ else
+ id = ((int*)ids)[i];
+
for (j=1; j<=num_var; j++) {
/* check if variables are to be put out for this block */
@@ -529,8 +528,8 @@ int define_truth_table(ex_entity_type obj_type, int exoid, int num_ent, int num_
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of entities in %s %d in file id %d",
- label, ids[i], exoid);
+ "Error: failed to locate number of entities in %s %"PRId64" in file id %d",
+ label, id, exoid);
ex_err("ex_put_all_var_param_ext",errmsg,exerrval);
return status;
}
@@ -546,12 +545,13 @@ int define_truth_table(ex_entity_type obj_type, int exoid, int num_ent, int num_
if (status != NC_ENAMEINUSE) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to define %s variable for %s %d in file id %d",
- label, label, ids[i], exoid);
+ "Error: failed to define %s variable for %s %"PRId64" in file id %d",
+ label, label, id, exoid);
ex_err("ex_put_all_var_param_ext",errmsg,exerrval);
return status;
}
}
+ ex_compress_variable(exoid, varid, 2);
}
} /* if */
k++; /* increment truth table pointer */
diff --git a/exodus/cbind/src/expatt.c b/exodus/cbind/src/ex_put_attr.c
similarity index 94%
copy from exodus/cbind/src/expatt.c
copy to exodus/cbind/src/ex_put_attr.c
index 82cd55d..4b910a0 100644
--- a/exodus/cbind/src/expatt.c
+++ b/exodus/cbind/src/ex_put_attr.c
@@ -63,7 +63,7 @@
int ex_put_attr (int exoid,
ex_entity_type blk_type,
- int blk_id,
+ ex_entity_id blk_id,
const void *attrib)
{
int status;
@@ -78,13 +78,13 @@ int ex_put_attr (int exoid,
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no attributes allowed for NULL %s %d in file id %d",
+ "Warning: no attributes allowed for NULL %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
ex_err("ex_put_attr",errmsg,EX_MSG);
return (EX_WARN); /* no attributes for this block */
} else {
sprintf(errmsg,
- "Error: no %s id %d in in file id %d",
+ "Error: no %s id %"PRId64" in in file id %d",
ex_name_of_object(blk_type), blk_id, exoid);
ex_err("ex_put_attr",errmsg,exerrval);
return (EX_FATAL);
@@ -132,7 +132,7 @@ int ex_put_attr (int exoid,
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate attribute variable for %s %d in file id %d",
+ "Error: failed to locate attribute variable for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
ex_err("ex_put_attr",errmsg,exerrval);
return (EX_FATAL);
@@ -148,7 +148,7 @@ int ex_put_attr (int exoid,
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to put attributes for %s %d in file id %d",
+ "Error: failed to put attributes for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
ex_err("ex_put_attr",errmsg,exerrval);
return (EX_FATAL);
diff --git a/exodus/cbind/src/expatn.c b/exodus/cbind/src/ex_put_attr_names.c
similarity index 94%
rename from exodus/cbind/src/expatn.c
rename to exodus/cbind/src/ex_put_attr_names.c
index 031f845..9d77d4a 100644
--- a/exodus/cbind/src/expatn.c
+++ b/exodus/cbind/src/ex_put_attr_names.c
@@ -64,7 +64,7 @@
*/
int ex_put_attr_names(int exoid,
ex_entity_type blk_type,
- int blk_id,
+ ex_entity_id blk_id,
char* names[])
{
int varid, numattrdim, blk_id_ndx;
@@ -81,13 +81,13 @@ int ex_put_attr_names(int exoid,
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no attributes allowed for NULL %s %d in file id %d",
+ "Warning: no attributes allowed for NULL %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
ex_err("ex_put_attr_names",errmsg,EX_MSG);
return (EX_WARN); /* no attributes for this block */
} else {
sprintf(errmsg,
- "Error: no %s id %d in %s array in file id %d",
+ "Error: no %s id %"PRId64" in %s array in file id %d",
ex_name_of_object(blk_type), blk_id, VAR_ID_EL_BLK, exoid);
ex_err("ex_put_attr_names",errmsg,exerrval);
return (EX_FATAL);
@@ -135,7 +135,7 @@ int ex_put_attr_names(int exoid,
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: number of attributes not defined for %s %d in file id %d",
+ "Error: number of attributes not defined for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
ex_err("ex_put_attr_names",errmsg,EX_MSG);
return (EX_FATAL); /* number of attributes not defined */
@@ -144,7 +144,7 @@ int ex_put_attr_names(int exoid,
if ((status = nc_inq_dimlen(exoid, numattrdim, &num_attr)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of attributes for %s %d in file id %d",
+ "Error: failed to get number of attributes for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
ex_err("ex_put_attr_names",errmsg,exerrval);
return (EX_FATAL);
@@ -190,7 +190,7 @@ int ex_put_attr_names(int exoid,
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate %s attribute names for %s %d in file id %d",
+ "Error: failed to locate %s attribute names for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),ex_name_of_object(blk_type),blk_id, exoid);
ex_err("ex_put_attr_names",errmsg,exerrval);
return (EX_FATAL);
diff --git a/exodus/cbind/src/expattp.c b/exodus/cbind/src/ex_put_attr_param.c
similarity index 94%
rename from exodus/cbind/src/expattp.c
rename to exodus/cbind/src/ex_put_attr_param.c
index 76b50b6..9ffcf8b 100644
--- a/exodus/cbind/src/expattp.c
+++ b/exodus/cbind/src/ex_put_attr_param.c
@@ -61,7 +61,7 @@
int ex_put_attr_param (int exoid,
ex_entity_type obj_type,
- int obj_id,
+ ex_entity_id obj_id,
int num_attrs)
{
int status;
@@ -86,13 +86,13 @@ int ex_put_attr_param (int exoid,
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no attributes found for NULL %s %d in file id %d",
+ "Warning: no attributes found for NULL %s %"PRId64" in file id %d",
ex_name_of_object(obj_type),obj_id,exoid);
ex_err("ex_put_attr_param",errmsg,EX_MSG);
return (EX_WARN); /* no attributes for this object */
} else {
sprintf(errmsg,
- "Warning: failed to locate %s id %d in id array in file id %d",
+ "Warning: failed to locate %s id %"PRId64" in id array in file id %d",
ex_name_of_object(obj_type),obj_id, exoid);
ex_err("ex_put_attr_param",errmsg,exerrval);
return (EX_WARN);
@@ -168,7 +168,7 @@ int ex_put_attr_param (int exoid,
if ((status = nc_inq_dimid(exoid, dnumobjent, &numobjentdim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of entries for %s %d in file id %d",
+ "Error: failed to locate number of entries for %s %"PRId64" in file id %d",
ex_name_of_object(obj_type), obj_id, exoid);
ex_err("ex_put_attr_param",errmsg,exerrval);
return (EX_FATAL);
@@ -185,7 +185,7 @@ int ex_put_attr_param (int exoid,
if ((status = nc_def_dim(exoid, dnumobjatt, num_attrs, &numattrdim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to define number of attributes in %s %d in file id %d",
+ "Error: failed to define number of attributes in %s %"PRId64" in file id %d",
ex_name_of_object(obj_type), obj_id,exoid);
ex_err("ex_put_attr_param",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
@@ -197,11 +197,12 @@ int ex_put_attr_param (int exoid,
if ((status = nc_def_var(exoid, vobjatt, nc_flt_code(exoid), 2, dims, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to define attributes for %s %d in file id %d",
+ "Error: failed to define attributes for %s %"PRId64" in file id %d",
ex_name_of_object(obj_type), obj_id,exoid);
ex_err("ex_put_attr_param",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
+ ex_compress_variable(exoid, varid, 2);
/* inquire previously defined dimensions */
if ((status = nc_inq_dimid(exoid, DIM_STR_NAME, &strdim)) != NC_NOERR) {
diff --git a/exodus/cbind/src/ex_put_block.c b/exodus/cbind/src/ex_put_block.c
new file mode 100644
index 0000000..85a5b52
--- /dev/null
+++ b/exodus/cbind/src/ex_put_block.c
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2006 Sandia Corporation. Under the terms of Contract
+ * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
+ * retains certain rights in this software.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * * Neither the name of Sandia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/*****************************************************************************
+*
+* expblk - ex_put_block: write edge, face, or element block parameters
+*
+* entry conditions -
+* input parameters:
+* int idexo exodus file id
+* int blk_type type of block (edge, face, or element)
+* int blk_id block identifer
+* char* entry_descrip string describing shape of entries in the block
+* int num_entries_this_blk number of entries(records) in the block
+* int num_nodes_per_entry number of nodes per block entry
+* int num_edges_per_entry number of edges per block entry
+* int num_faces_per_entry number of faces per block entry
+* int num_attr_per_entry number of attributes per block entry
+*
+* exit conditions -
+*
+*
+*****************************************************************************/
+
+#include "exodusII.h"
+#include "exodusII_int.h"
+#include <string.h>
+
+/*!
+ * writes the parameters used to describe an element/face/edge block
+ * \param exoid exodus file id
+ * \param blk_type type of block (edge, face, or element)
+ * \param blk_id block identifer
+ * \param entry_descrip string describing shape of entries in the block
+ * \param num_entries_this_blk number of entries(records) in the block
+ * \param num_nodes_per_entry number of nodes per block entry
+ * \param num_edges_per_entry number of edges per block entry
+ * \param num_faces_per_entry number of faces per block entry
+ * \param num_attr_per_entry number of attributes per block entry
+ */
+
+int ex_put_block( int exoid,
+ ex_entity_type blk_type,
+ ex_entity_id blk_id,
+ const char* entry_descrip,
+ int64_t num_entries_this_blk,
+ int64_t num_nodes_per_entry,
+ int64_t num_edges_per_entry,
+ int64_t num_faces_per_entry,
+ int64_t num_attr_per_entry )
+{
+ ex_block block;
+ block.type = blk_type;
+ block.id = blk_id;
+ strcpy(block.topology, entry_descrip);
+ block.num_entry = num_entries_this_blk;
+ block.num_nodes_per_entry = num_nodes_per_entry;
+ block.num_edges_per_entry = num_edges_per_entry;
+ block.num_faces_per_entry = num_faces_per_entry;
+ block.num_attribute = num_attr_per_entry;
+
+ return ex_put_block_param(exoid, block);
+}
+
diff --git a/exodus/cbind/src/expblk.c b/exodus/cbind/src/ex_put_block_param.c
similarity index 71%
rename from exodus/cbind/src/expblk.c
rename to exodus/cbind/src/ex_put_block_param.c
index 5de0cb7..4531c29 100644
--- a/exodus/cbind/src/expblk.c
+++ b/exodus/cbind/src/ex_put_block_param.c
@@ -44,9 +44,9 @@
* char* entry_descrip string describing shape of entries in the block
* int num_entries_this_blk number of entries(records) in the block
* int num_nodes_per_entry number of nodes per block entry
-* int num_edges_per_entry number of edges per block entry
-* int num_faces_per_entry number of faces per block entry
-* int num_attr_per_entry number of attributes per block entry
+* int block.num_edges_per_entry number of edges per block entry
+* int block.num_faces_per_entry number of faces per block entry
+* int num_attribute number of attributes per block entry
*
* exit conditions -
*
@@ -58,36 +58,26 @@
#include <string.h>
/*!
- * writes the parameters used to describe an element block
+ * writes the parameters used to describe an element/face/edge block
* \param exoid exodus file id
- * \param blk_type type of block (edge, face, or element)
- * \param blk_id block identifer
- * \param entry_descrip string describing shape of entries in the block
- * \param num_entries_this_blk number of entries(records) in the block
- * \param num_nodes_per_entry number of nodes per block entry
- * \param num_edges_per_entry number of edges per block entry
- * \param num_faces_per_entry number of faces per block entry
- * \param num_attr_per_entry number of attributes per block entry
+ * \param block ex_block structure describing block counts
*/
-int ex_put_block( int exoid,
- ex_entity_type blk_type,
- int blk_id,
- const char* entry_descrip,
- int num_entries_this_blk,
- int num_nodes_per_entry,
- int num_edges_per_entry,
- int num_faces_per_entry,
- int num_attr_per_entry )
+int ex_put_block_param( int exoid,
+ const ex_block block)
{
+ int conn_int_type;
int status;
int arbitrary_polyhedra = 0; /* 1 if block is arbitrary 2d polyhedra type; 2 if 3d polyhedra */
- int att_name_varid, varid, dimid, dims[2], blk_id_ndx, blk_stat, strdim;
+ int att_name_varid = -1;
+ int varid, dimid, dims[2], blk_id_ndx, blk_stat, strdim;
size_t start[2];
int num_blk;
size_t temp;
int cur_num_blk, numblkdim, numattrdim;
- int nnodperentdim, nedgperentdim, nfacperentdim;
+ int nnodperentdim = -1;
+ int nedgperentdim = -1;
+ int nfacperentdim = -1;
int connid;
int npeid;
char errmsg[MAX_ERR_LENGTH];
@@ -111,7 +101,7 @@ int ex_put_block( int exoid,
exerrval = 0; /* clear error code */
- switch (blk_type) {
+ switch (block.type) {
case EX_EDGE_BLOCK:
dnumblk = DIM_NUM_ED_BLK;
vblkids = VAR_ID_ED_BLK;
@@ -130,14 +120,14 @@ int ex_put_block( int exoid,
default:
exerrval = EX_BADPARAM;
sprintf( errmsg, "Error: Bad block type (%d) specified for file id %d",
- blk_type, exoid );
+ block.type, exoid );
ex_err( "ex_put_block", errmsg, exerrval );
return (EX_FATAL);
}
/* first check if any element blocks are specified */
- if ((status = ex_get_dimension(exoid, dnumblk, ex_name_of_object(blk_type),
+ if ((status = ex_get_dimension(exoid, dnumblk, ex_name_of_object(block.type),
&temp, &dimid, "ex_put_block")) != NC_NOERR) {
return EX_FATAL;
}
@@ -153,16 +143,16 @@ int ex_put_block( int exoid,
exerrval = status;
sprintf(errmsg,
"Error: failed to locate %s ids in file id %d",
- ex_name_of_object(blk_type), exoid);
+ ex_name_of_object(block.type), exoid);
ex_err("ex_put_block",errmsg,exerrval);
}
- blk_id_ndx = ex_id_lkup(exoid,blk_type,blk_id);
+ ex_id_lkup(exoid,block.type,block.id); /* Error value used, but don't need return value */
if (exerrval != EX_LOOKUPFAIL) { /* found the element block id */
exerrval = EX_FATAL;
sprintf(errmsg,
- "Error: %s id %d already exists in file id %d",
- ex_name_of_object(blk_type), blk_id,exoid);
+ "Error: %s id %"PRId64" already exists in file id %d",
+ ex_name_of_object(block.type), block.id,exoid);
ex_err("ex_put_block",errmsg,exerrval);
return (EX_FATAL);
}
@@ -172,12 +162,12 @@ int ex_put_block( int exoid,
NOTE: ex_get_file_item is a function that finds the number of element
blocks for a specific file and returns that value incremented.
*/
- cur_num_blk=ex_get_file_item(exoid, ex_get_counter_list(blk_type));
+ cur_num_blk=ex_get_file_item(exoid, ex_get_counter_list(block.type));
if (cur_num_blk >= num_blk) {
exerrval = EX_FATAL;
sprintf(errmsg,
"Error: exceeded number of %ss (%d) defined in file id %d",
- ex_name_of_object(blk_type), num_blk,exoid);
+ ex_name_of_object(block.type), num_blk,exoid);
ex_err("ex_put_block",errmsg,exerrval);
return (EX_FATAL);
}
@@ -185,22 +175,24 @@ int ex_put_block( int exoid,
/* NOTE: ex_get_file_item is a function that finds the number of element
blocks for a specific file and returns that value incremented. */
- cur_num_blk=ex_inc_file_item(exoid, ex_get_counter_list(blk_type));
+ cur_num_blk=ex_inc_file_item(exoid, ex_get_counter_list(block.type));
start[0] = cur_num_blk;
- /* write out element block id to previously defined id array variable*/
- if ((status = nc_put_var1_int(exoid, varid, start, &blk_id)) != NC_NOERR) {
+ /* write out block id to previously defined id array variable*/
+ status = nc_put_var1_longlong(exoid, varid, start, (long long*)&block.id);
+
+ if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to store %s id to file id %d",
- ex_name_of_object(blk_type), exoid);
+ ex_name_of_object(block.type), exoid);
ex_err("ex_put_block",errmsg,exerrval);
return (EX_FATAL);
}
blk_id_ndx = start[0]+1; /* element id index into vblkids array*/
- if (num_entries_this_blk == 0) /* Is this a NULL element block? */
+ if (block.num_entry == 0) /* Is this a NULL element block? */
blk_stat = 0; /* change element block status to NULL */
else
blk_stat = 1; /* change element block status to TRUE */
@@ -209,7 +201,7 @@ int ex_put_block( int exoid,
exerrval = status;
sprintf(errmsg,
"Error: failed to locate %s status in file id %d",
- ex_name_of_object(blk_type), exoid);
+ ex_name_of_object(block.type), exoid);
ex_err("ex_put_block",errmsg,exerrval);
return (EX_FATAL);
}
@@ -217,13 +209,13 @@ int ex_put_block( int exoid,
if ((status = nc_put_var1_int(exoid, varid, start, &blk_stat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to store %s id %d status to file id %d",
- ex_name_of_object(blk_type), blk_id, exoid);
+ "Error: failed to store %s id %"PRId64" status to file id %d",
+ ex_name_of_object(block.type), block.id, exoid);
ex_err("ex_put_block",errmsg,exerrval);
return (EX_FATAL);
}
- if (num_entries_this_blk == 0) {/* Is this a NULL element block? */
+ if (block.num_entry == 0) {/* Is this a NULL element block? */
return(EX_NOERR);
}
@@ -236,7 +228,7 @@ int ex_put_block( int exoid,
return (EX_FATAL);
}
- switch (blk_type) {
+ switch (block.type) {
case EX_EDGE_BLOCK:
dneblk = DIM_NUM_ED_IN_EBLK(blk_id_ndx);
dnnpe = DIM_NUM_NOD_PER_ED(blk_id_ndx);
@@ -279,71 +271,71 @@ int ex_put_block( int exoid,
exerrval = 1005;
sprintf(errmsg,
"Internal Error: unrecognized block type in switch: %d in file id %d",
- blk_type,exoid);
+ block.type,exoid);
ex_err("ex_put_block",errmsg,EX_MSG);
return (EX_FATAL); /* number of attributes not defined */
}
/* define some dimensions and variables*/
- if ((status = nc_def_dim(exoid,dneblk,num_entries_this_blk, &numblkdim )) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid,dneblk,block.num_entry, &numblkdim )) != NC_NOERR) {
if (status == NC_ENAMEINUSE) { /* duplicate entry */
exerrval = status;
sprintf(errmsg,
- "Error: %s %d already defined in file id %d",
- ex_name_of_object(blk_type), blk_id,exoid);
+ "Error: %s %"PRId64" already defined in file id %d",
+ ex_name_of_object(block.type), block.id,exoid);
ex_err("ex_put_block",errmsg,exerrval);
} else {
exerrval = status;
sprintf(errmsg,
- "Error: failed to define number of entities/block for %s %d file id %d",
- ex_name_of_object(blk_type), blk_id,exoid);
+ "Error: failed to define number of entities/block for %s %"PRId64" file id %d",
+ ex_name_of_object(block.type), block.id,exoid);
ex_err("ex_put_block",errmsg,exerrval);
}
goto error_ret; /* exit define mode and return */
}
- if ( dnnpe && num_nodes_per_entry > 0) {
+ if ( dnnpe && block.num_nodes_per_entry > 0) {
/* A nfaced block would not have any nodes defined... */
- if ((status = nc_def_dim(exoid,dnnpe,num_nodes_per_entry, &nnodperentdim)) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid,dnnpe,block.num_nodes_per_entry, &nnodperentdim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to define number of nodes/entity for %s %d in file id %d",
- ex_name_of_object(blk_type), blk_id,exoid);
+ "Error: failed to define number of nodes/entity for %s %"PRId64" in file id %d",
+ ex_name_of_object(block.type), block.id,exoid);
ex_err("ex_put_block",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
}
- if (dnepe && num_edges_per_entry > 0 ) {
- if ((status = nc_def_dim (exoid,dnepe,num_edges_per_entry, &nedgperentdim)) != NC_NOERR) {
+ if (dnepe && block.num_edges_per_entry > 0 ) {
+ if ((status = nc_def_dim (exoid,dnepe,block.num_edges_per_entry, &nedgperentdim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to define number of edges/entity for %s %d in file id %d",
- ex_name_of_object(blk_type), blk_id,exoid);
+ "Error: failed to define number of edges/entity for %s %"PRId64" in file id %d",
+ ex_name_of_object(block.type), block.id,exoid);
ex_err("ex_put_block",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
}
- if ( dnfpe && num_faces_per_entry > 0 ) {
- if ((status = nc_def_dim(exoid,dnfpe,num_faces_per_entry, &nfacperentdim)) != NC_NOERR) {
+ if ( dnfpe && block.num_faces_per_entry > 0 ) {
+ if ((status = nc_def_dim(exoid,dnfpe,block.num_faces_per_entry, &nfacperentdim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to define number of faces/entity for %s %d in file id %d",
- ex_name_of_object(blk_type), blk_id,exoid);
+ "Error: failed to define number of faces/entity for %s %"PRId64" in file id %d",
+ ex_name_of_object(block.type), block.id,exoid);
ex_err("ex_put_block",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
}
/* element attribute array */
- if (num_attr_per_entry > 0) {
+ if (block.num_attribute > 0) {
- if ((status = nc_def_dim(exoid, dnape, num_attr_per_entry, &numattrdim)) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, dnape, block.num_attribute, &numattrdim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to define number of attributes in %s %d in file id %d",
- ex_name_of_object(blk_type), blk_id,exoid);
+ "Error: failed to define number of attributes in %s %"PRId64" in file id %d",
+ ex_name_of_object(block.type), block.id,exoid);
ex_err("ex_put_block",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
@@ -354,11 +346,12 @@ int ex_put_block( int exoid,
if ((status = nc_def_var(exoid, vblkatt, nc_flt_code(exoid), 2, dims, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to define attributes for %s %d in file id %d",
- ex_name_of_object(blk_type), blk_id,exoid);
+ "Error: failed to define attributes for %s %"PRId64" in file id %d",
+ ex_name_of_object(block.type), block.id,exoid);
ex_err("ex_put_block",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
+ ex_compress_variable(exoid, varid, 2);
/* inquire previously defined dimensions */
if ((status = nc_inq_dimid(exoid, DIM_STR_NAME, &strdim)) != NC_NOERR) {
@@ -377,31 +370,36 @@ int ex_put_block( int exoid,
exerrval = status;
sprintf(errmsg,
"Error: failed to define %s attribute name array in file id %d",
- ex_name_of_object(blk_type), exoid);
+ ex_name_of_object(block.type), exoid);
ex_err("ex_put_block",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
}
+ conn_int_type = NC_INT;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_DB) {
+ conn_int_type = NC_INT64;
+ }
+
/* See if storing an 'nsided' element block (arbitrary 2d polyhedra or super element) */
- if (strlen(entry_descrip) >= 3) {
- if ((entry_descrip[0] == 'n' || entry_descrip[0] == 'N') &&
- (entry_descrip[1] == 's' || entry_descrip[1] == 'S') &&
- (entry_descrip[2] == 'i' || entry_descrip[2] == 'I'))
+ if (strlen(block.topology) >= 3) {
+ if ((block.topology[0] == 'n' || block.topology[0] == 'N') &&
+ (block.topology[1] == 's' || block.topology[1] == 'S') &&
+ (block.topology[2] == 'i' || block.topology[2] == 'I'))
arbitrary_polyhedra = 1;
- else if ((entry_descrip[0] == 'n' || entry_descrip[0] == 'N') &&
- (entry_descrip[1] == 'f' || entry_descrip[1] == 'F') &&
- (entry_descrip[2] == 'a' || entry_descrip[2] == 'A'))
+ else if ((block.topology[0] == 'n' || block.topology[0] == 'N') &&
+ (block.topology[1] == 'f' || block.topology[1] == 'F') &&
+ (block.topology[2] == 'a' || block.topology[2] == 'A'))
/* If a FACE_BLOCK, then we are dealing with the faces of the nfaced block. */
- arbitrary_polyhedra = blk_type == EX_FACE_BLOCK ? 1 : 2;
+ arbitrary_polyhedra = block.type == EX_FACE_BLOCK ? 1 : 2;
}
/* element connectivity array */
if (arbitrary_polyhedra > 0) {
- if (blk_type != EX_FACE_BLOCK && blk_type != EX_ELEM_BLOCK) {
+ if (block.type != EX_FACE_BLOCK && block.type != EX_ELEM_BLOCK) {
exerrval = EX_BADPARAM;
sprintf( errmsg, "Error: Bad block type (%d) for nsided/nfaced block in file id %d",
- blk_type, exoid );
+ block.type, exoid );
ex_err( "ex_put_block", errmsg, exerrval );
return (EX_FATAL);
}
@@ -412,7 +410,7 @@ int ex_put_block( int exoid,
/* store entity types as attribute of npeid variable -- node/elem, node/face, face/elem*/
strcpy(entity_type1, "NODE");
- if (blk_type == EX_ELEM_BLOCK)
+ if (block.type == EX_ELEM_BLOCK)
strcpy(entity_type2, "ELEM");
else
strcpy(entity_type2, "FACE");
@@ -425,11 +423,11 @@ int ex_put_block( int exoid,
strcpy(entity_type2, "ELEM");
}
- if ((status = nc_def_var(exoid, vconn, NC_INT, 1, dims, &connid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, vconn, conn_int_type, 1, dims, &connid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to create connectivity array for %s %d in file id %d",
- ex_name_of_object(blk_type), blk_id,exoid);
+ "Error: failed to create connectivity array for %s %"PRId64" in file id %d",
+ ex_name_of_object(block.type), block.id,exoid);
ex_err("ex_put_block",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
@@ -437,11 +435,11 @@ int ex_put_block( int exoid,
/* element face-per-element or node-per-element count array */
dims[0] = numblkdim;
- if ((status = nc_def_var(exoid, vnpecnt, NC_INT, 1, dims, &npeid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, vnpecnt, conn_int_type, 1, dims, &npeid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to create face- or node- per-entity count array for %s %d in file id %d",
- ex_name_of_object(blk_type), blk_id, exoid);
+ "Error: failed to create face- or node- per-entity count array for %s %"PRId64" in file id %d",
+ ex_name_of_object(block.type), block.id, exoid);
ex_err("ex_put_block",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
@@ -450,8 +448,8 @@ int ex_put_block( int exoid,
entity_type1)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to store entity type attribute text for %s %d in file id %d",
- ex_name_of_object(blk_type), blk_id, exoid);
+ "Error: failed to store entity type attribute text for %s %"PRId64" in file id %d",
+ ex_name_of_object(block.type), block.id, exoid);
ex_err("ex_put_block",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
@@ -459,8 +457,8 @@ int ex_put_block( int exoid,
entity_type2)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to store entity type attribute text for %s %d in file id %d",
- ex_name_of_object(blk_type), blk_id, exoid);
+ "Error: failed to store entity type attribute text for %s %"PRId64" in file id %d",
+ ex_name_of_object(block.type), block.id, exoid);
ex_err("ex_put_block",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
@@ -469,50 +467,51 @@ int ex_put_block( int exoid,
dims[0] = numblkdim;
dims[1] = nnodperentdim;
- if ((status = nc_def_var(exoid, vnodcon, NC_INT, 2, dims, &connid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, vnodcon, conn_int_type, 2, dims, &connid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to create connectivity array for %s %d in file id %d",
- ex_name_of_object(blk_type), blk_id,exoid);
+ "Error: failed to create connectivity array for %s %"PRId64" in file id %d",
+ ex_name_of_object(block.type), block.id,exoid);
ex_err("ex_put_block",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
+ ex_compress_variable(exoid, connid, 1);
}
/* store element type as attribute of connectivity variable */
- if ((status = nc_put_att_text(exoid, connid, ATT_NAME_ELB, strlen(entry_descrip)+1,
- entry_descrip)) != NC_NOERR) {
+ if ((status = nc_put_att_text(exoid, connid, ATT_NAME_ELB, strlen(block.topology)+1,
+ block.topology)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to store %s type name %s in file id %d",
- ex_name_of_object(blk_type), entry_descrip,exoid);
+ ex_name_of_object(block.type), block.topology,exoid);
ex_err("ex_put_block",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
if (arbitrary_polyhedra == 0) {
- if (vedgcon && num_edges_per_entry ) {
+ if (vedgcon && block.num_edges_per_entry ) {
dims[0] = numblkdim;
dims[1] = nedgperentdim;
- if ((status = nc_def_var(exoid, vedgcon, NC_INT, 2, dims, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, vedgcon, conn_int_type, 2, dims, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to create edge connectivity array for %s %d in file id %d",
- ex_name_of_object(blk_type), blk_id,exoid);
+ "Error: failed to create edge connectivity array for %s %"PRId64" in file id %d",
+ ex_name_of_object(block.type), block.id,exoid);
ex_err("ex_put_block",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
}
- if ( vfaccon && num_faces_per_entry ) {
+ if ( vfaccon && block.num_faces_per_entry ) {
dims[0] = numblkdim;
dims[1] = nfacperentdim;
- if ((status = nc_def_var(exoid, vfaccon, NC_INT, 2, dims, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, vfaccon, conn_int_type, 2, dims, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to create face connectivity array for %s %d in file id %d",
- ex_name_of_object(blk_type), blk_id,exoid);
+ "Error: failed to create face connectivity array for %s %"PRId64" in file id %d",
+ ex_name_of_object(block.type), block.id,exoid);
ex_err("ex_put_block",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
@@ -523,7 +522,7 @@ int ex_put_block( int exoid,
if ((exerrval=nc_enddef (exoid)) != NC_NOERR) {
sprintf(errmsg,
"Error: failed to complete %s definition in file id %d",
- ex_name_of_object(blk_type), exoid);
+ ex_name_of_object(block.type), exoid);
ex_err("ex_put_block",errmsg,exerrval);
return (EX_FATAL);
}
@@ -531,7 +530,7 @@ int ex_put_block( int exoid,
/* Output a dummy empty attribute name in case client code doesn't
write anything; avoids corruption in some cases.
*/
- if (num_attr_per_entry > 0) {
+ if (block.num_attribute > 0 && att_name_varid >= 0) {
size_t count[2];
char *text = "";
size_t i;
@@ -540,7 +539,7 @@ int ex_put_block( int exoid,
start[1] = 0;
count[1] = strlen(text)+1;
- for (i = 0; i < num_attr_per_entry; i++) {
+ for (i = 0; i < block.num_attribute; i++) {
start[0] = i;
nc_put_vara_text(exoid, att_name_varid, start, count, text);
}
diff --git a/nemesis/ne_pcmp.c b/exodus/cbind/src/ex_put_cmap_params.c
similarity index 66%
rename from nemesis/ne_pcmp.c
rename to exodus/cbind/src/ex_put_cmap_params.c
index 6e1784b..eaf0413 100644
--- a/nemesis/ne_pcmp.c
+++ b/exodus/cbind/src/ex_put_cmap_params.c
@@ -36,12 +36,12 @@
/*****************************************************************************/
/*****************************************************************************/
/* Function(s) contained in this file:
- * ne_put_cmap_params()
+ * ex_put_cmap_params()
*****************************************************************************
* This function outputs the communication map parameters.
*****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* node_cmap_ids - Pointer to vector of nodal communication
* set IDs.
* node_cmap_node_cnts - Pointer to a vector which contains a count of
@@ -67,29 +67,38 @@
#include <exodusII.h>
#include <exodusII_int.h>
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-int ne_put_cmap_params(int neid,
- int *node_cmap_ids,
- int *node_cmap_node_cnts,
- int *elem_cmap_ids,
- int *elem_cmap_elem_cnts,
- int processor
+int ex_put_cmap_params(int exoid,
+ void_int *node_cmap_ids,
+ void_int *node_cmap_node_cnts,
+ void_int *elem_cmap_ids,
+ void_int *elem_cmap_elem_cnts,
+ int64_t processor
)
{
- char *func_name="ne_put_cmap_params";
+ const char *func_name="ex_put_cmap_params";
size_t num_n_comm_maps, num_e_comm_maps;
size_t ncnt_cmap, ecnt_cmap;
- int icm, varid, dimid[1], n_varid, e_varid, status;
+ size_t icm;
+ int varid, dimid[1], n_varid, e_varid, status;
int n_varid_idx, e_varid_idx;
size_t start[1];
char ftype[2];
- int nl_ncnt_cmap, nl_ecnt_cmap;
+ int64_t nl_ncnt_cmap, nl_ecnt_cmap;
int nmstat;
char errmsg[MAX_ERR_LENGTH];
+
+ int index_type = NC_INT;
+ int id_type = NC_INT;
+ int format;
+ nc_inq_format(exoid, &format);
+ if ((ex_int64_status(exoid) & EX_BULK_INT64_DB) || (format == NC_FORMAT_NETCDF4)) {
+ index_type = NC_INT64;
+ }
+ if (ex_int64_status(exoid) & EX_IDS_INT64_DB) {
+ id_type = NC_INT64;
+ }
/*-----------------------------Execution begins-----------------------------*/
exerrval = 0; /* clear error code */
@@ -99,11 +108,11 @@ int ne_put_cmap_params(int neid,
** be used for writing a parallel file
*/
/* Get the file type */
- if (ne_get_file_type(neid, ftype) != EX_NOERR) {
+ if (ex_get_file_type(exoid, ftype) != EX_NOERR) {
exerrval = EX_MSG;
sprintf(errmsg,
"Error: failed to get file type from file ID %d\n",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -113,30 +122,30 @@ int ne_put_cmap_params(int neid,
exerrval = EX_MSG;
sprintf(errmsg,
"Error: function for use with parallel files only, file ID %d\n",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Put NetCDF file into define mode */
- if ((status = nc_redef(neid)) != NC_NOERR) {
+ if ((status = nc_redef(exoid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to file ID %d into define mode", neid);
+ "Error: failed to file ID %d into define mode", exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Check to see if there are nodal communications maps in the file */
- if ((status = nc_inq_dimid(neid, DIM_NUM_N_CMAPS, &dimid[0])) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_N_CMAPS, &dimid[0])) != NC_NOERR) {
num_n_comm_maps = 0;
}
else {
- if ((status = nc_inq_dimlen(neid, dimid[0], &num_n_comm_maps)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid[0], &num_n_comm_maps)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_N_CMAPS, neid);
+ DIM_NUM_N_CMAPS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -149,74 +158,82 @@ int ne_put_cmap_params(int neid,
if (num_n_comm_maps > 0) {
/* add the communications data index variable */
- if ((status = nc_def_var(neid, VAR_N_COMM_DATA_IDX, NC_INT, 1,
+ if ((status = nc_def_var(exoid, VAR_N_COMM_DATA_IDX, index_type, 1,
dimid, &n_varid_idx)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to add variable \"%s\" in file ID %d",
- VAR_N_COMM_DATA_IDX, neid);
+ VAR_N_COMM_DATA_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
/* Add dimensions for all of the nodal communication maps */
ncnt_cmap = 0;
- for(icm=0; icm < num_n_comm_maps; icm++) {
- ncnt_cmap += node_cmap_node_cnts[icm];
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ for(icm=0; icm < num_n_comm_maps; icm++) {
+ ncnt_cmap += ((int64_t*)node_cmap_node_cnts)[icm];
+ }
+ } else {
+ for(icm=0; icm < num_n_comm_maps; icm++) {
+ ncnt_cmap += ((int*)node_cmap_node_cnts)[icm];
+ }
}
- if ((status = nc_def_dim(neid, DIM_NCNT_CMAP, ncnt_cmap, &dimid[0])) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NCNT_CMAP, ncnt_cmap, &dimid[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to add dimension for \"%s\" in file ID %d",
- DIM_NCNT_CMAP, neid);
+ DIM_NCNT_CMAP, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
/* Define variables for the nodal IDS and processor vectors */
- if ((status = nc_def_var(neid, VAR_N_COMM_NIDS, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_N_COMM_NIDS, id_type, 1, dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to add variable \"%s\" in file ID %d",
- VAR_N_COMM_NIDS, neid);
+ VAR_N_COMM_NIDS, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, varid, 1);
- if ((status = nc_def_var(neid, VAR_N_COMM_PROC, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_N_COMM_PROC, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to add variable \"%s\" in file ID %d",
- VAR_N_COMM_PROC, neid);
+ VAR_N_COMM_PROC, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, varid, 1);
} /* End "if (num_n_comm_maps > 0)" */
/* Check to see if there are elemental communications maps in the file */
- if ((status = nc_inq_dimid(neid, DIM_NUM_E_CMAPS, &dimid[0])) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_E_CMAPS, &dimid[0])) != NC_NOERR) {
num_e_comm_maps = 0;
}
else{
- if ((status = nc_inq_dimlen(neid, dimid[0], &num_e_comm_maps)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid[0], &num_e_comm_maps)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_E_CMAPS, neid);
+ DIM_NUM_E_CMAPS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -230,86 +247,93 @@ int ne_put_cmap_params(int neid,
if (num_e_comm_maps > 0) {
/* add the communications data index variable */
- if ((status = nc_def_var(neid, VAR_E_COMM_DATA_IDX, NC_INT, 1,
+ if ((status = nc_def_var(exoid, VAR_E_COMM_DATA_IDX, index_type, 1,
dimid, &e_varid_idx)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to add variable \"%s\" in file ID %d",
- VAR_E_COMM_DATA_IDX, neid);
+ VAR_E_COMM_DATA_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
/* Add dimensions for each of the nodal communication maps */
ecnt_cmap = 0;
- for(icm=0; icm < num_e_comm_maps; icm++)
- ecnt_cmap += elem_cmap_elem_cnts[icm];
-
- if ((status = nc_def_dim(neid, DIM_ECNT_CMAP, ecnt_cmap, &dimid[0])) != NC_NOERR) {
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ for(icm=0; icm < num_e_comm_maps; icm++)
+ ecnt_cmap += ((int64_t*)elem_cmap_elem_cnts)[icm];
+ } else {
+ for(icm=0; icm < num_e_comm_maps; icm++)
+ ecnt_cmap += ((int*)elem_cmap_elem_cnts)[icm];
+ }
+ if ((status = nc_def_dim(exoid, DIM_ECNT_CMAP, ecnt_cmap, &dimid[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to add dimension for \"%s\" in file ID %d",
- DIM_ECNT_CMAP, neid);
+ DIM_ECNT_CMAP, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
- /* Define variables for the nodal IDS and processor vectors */
- if ((status = nc_def_var(neid, VAR_E_COMM_EIDS, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
+ /* Define variables for the element IDS and processor vectors */
+ if ((status = nc_def_var(exoid, VAR_E_COMM_EIDS, id_type, 1, dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to add variable \"%s\" in file ID %d",
- VAR_E_COMM_EIDS, neid);
+ VAR_E_COMM_EIDS, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, varid, 1);
- if ((status = nc_def_var(neid, VAR_E_COMM_PROC, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_E_COMM_PROC, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to add variable \"%s\" in file ID %d",
- VAR_E_COMM_PROC, neid);
+ VAR_E_COMM_PROC, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, varid, 1);
- if ((status = nc_def_var(neid, VAR_E_COMM_SIDS, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_E_COMM_SIDS, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to add variable \"%s\" in file ID %d",
- VAR_E_COMM_SIDS, neid);
+ VAR_E_COMM_SIDS, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, varid, 1);
} /* End "if (num_e_comm_maps > 0)" */
/* Exit define mode */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
/* Set the status of the nodal communication maps */
if (num_n_comm_maps > 0) {
- if ((status = nc_inq_varid(neid, VAR_N_COMM_STAT, &n_varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_N_COMM_STAT, &n_varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_N_COMM_STAT, neid);
+ VAR_N_COMM_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -317,50 +341,61 @@ int ne_put_cmap_params(int neid,
nl_ncnt_cmap = 0; /* reset this for index */
for(icm=0; icm < num_n_comm_maps; icm++) {
+ size_t ncnc;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ ncnc = ((int64_t*)node_cmap_node_cnts)[icm];
+ } else {
+ ncnc = ((int*)node_cmap_node_cnts)[icm];
+ }
+
start[0] = icm;
- if (node_cmap_node_cnts[icm] > 0)
+ if (ncnc > 0)
nmstat = 1;
else
nmstat = 0;
- if ((status = nc_put_var1_int(neid, n_varid, start, &nmstat)) != NC_NOERR) {
+ if ((status = nc_put_var1_int(exoid, n_varid, start, &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: unable to output variable in file ID %d", neid);
+ "Error: unable to output variable in file ID %d", exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* increment to the next starting position */
- nl_ncnt_cmap += node_cmap_node_cnts[icm];
+ nl_ncnt_cmap += ncnc;
/* fill the cmap data index */
- if ((status = nc_put_var1_int(neid, n_varid_idx, start, &nl_ncnt_cmap)) != NC_NOERR) {
+ if ((status = nc_put_var1_longlong(exoid, n_varid_idx, start, (long long*)&nl_ncnt_cmap)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output int elem map index in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
} /* End "for(icm=0; icm < num_n_comm_maps; icm++)" */
/* Get the variable ID for the comm map IDs vector */
- if ((status = nc_inq_varid(neid, VAR_N_COMM_IDS, &n_varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_N_COMM_IDS, &n_varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_N_COMM_IDS, neid);
+ VAR_N_COMM_IDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Output the nodal comm map IDs */
- status = nc_put_var_int(neid, n_varid, node_cmap_ids);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ status = nc_put_var_longlong(exoid, n_varid, node_cmap_ids);
+ } else {
+ status = nc_put_var_int(exoid, n_varid, node_cmap_ids);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to output variable in file ID %d", neid);
+ "Error: failed to output variable in file ID %d", exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -371,62 +406,71 @@ int ne_put_cmap_params(int neid,
if (num_e_comm_maps > 0) {
/* Get variable ID for elemental status vector */
- if ((status = nc_inq_varid(neid, VAR_E_COMM_STAT, &e_varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_E_COMM_STAT, &e_varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_E_COMM_STAT, neid);
+ VAR_E_COMM_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
nl_ecnt_cmap = 0; /* reset this for index */
for(icm=0; icm < num_e_comm_maps; icm++) {
-
+ size_t ecec;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ ecec = ((int64_t*)elem_cmap_elem_cnts)[icm];
+ } else {
+ ecec = ((int*)elem_cmap_elem_cnts)[icm];
+ }
start[0] = icm;
- if (elem_cmap_elem_cnts[icm] > 0)
+ if (ecec > 0)
nmstat = 1;
else
nmstat = 0;
- if ((status = nc_put_var1_int(neid, e_varid, start, &nmstat)) != NC_NOERR) {
+ if ((status = nc_put_var1_int(exoid, e_varid, start, &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: unable to output variable in file ID %d", neid);
+ "Error: unable to output variable in file ID %d", exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* increment to the next starting position */
- nl_ecnt_cmap += elem_cmap_elem_cnts[icm];
+ nl_ecnt_cmap += ecec;
/* fill the cmap data index */
- if ((status = nc_put_var1_int(neid, e_varid_idx, start, &nl_ecnt_cmap)) != NC_NOERR) {
+ if ((status = nc_put_var1_longlong(exoid, e_varid_idx, start, (long long*)&nl_ecnt_cmap)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output int elem map index in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
} /* End "for(icm=0; icm < num_e_comm_maps; icm++)" */
/* Get the variable ID for the elemental comm map IDs vector */
- if ((status = nc_inq_varid(neid, VAR_E_COMM_IDS, &e_varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_E_COMM_IDS, &e_varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_E_COMM_IDS, neid);
+ VAR_E_COMM_IDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Output the elemental comm map IDs */
- status = nc_put_var_int(neid, e_varid, elem_cmap_ids);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ status = nc_put_var_longlong(exoid, e_varid, elem_cmap_ids);
+ } else {
+ status = nc_put_var_int(exoid, e_varid, elem_cmap_ids);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to output variable in file ID %d", neid);
+ "Error: failed to output variable in file ID %d", exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
diff --git a/nemesis/ne_pcmpc.c b/exodus/cbind/src/ex_put_cmap_params_cc.c
similarity index 67%
rename from nemesis/ne_pcmpc.c
rename to exodus/cbind/src/ex_put_cmap_params_cc.c
index e2579cd..a0ba44e 100644
--- a/nemesis/ne_pcmpc.c
+++ b/exodus/cbind/src/ex_put_cmap_params_cc.c
@@ -36,13 +36,13 @@
/*****************************************************************************/
/*****************************************************************************/
/* Function(s) contained in this file:
- * ne_put_cmap_params_cc()
+ * ex_put_cmap_params_cc()
*****************************************************************************
* This function outputs the concantenated list of communication map
* parameters.
*****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* node_cmap_ids - Pointer to vector of nodal communication
* set IDs.
* node_cmap_node_cnts - Pointer to a vector which contains a count of
@@ -63,27 +63,20 @@
#include <stdlib.h>
#include <netcdf.h>
-#ifndef NC_INT64
-#define NC_INT64 NC_INT
-#endif
-
#include <exodusII.h>
#include <exodusII_int.h>
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-int ne_put_cmap_params_cc(int neid,
- int *node_cmap_ids,
- int *node_cmap_node_cnts,
- int *node_proc_ptrs,
- int *elem_cmap_ids,
- int *elem_cmap_elem_cnts,
- int *elem_proc_ptrs
+int ex_put_cmap_params_cc(int exoid,
+ void_int *node_cmap_ids,
+ void_int *node_cmap_node_cnts,
+ void_int *node_proc_ptrs,
+ void_int *elem_cmap_ids,
+ void_int *elem_cmap_elem_cnts,
+ void_int *elem_proc_ptrs
)
{
- char *func_name="ne_put_cmap_params_cc";
+ const char *func_name="ex_put_cmap_params_cc";
size_t num_n_comm_maps, num_e_comm_maps, num_procs_in_file;
int status, icm, n_varid[2], e_varid[2], iproc;
@@ -92,6 +85,7 @@ int ne_put_cmap_params_cc(int neid,
int num_icm;
size_t start[1], count[1];
size_t ecnt_cmap, ncnt_cmap;
+
long long nl_ecnt_cmap, nl_ncnt_cmap;
long long *n_var_idx = NULL;
long long *e_var_idx = NULL;
@@ -100,34 +94,39 @@ int ne_put_cmap_params_cc(int neid,
char errmsg[MAX_ERR_LENGTH];
int format;
- int index_type;
+ int index_type, bulk_type;
/*-----------------------------Execution begins-----------------------------*/
exerrval = 0; /* clear error code */
/* See if using NC_FORMAT_NETCDF4 format... */
- nc_inq_format(neid, &format);
- if (format == NC_FORMAT_NETCDF4) {
+ nc_inq_format(exoid, &format);
+ if ((ex_int64_status(exoid) & EX_BULK_INT64_DB) || (format == NC_FORMAT_NETCDF4)) {
index_type = NC_INT64;
} else {
index_type = NC_INT;
}
+ if (ex_int64_status(exoid) & EX_BULK_INT64_DB) {
+ bulk_type = NC_INT64;
+ } else {
+ bulk_type = NC_INT;
+ }
/* Get the number of processors in the file */
- if ((status = nc_inq_dimid(neid, DIM_NUM_PROCS_F, &n_dimid[0])) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_PROCS_F, &n_dimid[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get dimension ID for \"%s\" in file ID %d",
- DIM_NUM_PROCS_F, neid);
+ DIM_NUM_PROCS_F, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, n_dimid[0], &num_procs_in_file)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, n_dimid[0], &num_procs_in_file)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_PROCS_F, neid);
+ DIM_NUM_PROCS_F, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -139,16 +138,16 @@ int ne_put_cmap_params_cc(int neid,
*/
/* Check to see if there are nodal communications maps in the file */
- if (nc_inq_dimid(neid, DIM_NUM_N_CMAPS, &n_dimid[0]) != NC_NOERR) {
+ if (nc_inq_dimid(exoid, DIM_NUM_N_CMAPS, &n_dimid[0]) != NC_NOERR) {
num_n_comm_maps = 0;
}
else {
- if ((status = nc_inq_dimlen(neid, n_dimid[0], &num_n_comm_maps)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, n_dimid[0], &num_n_comm_maps)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in \
file ID %d",
- DIM_NUM_N_CMAPS, neid);
+ DIM_NUM_N_CMAPS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -156,11 +155,11 @@ file ID %d",
if (num_n_comm_maps > 0) {
/* Get the variable ID for the comm map index vector */
- if ((status = nc_inq_varid(neid, VAR_N_COMM_INFO_IDX, &n_varid_idx)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_N_COMM_INFO_IDX, &n_varid_idx)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_N_COMM_INFO_IDX, neid);
+ VAR_N_COMM_INFO_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -171,7 +170,7 @@ file ID %d",
exerrval = EX_MSG;
sprintf(errmsg,
"Error: insufficient memory to read index variable from file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -180,28 +179,32 @@ file ID %d",
n_var_idx[0] = 0;
/* get the communication map info index */
- status = nc_get_var_longlong(neid, n_varid_idx, &(n_var_idx[1]));
+#if defined(NC_NETCDF4)
+ status = nc_get_var_longlong(exoid, n_varid_idx, &(n_var_idx[1]));
+#else
+ status = nc_get_var_int(exoid, n_varid_idx, &(n_var_idx[1]));
+#endif
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_N_COMM_INFO_IDX, neid);
+ VAR_N_COMM_INFO_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
} /* "if (num_n_comm_maps > 0)" */
/* Check to see if there are elemental communications maps in the file */
- if ((status = nc_inq_dimid(neid, DIM_NUM_E_CMAPS, &e_dimid[0])) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_E_CMAPS, &e_dimid[0])) != NC_NOERR) {
num_e_comm_maps = 0;
}
else {
- if ((status = nc_inq_dimlen(neid, e_dimid[0], &num_e_comm_maps)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, e_dimid[0], &num_e_comm_maps)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in \
file ID %d",
- DIM_NUM_E_CMAPS, neid);
+ DIM_NUM_E_CMAPS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -209,11 +212,11 @@ file ID %d",
if (num_e_comm_maps > 0) {
/* Get the variable ID for the comm map index vector */
- if ((status = nc_inq_varid(neid, VAR_E_COMM_INFO_IDX, &e_varid_idx)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_E_COMM_INFO_IDX, &e_varid_idx)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_E_COMM_INFO_IDX, neid);
+ VAR_E_COMM_INFO_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -224,7 +227,7 @@ file ID %d",
exerrval = EX_MSG;
sprintf(errmsg,
"Error: insufficient memory to read index variable from file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -233,22 +236,26 @@ file ID %d",
e_var_idx[0] = 0;
/* get the communication map info index */
- status = nc_get_var_longlong(neid, e_varid_idx, &(e_var_idx[1]));
+#if defined NC_NETCDF4
+ status = nc_get_var_longlong(exoid, e_varid_idx, &(e_var_idx[1]));
+#else
+ status = nc_get_var_int(exoid, e_varid_idx, &(e_var_idx[1]));
+#endif
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_E_COMM_INFO_IDX, neid);
+ VAR_E_COMM_INFO_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
} /* "if (num_e_comm_maps >0)" */
/* Put NetCDF file into define mode */
- if ((status = nc_redef(neid)) != NC_NOERR) {
+ if ((status = nc_redef(exoid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to put file ID %d into define mode", neid);
+ "Error: failed to put file ID %d into define mode", exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -259,15 +266,15 @@ file ID %d",
*/
if (num_n_comm_maps > 0) {
/* add the communications data index variable */
- if ((status = nc_def_var(neid, VAR_N_COMM_DATA_IDX, index_type, 1,
+ if ((status = nc_def_var(exoid, VAR_N_COMM_DATA_IDX, index_type, 1,
n_dimid, &n_varid_idx)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to add variable \"%s\" in file ID %d",
- VAR_N_COMM_DATA_IDX, neid);
+ VAR_N_COMM_DATA_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
@@ -277,45 +284,51 @@ file ID %d",
for(iproc=0; iproc < num_procs_in_file; iproc++) {
num_icm = n_var_idx[iproc+1] - n_var_idx[iproc];
for(icm=0; icm < num_icm; icm++)
- ncnt_cmap += node_cmap_node_cnts[node_proc_ptrs[iproc]+icm];
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ ncnt_cmap += ((int64_t*)node_cmap_node_cnts)[((int64_t*)node_proc_ptrs)[iproc]+icm];
+ } else {
+ ncnt_cmap += ((int*)node_cmap_node_cnts)[((int*)node_proc_ptrs)[iproc]+icm];
+ }
}
- if ((status = nc_def_dim(neid, DIM_NCNT_CMAP, ncnt_cmap, &n_dimid[0])) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NCNT_CMAP, ncnt_cmap, &n_dimid[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to add dimension for \"%s\" of size %zd in file ID %d",
- DIM_NCNT_CMAP, ncnt_cmap, neid);
+ "Error: failed to add dimension for \"%s\" of size %lu in file ID %d",
+ DIM_NCNT_CMAP, (unsigned long)ncnt_cmap, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
/* Define variables for the nodal IDS and processor vectors */
- if ((status = nc_def_var(neid, VAR_N_COMM_NIDS, NC_INT, 1, n_dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_N_COMM_NIDS, bulk_type, 1, n_dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to add variable \"%s\" in file ID %d",
- VAR_N_COMM_NIDS, neid);
+ VAR_N_COMM_NIDS, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, varid, 1);
- if ((status = nc_def_var(neid, VAR_N_COMM_PROC, NC_INT, 1, n_dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_N_COMM_PROC, NC_INT, 1, n_dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to add variable \"%s\" in file ID %d",
- VAR_N_COMM_PROC, neid);
+ VAR_N_COMM_PROC, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, varid, 1);
} /* End "if (num_n_comm_maps > 0)" */
@@ -325,15 +338,15 @@ file ID %d",
*/
if (num_e_comm_maps > 0) {
/* add the communications data index variable */
- if ((status = nc_def_var(neid, VAR_E_COMM_DATA_IDX, index_type, 1,
+ if ((status = nc_def_var(exoid, VAR_E_COMM_DATA_IDX, index_type, 1,
e_dimid, &e_varid_idx)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to add variable \"%s\" in file ID %d",
- VAR_E_COMM_DATA_IDX, neid);
+ VAR_E_COMM_DATA_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
@@ -343,85 +356,92 @@ file ID %d",
for(iproc=0; iproc < num_procs_in_file; iproc++) {
num_icm = e_var_idx[iproc+1] - e_var_idx[iproc];
for(icm=0; icm < num_icm; icm++)
- ecnt_cmap += elem_cmap_elem_cnts[elem_proc_ptrs[iproc]+icm];
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ ecnt_cmap += ((int64_t*)elem_cmap_elem_cnts)[((int64_t*)elem_proc_ptrs)[iproc]+icm];
+ } else {
+ ecnt_cmap += ((int*)elem_cmap_elem_cnts)[((int*)elem_proc_ptrs)[iproc]+icm];
+ }
}
/* Add dimensions for elemental communications maps */
- if ((status = nc_def_dim(neid, DIM_ECNT_CMAP, ecnt_cmap, &e_dimid[0])) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_ECNT_CMAP, ecnt_cmap, &e_dimid[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to add dimension for \"%s\" in file ID %d",
- DIM_ECNT_CMAP, neid);
+ DIM_ECNT_CMAP, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
- /* Define variables for the nodal IDS and processor vectors */
- if ((status = nc_def_var(neid, VAR_E_COMM_EIDS, NC_INT, 1, e_dimid, &varid)) != NC_NOERR) {
+ /* Define variables for the element IDS and processor vectors */
+ if ((status = nc_def_var(exoid, VAR_E_COMM_EIDS, bulk_type, 1, e_dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to add variable \"%s\" in file ID %d",
- VAR_E_COMM_EIDS, neid);
+ VAR_E_COMM_EIDS, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, varid, 1);
- if ((status = nc_def_var(neid, VAR_E_COMM_PROC, NC_INT, 1, e_dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_E_COMM_PROC, NC_INT, 1, e_dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to add variable \"%s\" in file ID %d",
- VAR_E_COMM_PROC, neid);
+ VAR_E_COMM_PROC, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, varid, 1);
- if ((status = nc_def_var(neid, VAR_E_COMM_SIDS, NC_INT, 1, e_dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_E_COMM_SIDS, bulk_type, 1, e_dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to add variable \"%s\" in file ID %d",
- VAR_E_COMM_SIDS, neid);
+ VAR_E_COMM_SIDS, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, varid, 1);
} /* End "if (num_e_comm_maps > 0)" */
/* Exit define mode */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
/* Set the status of the nodal communication maps */
if (num_n_comm_maps > 0) {
/* need to get the two "n_comm_*" variable ids */
- if ((status = nc_inq_varid(neid, VAR_N_COMM_STAT, &n_varid[0])) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_N_COMM_STAT, &n_varid[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_N_COMM_STAT, neid);
+ VAR_N_COMM_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the variable ID for the comm map IDs vector */
- if ((status = nc_inq_varid(neid, VAR_N_COMM_IDS, &n_varid[1])) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_N_COMM_IDS, &n_varid[1])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_N_COMM_IDS, neid);
+ VAR_N_COMM_IDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -430,33 +450,47 @@ file ID %d",
nl_ncnt_cmap = 0;
for(iproc=0; iproc < num_procs_in_file; iproc++) {
+ size_t proc_ptr;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ proc_ptr = ((int64_t*)node_proc_ptrs)[iproc];
+ } else {
+ proc_ptr = ((int*)node_proc_ptrs)[iproc];
+ }
+
num_icm = n_var_idx[iproc+1] - n_var_idx[iproc];
for(icm=0; icm < num_icm; icm++) {
-
+ size_t cnt;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ cnt = ((int64_t*)node_cmap_node_cnts)[proc_ptr+icm];
+ } else {
+ cnt = ((int*)node_cmap_node_cnts)[proc_ptr+icm];
+ }
+
start[0] = n_var_idx[iproc] + icm;
- if (node_cmap_node_cnts[node_proc_ptrs[iproc]+icm] > 0)
+ if (cnt > 0)
nmstat = 1;
else
nmstat = 0;
- if ((status = nc_put_var1_int(neid, n_varid[0], start, &nmstat)) != NC_NOERR) {
+ if ((status = nc_put_var1_int(exoid, n_varid[0], start, &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: unable to output variable in file ID %d", neid);
+ "Error: unable to output variable in file ID %d", exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* increment to the next starting position */
- nl_ncnt_cmap += node_cmap_node_cnts[node_proc_ptrs[iproc]+icm];
+ nl_ncnt_cmap += cnt;
/* fill the data index variable */
- status = nc_put_var1_longlong(neid, n_varid_idx, start, &nl_ncnt_cmap);
+ status = nc_put_var1_longlong(exoid, n_varid_idx, start, &nl_ncnt_cmap);
+
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output int elem map index in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -466,12 +500,17 @@ file ID %d",
/* Output the nodal comm map IDs */
start[0] = n_var_idx[iproc];
count[0] = num_icm;
- status = nc_put_vara_int(neid, n_varid[1], start, count,
- &node_cmap_ids[node_proc_ptrs[iproc]]);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ status = nc_put_vara_longlong(exoid, n_varid[1], start, count,
+ &((long long*)node_cmap_ids)[proc_ptr]);
+ } else {
+ status = nc_put_vara_int(exoid, n_varid[1], start, count,
+ &((int*)node_cmap_ids)[proc_ptr]);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to output variable in file ID %d", neid);
+ "Error: failed to output variable in file ID %d", exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -491,21 +530,21 @@ file ID %d",
/* need to get the two "e_comm_*" variables" */
/* Get variable ID for elemental status vector */
- if ((status = nc_inq_varid(neid, VAR_E_COMM_STAT, &e_varid[0])) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_E_COMM_STAT, &e_varid[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_E_COMM_STAT, neid);
+ VAR_E_COMM_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the variable ID for the elemental comm map IDs vector */
- if ((status = nc_inq_varid(neid, VAR_E_COMM_IDS, &e_varid[1])) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_E_COMM_IDS, &e_varid[1])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_E_COMM_IDS, neid);
+ VAR_E_COMM_IDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -514,33 +553,47 @@ file ID %d",
nl_ecnt_cmap = 0;
for(iproc=0; iproc < num_procs_in_file; iproc++) {
+ size_t proc_ptr;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ proc_ptr = ((int64_t*)elem_proc_ptrs)[iproc];
+ } else {
+ proc_ptr = ((int*)elem_proc_ptrs)[iproc];
+ }
num_icm = e_var_idx[iproc+1] - e_var_idx[iproc];
for(icm=0; icm < num_icm; icm++) {
+ size_t cnt;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ cnt = ((int64_t*)elem_cmap_elem_cnts)[proc_ptr+icm];
+ } else {
+ cnt = ((int*)elem_cmap_elem_cnts)[proc_ptr+icm];
+ }
+
start[0] = e_var_idx[iproc] + icm;
- if (elem_cmap_elem_cnts[elem_proc_ptrs[iproc]+icm] > 0)
+ if (cnt > 0)
nmstat = 1;
else
nmstat = 0;
- if ((status = nc_put_var1_int(neid, e_varid[0], start, &nmstat)) != NC_NOERR) {
+ if ((status = nc_put_var1_int(exoid, e_varid[0], start, &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: unable to output variable in file ID %d", neid);
+ "Error: unable to output variable in file ID %d", exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* increment to the next starting position */
- nl_ecnt_cmap += elem_cmap_elem_cnts[elem_proc_ptrs[iproc]+icm];
+ nl_ecnt_cmap += cnt;
/* fill the data index variable */
- status = nc_put_var1_longlong(neid, e_varid_idx, start, &nl_ecnt_cmap);
+ status = nc_put_var1_longlong(exoid, e_varid_idx, start, &nl_ecnt_cmap);
+
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output int elem map index in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -550,12 +603,17 @@ file ID %d",
/* Output the elemental comm map IDs */
start[0] = e_var_idx[iproc];
count[0] = num_icm;
- status = nc_put_vara_int(neid, e_varid[1], start, count,
- &elem_cmap_ids[elem_proc_ptrs[iproc]]);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ status = nc_put_vara_longlong(exoid, e_varid[1], start, count,
+ &((long long*)elem_cmap_ids)[proc_ptr]);
+ } else {
+ status = nc_put_vara_int(exoid, e_varid[1], start, count,
+ &((int*)elem_cmap_ids)[proc_ptr]);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to output variable in file ID %d", neid);
+ "Error: failed to output variable in file ID %d", exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
diff --git a/exodus/cbind/src/expcab.c b/exodus/cbind/src/ex_put_concat_all_blocks.c
similarity index 83%
rename from exodus/cbind/src/expcab.c
rename to exodus/cbind/src/ex_put_concat_all_blocks.c
index dc5a363..a3e1b12 100644
--- a/exodus/cbind/src/expcab.c
+++ b/exodus/cbind/src/ex_put_concat_all_blocks.c
@@ -60,8 +60,11 @@ int ex_put_concat_all_blocks (int exoid,
int varid, dimid, dims[2], strdim, *eb_stat, *ed_stat, *fa_stat;
int temp;
size_t iblk;
+ size_t i;
int status;
- size_t num_elem_blk, num_edge_blk, num_face_blk, i;
+ size_t num_elem_blk = 0;
+ size_t num_edge_blk = 0;
+ size_t num_face_blk = 0;
int cur_num_elem_blk, nelnoddim, numelbdim, numattrdim, connid=-1;
int cur_num_edge_blk, numedbdim, nednoddim, cur_num_face_blk, numfabdim, nfanoddim;
int neledgdim=-1, nelfacdim=-1;
@@ -69,6 +72,17 @@ int ex_put_concat_all_blocks (int exoid,
int elem_work = 0; /* is DIM_NUM_EL_BLK defined? If so, there's work to do */
int edge_work = 0; /* is DIM_NUM_ED_BLK defined? If so, there's work to do */
int face_work = 0; /* is DIM_NUM_FA_BLK defined? If so, there's work to do */
+
+ int* edge_id_int = NULL;
+ int* face_id_int = NULL;
+ int* elem_id_int = NULL;
+
+ int64_t* edge_id_int64 = NULL;
+ int64_t* face_id_int64 = NULL;
+ int64_t* elem_id_int64 = NULL;
+
+ int ids_int64 = ex_int64_status(exoid) & EX_IDS_INT64_API;
+
static const char* dim_num_maps[] = {
DIM_NUM_NM,
DIM_NUM_EDM,
@@ -87,11 +101,22 @@ int ex_put_concat_all_blocks (int exoid,
EX_FACE_MAP,
EX_ELEM_MAP
};
+
/* If param->define_maps is true, we must fill these with values from ex_put_init_ext
before entering define mode */
size_t num_maps[sizeof(dim_num_maps)/sizeof(dim_num_maps[0])];
size_t num_map_dims = sizeof(dim_num_maps)/sizeof(dim_num_maps[0]);
+ if (ids_int64) {
+ edge_id_int64 = param->edge_blk_id;
+ face_id_int64 = param->face_blk_id;
+ elem_id_int64 = param->elem_blk_id;
+ } else {
+ edge_id_int = param->edge_blk_id;
+ face_id_int = param->face_blk_id;
+ elem_id_int = param->elem_blk_id;
+ }
+
exerrval = 0; /* clear error code */
/* inquire previously defined dimensions */
@@ -189,7 +214,11 @@ int ex_put_concat_all_blocks (int exoid,
} \
\
/* then, write out id list */ \
- status = nc_put_var_int(exoid, varid, SIDNAME); \
+ if (ids_int64) { \
+ status = nc_put_var_longlong(exoid, varid, SIDNAME); \
+ } else { \
+ status = nc_put_var_int(exoid, varid, SIDNAME); \
+ } \
\
if (status != NC_NOERR) { \
exerrval = status; \
@@ -229,8 +258,8 @@ int ex_put_concat_all_blocks (int exoid,
DVAL[iblk], &VADIM1)) != NC_NOERR) { \
exerrval = status; \
sprintf(errmsg, \
- "Error: failed to define number of attributes in " TNAME " block %d in file id %d", \
- ID[iblk],exoid); \
+ "Error: failed to define number of attributes in " TNAME " block %"PRId64" in file id %d", \
+ ID,exoid); \
ex_err("ex_put_concat_all_blocks",errmsg,exerrval); \
goto error_ret; /* exit define mode and return */ \
} \
@@ -242,11 +271,12 @@ int ex_put_concat_all_blocks (int exoid,
nc_flt_code(exoid), 2, dims, &temp)) != NC_NOERR) { \
exerrval = status; \
sprintf(errmsg, \
- "Error: failed to define attributes for " TNAME " block %d in file id %d", \
- ID[iblk],exoid); \
+ "Error: failed to define attributes for " TNAME " block %"PRId64" in file id %d", \
+ ID,exoid); \
ex_err("ex_put_concat_all_blocks",errmsg,exerrval); \
goto error_ret; /* exit define mode and return */ \
} \
+ ex_compress_variable(exoid, temp, 2); \
\
/* Attribute names... */ \
dims[0] = VADIM1; \
@@ -262,25 +292,35 @@ int ex_put_concat_all_blocks (int exoid,
}
#define EX_PREPARE_CONN(TNAME,BLK,BLKID,BLKSZ,VNAME,DNAME) \
- if ( DNAME > 0 ) { \
+ if ( DNAME > 0 ) { \
+ int conn_int_type = NC_INT; \
+ if (ex_int64_status(exoid) & EX_BULK_INT64_DB) { \
+ conn_int_type = NC_INT64; \
+ } \
dims[0] = BLKSZ; \
dims[1] = DNAME; \
\
if ((status = nc_def_var(exoid, VNAME(BLK+1), \
- NC_INT, 2, dims, &connid)) != NC_NOERR) { \
+ conn_int_type, 2, dims, &connid)) != NC_NOERR) { \
exerrval = status; \
sprintf(errmsg, \
- "Error: failed to create " TNAME " connectivity array for block %d in file id %d", \
- BLKID[iblk],exoid); \
+ "Error: failed to create " TNAME " connectivity array for block %"PRId64" in file id %d", \
+ BLKID,exoid); \
ex_err("ex_put_concat_all_blocks",errmsg,exerrval); \
goto error_ret; /* exit define mode and return */ \
} \
+ ex_compress_variable(exoid, connid, 1); \
}
/* Iterate over edge blocks ... */
for (iblk = 0; iblk < num_edge_blk; ++iblk) {
-
+ ex_entity_id eb_id;
+ if (ids_int64)
+ eb_id = edge_id_int64[iblk];
+ else
+ eb_id = edge_id_int[iblk];
+
cur_num_edge_blk=ex_get_file_item(exoid, ex_get_counter_list(EX_EDGE_BLOCK));
if (cur_num_edge_blk >= (int)num_edge_blk) {
exerrval = EX_FATAL;
@@ -305,12 +345,12 @@ int ex_put_concat_all_blocks (int exoid,
exerrval = status;
if (status == NC_ENAMEINUSE) { /* duplicate entry */
sprintf(errmsg,
- "Error: edge block %d already defined in file id %d",
- param->edge_blk_id[iblk],exoid);
+ "Error: edge block %"PRId64" already defined in file id %d",
+ eb_id,exoid);
} else {
sprintf(errmsg,
- "Error: failed to define number of edges/block for block %d file id %d",
- param->edge_blk_id[iblk],exoid);
+ "Error: failed to define number of edges/block for block %"PRId64" file id %d",
+ eb_id,exoid);
}
ex_err("ex_put_concat_all_blocks",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
@@ -321,16 +361,18 @@ int ex_put_concat_all_blocks (int exoid,
param->num_nodes_per_edge[iblk],&nednoddim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to define number of nodes/edge for block %d in file id %d",
- param->edge_blk_id[iblk],exoid);
+ "Error: failed to define number of nodes/edge for block %"PRId64" in file id %d",
+ eb_id,exoid);
ex_err("ex_put_concat_all_blocks",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
/* edge attribute array */
- EX_PREPARE_ATTRIB_ARRAY("edge",cur_num_edge_blk,DIM_NUM_ATT_IN_EBLK,param->num_attr_edge,param->edge_blk_id,VAR_EATTRIB,numedbdim,numattrdim,VAR_NAME_EATTRIB);
-
- EX_PREPARE_CONN("edge block",cur_num_edge_blk,param->edge_blk_id,numedbdim,VAR_EBCONN,nednoddim);
+ EX_PREPARE_ATTRIB_ARRAY("edge",cur_num_edge_blk,DIM_NUM_ATT_IN_EBLK,param->num_attr_edge,
+ eb_id,VAR_EATTRIB,numedbdim,numattrdim,VAR_NAME_EATTRIB);
+
+ EX_PREPARE_CONN("edge block",cur_num_edge_blk,
+ eb_id,numedbdim,VAR_EBCONN,nednoddim);
/* store edge type as attribute of connectivity variable */
if ((status = nc_put_att_text(exoid, connid, ATT_NAME_ELB, strlen(param->edge_type[iblk])+1,
@@ -346,6 +388,11 @@ int ex_put_concat_all_blocks (int exoid,
/* Iterate over face blocks ... */
for (iblk = 0; iblk < num_face_blk; ++iblk) {
+ ex_entity_id fb_id;
+ if (ids_int64)
+ fb_id = face_id_int64[iblk];
+ else
+ fb_id = face_id_int[iblk];
cur_num_face_blk=ex_get_file_item(exoid, ex_get_counter_list(EX_FACE_BLOCK));
if (cur_num_face_blk >= (int)num_face_blk) {
@@ -371,12 +418,12 @@ int ex_put_concat_all_blocks (int exoid,
exerrval = status;
if (status == NC_ENAMEINUSE) { /* duplicate entry */
sprintf(errmsg,
- "Error: face block %d already defined in file id %d",
- param->face_blk_id[iblk],exoid);
+ "Error: face block %"PRId64" already defined in file id %d",
+ fb_id,exoid);
} else {
sprintf(errmsg,
- "Error: failed to define number of faces/block for block %d file id %d",
- param->face_blk_id[iblk],exoid);
+ "Error: failed to define number of faces/block for block %"PRId64" file id %d",
+ fb_id,exoid);
}
ex_err("ex_put_concat_all_blocks",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
@@ -387,17 +434,18 @@ int ex_put_concat_all_blocks (int exoid,
param->num_nodes_per_face[iblk],&nfanoddim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to define number of nodes/face for block %d in file id %d",
- param->face_blk_id[iblk],exoid);
+ "Error: failed to define number of nodes/face for block %"PRId64" in file id %d",
+ fb_id,exoid);
ex_err("ex_put_concat_all_blocks",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
- /* edge attribute array */
- EX_PREPARE_ATTRIB_ARRAY("face",cur_num_face_blk,DIM_NUM_ATT_IN_FBLK,param->num_attr_face,param->face_blk_id,VAR_FATTRIB,numfabdim,numattrdim,VAR_NAME_FATTRIB);
-
- EX_PREPARE_CONN("face block",cur_num_face_blk,param->face_blk_id,numfabdim,VAR_FBCONN,nfanoddim);
-
+ /* face attribute array */
+ EX_PREPARE_ATTRIB_ARRAY("face",cur_num_face_blk,DIM_NUM_ATT_IN_FBLK,param->num_attr_face,
+ fb_id,VAR_FATTRIB,numfabdim,numattrdim,VAR_NAME_FATTRIB);
+
+ EX_PREPARE_CONN("face block",cur_num_face_blk,fb_id,numfabdim,VAR_FBCONN,nfanoddim);
+
/* store face type as attribute of connectivity variable */
if ((status = nc_put_att_text(exoid, connid, ATT_NAME_ELB, strlen(param->face_type[iblk])+1,
(void*)param->face_type[iblk])) != NC_NOERR) {
@@ -412,6 +460,11 @@ int ex_put_concat_all_blocks (int exoid,
/* Iterate over element blocks ... */
for (iblk = 0; iblk < num_elem_blk; ++iblk) {
+ ex_entity_id eb_id;
+ if (ids_int64)
+ eb_id = elem_id_int64[iblk];
+ else
+ eb_id = elem_id_int[iblk];
cur_num_elem_blk=ex_get_file_item(exoid, ex_get_counter_list(EX_ELEM_BLOCK));
if (cur_num_elem_blk >= (int)num_elem_blk) {
@@ -437,12 +490,12 @@ int ex_put_concat_all_blocks (int exoid,
exerrval = status;
if (status == NC_ENAMEINUSE) { /* duplicate entry */
sprintf(errmsg,
- "Error: element block %d already defined in file id %d",
- param->elem_blk_id[iblk],exoid);
+ "Error: element block %"PRId64" already defined in file id %d",
+ eb_id,exoid);
} else {
sprintf(errmsg,
- "Error: failed to define number of elements/block for block %d file id %d",
- param->elem_blk_id[iblk],exoid);
+ "Error: failed to define number of elements/block for block %"PRId64" file id %d",
+ eb_id,exoid);
}
ex_err("ex_put_concat_all_blocks",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
@@ -456,8 +509,8 @@ int ex_put_concat_all_blocks (int exoid,
param->num_nodes_per_elem[iblk], &nelnoddim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to define number of nodes/element for block %d in file id %d",
- param->elem_blk_id[iblk],exoid);
+ "Error: failed to define number of nodes/element for block %"PRId64" in file id %d",
+ eb_id,exoid);
ex_err("ex_put_concat_all_blocks",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
@@ -468,8 +521,8 @@ int ex_put_concat_all_blocks (int exoid,
param->num_edges_per_elem[iblk],&neledgdim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to define number of edges/element for block %d in file id %d",
- param->elem_blk_id[iblk],exoid);
+ "Error: failed to define number of edges/element for block %"PRId64" in file id %d",
+ eb_id,exoid);
ex_err("ex_put_concat_all_blocks",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
@@ -481,18 +534,17 @@ int ex_put_concat_all_blocks (int exoid,
param->num_faces_per_elem[iblk],&nelfacdim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to define number of faces/element for block %d in file id %d",
- param->elem_blk_id[iblk],exoid);
+ "Error: failed to define number of faces/element for block %"PRId64" in file id %d",
+ eb_id,exoid);
ex_err("ex_put_concat_all_blocks",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
}
- /* element attribute array */
- EX_PREPARE_ATTRIB_ARRAY("element",cur_num_elem_blk,DIM_NUM_ATT_IN_BLK,param->num_attr_elem,param->elem_blk_id,VAR_ATTRIB,numelbdim,numattrdim,VAR_NAME_ATTRIB);
+ EX_PREPARE_ATTRIB_ARRAY("element",cur_num_elem_blk,DIM_NUM_ATT_IN_BLK,param->num_attr_elem,
+ eb_id,VAR_ATTRIB,numelbdim,numattrdim,VAR_NAME_ATTRIB);
- /* element connectivity array */
- EX_PREPARE_CONN("nodal",cur_num_elem_blk,param->elem_blk_id,numelbdim,VAR_CONN,nelnoddim);
+ EX_PREPARE_CONN("nodal",cur_num_elem_blk,eb_id,numelbdim,VAR_CONN,nelnoddim);
/* store element type as attribute of connectivity variable */
if ((status = nc_put_att_text(exoid, connid, ATT_NAME_ELB, strlen(param->elem_type[iblk])+1,
@@ -505,8 +557,8 @@ int ex_put_concat_all_blocks (int exoid,
goto error_ret; /* exit define mode and return */
}
- EX_PREPARE_CONN( "edge",cur_num_elem_blk,param->elem_blk_id,numelbdim,VAR_ECONN,neledgdim);
- EX_PREPARE_CONN( "face",cur_num_elem_blk,param->elem_blk_id,numelbdim,VAR_FCONN,nelfacdim);
+ EX_PREPARE_CONN( "edge",cur_num_elem_blk,eb_id,numelbdim,VAR_ECONN,neledgdim);
+ EX_PREPARE_CONN( "face",cur_num_elem_blk,eb_id,numelbdim,VAR_FCONN,nelfacdim);
}
/* Define the element map here to avoid a later redefine call */
@@ -523,7 +575,12 @@ int ex_put_concat_all_blocks (int exoid,
for ( i = 1; i <= num_maps[map_type]; ++i ) {
const char* mapname = ex_name_of_map( map_enums[map_type], i );
if (nc_inq_varid(exoid, mapname, &temp) != NC_NOERR) {
- if ((status = nc_def_var(exoid, mapname, NC_INT, 1, dims, &temp)) != NC_NOERR) {
+ int map_int_type = NC_INT;
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_DB) {
+ map_int_type = NC_INT64;
+ }
+
+ if ((status = nc_def_var(exoid, mapname, map_int_type, 1, dims, &temp)) != NC_NOERR) {
exerrval = status;
if ( status == NC_ENAMEINUSE ) {
sprintf( errmsg, "Error: number map %s already exists in file id %d", mapname, exoid );
@@ -533,6 +590,7 @@ int ex_put_concat_all_blocks (int exoid,
ex_err( "ex_put_concat_all_blocks", errmsg, exerrval );
goto error_ret; /* exit define mode and return */
}
+ ex_compress_variable(exoid, temp, 1); \
}
}
}
diff --git a/exodus/cbind/src/expclb.c b/exodus/cbind/src/ex_put_concat_elem_block.c
similarity index 79%
rename from exodus/cbind/src/expclb.c
rename to exodus/cbind/src/ex_put_concat_elem_block.c
index 4275981..961fbf1 100644
--- a/exodus/cbind/src/expclb.c
+++ b/exodus/cbind/src/ex_put_concat_elem_block.c
@@ -42,7 +42,7 @@
* char** elem_type element type string
* int* num_elem_this_blk number of elements in the element blk
* int* num_nodes_per_elem number of nodes per element block
-* int* num_attr number of attributes
+* int* num_attr_this_blk number of attributes
* int define_maps if != 0, write maps, else don't
*
*****************************************************************************/
@@ -59,15 +59,15 @@
* \param elem_type element type string
* \param num_elem_this_blk number of elements in the element blk
* \param num_nodes_per_elem number of nodes per element block
- * \param num_attr number of attributes
+ * \param num_attr_this_blk number of attributes
* \param define_maps if != 0, write maps, else don't
*/
int ex_put_concat_elem_block (int exoid,
- const int* elem_blk_id,
+ const void_int* elem_blk_id,
char *elem_type[],
- const int* num_elem_this_blk,
- const int* num_nodes_per_elem,
- const int* num_attr,
+ const void_int* num_elem_this_blk,
+ const void_int* num_nodes_per_elem,
+ const void_int* num_attr_this_blk,
int define_maps)
{
int i, varid, dimid, dims[2], strdim, *eb_array;
@@ -75,6 +75,7 @@ int ex_put_concat_elem_block (int exoid,
int iblk;
int status;
int num_elem_blk;
+ int map_int_type, conn_int_type;
size_t length;
int cur_num_elem_blk, nelnoddim, numelbdim, numattrdim, connid, numelemdim, numnodedim;
char errmsg[MAX_ERR_LENGTH];
@@ -109,11 +110,14 @@ int ex_put_concat_elem_block (int exoid,
return (EX_FATAL);
}
- for (i=0;i<num_elem_blk;i++) {
- if (num_elem_this_blk[i] == 0) /* Is this a NULL element block? */
- eb_array[i] = 0; /* change element block status to NULL */
- else
- eb_array[i] = 1; /* change element block status to TRUE */
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ for (i=0;i<num_elem_blk;i++) {
+ eb_array[i] = (((int64_t*)num_elem_this_blk)[i] == 0) ? 0 : 1;
+ }
+ } else {
+ for (i=0;i<num_elem_blk;i++) {
+ eb_array[i] = (((int*)num_elem_this_blk)[i] == 0) ? 0 : 1;
+ }
}
/* Next, get variable id of status array */
@@ -149,7 +153,11 @@ int ex_put_concat_elem_block (int exoid,
}
/* then, write out id list */
- status = nc_put_var_int(exoid, varid, elem_blk_id);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ status = nc_put_var_longlong(exoid, varid, elem_blk_id);
+ } else {
+ status = nc_put_var_int(exoid, varid, elem_blk_id);
+ }
if (status != NC_NOERR) {
exerrval = status;
@@ -177,8 +185,33 @@ int ex_put_concat_elem_block (int exoid,
return (EX_FATAL);
}
+ conn_int_type = NC_INT;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_DB) {
+ conn_int_type = NC_INT64;
+ }
+
+ map_int_type = NC_INT;
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_DB) {
+ map_int_type = NC_INT64;
+ }
+
/* Iterate over element blocks ... */
for (iblk = 0; iblk < num_elem_blk; iblk++) {
+ ex_entity_id eb_id;
+ size_t num_elem;
+ size_t num_npe;
+ size_t num_attr;
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ eb_id = ((int64_t*)elem_blk_id)[iblk];
+ num_elem = ((int64_t*)num_elem_this_blk)[iblk];
+ num_npe = ((int64_t*)num_nodes_per_elem)[iblk];
+ num_attr = ((int64_t*)num_attr_this_blk)[iblk];
+ } else {
+ eb_id = ((int*)elem_blk_id)[iblk];
+ num_elem = ((int*)num_elem_this_blk)[iblk];
+ num_npe = ((int*)num_nodes_per_elem)[iblk];
+ num_attr = ((int*)num_attr_this_blk)[iblk];
+ }
cur_num_elem_blk=ex_get_file_item(exoid, ex_get_counter_list(EX_ELEM_BLOCK));
if (cur_num_elem_blk >= num_elem_blk) {
@@ -194,22 +227,22 @@ int ex_put_concat_elem_block (int exoid,
for a specific file and returns that value incremented. */
cur_num_elem_blk=ex_inc_file_item(exoid, ex_get_counter_list(EX_ELEM_BLOCK));
- if (num_elem_this_blk[iblk] == 0) /* Is this a NULL element block? */
+ if (eb_array[iblk] == 0) /* Is this a NULL element block? */
continue;
/* define some dimensions and variables*/
if ((status = nc_def_dim(exoid,
DIM_NUM_EL_IN_BLK(cur_num_elem_blk+1),
- num_elem_this_blk[iblk], &numelbdim)) != NC_NOERR) {
+ num_elem, &numelbdim)) != NC_NOERR) {
exerrval = status;
if (status == NC_ENAMEINUSE) { /* duplicate entry */
sprintf(errmsg,
- "Error: element block %d already defined in file id %d",
- elem_blk_id[iblk],exoid);
+ "Error: element block %"PRId64" already defined in file id %d",
+ eb_id,exoid);
} else {
sprintf(errmsg,
- "Error: failed to define number of elements/block for block %d file id %d",
- elem_blk_id[iblk],exoid);
+ "Error: failed to define number of elements/block for block %"PRId64" file id %d",
+ eb_id,exoid);
}
ex_err("ex_put_concat_elem_block",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
@@ -217,11 +250,11 @@ int ex_put_concat_elem_block (int exoid,
if ((status = nc_def_dim(exoid,
DIM_NUM_NOD_PER_EL(cur_num_elem_blk+1),
- num_nodes_per_elem[iblk], &nelnoddim)) != NC_NOERR) {
+ num_npe, &nelnoddim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to define number of nodes/element for block %d in file id %d",
- elem_blk_id[iblk],exoid);
+ "Error: failed to define number of nodes/element for block %"PRId64" in file id %d",
+ eb_id,exoid);
ex_err("ex_put_concat_elem_block",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
@@ -231,14 +264,15 @@ int ex_put_concat_elem_block (int exoid,
dims[1] = nelnoddim;
if ((status = nc_def_var (exoid, VAR_CONN(cur_num_elem_blk+1),
- NC_INT, 2, dims, &connid)) != NC_NOERR) {
+ conn_int_type, 2, dims, &connid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to create connectivity array for block %d in file id %d",
- elem_blk_id[iblk],exoid);
+ "Error: failed to create connectivity array for block %"PRId64" in file id %d",
+ eb_id,exoid);
ex_err("ex_put_concat_elem_block",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
+ ex_compress_variable(exoid, connid, 1);
/* store element type as attribute of connectivity variable */
if ((status = nc_put_att_text(exoid, connid, ATT_NAME_ELB, strlen(elem_type[iblk])+1,
@@ -252,14 +286,14 @@ int ex_put_concat_elem_block (int exoid,
}
/* element attribute array */
- if (num_attr[iblk] > 0) {
+ if (num_attr > 0) {
if ((status = nc_def_dim (exoid,
DIM_NUM_ATT_IN_BLK(cur_num_elem_blk+1),
- num_attr[iblk], &numattrdim)) != NC_NOERR) {
+ num_attr, &numattrdim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to define number of attributes in block %d in file id %d",
- elem_blk_id[iblk],exoid);
+ "Error: failed to define number of attributes in block %"PRId64" in file id %d",
+ eb_id,exoid);
ex_err("ex_put_concat_elem_block",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
@@ -285,8 +319,8 @@ int ex_put_concat_elem_block (int exoid,
nc_flt_code(exoid), 2, dims, &temp)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to define attributes for element block %d in file id %d",
- elem_blk_id[iblk],exoid);
+ "Error: failed to define attributes for element block %"PRId64" in file id %d",
+ eb_id,exoid);
ex_err("ex_put_concat_elem_block",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
@@ -305,7 +339,7 @@ int ex_put_concat_elem_block (int exoid,
if (nc_inq_dimid(exoid, DIM_NUM_ELEM, &numelemdim) == NC_NOERR) {
dims[0] = numelemdim;
- if ((status = nc_def_var(exoid, VAR_ELEM_NUM_MAP, NC_INT, 1, dims, &temp)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_ELEM_NUM_MAP, map_int_type, 1, dims, &temp)) != NC_NOERR) {
exerrval = status;
if (status == NC_ENAMEINUSE) {
sprintf(errmsg,
@@ -319,6 +353,7 @@ int ex_put_concat_elem_block (int exoid,
ex_err("ex_put_concat_elem_block",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
+ ex_compress_variable(exoid, temp, 1);
}
}
@@ -327,7 +362,7 @@ int ex_put_concat_elem_block (int exoid,
/* Map does not exist */
if ((nc_inq_dimid(exoid, DIM_NUM_NODES, &numnodedim)) == NC_NOERR) {
dims[0] = numnodedim;
- if ((status = nc_def_var(exoid, VAR_NODE_NUM_MAP, NC_INT, 1, dims, &temp)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_NODE_NUM_MAP, map_int_type, 1, dims, &temp)) != NC_NOERR) {
exerrval = status;
if (status == NC_ENAMEINUSE) {
sprintf(errmsg,
@@ -341,6 +376,7 @@ int ex_put_concat_elem_block (int exoid,
ex_err("ex_put_concat_elem_block",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
+ ex_compress_variable(exoid, temp, 1);
}
}
}
@@ -366,9 +402,15 @@ int ex_put_concat_elem_block (int exoid,
count[1] = strlen(text)+1;
for (iblk = 0; iblk < num_elem_blk; iblk++) {
- if (num_elem_this_blk[iblk] == 0) /* Is this a NULL element block? */
+ size_t num_attr;
+ if (eb_array[iblk] == 0) /* Is this a NULL element block? */
continue;
- for (i = 0; i < num_attr[iblk]; i++) {
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ num_attr = ((int64_t*)num_attr_this_blk)[iblk];
+ } else {
+ num_attr = ((int*)num_attr_this_blk)[iblk];
+ }
+ for (i = 0; i < num_attr; i++) {
start[0] = i;
nc_put_vara_text(exoid, eb_array[iblk], start, count, text);
}
diff --git a/exodus/cbind/src/expcns.c b/exodus/cbind/src/ex_put_concat_node_sets.c
similarity index 94%
rename from exodus/cbind/src/expcns.c
rename to exodus/cbind/src/ex_put_concat_node_sets.c
index 9faa138..ef4361a 100644
--- a/exodus/cbind/src/expcns.c
+++ b/exodus/cbind/src/ex_put_concat_node_sets.c
@@ -124,12 +124,12 @@ error = ex_put_concat_node_sets (exoid, ids, num_nodes_per_set,
*/
int ex_put_concat_node_sets (int exoid,
- int *node_set_ids,
- int *num_nodes_per_set,
- int *num_dist_per_set,
- int *node_sets_node_index,
- int *node_sets_df_index,
- int *node_sets_node_list,
+ void_int *node_set_ids,
+ void_int *num_nodes_per_set,
+ void_int *num_dist_per_set,
+ void_int *node_sets_node_index,
+ void_int *node_sets_df_index,
+ void_int *node_sets_node_list,
void *node_sets_dist_fact)
{
struct ex_set_specs set_specs;
diff --git a/exodus/cbind/src/expcset.c b/exodus/cbind/src/ex_put_concat_sets.c
similarity index 65%
rename from exodus/cbind/src/expcset.c
rename to exodus/cbind/src/ex_put_concat_sets.c
index eef98c8..e7b05c3 100644
--- a/exodus/cbind/src/expcset.c
+++ b/exodus/cbind/src/ex_put_concat_sets.c
@@ -68,18 +68,17 @@ int ex_put_concat_sets (int exoid,
{
int status;
int temp;
- const int *set_ids = set_specs->sets_ids;
- const int *num_entries_per_set = set_specs->num_entries_per_set;
- const int *num_dist_per_set = set_specs->num_dist_per_set;
- const int *sets_entry_index = set_specs->sets_entry_index;
- const int *sets_dist_index = set_specs->sets_dist_index;
- const int *sets_entry_list = set_specs->sets_entry_list;
- const int *sets_extra_list = set_specs->sets_extra_list;
+ const void_int *num_entries_per_set = set_specs->num_entries_per_set;
+ const void_int *num_dist_per_set = set_specs->num_dist_per_set;
+ const void_int *sets_entry_index = set_specs->sets_entry_index;
+ const void_int *sets_dist_index = set_specs->sets_dist_index;
const void *sets_dist_fact = set_specs->sets_dist_fact;
- char *cdum = NULL;
- int i, num_sets, cur_num_sets, dimid, varid, set_id_ndx, dims[1];
+ size_t i, num_df, num_entry;
+ int cur_num_sets, num_sets;
+ int dimid, varid, set_id_ndx, dims[1];
int *set_stat = NULL;
- float fdum;
+ int set_int_type, int_size;
+
const float *flt_dist_fact = NULL;
const double *dbl_dist_fact = NULL;
char errmsg[MAX_ERR_LENGTH];
@@ -90,12 +89,14 @@ int ex_put_concat_sets (int exoid,
char* elemptr = NULL;
char* extraptr = NULL;
ex_inquiry ex_inq_val;
- const int *extra_list = NULL;
exerrval = 0; /* clear error code */
- cdum = 0; /* initialize even though it is not used */
-
+ int_size = sizeof(int);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ int_size = sizeof(int64_t);
+ }
+
/* setup pointers based on set_type
NOTE: there is another block that sets more stuff later ... */
@@ -150,7 +151,8 @@ int ex_put_concat_sets (int exoid,
}
/* inquire how many sets are to be stored */
- if (ex_inquire(exoid, ex_inq_val, &num_sets, &fdum, cdum) != NC_NOERR) {
+ num_sets = ex_inquire_int(exoid, ex_inq_val);
+ if (num_sets < 0) {
sprintf(errmsg,
"Error: failed to get number of %ss defined for file id %d",
ex_name_of_object(set_type), exoid);
@@ -171,11 +173,14 @@ int ex_put_concat_sets (int exoid,
return (EX_FATAL);
}
- for (i=0;i<num_sets;i++) {
- if (num_entries_per_set[i] == 0) /* Is this a NULL set? */
- set_stat[i] = 0; /* change set status to NULL */
- else
- set_stat[i] = 1; /* change set status to TRUE */
+ if (int_size == sizeof(int64_t)) {
+ for (i=0;i<num_sets;i++) {
+ set_stat[i] = (((int64_t*)num_entries_per_set)[i] == 0) ? 0 : 1;
+ }
+ } else {
+ for (i=0;i<num_sets;i++) {
+ set_stat[i] = (((int*)num_entries_per_set)[i] == 0) ? 0 : 1;
+ }
}
/* Next, get variable id of status array */
@@ -199,8 +204,6 @@ int ex_put_concat_sets (int exoid,
return (EX_FATAL);
}
- free(set_stat);
-
/* put netcdf file into define mode */
if ((status = nc_redef (exoid)) != NC_NOERR) {
exerrval = status;
@@ -213,6 +216,13 @@ int ex_put_concat_sets (int exoid,
/* create set definitions */
for (i=0; i<num_sets; i++) {
+ int64_t set_id;
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ set_id = ((int64_t*)set_specs->sets_ids)[i];
+ } else {
+ set_id = ((int*)set_specs->sets_ids)[i];
+ }
+
/* Keep track of the total number of sets defined using a counter stored
in a linked list keyed by exoid.
NOTE: ex_get_file_item is used to find the number of sets of type
@@ -268,77 +278,98 @@ int ex_put_concat_sets (int exoid,
}
/* define dimension for number of entries per set */
- if (num_entries_per_set[i] == 0) /* Is this a NULL set? */
+ if (set_stat[i] == 0) /* Is this a NULL set? */
continue; /* Do not create anything for NULL sets! */
- if ((status = nc_def_dim(exoid, ex_dim_num_entries_in_object(set_type, set_id_ndx),
- num_entries_per_set[i], &dimid)) != NC_NOERR) {
+ if (int_size == sizeof(int)) {
+ status = nc_def_dim(exoid, ex_dim_num_entries_in_object(set_type, set_id_ndx),
+ ((int*)num_entries_per_set)[i], &dimid);
+ } else {
+ status = nc_def_dim(exoid, ex_dim_num_entries_in_object(set_type, set_id_ndx),
+ ((int64_t*)num_entries_per_set)[i], &dimid);
+ }
+
+ if (status != NC_NOERR) {
if (status == NC_ENAMEINUSE) {
exerrval = status;
sprintf(errmsg,
- "Error: %s entry count %d already defined in file id %d",
- ex_name_of_object(set_type), set_ids[i],exoid);
+ "Error: %s entry count %"PRId64" already defined in file id %d",
+ ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_concat_sets",errmsg,exerrval);
} else {
exerrval = status;
sprintf(errmsg,
- "Error: failed to define number of entries for %s %d in file id %d",
- ex_name_of_object(set_type), set_ids[i],exoid);
+ "Error: failed to define number of entries for %s %"PRId64" in file id %d",
+ ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_concat_sets",errmsg,exerrval);
}
goto error_ret;
}
/* create element list variable for set */
+ set_int_type = NC_INT;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_DB) {
+ set_int_type = NC_INT64;
+ }
dims[0] = dimid;
- if ((status = nc_def_var(exoid,elemptr,NC_INT,1,dims, &temp)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid,elemptr,set_int_type,1,dims, &temp)) != NC_NOERR) {
if (status == NC_ENAMEINUSE) {
exerrval = status;
sprintf(errmsg,
- "Error: element list already exists for %s %d in file id %d",
- ex_name_of_object(set_type), set_ids[i],exoid);
+ "Error: element list already exists for %s %"PRId64" in file id %d",
+ ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_concat_sets",errmsg,exerrval);
} else {
exerrval = status;
sprintf(errmsg,
- "Error: failed to create element list for %s %d in file id %d",
- ex_name_of_object(set_type), set_ids[i],exoid);
+ "Error: failed to create element list for %s %"PRId64" in file id %d",
+ ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_concat_sets",errmsg,exerrval);
}
goto error_ret; /* exit define mode and return */
}
+ ex_compress_variable(exoid, temp, 1);
/* create extra list variable for set (only for edge, face and side sets) */
if (extraptr) {
- if ((status = nc_def_var(exoid,extraptr,NC_INT,1,dims, &temp)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid,extraptr,set_int_type,1,dims, &temp)) != NC_NOERR) {
if (status == NC_ENAMEINUSE) {
exerrval = status;
sprintf(errmsg,
- "Error: extra list already exists for %s %d in file id %d",
- ex_name_of_object(set_type), set_ids[i],exoid);
+ "Error: extra list already exists for %s %"PRId64" in file id %d",
+ ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_concat_sets",errmsg,exerrval);
} else {
exerrval = status;
sprintf(errmsg,
- "Error: failed to create extra list for %s %d in file id %d",
- ex_name_of_object(set_type), set_ids[i],exoid);
+ "Error: failed to create extra list for %s %"PRId64" in file id %d",
+ ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_concat_sets",errmsg,exerrval);
}
goto error_ret; /* exit define mode and return */
}
+ ex_compress_variable(exoid, temp, 1);
}
/* define dimension for number of dist factors per set */
/* NOTE: only define df count if the dist factors exist! */
- if (num_dist_per_set[i] > 0) {
+ if (int_size == sizeof(int64_t)) {
+ num_df = ((int64_t*)num_dist_per_set)[i];
+ num_entry = ((int64_t*)num_entries_per_set)[i];
+ } else {
+ num_df = ((int*)num_dist_per_set)[i];
+ num_entry = ((int*)num_entries_per_set)[i];
+ }
+
+ if (num_df > 0) {
if (set_type == EX_NODE_SET) {
- if (num_dist_per_set[i] != num_entries_per_set[i]) {
+ if (num_df != num_entry) {
exerrval = EX_FATAL;
sprintf(errmsg,
- "Error: # dist fact (%d) not equal to # nodes (%d) in node set %d file id %d",
- num_dist_per_set[i], num_entries_per_set[i], set_ids[i],exoid);
+ "Error: # dist fact (%"ST_ZU") not equal to # nodes (%"ST_ZU") in node set %"PRId64" file id %d",
+ num_df, num_entry, set_id,exoid);
ex_err("ex_put_concat_sets",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
@@ -346,18 +377,18 @@ int ex_put_concat_sets (int exoid,
/* resuse dimid from entry lists */
} else {
if ((status = nc_def_dim(exoid, numdfptr,
- num_dist_per_set[i], &dimid)) != NC_NOERR) {
+ num_df, &dimid)) != NC_NOERR) {
if (status == NC_ENAMEINUSE) {
exerrval = status;
sprintf(errmsg,
- "Error: %s df count %d already defined in file id %d",
- ex_name_of_object(set_type), set_ids[i],exoid);
+ "Error: %s df count %"PRId64" already defined in file id %d",
+ ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_concat_sets",errmsg,exerrval);
} else {
exerrval = status;
sprintf(errmsg,
- "Error: failed to define %s df count for set %d in file id %d",
- ex_name_of_object(set_type), set_ids[i],exoid);
+ "Error: failed to define %s df count for set %"PRId64" in file id %d",
+ ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_concat_sets",errmsg,exerrval);
}
goto error_ret;
@@ -370,18 +401,19 @@ int ex_put_concat_sets (int exoid,
if (status == NC_ENAMEINUSE) {
exerrval = status;
sprintf(errmsg,
- "Error: dist factor list already exists for %s %d in file id %d",
- ex_name_of_object(set_type), set_ids[i],exoid);
+ "Error: dist factor list already exists for %s %"PRId64" in file id %d",
+ ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_concat_sets",errmsg,exerrval);
} else {
exerrval = status;
sprintf(errmsg,
- "Error: failed to create dist factor list for %s %d in file id %d",
- ex_name_of_object(set_type), set_ids[i],exoid);
+ "Error: failed to create dist factor list for %s %"PRId64" in file id %d",
+ ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_concat_sets",errmsg,exerrval);
}
goto error_ret; /* exit define mode and return */
}
+ ex_compress_variable(exoid, temp, 2);
} /* end define dist factors */
}
@@ -408,7 +440,11 @@ int ex_put_concat_sets (int exoid,
}
/* then, write out set id list */
- status = nc_put_var_int(exoid, varid, set_ids);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ status = nc_put_var_longlong(exoid, varid, set_specs->sets_ids);
+ } else {
+ status = nc_put_var_int(exoid, varid, set_specs->sets_ids);
+ }
if (status != NC_NOERR) {
exerrval = status;
@@ -428,63 +464,92 @@ int ex_put_concat_sets (int exoid,
/* Now, use ExodusII call to store sets */
for (i=0; i<num_sets; i++) {
+ int64_t set_id;
+ size_t df_ndx;
+
+ if (set_stat[i] == 0) /* Is this a NULL set? */
+ continue; /* Do not create anything for NULL sets! */
- if (num_entries_per_set[i] == 0) /* Is this a NULL set? */
- continue; /* Do not create anything for NULL sets! */
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ set_id = ((int64_t*)set_specs->sets_ids)[i];
+ } else {
+ set_id = ((int*)set_specs->sets_ids)[i];
+ }
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ int64_t* extra_list = NULL;
+ /* set extra list */
+ if (set_type == EX_EDGE_SET || set_type == EX_FACE_SET || set_type == EX_SIDE_SET)
+ extra_list = &(((int64_t*)set_specs->sets_extra_list)[((int64_t*)sets_entry_index)[i]]);
+
+ status = ex_put_set(exoid, set_type, set_id,
+ &(((int64_t*)set_specs->sets_entry_list)[((int64_t*)sets_entry_index)[i]]),
+ extra_list);
+ } else {
+ int* extra_list = NULL;
/* set extra list */
- if (set_type == EX_EDGE_SET || set_type == EX_FACE_SET ||
- set_type == EX_SIDE_SET)
- extra_list = &(sets_extra_list[sets_entry_index[i]]);
- else
- extra_list = NULL;
-
- if (ex_put_set(exoid, set_type, set_ids[i],
- &(sets_entry_list[sets_entry_index[i]]),
- extra_list) == -1)
- return(EX_FATAL); /* error will be reported by subroutine */
-
- if (ex_comp_ws(exoid) == sizeof(float)) {
- flt_dist_fact = sets_dist_fact;
- if (num_dist_per_set[i] > 0) { /* store dist factors if required */
- if (ex_put_set_dist_fact(exoid, set_type, set_ids[i],
- &(flt_dist_fact[sets_dist_index[i]])) == -1) {
- sprintf(errmsg,
- "Error: failed to store %s %d dist factors for file id %d",
- ex_name_of_object(set_type), set_ids[i],exoid);
- /* use error val from exodusII routine */
- ex_err("ex_put_concat_sets",errmsg,exerrval);
- return (EX_FATAL);
- }
+ if (set_type == EX_EDGE_SET || set_type == EX_FACE_SET || set_type == EX_SIDE_SET)
+ extra_list = &(((int*)set_specs->sets_extra_list)[((int*)sets_entry_index)[i]]);
+
+ status = ex_put_set(exoid, set_type, set_id,
+ &(((int*)set_specs->sets_entry_list)[((int*)sets_entry_index)[i]]),
+ extra_list);
+ }
+ if (status != NC_NOERR)
+ return(EX_FATAL); /* error will be reported by subroutine */
+
+ if (int_size == sizeof(int)) {
+ num_df = ((int*)num_dist_per_set)[i];
+ df_ndx = ((int*)sets_dist_index)[i];
+ } else {
+ num_df = ((int64_t*)num_dist_per_set)[i];
+ df_ndx = ((int64_t*)sets_dist_index)[i];
+ }
+
+ if (ex_comp_ws(exoid) == sizeof(float)) {
+ flt_dist_fact = sets_dist_fact;
+ if (num_df > 0) { /* store dist factors if required */
+ if (ex_put_set_dist_fact(exoid, set_type, set_id,
+ &(flt_dist_fact[df_ndx])) == -1) {
+ sprintf(errmsg,
+ "Error: failed to store %s %"PRId64" dist factors for file id %d",
+ ex_name_of_object(set_type), set_id,exoid);
+ /* use error val from exodusII routine */
+ ex_err("ex_put_concat_sets",errmsg,exerrval);
+ return (EX_FATAL);
}
- } else if (ex_comp_ws(exoid) == sizeof(double)) {
- dbl_dist_fact = sets_dist_fact;
- if (num_dist_per_set[i] > 0) { /* only store if they exist */
- if (ex_put_set_dist_fact(exoid, set_type, set_ids[i],
- &(dbl_dist_fact[sets_dist_index[i]])) == -1) {
- sprintf(errmsg,
- "Error: failed to store %s %d dist factors for file id %d",
- ex_name_of_object(set_type), set_ids[i],exoid);
- /* use error val from exodusII routine */
- ex_err("ex_put_concat_sets",errmsg,exerrval);
- return (EX_FATAL);
- }
+ }
+ } else if (ex_comp_ws(exoid) == sizeof(double)) {
+ dbl_dist_fact = sets_dist_fact;
+ if (num_df) { /* only store if they exist */
+ if (ex_put_set_dist_fact(exoid, set_type, set_id,
+ &(dbl_dist_fact[df_ndx])) == -1) {
+ sprintf(errmsg,
+ "Error: failed to store %s %"PRId64" dist factors for file id %d",
+ ex_name_of_object(set_type), set_id,exoid);
+ /* use error val from exodusII routine */
+ ex_err("ex_put_concat_sets",errmsg,exerrval);
+ return (EX_FATAL);
}
- } else {
- /* unknown floating point word size */
- exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "Error: unsupported floating point word size %d for file id %d",
- ex_comp_ws(exoid), exoid);
- ex_err("ex_put_concat_sets", errmsg, exerrval);
- return (EX_FATAL);
}
+ } else {
+ /* unknown floating point word size */
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Error: unsupported floating point word size %d for file id %d",
+ ex_comp_ws(exoid), exoid);
+ ex_err("ex_put_concat_sets", errmsg, exerrval);
+ return (EX_FATAL);
+ }
}
+ free(set_stat);
return(EX_NOERR);
/* Fatal error: exit definition mode and return */
error_ret:
+ free(set_stat);
+
if (nc_enddef (exoid) != NC_NOERR) /* exit define mode */
{
sprintf(errmsg,
diff --git a/exodus/cbind/src/expcss.c b/exodus/cbind/src/ex_put_concat_side_sets.c
similarity index 91%
rename from exodus/cbind/src/expcss.c
rename to exodus/cbind/src/ex_put_concat_side_sets.c
index 3bea752..1b668b6 100644
--- a/exodus/cbind/src/expcss.c
+++ b/exodus/cbind/src/ex_put_concat_side_sets.c
@@ -77,13 +77,13 @@
*/
int ex_put_concat_side_sets (int exoid,
- int *side_set_ids,
- int *num_elem_per_set,
- int *num_dist_per_set,
- int *side_sets_elem_index,
- int *side_sets_dist_index,
- int *side_sets_elem_list,
- int *side_sets_side_list,
+ void_int *side_set_ids,
+ void_int *num_elem_per_set,
+ void_int *num_dist_per_set,
+ void_int *side_sets_elem_index,
+ void_int *side_sets_dist_index,
+ void_int *side_sets_elem_list,
+ void_int *side_sets_side_list,
void *side_sets_dist_fact)
{
struct ex_set_specs set_specs;
diff --git a/exodus/cbind/src/expvpc.c b/exodus/cbind/src/ex_put_concat_var_param.c
similarity index 100%
rename from exodus/cbind/src/expvpc.c
rename to exodus/cbind/src/ex_put_concat_var_param.c
diff --git a/exodus/cbind/src/expconn.c b/exodus/cbind/src/ex_put_conn.c
similarity index 85%
rename from exodus/cbind/src/expconn.c
rename to exodus/cbind/src/ex_put_conn.c
index 5143c77..21e57e6 100644
--- a/exodus/cbind/src/expconn.c
+++ b/exodus/cbind/src/ex_put_conn.c
@@ -39,11 +39,15 @@
/*! write out the connectivity array */
#define EX_WRITE_CONN(TNAME,VARCONN,VARCONNVAL) \
- status = nc_put_var_int(exoid, VARCONN, VARCONNVAL); \
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) { \
+ status = nc_put_var_longlong(exoid, VARCONN, VARCONNVAL); \
+ } else { \
+ status = nc_put_var_int(exoid, VARCONN, VARCONNVAL); \
+ } \
if (status != NC_NOERR) { \
exerrval = status; \
sprintf(errmsg, \
- "Error: failed to write connectivity array for %s block %d in file id %d", \
+ "Error: failed to write connectivity array for %s block %"PRId64" in file id %d", \
TNAME,blk_id,exoid); \
ex_err("ex_put_conn",errmsg, exerrval); \
return(EX_FATAL); \
@@ -61,10 +65,10 @@
int ex_put_conn (int exoid,
ex_entity_type blk_type,
- int blk_id,
- const int *node_conn,
- const int *elem_edge_conn,
- const int *elem_face_conn)
+ ex_entity_id blk_id,
+ const void_int *node_conn,
+ const void_int *elem_edge_conn,
+ const void_int *elem_face_conn)
{
int connid=-1, blk_id_ndx, status;
char errmsg[MAX_ERR_LENGTH];
@@ -72,20 +76,17 @@ int ex_put_conn (int exoid,
exerrval = 0; /* clear error code */
blk_id_ndx = ex_id_lkup(exoid,blk_type,blk_id);
- if (exerrval != 0)
- {
- if (exerrval == EX_NULLENTITY)
- {
+ if (exerrval != 0) {
+ if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: connectivity array not allowed for NULL %s block %d in file id %d",
+ "Warning: connectivity array not allowed for NULL %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
ex_err("ex_put_conn",errmsg,EX_MSG);
return (EX_WARN);
}
- else
- {
+ else {
sprintf(errmsg,
- "Error: failed to locate %s block id %d in id array in file id %d",
+ "Error: failed to locate %s id %"PRId64" in id array in file id %d",
ex_name_of_object(blk_type),blk_id, exoid);
ex_err("ex_put_conn",errmsg,exerrval);
return (EX_FATAL);
@@ -115,7 +116,7 @@ int ex_put_conn (int exoid,
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate connectivity array for %s block %d in file id %d",
+ "Error: failed to locate connectivity array for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
ex_err("ex_put_conn",errmsg, exerrval);
return(EX_FATAL);
@@ -138,7 +139,7 @@ int ex_put_conn (int exoid,
exerrval = status;
sprintf(errmsg,
"Error: edge connectivity specified but failed to "
- "locate number of edges/element in block %d in file id %d",
+ "locate number of edges/element in block %"PRId64" in file id %d",
blk_id,exoid);
ex_err("ex_put_conn",errmsg,exerrval);
return(EX_FATAL);
@@ -150,7 +151,7 @@ int ex_put_conn (int exoid,
exerrval = status;
sprintf(errmsg,
"Error: face connectivity specified but failed to "
- "locate number of faces/element in block %d in file id %d",
+ "locate number of faces/element in block %"PRId64" in file id %d",
blk_id,exoid);
ex_err("ex_put_conn",errmsg,exerrval);
return(EX_FATAL);
@@ -162,7 +163,7 @@ int ex_put_conn (int exoid,
{
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of edges/elem in block %d in file id %d",
+ "Error: failed to get number of edges/elem in block %"PRId64" in file id %d",
blk_id,exoid);
ex_err("ex_put_conn",errmsg,exerrval);
return(EX_FATAL);
@@ -174,7 +175,7 @@ int ex_put_conn (int exoid,
{
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of faces/elem in block %d in file id %d",
+ "Error: failed to get number of faces/elem in block %"PRId64" in file id %d",
blk_id,exoid);
ex_err("ex_put_conn",errmsg,exerrval);
return(EX_FATAL);
@@ -211,7 +212,7 @@ int ex_put_conn (int exoid,
exerrval = status;
sprintf(errmsg,
"Error: failed to locate connectivity array for "
- "element edge block %d in file id %d",
+ "element edge block %"PRId64" in file id %d",
blk_id,exoid);
ex_err("ex_put_conn",errmsg, exerrval);
return(EX_FATAL);
@@ -226,7 +227,7 @@ int ex_put_conn (int exoid,
exerrval = status;
sprintf(errmsg,
"Error: failed to locate connectivity array for "
- "element face block %d in file id %d",
+ "element face block %"PRId64" in file id %d",
blk_id,exoid);
ex_err("ex_put_conn",errmsg, exerrval);
return(EX_FATAL);
diff --git a/exodus/cbind/src/expcor.c b/exodus/cbind/src/ex_put_coord.c
similarity index 100%
rename from exodus/cbind/src/expcor.c
rename to exodus/cbind/src/ex_put_coord.c
diff --git a/exodus/cbind/src/expcon.c b/exodus/cbind/src/ex_put_coord_names.c
similarity index 100%
rename from exodus/cbind/src/expcon.c
rename to exodus/cbind/src/ex_put_coord_names.c
diff --git a/exodus/cbind/src/expfrm.c b/exodus/cbind/src/ex_put_coordinate_frames.c
similarity index 87%
rename from exodus/cbind/src/expfrm.c
rename to exodus/cbind/src/ex_put_coordinate_frames.c
index c02fc8c..4073f7a 100644
--- a/exodus/cbind/src/expfrm.c
+++ b/exodus/cbind/src/ex_put_coordinate_frames.c
@@ -58,8 +58,11 @@
/* -------------------- local defines --------------------------- */
#define PROCNAME "ex_put_coordinate_frames"
/* -------------------- end of local defines -------------------- */
-int ex_put_coordinate_frames( int exoid, int nframes, const int cf_ids[],
- void* pt_coordinates, const char* tags)
+int ex_put_coordinate_frames( int exoid,
+ int nframes,
+ const void_int *cf_ids,
+ void* pt_coordinates,
+ const char* tags)
{
int status;
int dim, dim9; /* dimension id for nframes, nframes*9 */
@@ -68,7 +71,8 @@ int ex_put_coordinate_frames( int exoid, int nframes, const int cf_ids[],
int varids; /* variable id for the frame ids */
int vartags; /* variable id for the frame tags */
int i; /* general indices */
-
+ int int_type;
+
if ( exoid < 0 )
return exoid;
@@ -102,10 +106,15 @@ int ex_put_coordinate_frames( int exoid, int nframes, const int cf_ids[],
goto error_ret;
}
+ int_type = NC_INT;
+ if (ex_int64_status(exoid) & EX_IDS_INT64_DB) {
+ int_type = NC_INT64;
+ }
+
/* define the variables. coordinates, tags and ids */
if (nc_def_var (exoid, VAR_FRAME_COORDS,
nc_flt_code(exoid), 1, &dim9, &varcoords) != NC_NOERR ||
- (nc_def_var(exoid, VAR_FRAME_IDS,NC_INT, 1, &dim, &varids) != NC_NOERR) ||
+ (nc_def_var(exoid, VAR_FRAME_IDS,int_type, 1, &dim, &varids) != NC_NOERR) ||
(nc_def_var(exoid, VAR_FRAME_TAGS,NC_CHAR,1,&dim, &vartags) != NC_NOERR) ) {
exerrval = EX_FATAL;
sprintf(errmsg,
@@ -137,8 +146,21 @@ int ex_put_coordinate_frames( int exoid, int nframes, const int cf_ids[],
/* could also check vectors. Leave this up to the application */
/* put the variables into the file */
- if ( nc_put_var_text(exoid, vartags, tags) != NC_NOERR ||
- nc_put_var_int(exoid, varids, cf_ids) != NC_NOERR) {
+ if (nc_put_var_text(exoid, vartags, tags) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed writing frame data in file id %d",exoid);
+ ex_err(PROCNAME,errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ status = nc_put_var_longlong(exoid, varids, cf_ids);
+ } else {
+ status = nc_put_var_int(exoid, varids, cf_ids);
+ }
+
+ if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed writing frame data in file id %d",exoid);
diff --git a/nemesis/ne_pebig.c b/exodus/cbind/src/ex_put_eb_info_global.c
similarity index 79%
rename from nemesis/ne_pebig.c
rename to exodus/cbind/src/ex_put_eb_info_global.c
index 6b0d4bf..c22daf2 100644
--- a/nemesis/ne_pebig.c
+++ b/exodus/cbind/src/ex_put_eb_info_global.c
@@ -36,13 +36,13 @@
/*****************************************************************************/
/*****************************************************************************/
/* Function(s) contained in this file:
- * ne_put_eb_info_global()
+ * ex_put_eb_info_global()
*****************************************************************************
* This function outputs the global element block IDs of all the element
* blocks associated with a geometry.
*****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* el_blk_ids - Pointer to vector of global element block IDs.
* el_blk_cnts - Pointer to vector of global element block counts.
*/
@@ -56,60 +56,65 @@
#include <exodusII.h>
#include <exodusII_int.h>
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-int ne_put_eb_info_global(int neid,
- int *el_blk_ids,
- int *el_blk_cnts
+int ex_put_eb_info_global(int exoid,
+ void_int *el_blk_ids,
+ void_int *el_blk_cnts
)
{
- char *func_name="ne_put_eb_info_global";
+ const char *func_name="ex_put_eb_info_global";
int varid, status;
char errmsg[MAX_ERR_LENGTH];
/* Find the variable ID for the element block IDs */
- if ((status = nc_inq_varid(neid, VAR_ELBLK_IDS_GLOBAL, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_ELBLK_IDS_GLOBAL, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_ELBLK_IDS_GLOBAL, neid);
+ VAR_ELBLK_IDS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Output the global element block IDs */
- status = nc_put_var_int(neid, varid, el_blk_ids);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ status = nc_put_var_longlong(exoid, varid, el_blk_ids);
+ } else {
+ status = nc_put_var_int(exoid, varid, el_blk_ids);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output variable \"%s\" in file ID %d",
- VAR_ELBLK_IDS_GLOBAL, neid);
+ VAR_ELBLK_IDS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Find the variable ID for the element block counts */
- if ((status = nc_inq_varid(neid, VAR_ELBLK_CNT_GLOBAL, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_ELBLK_CNT_GLOBAL, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_ELBLK_CNT_GLOBAL, neid);
+ VAR_ELBLK_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Output the global element block counts */
- status = nc_put_var_int(neid, varid, el_blk_cnts);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_put_var_longlong(exoid, varid, el_blk_cnts);
+ } else {
+ status = nc_put_var_int(exoid, varid, el_blk_cnts);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output variable \"%s\" in file ID %d",
- VAR_ELBLK_CNT_GLOBAL, neid);
+ VAR_ELBLK_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
diff --git a/exodus/cbind/src/expeat.c b/exodus/cbind/src/ex_put_elem_attr.c
similarity index 98%
rename from exodus/cbind/src/expeat.c
rename to exodus/cbind/src/ex_put_elem_attr.c
index 19b8c0b..1c3a109 100644
--- a/exodus/cbind/src/expeat.c
+++ b/exodus/cbind/src/ex_put_elem_attr.c
@@ -70,7 +70,7 @@ writing the attributes array for an element block.
*/
int ex_put_elem_attr (int exoid,
- int elem_blk_id,
+ ex_entity_id elem_blk_id,
const void *attrib)
{
return ex_put_attr( exoid, EX_ELEM_BLOCK, elem_blk_id, attrib );
diff --git a/exodus/cbind/src/expean.c b/exodus/cbind/src/ex_put_elem_attr_names.c
similarity index 98%
rename from exodus/cbind/src/expean.c
rename to exodus/cbind/src/ex_put_elem_attr_names.c
index ebbecce..d6facd8 100644
--- a/exodus/cbind/src/expean.c
+++ b/exodus/cbind/src/ex_put_elem_attr_names.c
@@ -62,7 +62,7 @@
* \deprecated Use ex_put_attr_names()(exoid, EX_ELEM_BLOCK, elem_blk_id, names)
*/
int ex_put_elem_attr_names(int exoid,
- int elem_blk_id,
+ ex_entity_id elem_blk_id,
char* names[])
{
return ex_put_attr_names( exoid, EX_ELEM_BLOCK, elem_blk_id, names );
diff --git a/exodus/cbind/src/expelb.c b/exodus/cbind/src/ex_put_elem_block.c
similarity index 96%
rename from exodus/cbind/src/expelb.c
rename to exodus/cbind/src/ex_put_elem_block.c
index ad82e56..4e05f4b 100644
--- a/exodus/cbind/src/expelb.c
+++ b/exodus/cbind/src/ex_put_elem_block.c
@@ -125,11 +125,11 @@ error = ex_put_attr (exoid, EX_ELEM_BLOCK, id, attrib);
*/
int ex_put_elem_block (int exoid,
- int elem_blk_id,
+ ex_entity_id elem_blk_id,
const char *elem_type,
- int num_elem_this_blk,
- int num_nodes_per_elem,
- int num_attr_per_elem)
+ int64_t num_elem_this_blk,
+ int64_t num_nodes_per_elem,
+ int64_t num_attr_per_elem)
{
return ex_put_block( exoid, EX_ELEM_BLOCK, elem_blk_id,
elem_type, num_elem_this_blk, num_nodes_per_elem,
diff --git a/nemesis/ne_pelcm.c b/exodus/cbind/src/ex_put_elem_cmap.c
similarity index 74%
rename from nemesis/ne_pelcm.c
rename to exodus/cbind/src/ex_put_elem_cmap.c
index 8d5bc80..231b534 100644
--- a/nemesis/ne_pelcm.c
+++ b/exodus/cbind/src/ex_put_elem_cmap.c
@@ -36,12 +36,12 @@
/****************************************************************************/
/****************************************************************************/
/* Function(s) contained in this file:
- * ne_put_elem_cmap()
+ * ex_put_elem_cmap()
****************************************************************************
* The function outputs an elemental communication map.
****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* map_id - The ID of the elementa communication map to write.
* elem_ids - Pointer to vector of element IDs to output.
* side_ids - Pointer to vector of side IDs for each element
@@ -61,18 +61,15 @@
#include <exodusII.h>
#include <exodusII_int.h>
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-int ne_put_elem_cmap(int neid,
- int map_id,
- int *elem_ids,
- int *side_ids,
- int *proc_ids,
+int ex_put_elem_cmap(int exoid,
+ ex_entity_id map_id,
+ void_int *elem_ids,
+ void_int *side_ids,
+ void_int *proc_ids,
int processor
)
{
- char *func_name="ne_put_elem_cmap";
+ const char *func_name="ex_put_elem_cmap";
int map_idx, varid, dimid, status;
size_t start[1], count[1], ret_val;
@@ -85,20 +82,20 @@ int ne_put_elem_cmap(int neid,
exerrval = 0; /* clear error code */
/* get the index for the comm map information variables */
- if (ne_get_idx(neid, VAR_E_COMM_INFO_IDX, varidx, processor) == -1) {
+ if (ex_get_idx(exoid, VAR_E_COMM_INFO_IDX, varidx, processor) == -1) {
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_E_COMM_INFO_IDX, neid);
+ VAR_E_COMM_INFO_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the index for this map_id */
- if ((map_idx=ne_id_lkup(neid, VAR_E_COMM_IDS, varidx, map_id)) == -1) {
+ if ((map_idx=ne_id_lkup(exoid, VAR_E_COMM_IDS, varidx, map_id)) == -1) {
sprintf(errmsg,
"Error: failed to find index for variable \"%s\" in file ID %d",
- VAR_E_COMM_IDS, neid);
+ VAR_E_COMM_IDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -107,21 +104,21 @@ int ne_put_elem_cmap(int neid,
* Find out if this is a NULL comm map by checking it's entry in
* the status vector.
*/
- if ((status = nc_inq_varid(neid, VAR_E_COMM_STAT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_E_COMM_STAT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_E_COMM_STAT, neid);
+ VAR_E_COMM_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
start[0] = map_idx;
- if ((status = nc_get_var1_int(neid, varid, start, &value)) != NC_NOERR) {
+ if ((status = nc_get_var1_int(exoid, varid, start, &value)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_E_COMM_STAT, neid);
+ VAR_E_COMM_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -129,11 +126,11 @@ int ne_put_elem_cmap(int neid,
if (value == 0) return(EX_NOERR); /* NULL set */
/* now I need to get the comm map data index */
- if (ne_get_idx(neid, VAR_E_COMM_DATA_IDX, varidx, map_idx) == -1) {
+ if (ex_get_idx(exoid, VAR_E_COMM_DATA_IDX, varidx, map_idx) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_E_COMM_DATA_IDX, neid);
+ VAR_E_COMM_DATA_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -142,20 +139,20 @@ int ne_put_elem_cmap(int neid,
/* check if I need to get the dimension of the cmap data */
if (varidx[1] == -1) {
/* Get the size of the comm maps */
- if ((status = nc_inq_dimid(neid, DIM_ECNT_CMAP, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_ECNT_CMAP, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get dimension ID for \"%s\" in file ID %d",
- DIM_ECNT_CMAP, neid);
+ DIM_ECNT_CMAP, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid, &ret_val)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &ret_val)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get length of dimension \"%s\" in file ID %d",
- DIM_ECNT_CMAP, neid);
+ DIM_ECNT_CMAP, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -167,60 +164,72 @@ int ne_put_elem_cmap(int neid,
count[0] = varidx[1] - varidx[0];
/* Output the element IDs for this comm map */
- if ((status = nc_inq_varid(neid, VAR_E_COMM_EIDS, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_E_COMM_EIDS, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_E_COMM_EIDS, neid);
+ VAR_E_COMM_EIDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- status = nc_put_vara_int(neid, varid, start, count, elem_ids);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_put_vara_longlong(exoid, varid, start, count, elem_ids);
+ } else {
+ status = nc_put_vara_int(exoid, varid, start, count, elem_ids);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output vector \"%s\" in file ID %d",
- VAR_E_COMM_EIDS, neid);
+ VAR_E_COMM_EIDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Output the processor IDs for this map */
- if ((status = nc_inq_varid(neid, VAR_E_COMM_PROC, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_E_COMM_PROC, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_E_COMM_PROC, neid);
+ VAR_E_COMM_PROC, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- status = nc_put_vara_int(neid, varid, start, count, proc_ids);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_put_vara_longlong(exoid, varid, start, count, proc_ids);
+ } else {
+ status = nc_put_vara_int(exoid, varid, start, count, proc_ids);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output variable \"%s\" in file ID %d",
- VAR_E_COMM_PROC, neid);
+ VAR_E_COMM_PROC, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_varid(neid, VAR_E_COMM_SIDS, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_E_COMM_SIDS, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_E_COMM_SIDS, neid);
+ VAR_E_COMM_SIDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- status = nc_put_vara_int(neid, varid, start, count, side_ids);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_put_vara_longlong(exoid, varid, start, count, side_ids);
+ } else {
+ status = nc_put_vara_int(exoid, varid, start, count, side_ids);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to ouput variable \"%s\" in file ID %d",
- VAR_E_COMM_SIDS, neid);
+ VAR_E_COMM_SIDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
diff --git a/exodus/cbind/src/expelc.c b/exodus/cbind/src/ex_put_elem_conn.c
similarity index 96%
rename from exodus/cbind/src/expelc.c
rename to exodus/cbind/src/ex_put_elem_conn.c
index 5aa336c..6d10617 100644
--- a/exodus/cbind/src/expelc.c
+++ b/exodus/cbind/src/ex_put_elem_conn.c
@@ -63,8 +63,8 @@ writing the connectivity array for an element block.
*/
int ex_put_elem_conn (int exoid,
- int elem_blk_id,
- const int *connect)
+ ex_entity_id elem_blk_id,
+ const void_int *connect)
{
return ex_put_conn(exoid, EX_ELEM_BLOCK, elem_blk_id, connect, 0, 0);
}
diff --git a/exodus/cbind/src/expem.c b/exodus/cbind/src/ex_put_elem_map.c
similarity index 96%
copy from exodus/cbind/src/expem.c
copy to exodus/cbind/src/ex_put_elem_map.c
index 34a660a..f6600e2 100644
--- a/exodus/cbind/src/expem.c
+++ b/exodus/cbind/src/ex_put_elem_map.c
@@ -62,8 +62,8 @@
*/
int ex_put_elem_map (int exoid,
- int map_id,
- const int *elem_map)
+ ex_entity_id map_id,
+ const void_int *elem_map)
{
return ex_put_num_map( exoid, EX_ELEM_MAP, map_id, elem_map );
}
diff --git a/exodus/cbind/src/expenm.c b/exodus/cbind/src/ex_put_elem_num_map.c
similarity index 98%
rename from exodus/cbind/src/expenm.c
rename to exodus/cbind/src/ex_put_elem_num_map.c
index a12bc1e..66f4a33 100644
--- a/exodus/cbind/src/expenm.c
+++ b/exodus/cbind/src/ex_put_elem_num_map.c
@@ -75,7 +75,7 @@ error = ex_put_id_map(exoid, EX_ELEM_MAP, elem_map);
*/
int ex_put_elem_num_map (int exoid,
- const int *elem_map)
+ const void_int *elem_map)
{
return ex_put_id_map(exoid, EX_ELEM_MAP, elem_map);
}
diff --git a/exodus/cbind/src/expev.c b/exodus/cbind/src/ex_put_elem_var.c
similarity index 98%
rename from exodus/cbind/src/expev.c
rename to exodus/cbind/src/ex_put_elem_var.c
index 60aae32..ba47b05 100644
--- a/exodus/cbind/src/expev.c
+++ b/exodus/cbind/src/ex_put_elem_var.c
@@ -135,8 +135,8 @@ for (k=1; k <= num_ele_vars; k++) {
int ex_put_elem_var (int exoid,
int time_step,
int elem_var_index,
- int elem_blk_id,
- int num_elem_this_blk,
+ ex_entity_id elem_blk_id,
+ int64_t num_elem_this_blk,
const void *elem_var_vals)
{
return ex_put_var(exoid, time_step, EX_ELEM_BLOCK, elem_var_index,
diff --git a/nemesis/ne_pevs.c b/exodus/cbind/src/ex_put_elem_var_slab.c
similarity index 65%
rename from nemesis/ne_pevs.c
rename to exodus/cbind/src/ex_put_elem_var_slab.c
index b16ec97..c299111 100644
--- a/nemesis/ne_pevs.c
+++ b/exodus/cbind/src/ex_put_elem_var_slab.c
@@ -37,13 +37,13 @@
/*****************************************************************************/
/* Function(s) contained in this file:
*
- * ne_put_elem_var_slab()
+ * ex_put_elem_var_slab()
*
*****************************************************************************
*
* Variable Index:
*
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* time_step - The time step to write this data to.
* elem_var_index - The index of this elemental variable.
* elem_blk_id - The ID of the element block being written to.
@@ -58,8 +58,6 @@
#include "exodusII.h"
#include "exodusII_int.h"
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
#include <stdlib.h>
/*
@@ -68,12 +66,12 @@
* first time step and element variable index are 1
*/
-int ne_put_elem_var_slab (int neid,
+int ex_put_elem_var_slab (int exoid,
int time_step,
int elem_var_index,
- int elem_blk_id,
- int start_pos,
- int num_vals,
+ ex_entity_id elem_blk_id,
+ int64_t start_pos,
+ int64_t num_vals,
void *elem_var_vals)
{
int status;
@@ -85,64 +83,64 @@ int ne_put_elem_var_slab (int neid,
exerrval = 0; /* clear error code */
/* Determine index of elem_blk_id in VAR_ID_EL_BLK array */
- if ((elem_blk_id_ndx = ex_id_lkup(neid, EX_ELEM_BLOCK, elem_blk_id)) < 0) {
+ if ((elem_blk_id_ndx = ex_id_lkup(exoid, EX_ELEM_BLOCK, elem_blk_id)) < 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no variables allowed for NULL block %d in file id %d",
- elem_blk_id, neid);
- ex_err("ne_put_elem_var_slab", errmsg, EX_MSG);
+ "Warning: no variables allowed for NULL block %"PRId64" in file id %d",
+ elem_blk_id, exoid);
+ ex_err("ex_put_elem_var_slab", errmsg, EX_MSG);
return (EX_WARN);
} else {
sprintf(errmsg,
- "Error: failed to locate element block id %d in %s array in file id %d",
- elem_blk_id, VAR_ID_EL_BLK, neid);
- ex_err("ne_put_elem_var_slab", errmsg, exerrval);
+ "Error: failed to locate element block id %"PRId64" in %s array in file id %d",
+ elem_blk_id, VAR_ID_EL_BLK, exoid);
+ ex_err("ex_put_elem_var_slab", errmsg, exerrval);
return (EX_FATAL);
}
}
- if ((status = nc_inq_varid (neid,
+ if ((status = nc_inq_varid (exoid,
VAR_ELEM_VAR(elem_var_index, elem_blk_id_ndx), &varid)) != NC_NOERR) {
if (status == NC_ENOTVAR) { /* variable doesn't exist, create it! */
/* inquire previously defined dimensions */
/* check for the existance of an element variable truth table */
- if ((status = nc_inq_varid (neid, VAR_ELEM_TAB, &varid)) == NC_NOERR) {
+ if ((status = nc_inq_varid (exoid, VAR_ELEM_TAB, &varid)) == NC_NOERR) {
/* find out number of element blocks and element variables */
- if ((status = nc_inq_dimid (neid, DIM_NUM_EL_BLK, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_EL_BLK, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to locate number of element blocks in file id %d",
- neid);
- ex_err("ne_put_elem_var_slab", errmsg, exerrval);
+ exoid);
+ ex_err("ex_put_elem_var_slab", errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid, &num_elem_blk)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &num_elem_blk)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get number of element blocks in file id %d",
- neid);
- ex_err("ne_put_elem_var_slab", errmsg, exerrval);
+ exoid);
+ ex_err("ex_put_elem_var_slab", errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimid (neid, DIM_NUM_ELE_VAR, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_ELE_VAR, &dimid)) != NC_NOERR) {
exerrval = EX_BADPARAM;
sprintf(errmsg,
"Error: no element variables stored in file id %d",
- neid);
- ex_err("ne_put_elem_var_slab", errmsg, exerrval);
+ exoid);
+ ex_err("ex_put_elem_var_slab", errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid, &num_elem_var)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &num_elem_var)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get number of element variables in file id %d",
- neid);
- ex_err("ne_put_elem_var_slab", errmsg, exerrval);
+ exoid);
+ ex_err("ex_put_elem_var_slab", errmsg, exerrval);
return (EX_FATAL);
}
@@ -151,17 +149,17 @@ int ne_put_elem_var_slab (int neid,
exerrval = EX_MEMFAIL;
sprintf(errmsg,
"Error: failed to allocate memory for element variable truth table in file id %d",
- neid);
- ex_err("ne_put_elem_var_slab", errmsg, exerrval);
+ exoid);
+ ex_err("ex_put_elem_var_slab", errmsg, exerrval);
return (EX_FATAL);
}
/* read in the element variable truth table */
- if ((status = nc_get_var_int(neid, varid, elem_var_tab)) != NC_NOERR) {
+ if ((status = nc_get_var_int(exoid, varid, elem_var_tab)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get truth table from file id %d", neid);
- ex_err("ne_put_elem_var_slab", errmsg, exerrval);
+ "Error: failed to get truth table from file id %d", exoid);
+ ex_err("ex_put_elem_var_slab", errmsg, exerrval);
return (EX_FATAL);
}
@@ -169,45 +167,45 @@ int ne_put_elem_var_slab (int neid,
free(elem_var_tab);
exerrval = EX_BADPARAM;
sprintf(errmsg,
- "Error: Invalid element variable %d, block %d in file id %d",
- elem_var_index, elem_blk_id, neid);
- ex_err("ne_put_elem_var_slab", errmsg, exerrval);
+ "Error: Invalid element variable %d, block %"PRId64" in file id %d",
+ elem_var_index, elem_blk_id, exoid);
+ ex_err("ex_put_elem_var_slab", errmsg, exerrval);
return (EX_FATAL);
}
free(elem_var_tab);
}
- if ((status = nc_inq_dimid (neid, DIM_TIME, &time_dim)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_TIME, &time_dim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate time dimension in file id %d", neid);
- ex_err("ne_put_elem_var_slab", errmsg, exerrval);
+ "Error: failed to locate time dimension in file id %d", exoid);
+ ex_err("ex_put_elem_var_slab", errmsg, exerrval);
goto error_ret; /* exit define mode and return */
}
- if ((status = nc_inq_dimid(neid, DIM_NUM_EL_IN_BLK(elem_blk_id_ndx), &numelbdim)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_EL_IN_BLK(elem_blk_id_ndx), &numelbdim)) != NC_NOERR) {
if (status == NC_EBADDIM) {
exerrval = status;
sprintf(errmsg,
- "Error: number of elements in element block %d not defined in file id %d",
- elem_blk_id, neid);
- ex_err("ne_put_elem_var_slab", errmsg, exerrval);
+ "Error: number of elements in element block %"PRId64" not defined in file id %d",
+ elem_blk_id, exoid);
+ ex_err("ex_put_elem_var_slab", errmsg, exerrval);
} else {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of elements in element block %d in file id %d",
- elem_blk_id, neid);
- ex_err("ne_put_elem_var_slab", errmsg, exerrval);
+ "Error: failed to locate number of elements in element block %"PRId64" in file id %d",
+ elem_blk_id, exoid);
+ ex_err("ex_put_elem_var_slab", errmsg, exerrval);
}
goto error_ret;
}
/* variable doesn't exist so put file into define mode */
- if ((status = nc_redef (neid)) != NC_NOERR) {
+ if ((status = nc_redef (exoid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to put file id %d into define mode", neid);
- ex_err("ne_put_elem_var_slab", errmsg, exerrval);
+ "Error: failed to put file id %d into define mode", exoid);
+ ex_err("ex_put_elem_var_slab", errmsg, exerrval);
return (EX_FATAL);
}
@@ -215,32 +213,33 @@ int ne_put_elem_var_slab (int neid,
/* define netCDF variable to store element variable values */
dims[0] = time_dim;
dims[1] = numelbdim;
- if ((status = nc_def_var(neid, VAR_ELEM_VAR(elem_var_index, elem_blk_id_ndx),
- nc_flt_code(neid), 2, dims, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_ELEM_VAR(elem_var_index, elem_blk_id_ndx),
+ nc_flt_code(exoid), 2, dims, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define element variable %d in file id %d",
- elem_var_index, neid);
- ex_err("ne_put_elem_var_slab", errmsg, exerrval);
+ elem_var_index, exoid);
+ ex_err("ex_put_elem_var_slab", errmsg, exerrval);
goto error_ret;
}
+ ex_compress_variable(exoid, varid, 2);
/* leave define mode */
- if ((status = nc_enddef(neid)) != NC_NOERR) {
+ if ((status = nc_enddef(exoid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to complete element variable %s definition to file id %d",
- VAR_ELEM_VAR(elem_var_index, elem_blk_id_ndx), neid);
- ex_err("ne_put_elem_var_slab", errmsg, exerrval);
+ VAR_ELEM_VAR(elem_var_index, elem_blk_id_ndx), exoid);
+ ex_err("ex_put_elem_var_slab", errmsg, exerrval);
return (EX_FATAL);
}
} else {
exerrval = status;
sprintf(errmsg,
"Error: failed to locate element variable %s in file id %d",
- VAR_ELEM_VAR(elem_var_index, elem_blk_id_ndx),neid);
- ex_err("ne_put_elem_var_slab", errmsg, exerrval);
+ VAR_ELEM_VAR(elem_var_index, elem_blk_id_ndx),exoid);
+ ex_err("ex_put_elem_var_slab", errmsg, exerrval);
return (EX_FATAL);
}
}
@@ -252,18 +251,18 @@ int ne_put_elem_var_slab (int neid,
count[0] = 1;
count[1] = num_vals;
- if (ex_comp_ws(neid) == 4) {
- status = nc_put_vara_float(neid, varid, start, count, elem_var_vals);
+ if (ex_comp_ws(exoid) == 4) {
+ status = nc_put_vara_float(exoid, varid, start, count, elem_var_vals);
} else {
- status = nc_put_vara_double(neid, varid, start, count, elem_var_vals);
+ status = nc_put_vara_double(exoid, varid, start, count, elem_var_vals);
}
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to store element variable %d in file id %d",
- elem_var_index, neid);
- ex_err("ne_put_elem_var_slab", errmsg, exerrval);
+ elem_var_index, exoid);
+ ex_err("ex_put_elem_var_slab", errmsg, exerrval);
return (EX_FATAL);
}
@@ -271,11 +270,11 @@ int ne_put_elem_var_slab (int neid,
/* Fatal error: exit definition mode and return */
error_ret:
- if (nc_enddef (neid) != NC_NOERR) /* exit define mode */
+ if (nc_enddef (exoid) != NC_NOERR) /* exit define mode */
{
sprintf(errmsg,
- "Error: failed to complete definition for file id %d", neid);
- ex_err("ne_put_elem_var_slab", errmsg, exerrval);
+ "Error: failed to complete definition for file id %d", exoid);
+ ex_err("ex_put_elem_var_slab", errmsg, exerrval);
}
return (EX_FATAL);
}
diff --git a/exodus/cbind/src/expvtt.c b/exodus/cbind/src/ex_put_elem_var_tab.c
similarity index 100%
rename from exodus/cbind/src/expvtt.c
rename to exodus/cbind/src/ex_put_elem_var_tab.c
diff --git a/exodus/cbind/src/expecpp.c b/exodus/cbind/src/ex_put_entity_count_per_polyhedra.c
similarity index 94%
rename from exodus/cbind/src/expecpp.c
rename to exodus/cbind/src/ex_put_entity_count_per_polyhedra.c
index 4a627b9..7347119 100644
--- a/exodus/cbind/src/expecpp.c
+++ b/exodus/cbind/src/ex_put_entity_count_per_polyhedra.c
@@ -54,7 +54,7 @@
int ex_put_entity_count_per_polyhedra (int exoid,
ex_entity_type blk_type,
- int blk_id,
+ ex_entity_id blk_id,
const int *entity_counts)
{
int npeid=-1, blk_id_ndx, status;
@@ -68,7 +68,7 @@ int ex_put_entity_count_per_polyhedra (int exoid,
if (exerrval == EX_NULLENTITY)
{
sprintf(errmsg,
- "Warning: entity_counts array not allowed for NULL %s block %d in file id %d",
+ "Warning: entity_counts array not allowed for NULL %s block %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
ex_err("ex_put_entity_count_per_polyhedra",errmsg,EX_MSG);
return (EX_WARN);
@@ -76,7 +76,7 @@ int ex_put_entity_count_per_polyhedra (int exoid,
else
{
sprintf(errmsg,
- "Error: failed to locate %s block id %d in id array in file id %d",
+ "Error: failed to locate %s block id %"PRId64" in id array in file id %d",
ex_name_of_object(blk_type),blk_id, exoid);
ex_err("ex_put_entity_count_per_polyhedra",errmsg,exerrval);
return (EX_FATAL);
@@ -103,7 +103,7 @@ int ex_put_entity_count_per_polyhedra (int exoid,
{
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate entity_counts array for %s block %d in file id %d",
+ "Error: failed to locate entity_counts array for %s block %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
ex_err("ex_put_entity_count_per_polyhedra",errmsg, exerrval);
return(EX_FATAL);
@@ -113,7 +113,7 @@ int ex_put_entity_count_per_polyhedra (int exoid,
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to write node counts array for %s block %d in file id %d",
+ "Error: failed to write node counts array for %s block %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
ex_err("ex_put_entity_count_per_polyhedra",errmsg, exerrval);
return(EX_FATAL);
diff --git a/exodus/cbind/src/expgv.c b/exodus/cbind/src/ex_put_glob_vars.c
similarity index 100%
rename from exodus/cbind/src/expgv.c
rename to exodus/cbind/src/ex_put_glob_vars.c
diff --git a/exodus/cbind/src/expidm.c b/exodus/cbind/src/ex_put_id_map.c
similarity index 91%
rename from exodus/cbind/src/expidm.c
rename to exodus/cbind/src/ex_put_id_map.c
index 74c5112..8bdd20d 100644
--- a/exodus/cbind/src/expidm.c
+++ b/exodus/cbind/src/ex_put_id_map.c
@@ -64,9 +64,10 @@
int ex_put_id_map (int exoid,
ex_entity_type map_type,
- const int *map)
+ const void_int *map)
{
int dimid, mapid, status, dims[1];
+ int map_int_type;
char errmsg[MAX_ERR_LENGTH];
const char* tname;
const char* dnumentries;
@@ -124,7 +125,13 @@ int ex_put_id_map (int exoid,
/* create a variable array in which to store the id map */
dims[0] = dimid;
- if ((status = nc_def_var(exoid, vmap, NC_INT, 1, dims, &mapid)) != NC_NOERR) {
+ /* Check type to be used for maps... */
+ map_int_type = NC_INT;
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_DB) {
+ map_int_type = NC_INT64;
+ }
+
+ if ((status = nc_def_var(exoid, vmap, map_int_type, 1, dims, &mapid)) != NC_NOERR) {
if (status == NC_ENAMEINUSE) {
exerrval = status;
sprintf(errmsg,
@@ -140,6 +147,7 @@ int ex_put_id_map (int exoid,
}
goto error_ret; /* exit define mode and return */
}
+ ex_compress_variable(exoid, mapid, 1);
/* leave define mode */
@@ -154,7 +162,11 @@ int ex_put_id_map (int exoid,
}
/* write out the entity numbering map */
- status = nc_put_var_int(exoid, mapid, map);
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_put_var_longlong(exoid, mapid, map);
+ } else {
+ status = nc_put_var_int(exoid, mapid, map);
+ }
if (status!= NC_NOERR) {
exerrval = status;
diff --git a/exodus/cbind/src/expinf.c b/exodus/cbind/src/ex_put_info.c
similarity index 53%
rename from exodus/cbind/src/expinf.c
rename to exodus/cbind/src/ex_put_info.c
index e0bfcc7..66101ca 100644
--- a/exodus/cbind/src/expinf.c
+++ b/exodus/cbind/src/ex_put_info.c
@@ -50,7 +50,11 @@ include:
\param[in] exoid exodus file ID returned from a previous call to ex_create() or ex_open().
\param[in] num_info The number of information records.
-\param[in] info Array containing the information records.
+\param[in] info Array containing the information records. To only
+ define the number of info records instead of
+ defining and outputting, pass NULL for
+ info argument.
+
The following code will write out three information records
to an open exodus file -
@@ -70,6 +74,29 @@ info[2] = "This is the third information record.";
error = ex_put_info(exoid, num_info, info);
\endcode
+The following code will first tell the database that there are three
+information records, and then later actually output those records.
+
+\code
+#include "exodusII.h"
+int error, exoid, num_info;
+char *info[3];
+
+\comment{Define the number of information records that will be written
+later.}
+num_info = 3;
+
+error = ex_put_info(exoid, num_info, NULL);
+
+
+\comment{Now, actually write the information records}
+info[0] = "This is the first information record.";
+info[1] = "This is the second information record.";
+info[2] = "This is the third information record.";
+error = ex_put_info(exoid, num_info, info);
+
+\endcode
+
*/
int ex_put_info (int exoid,
@@ -86,85 +113,105 @@ int ex_put_info (int exoid,
/* only do this if there are records */
if (num_info > 0) {
- /* inquire previously defined dimensions */
- if ((status = nc_inq_dimid(exoid, DIM_LIN, &lindim)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get line string length in file id %d", exoid);
- ex_err("ex_put_info",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* put file into define mode */
- if ((status = nc_redef (exoid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed put file id %d into define mode", exoid);
- ex_err("ex_put_info",errmsg,exerrval);
- return (EX_FATAL);
- }
+ /* See if the number of info records has already been defined.
+ Assume that if the DIM_NUM_INFO dimension exists, then the
+ VAR_INFO variable also exists...
+ */
+ status = nc_inq_dimid(exoid, DIM_NUM_INFO, &num_info_dim);
+ if (status != NC_NOERR) {
- /* define dimensions */
- if ((status = nc_def_dim(exoid, DIM_NUM_INFO, num_info, &num_info_dim)) != NC_NOERR) {
- if (status == NC_ENAMEINUSE) { /* duplicate entry? */
+ /* inquire previously defined dimensions */
+ if ((status = nc_inq_dimid(exoid, DIM_LIN, &lindim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: info records already exist in file id %d",
- exoid);
+ "Error: failed to get line string length in file id %d", exoid);
ex_err("ex_put_info",errmsg,exerrval);
- } else {
+ return (EX_FATAL);
+ }
+
+ /* put file into define mode */
+ if ((status = nc_redef (exoid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to define number of info records in file id %d",
- exoid);
+ "Error: failed put file id %d into define mode", exoid);
ex_err("ex_put_info",errmsg,exerrval);
+ return (EX_FATAL);
}
- goto error_ret; /* exit define mode and return */
- }
-
- /* define variable */
- dims[0] = num_info_dim;
- dims[1] = lindim;
-
- if ((status = nc_def_var(exoid, VAR_INFO, NC_CHAR, 2, dims, &varid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to define info record in file id %d",
- exoid);
- ex_err("ex_put_info",errmsg,exerrval);
- goto error_ret; /* exit define mode and return */
- }
-
- /* leave define mode */
- if ((status = nc_enddef (exoid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to complete info record definition in file id %d",
- exoid);
- ex_err("ex_put_info",errmsg,exerrval);
- return (EX_FATAL);
- }
-
+ /* define dimensions */
+ if ((status = nc_def_dim(exoid, DIM_NUM_INFO, num_info, &num_info_dim)) != NC_NOERR) {
+ if (status == NC_ENAMEINUSE) { /* duplicate entry? */
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: info records already exist in file id %d",
+ exoid);
+ ex_err("ex_put_info",errmsg,exerrval);
+ } else {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to define number of info records in file id %d",
+ exoid);
+ ex_err("ex_put_info",errmsg,exerrval);
+ }
+
+ goto error_ret; /* exit define mode and return */
+ }
- /* write out information records */
- for (i=0; i<num_info; i++) {
- int length = strlen(info[i]);
- start[0] = i;
- start[1] = 0;
+ /* define variable */
+ dims[0] = num_info_dim;
+ dims[1] = lindim;
- count[0] = 1;
- count[1] = length < MAX_LINE_LENGTH ? length : MAX_LINE_LENGTH;
+ if ((status = nc_def_var(exoid, VAR_INFO, NC_CHAR, 2, dims, &varid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to define info record in file id %d",
+ exoid);
+ ex_err("ex_put_info",errmsg,exerrval);
+ goto error_ret; /* exit define mode and return */
+ }
+ ex_compress_variable(exoid, varid, 3);
- if ((status = nc_put_vara_text(exoid, varid, start, count, info[i])) != NC_NOERR) {
+ /* leave define mode */
+ if ((status = nc_enddef (exoid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to complete info record definition in file id %d",
+ exoid);
+ ex_err("ex_put_info",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ } else {
+ if ((status = nc_inq_varid(exoid, VAR_INFO, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to store info record in file id %d",
+ "Error: failed to find info record variable in file id %d",
exoid);
ex_err("ex_put_info",errmsg,exerrval);
return (EX_FATAL);
}
}
+
+ if (info != NULL) {
+ /* write out information records */
+
+ for (i=0; i<num_info; i++) {
+ int length = strlen(info[i]);
+ start[0] = i;
+ start[1] = 0;
+
+ count[0] = 1;
+ count[1] = length < MAX_LINE_LENGTH ? length : MAX_LINE_LENGTH;
+
+ if ((status = nc_put_vara_text(exoid, varid, start, count, info[i])) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to store info record in file id %d",
+ exoid);
+ ex_err("ex_put_info",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ }
+ }
}
return (EX_NOERR);
diff --git a/exodus/cbind/src/expini.c b/exodus/cbind/src/ex_put_init.c
similarity index 94%
rename from exodus/cbind/src/expini.c
rename to exodus/cbind/src/ex_put_init.c
index 240abae..cb9e601 100644
--- a/exodus/cbind/src/expini.c
+++ b/exodus/cbind/src/ex_put_init.c
@@ -77,12 +77,12 @@ error = ex_put_init (exoid, "This is the title", num_dim,
int ex_put_init (int exoid,
const char *title,
- int num_dim,
- int num_nodes,
- int num_elem,
- int num_elem_blk,
- int num_node_sets,
- int num_side_sets)
+ int64_t num_dim,
+ int64_t num_nodes,
+ int64_t num_elem,
+ int64_t num_elem_blk,
+ int64_t num_node_sets,
+ int64_t num_side_sets)
{
ex_init_params par;
diff --git a/exodus/cbind/src/expinix.c b/exodus/cbind/src/ex_put_init_ext.c
similarity index 95%
rename from exodus/cbind/src/expinix.c
rename to exodus/cbind/src/ex_put_init_ext.c
index a6b0fbb..7594709 100644
--- a/exodus/cbind/src/expinix.c
+++ b/exodus/cbind/src/ex_put_init_ext.c
@@ -104,16 +104,17 @@ static int ex_write_object_names(int exoid, const char *type, const char *dimens
static int ex_write_object_params(int exoid, const char *type, const char *dimension_name,
const char *status_dim_name, const char *id_array_dim_name,
- int count, int *dimension)
+ size_t count, int *dimension)
{
int dim[2];
int varid;
int status;
+ int int_type;
char errmsg[MAX_ERR_LENGTH];
/* Can have nonzero model->num_elem_blk even if model->num_elem == 0 */
if (count > 0) {
- if ((status = nc_def_dim(exoid, dimension_name, (size_t)count, dimension)) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, dimension_name, count, dimension)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define number of %ss in file id %d",
@@ -133,7 +134,11 @@ static int ex_write_object_params(int exoid, const char *type, const char *dimen
}
/* type id array */
- if ((status = nc_def_var (exoid, id_array_dim_name, NC_INT, 1, dim, &varid)) != NC_NOERR) {
+ int_type = NC_INT;
+ if (ex_int64_status(exoid) & EX_IDS_INT64_DB) {
+ int_type = NC_INT64;
+ }
+ if ((status = nc_def_var (exoid, id_array_dim_name, int_type, 1, dim, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define %s id array in file id %d", type, exoid);
@@ -155,16 +160,21 @@ static int ex_write_object_params(int exoid, const char *type, const char *dimen
}
static int ex_write_map_params(int exoid, const char *map_name, const char *map_dim_name,
- const char *map_id_name, int map_count, int *map_dimension)
+ const char *map_id_name, size_t map_count, int *map_dimension)
{
int dim[2];
int varid;
int status;
char errmsg[MAX_ERR_LENGTH];
+
+ int int_type = NC_INT;
+ if (ex_int64_status(exoid) & EX_IDS_INT64_DB) {
+ int_type = NC_INT64;
+ }
/* Can have nonzero model->num_XXXX_map even if model->num_XXXX == 0 */
if ((map_count) > 0) {
- if ((status = nc_def_dim(exoid, map_dim_name, (size_t)(map_count), map_dimension)) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, map_dim_name, map_count, map_dimension)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define number of %ss in file id %d",
@@ -176,7 +186,7 @@ static int ex_write_map_params(int exoid, const char *map_name, const char *map_
dim[0] = *map_dimension;
/* map_name id array */
- if ((status = nc_def_var(exoid, map_id_name, NC_INT, 1, dim, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, map_id_name, int_type, 1, dim, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define %s id array in file id %d", map_name, exoid);
@@ -200,7 +210,6 @@ static int ex_write_map_params(int exoid, const char *map_name, const char *map_
static void invalidate_id_status(int exoid, const char *var_stat,
const char *var_id, int count, int *ids)
{
- int status;
int i;
int id_var, stat_var;
@@ -209,11 +218,8 @@ static void invalidate_id_status(int exoid, const char *var_stat,
for (i=0; i < count; i++) {
ids[i] = EX_INVALID_ID;
}
-
- status = nc_inq_varid(exoid, var_id, &id_var);
- assert(status == NC_NOERR);
- status = nc_put_var_int(exoid, id_var, ids);
- assert(status == NC_NOERR);
+ nc_inq_varid(exoid, var_id, &id_var);
+ nc_put_var_int(exoid, id_var, ids);
}
if (var_stat != 0) {
@@ -221,10 +227,8 @@ static void invalidate_id_status(int exoid, const char *var_stat,
ids[i] = 0;
}
- status = nc_inq_varid(exoid, var_stat, &stat_var);
- assert(status == NC_NOERR);
- status = nc_put_var_int(exoid, stat_var, ids);
- assert(status == NC_NOERR);
+ nc_inq_varid(exoid, var_stat, &stat_var);
+ nc_put_var_int(exoid, stat_var, ids);
}
}
}
@@ -289,7 +293,8 @@ int ex_put_init_ext (int exoid,
/* create name string length dimension */
{
- int max_name = ex_max_name_length < 32 ? 32 : ex_max_name_length;
+ int max_name = ex_inquire_int(exoid, EX_INQ_MAX_READ_NAME_LENGTH);
+ if (max_name < ex_default_max_name_length) max_name = ex_default_max_name_length;
if ((status=nc_def_dim (exoid, DIM_STR_NAME, max_name+1, &dim_str_name)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
@@ -439,6 +444,7 @@ int ex_put_init_ext (int exoid,
ex_err("ex_put_init_ext",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
+ ex_compress_variable(exoid, temp, 2);
}
if (model->num_dim > 1) {
@@ -450,6 +456,7 @@ int ex_put_init_ext (int exoid,
ex_err("ex_put_init_ext",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
+ ex_compress_variable(exoid, temp, 2);
}
if (model->num_dim > 2) {
@@ -461,6 +468,7 @@ int ex_put_init_ext (int exoid,
ex_err("ex_put_init_ext",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
+ ex_compress_variable(exoid, temp, 2);
}
} else {
/* node coordinate arrays: -- all stored together (old method) */
diff --git a/nemesis/ne_pinig.c b/exodus/cbind/src/ex_put_init_global.c
similarity index 71%
rename from nemesis/ne_pinig.c
rename to exodus/cbind/src/ex_put_init_global.c
index 1f3e8a6..3f251d6 100644
--- a/nemesis/ne_pinig.c
+++ b/exodus/cbind/src/ex_put_init_global.c
@@ -37,12 +37,12 @@
/*****************************************************************************/
/*****************************************************************************/
/* Function(s) contained in this file:
- * ne_put_init_global()
+ * ex_put_init_global()
*****************************************************************************
* This function outputs the initial global information.
*****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* num_nodes_g - The number of global FEM nodes. This is output as
* a NetCDF variable.
* num_elems_g - The number of global FEM elements. This is output
@@ -65,63 +65,65 @@
#include <exodusII.h>
#include <exodusII_int.h>
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-int ne_put_init_global(int neid,
- int num_nodes_g,
- int num_elems_g,
- int num_elem_blks_g,
- int num_node_sets_g,
- int num_side_sets_g
+int ex_put_init_global(int exoid,
+ int64_t num_nodes_g,
+ int64_t num_elems_g,
+ int64_t num_elem_blks_g,
+ int64_t num_node_sets_g,
+ int64_t num_side_sets_g
)
{
- char *func_name="ne_put_init_global";
+ const char *func_name="ex_put_init_global";
int varid, dimid, status;
- int ltempsv;
-
char errmsg[MAX_ERR_LENGTH];
-/*-----------------------------Execution begins-----------------------------*/
+ int int_type = NC_INT;
+ int id_type = NC_INT;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_DB) {
+ int_type = NC_INT64;
+ }
+ if (ex_int64_status(exoid) & EX_IDS_INT64_DB) {
+ id_type = NC_INT64;
+ }
+/*-----------------------------Execution begins-----------------------------*/
exerrval = 0; /* clear error code */
+
/* Put NetCDF file into define mode */
- if ((status = nc_redef(neid)) != NC_NOERR) {
+ if ((status = nc_redef(exoid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to put file ID %d into define mode", neid);
+ "Error: failed to put file ID %d into define mode", exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Output the file version */
- if ((status=ne_put_version(neid)) < 0) return (status);
+ if ((status=ex_put_nemesis_version(exoid)) < 0) return (status);
/* Define dimension for number of global nodes */
- ltempsv = num_nodes_g;
- if ((status = nc_def_dim(neid, DIM_NUM_NODES_GLOBAL, ltempsv, &dimid)) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NUM_NODES_GLOBAL, num_nodes_g, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to dimension \"%s\" in file ID %d",
- DIM_NUM_NODES_GLOBAL, neid);
+ DIM_NUM_NODES_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
/* Define dimension for number of global elements */
- ltempsv = num_elems_g;
- if ((status = nc_def_dim(neid, DIM_NUM_ELEMS_GLOBAL, ltempsv, &dimid)) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NUM_ELEMS_GLOBAL, num_elems_g, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to dimension \"%s\" in file ID %d",
- DIM_NUM_ELEMS_GLOBAL, neid);
+ DIM_NUM_ELEMS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
@@ -131,43 +133,40 @@ int ne_put_init_global(int neid,
* dimension since the vector of global element block IDs is sized
* by this quantity.
*/
- ltempsv = num_elem_blks_g;
- if ((status = nc_def_dim(neid, DIM_NUM_ELBLK_GLOBAL, ltempsv, &dimid)) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NUM_ELBLK_GLOBAL, num_elem_blks_g, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to dimension \"%s\" in file ID %d",
- DIM_NUM_ELBLK_GLOBAL, neid);
+ DIM_NUM_ELBLK_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
/* Define the element block IDs variable. */
- if ((status = nc_def_var(neid, VAR_ELBLK_IDS_GLOBAL, NC_INT, 1, &dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_ELBLK_IDS_GLOBAL, id_type, 1, &dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to put variable definition for \"%s\" into \
-file ID %d",
- VAR_ELBLK_IDS_GLOBAL, neid);
+ "Error: failed to put variable definition for \"%s\" into file ID %d",
+ VAR_ELBLK_IDS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
/* Define the element block counts variable. */
- if ((status = nc_def_var(neid, VAR_ELBLK_CNT_GLOBAL, NC_INT, 1, &dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_ELBLK_CNT_GLOBAL, int_type, 1, &dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to put variable definition for \"%s\" into \
-file ID %d",
- VAR_ELBLK_CNT_GLOBAL, neid);
+ "Error: failed to put variable definition for \"%s\" into file ID %d",
+ VAR_ELBLK_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
@@ -178,44 +177,41 @@ file ID %d",
* by this quantity.
*/
if (num_node_sets_g > 0) {
- ltempsv = num_node_sets_g;
- if ((status = nc_def_dim(neid, DIM_NUM_NS_GLOBAL, ltempsv, &dimid)) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NUM_NS_GLOBAL, num_node_sets_g, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to dimension \"%s\" in file ID %d",
- DIM_NUM_NS_GLOBAL, neid);
+ DIM_NUM_NS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
/* Define the variable for output of global node set IDs */
- if ((status = nc_def_var(neid, VAR_NS_IDS_GLOBAL, NC_INT, 1, &dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_NS_IDS_GLOBAL, id_type, 1, &dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to put variable definition for \"%s\" into \
-file ID %d",
- VAR_NS_IDS_GLOBAL, neid);
+ "Error: failed to put variable definition for \"%s\" into file ID %d",
+ VAR_NS_IDS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
/* Define variable for global node counts in each global node set */
- if ((status = nc_def_var(neid, VAR_NS_NODE_CNT_GLOBAL, NC_INT, 1, &dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_NS_NODE_CNT_GLOBAL, int_type, 1, &dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to put variable definition for \"%s\" into \
-file ID %d",
- VAR_NS_NODE_CNT_GLOBAL, neid);
+ "Error: failed to put variable definition for \"%s\" into file ID %d",
+ VAR_NS_NODE_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returing */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
@@ -224,15 +220,14 @@ file ID %d",
* Define variable for global dist. factor count in each global
* node set
*/
- if ((status = nc_def_var(neid, VAR_NS_DF_CNT_GLOBAL, NC_INT, 1, &dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_NS_DF_CNT_GLOBAL, int_type, 1, &dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to put variable definition for \"%s\" into \
-file ID %d",
- VAR_NS_DF_CNT_GLOBAL, neid);
+ "Error: failed to put variable definition for \"%s\" into file ID %d",
+ VAR_NS_DF_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returing */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
@@ -245,30 +240,28 @@ file ID %d",
* by this quantity.
*/
if (num_side_sets_g > 0) {
- ltempsv = num_side_sets_g;
- if ((status = nc_def_dim(neid, DIM_NUM_SS_GLOBAL, ltempsv, &dimid)) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NUM_SS_GLOBAL, num_side_sets_g, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to dimension \"%s\" in file id %d",
- DIM_NUM_SS_GLOBAL, neid);
+ DIM_NUM_SS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
/* Define the variable for output of global side set IDs */
- if ((status = nc_def_var(neid, VAR_SS_IDS_GLOBAL, NC_INT, 1, &dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_SS_IDS_GLOBAL, id_type, 1, &dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to put variable definition for \"%s\" into \
-file id %d",
- VAR_SS_IDS_GLOBAL, neid);
+ "Error: failed to put variable definition for \"%s\" into file id %d",
+ VAR_SS_IDS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
@@ -277,16 +270,15 @@ file id %d",
* Define the variable for count of global number of sides in the
* global side sets.
*/
- if ((status = nc_def_var(neid, VAR_SS_SIDE_CNT_GLOBAL, NC_INT, 1, &dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_SS_SIDE_CNT_GLOBAL, int_type, 1, &dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to put variable definition for \"%s\" into \
-file id %d",
- VAR_SS_SIDE_CNT_GLOBAL, neid);
+ "Error: failed to put variable definition for \"%s\" into file id %d",
+ VAR_SS_SIDE_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
@@ -295,16 +287,15 @@ file id %d",
* Define the variable for count of global dist. factors in the
* global side sets.
*/
- if ((status = nc_def_var(neid, VAR_SS_DF_CNT_GLOBAL, NC_INT, 1, &dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_SS_DF_CNT_GLOBAL, int_type, 1, &dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to put variable definition for \"%s\" into \
-file id %d",
- VAR_SS_DF_CNT_GLOBAL, neid);
+ "Error: failed to put variable definition for \"%s\" into file id %d",
+ VAR_SS_DF_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
@@ -312,7 +303,7 @@ file id %d",
} /* End "if (num_side_sets_g > 0)" */
/* End define mode */
- if (ne_leavedef(neid, func_name) != EX_NOERR)
+ if (ex_leavedef(exoid, func_name) != EX_NOERR)
return (EX_FATAL);
return (EX_NOERR);
diff --git a/nemesis/ne_piinf.c b/exodus/cbind/src/ex_put_init_info.c
similarity index 81%
rename from nemesis/ne_piinf.c
rename to exodus/cbind/src/ex_put_init_info.c
index a2182b0..c09c87e 100644
--- a/nemesis/ne_piinf.c
+++ b/exodus/cbind/src/ex_put_init_info.c
@@ -35,13 +35,13 @@
/*****************************************************************************/
/*****************************************************************************/
/* Function(s) contained in this file:
- * ne_put_init_info()
+ * ex_put_init_info()
*****************************************************************************
* This function writes information about the processors for which the
* decomposition was performed.
*****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* num_proc - The number of processors in the decomposition.
* num_proc_in_f - The number of processors the file contains
* information for.
@@ -58,16 +58,13 @@
#include <exodusII.h>
#include <exodusII_int.h>
-#include "ne_nemesisI.h"
-#include "ne_nemesisI_int.h"
-
-int ne_put_init_info(int neid,
+int ex_put_init_info(int exoid,
int num_proc,
int num_proc_in_f,
char *ftype
)
{
- char *func_name="ne_put_init_info";
+ const char *func_name="ex_put_init_info";
int dimid, varid;
int ltempsv;
@@ -83,7 +80,7 @@ int ne_put_init_info(int neid,
exerrval = EX_MSG;
sprintf(errmsg,
"Error: NULL file type input for file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -98,84 +95,84 @@ int ne_put_init_info(int neid,
exerrval = EX_MSG;
sprintf(errmsg,
"Error: unknown file type requested for file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Put file into define mode */
- if ((status = nc_redef(neid)) != NC_NOERR) {
+ if ((status = nc_redef(exoid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to put file ID %d into define mode", neid);
+ "Error: failed to put file ID %d into define mode", exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Define dimension for the number of processors */
- if ((status = nc_inq_dimid(neid, DIM_NUM_PROCS, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_PROCS, &dimid)) != NC_NOERR) {
ltempsv = num_proc;
- if ((status = nc_def_dim(neid, DIM_NUM_PROCS, ltempsv, &dimid)) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NUM_PROCS, ltempsv, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to dimension \"%s\" in file ID %d",
- DIM_NUM_PROCS, neid);
+ DIM_NUM_PROCS, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
}
/* If this is a parallel file then the status vectors are size 1 */
- if (nc_inq_dimid(neid, DIM_NUM_PROCS_F, &dimid) != NC_NOERR) {
+ if (nc_inq_dimid(exoid, DIM_NUM_PROCS_F, &dimid) != NC_NOERR) {
ltempsv = num_proc_in_f;
- if ((status = nc_def_dim(neid, DIM_NUM_PROCS_F, ltempsv, &dimid)) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NUM_PROCS_F, ltempsv, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to dimension \"%s\" in file ID %d",
- DIM_NUM_PROCS_F, neid);
+ DIM_NUM_PROCS_F, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
}
/* Output the file type */
- if (nc_inq_varid(neid, VAR_FILE_TYPE, &varid) != NC_NOERR) {
- if ((status = nc_def_var(neid, VAR_FILE_TYPE, NC_INT, 0, NULL, &varid)) != NC_NOERR) {
+ if (nc_inq_varid(exoid, VAR_FILE_TYPE, &varid) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_FILE_TYPE, NC_INT, 0, NULL, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define file type in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
- if (ne_leavedef(neid, func_name) != EX_NOERR)
+ if (ex_leavedef(exoid, func_name) != EX_NOERR)
return (EX_FATAL);
- if ((status = nc_put_var1_int(neid, varid, NULL, &lftype)) != NC_NOERR) {
+ if ((status = nc_put_var1_int(exoid, varid, NULL, &lftype)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: unable to output file type variable in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
}
else {
- if (ne_leavedef(neid, func_name) != EX_NOERR)
+ if (ex_leavedef(exoid, func_name) != EX_NOERR)
return (EX_FATAL);
}
diff --git a/nemesis/ne_plbp.c b/exodus/cbind/src/ex_put_loadbal_param.c
similarity index 68%
rename from nemesis/ne_plbp.c
rename to exodus/cbind/src/ex_put_loadbal_param.c
index ca30cb0..56bf3a3 100644
--- a/nemesis/ne_plbp.c
+++ b/exodus/cbind/src/ex_put_loadbal_param.c
@@ -36,12 +36,12 @@
/*****************************************************************************/
/*****************************************************************************/
/* Function(s) contained in this file:
- * ne_put_loadbal_param()
+ * ex_put_loadbal_param()
*****************************************************************************
* This function outputs the load balance parameters.
*****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* num_int_nodes - The number of internal FEM nodes.
* num_bor_nodes - The number of border FEM nodes.
* num_ext_nodes - The number of external FEM nodes.
@@ -62,21 +62,18 @@
#include <exodusII.h>
#include <exodusII_int.h>
-#include "ne_nemesisI.h"
-#include "ne_nemesisI_int.h"
-
-int ne_put_loadbal_param(int neid,
- int num_int_nodes,
- int num_bor_nodes,
- int num_ext_nodes,
- int num_int_elems,
- int num_bor_elems,
- int num_node_cmaps,
- int num_elem_cmaps,
- int processor
+int ex_put_loadbal_param(int exoid,
+ int64_t num_int_nodes,
+ int64_t num_bor_nodes,
+ int64_t num_ext_nodes,
+ int64_t num_int_elems,
+ int64_t num_bor_elems,
+ int64_t num_node_cmaps,
+ int64_t num_elem_cmaps,
+ int processor
)
{
- char *func_name="ne_put_loadbal_param";
+ const char *func_name="ex_put_loadbal_param";
int status, varid;
int dimid_npf, dimid[3];
@@ -86,16 +83,25 @@ int ne_put_loadbal_param(int neid,
int nmstat, ltempsv;
char errmsg[MAX_ERR_LENGTH];
+
+ int id_type = NC_INT;
+ int map_type = NC_INT;
+ if (ex_int64_status(exoid) & EX_IDS_INT64_DB) {
+ id_type = NC_INT64;
+ }
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_DB) {
+ map_type = NC_INT64;
+ }
/*-----------------------------Execution begins-----------------------------*/
exerrval = 0; /* clear error code */
/* Get the file type */
- if (ne_get_file_type(neid, ftype) != EX_NOERR) {
+ if (ex_get_file_type(exoid, ftype) != EX_NOERR) {
exerrval = EX_MSG;
sprintf(errmsg,
"Error: failed to get file type from file ID %d\n",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -105,7 +111,7 @@ int ne_put_loadbal_param(int neid,
exerrval = EX_MSG;
sprintf(errmsg,
"Error: function for use with parallel files only, file ID %d\n",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -114,136 +120,136 @@ int ne_put_loadbal_param(int neid,
* Get the dimension ID for the number of processors storing
* information in this file.
*/
- if ((status = nc_inq_dimid(neid, DIM_NUM_PROCS_F, &dimid_npf)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_PROCS_F, &dimid_npf)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NUM_PROCS_F, neid);
+ DIM_NUM_PROCS_F, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
/* Put NetCDF file into define mode */
- if ((status = nc_redef(neid)) != NC_NOERR) {
+ if ((status = nc_redef(exoid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to put file id %d into define mode", neid);
+ "Error: failed to put file id %d into define mode", exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Output the file version */
- if ((status=ne_put_version(neid)) < 0) return (status);
+ if ((status=ex_put_nemesis_version(exoid)) < 0) return (status);
/* Define the status variables for the nodal vectors */
- if (nc_inq_varid(neid, VAR_INT_N_STAT, &varid) != NC_NOERR) {
- if ((status = nc_def_var(neid, VAR_INT_N_STAT, NC_INT, 1, &dimid_npf, &varid)) != NC_NOERR) {
+ if (nc_inq_varid(exoid, VAR_INT_N_STAT, &varid) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_INT_N_STAT, NC_INT, 1, &dimid_npf, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_INT_N_STAT, neid);
+ VAR_INT_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
}
/* Set the dimension for status vectors */
- if (nc_inq_varid(neid, VAR_BOR_N_STAT, &varid) != NC_NOERR) {
- if ((status = nc_def_var(neid, VAR_BOR_N_STAT, NC_INT, 1, &dimid_npf, &varid)) != NC_NOERR) {
+ if (nc_inq_varid(exoid, VAR_BOR_N_STAT, &varid) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_BOR_N_STAT, NC_INT, 1, &dimid_npf, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_BOR_N_STAT, neid);
+ VAR_BOR_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
}
- if (nc_inq_varid(neid, VAR_EXT_N_STAT, &varid) != NC_NOERR) {
- if ((status = nc_def_var(neid, VAR_EXT_N_STAT, NC_INT, 1, &dimid_npf, &varid)) != NC_NOERR) {
+ if (nc_inq_varid(exoid, VAR_EXT_N_STAT, &varid) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_EXT_N_STAT, NC_INT, 1, &dimid_npf, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_EXT_N_STAT, neid);
+ VAR_EXT_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
}
/* Define the variable IDs for the elemental status vectors */
- if (nc_inq_varid(neid, VAR_INT_E_STAT, &varid) != NC_NOERR) {
- if ((status = nc_def_var(neid, VAR_INT_E_STAT, NC_INT, 1, &dimid_npf, &varid)) != NC_NOERR) {
+ if (nc_inq_varid(exoid, VAR_INT_E_STAT, &varid) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_INT_E_STAT, NC_INT, 1, &dimid_npf, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_INT_E_STAT, neid);
+ VAR_INT_E_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
}
- if (nc_inq_varid(neid, VAR_BOR_E_STAT, &varid) != NC_NOERR) {
- if ((status = nc_def_var(neid, VAR_BOR_E_STAT, NC_INT, 1, &dimid_npf, &varid)) != NC_NOERR) {
+ if (nc_inq_varid(exoid, VAR_BOR_E_STAT, &varid) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_BOR_E_STAT, NC_INT, 1, &dimid_npf, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: Failed to define variable \"%s\" in file ID %d",
- VAR_BOR_E_STAT, neid);
+ VAR_BOR_E_STAT, exoid);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
}
/* Get the variable ID for the nodal status vectors */
- if ((status = nc_inq_varid(neid, VAR_INT_N_STAT, &varid_nm[0])) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_INT_N_STAT, &varid_nm[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_INT_N_STAT, neid);
+ VAR_INT_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
- if ((status = nc_inq_varid(neid, VAR_BOR_N_STAT, &varid_nm[1])) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_BOR_N_STAT, &varid_nm[1])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_BOR_N_STAT, neid);
+ VAR_BOR_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
- if ((status = nc_inq_varid(neid, VAR_EXT_N_STAT, &varid_nm[2])) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_EXT_N_STAT, &varid_nm[2])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_EXT_N_STAT, neid);
+ VAR_EXT_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
@@ -251,53 +257,54 @@ int ne_put_loadbal_param(int neid,
/* Define variable for the internal element information */
if (num_int_elems > 0) {
ltempsv = num_int_elems;
- if ((status = nc_def_dim(neid, DIM_NUM_INT_ELEMS, ltempsv, &dimid[0])) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NUM_INT_ELEMS, ltempsv, &dimid[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to dimension \"%s\" in file id %d",
- DIM_NUM_INT_ELEMS, neid);
+ DIM_NUM_INT_ELEMS, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
- if ((status = nc_def_var(neid, VAR_ELEM_MAP_INT, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_ELEM_MAP_INT, map_type, 1, dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_ELEM_MAP_INT, neid);
+ VAR_ELEM_MAP_INT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, varid, 1);
} /* End "if (num_int_elems > 0)" */
/* Get the variable IDs for the elemental status vectors */
- if ((status = nc_inq_varid(neid, VAR_INT_E_STAT, &varid_em[0])) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_INT_E_STAT, &varid_em[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_INT_E_STAT, neid);
+ VAR_INT_E_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
- if ((status = nc_inq_varid(neid, VAR_BOR_E_STAT, &varid_em[1])) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_BOR_E_STAT, &varid_em[1])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_BOR_E_STAT, neid);
+ VAR_BOR_E_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
@@ -305,157 +312,161 @@ int ne_put_loadbal_param(int neid,
/* Define variable for the border element information */
if (num_bor_elems > 0) {
ltempsv = num_bor_elems;
- if ((status = nc_def_dim(neid, DIM_NUM_BOR_ELEMS, ltempsv, &dimid[0])) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NUM_BOR_ELEMS, ltempsv, &dimid[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to dimension \"%s\" in file id %d",
- DIM_NUM_BOR_ELEMS, neid);
+ DIM_NUM_BOR_ELEMS, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
- if ((status = nc_def_var(neid, VAR_ELEM_MAP_BOR, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_ELEM_MAP_BOR, map_type, 1, dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_ELEM_MAP_BOR, neid);
+ VAR_ELEM_MAP_BOR, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, varid, 1);
} /* End "if (num_bor_elems > 0)" */
if (num_int_nodes > 0) {
/* Define variable for vector of internal FEM node IDs */
ltempsv = num_int_nodes;
- if ((status = nc_def_dim(neid, DIM_NUM_INT_NODES, ltempsv, &dimid[0])) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NUM_INT_NODES, ltempsv, &dimid[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to dimension \"%s\" in file id %d",
- DIM_NUM_INT_NODES, neid);
+ DIM_NUM_INT_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
- if ((status = nc_def_var(neid, VAR_NODE_MAP_INT, NC_INT, 1, &dimid[0], &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_NODE_MAP_INT, map_type, 1, &dimid[0], &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_NODE_MAP_INT, neid);
+ VAR_NODE_MAP_INT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, varid, 1);
} /* End "if (num_int_nodes > 0)" */
if (num_bor_nodes > 0) {
/* Define variable for vector of border FEM node IDs */
ltempsv = num_bor_nodes;
- if ((status = nc_def_dim(neid, DIM_NUM_BOR_NODES, ltempsv, &dimid[1])) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NUM_BOR_NODES, ltempsv, &dimid[1])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to dimension \"%s\" in file id %d",
- DIM_NUM_BOR_NODES, neid);
+ DIM_NUM_BOR_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
- if ((status = nc_def_var(neid, VAR_NODE_MAP_BOR, NC_INT, 1, &dimid[1], &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_NODE_MAP_BOR, map_type, 1, &dimid[1], &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_NODE_MAP_BOR, neid);
+ VAR_NODE_MAP_BOR, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
-
}
+ ex_compress_variable(exoid, varid, 1);
} /* End "if (num_bor_nodes > 0)" */
if (num_ext_nodes > 0) {
/* Define dimension for vector of external FEM node IDs */
ltempsv = num_ext_nodes;
- if ((status = nc_def_dim(neid, DIM_NUM_EXT_NODES, ltempsv, &dimid[2])) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NUM_EXT_NODES, ltempsv, &dimid[2])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to dimension \"%s\" in file id %d",
- DIM_NUM_EXT_NODES, neid);
+ DIM_NUM_EXT_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
- if ((status = nc_def_var(neid, VAR_NODE_MAP_EXT, NC_INT, 1, &dimid[2], &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_NODE_MAP_EXT, map_type, 1, &dimid[2], &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_NODE_MAP_EXT, neid);
+ VAR_NODE_MAP_EXT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, varid, 1);
} /* End "if (num_ext_nodes > 0)" */
/* Add the nodal communication map count */
if (num_node_cmaps > 0) {
ltempsv = num_node_cmaps;
- if ((status = nc_def_dim(neid, DIM_NUM_N_CMAPS, ltempsv, &dimid[0])) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NUM_N_CMAPS, ltempsv, &dimid[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to add dimension \"%s\" in file ID %d",
- DIM_NUM_N_CMAPS, neid);
+ DIM_NUM_N_CMAPS, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
/* Add the ID vector */
- if ((status = nc_def_var(neid, VAR_N_COMM_IDS, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_N_COMM_IDS, id_type, 1, dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_N_COMM_IDS, neid);
+ VAR_N_COMM_IDS, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, varid, 1);
/* Add the status vector */
- if ((status = nc_def_var(neid, VAR_N_COMM_STAT, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_N_COMM_STAT, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_N_COMM_STAT, neid);
+ VAR_N_COMM_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
@@ -465,39 +476,40 @@ int ne_put_loadbal_param(int neid,
/* Add the nodal communication map count */
if (num_elem_cmaps > 0) {
ltempsv = num_elem_cmaps;
- if ((status = nc_def_dim(neid, DIM_NUM_E_CMAPS, ltempsv, &dimid[0])) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NUM_E_CMAPS, ltempsv, &dimid[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to add dimension \"%s\" in file ID %d",
- DIM_NUM_E_CMAPS, neid);
+ DIM_NUM_E_CMAPS, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
/* Add variables for elemental communication maps */
- if ((status = nc_def_var(neid, VAR_E_COMM_IDS, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_E_COMM_IDS, id_type, 1, dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_E_COMM_IDS, neid);
+ VAR_E_COMM_IDS, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, varid, 1);
- if ((status = nc_def_var(neid, VAR_E_COMM_STAT, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_E_COMM_STAT, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_E_COMM_STAT, neid);
+ VAR_E_COMM_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
@@ -505,7 +517,7 @@ int ne_put_loadbal_param(int neid,
} /* End "if (num_elem_cmaps > 0)" */
/* Leave define mode */
- if (ne_leavedef(neid, func_name) != EX_NOERR)
+ if (ex_leavedef(exoid, func_name) != EX_NOERR)
return (EX_FATAL);
/*
@@ -516,22 +528,22 @@ int ne_put_loadbal_param(int neid,
if (num_int_nodes == 0) {
/* NULL set for internal nodes */
nmstat = 0;
- if ((status = nc_put_var_int(neid, varid_nm[0], &nmstat)) != NC_NOERR) {
+ if ((status = nc_put_var_int(exoid, varid_nm[0], &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output status for int node map in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
}
else {
nmstat = 1;
- if ((status = nc_put_var_int(neid, varid_nm[0], &nmstat)) != NC_NOERR) {
+ if ((status = nc_put_var_int(exoid, varid_nm[0], &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output status for int node map in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -542,11 +554,11 @@ int ne_put_loadbal_param(int neid,
if (num_bor_nodes == 0) {
/* NULL set for border nodes */
nmstat = 0;
- if ((status = nc_put_var_int(neid, varid_nm[1], &nmstat)) != NC_NOERR) {
+ if ((status = nc_put_var_int(exoid, varid_nm[1], &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output status for bor node map in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -554,11 +566,11 @@ int ne_put_loadbal_param(int neid,
else {
/* Set the status indicating non-NULL size */
nmstat = 1;
- if ((status = nc_put_var_int(neid, varid_nm[1], &nmstat)) != NC_NOERR) {
+ if ((status = nc_put_var_int(exoid, varid_nm[1], &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output status for bor node map in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -569,11 +581,11 @@ int ne_put_loadbal_param(int neid,
if (num_ext_nodes == 0) {
/* NULL set for external nodes */
nmstat = 0;
- if ((status = nc_put_var_int(neid, varid_nm[2], &nmstat)) != NC_NOERR) {
+ if ((status = nc_put_var_int(exoid, varid_nm[2], &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output status for ext node map in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -581,11 +593,11 @@ int ne_put_loadbal_param(int neid,
else {
/* Set the status indicating non-NULL size */
nmstat = 1;
- if ((status = nc_put_var_int(neid, varid_nm[2], &nmstat)) != NC_NOERR) {
+ if ((status = nc_put_var_int(exoid, varid_nm[2], &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output status for ext node map in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -596,11 +608,11 @@ int ne_put_loadbal_param(int neid,
if (num_int_elems == 0) {
/* NULL set for internal elements */
nmstat = 0;
- if ((status = nc_put_var_int(neid, varid_em[0], &nmstat)) != NC_NOERR) {
+ if ((status = nc_put_var_int(exoid, varid_em[0], &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output status for int elem map in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -608,11 +620,11 @@ int ne_put_loadbal_param(int neid,
else {
/* Set the status indicating non-NULL size */
nmstat = 1;
- if ((status = nc_put_var_int(neid, varid_em[0], &nmstat)) != NC_NOERR) {
+ if ((status = nc_put_var_int(exoid, varid_em[0], &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output status for int elem map in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -623,11 +635,11 @@ int ne_put_loadbal_param(int neid,
if (num_bor_elems == 0) {
/* NULL set for internal elements */
nmstat = 0;
- if ((status = nc_put_var_int(neid, varid_em[1], &nmstat)) != NC_NOERR) {
+ if ((status = nc_put_var_int(exoid, varid_em[1], &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output status for bor elem map in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -635,11 +647,11 @@ int ne_put_loadbal_param(int neid,
else {
/* Set the status indicating non-NULL size */
nmstat = 1;
- if ((status = nc_put_var_int(neid, varid_em[1], &nmstat)) != NC_NOERR) {
+ if ((status = nc_put_var_int(exoid, varid_em[1], &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output status for bor elem map in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
diff --git a/nemesis/ne_plbpc.c b/exodus/cbind/src/ex_put_loadbal_param_cc.c
similarity index 61%
rename from nemesis/ne_plbpc.c
rename to exodus/cbind/src/ex_put_loadbal_param_cc.c
index aa4da6f..db3ba52 100644
--- a/nemesis/ne_plbpc.c
+++ b/exodus/cbind/src/ex_put_loadbal_param_cc.c
@@ -37,12 +37,12 @@
/*****************************************************************************/
/*****************************************************************************/
/* Function(s) contained in this file:
- * ne_put_loadbal_param_cc()
+ * ex_put_loadbal_param_cc()
*****************************************************************************
* This function outputs the concatenated list of load-balance parameters.
*****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* num_int_nodes - Vector of number of internal FEM nodes for
* "num_proc_in_f" processors.
* num_bor_nodes - Vector of number of border FEM nodes for
@@ -64,27 +64,25 @@
#include <stdio.h>
+#include <netcdf.h>
+
#include <exodusII.h>
#include <exodusII_int.h>
-#include <netcdf.h>
#ifndef NC_INT64
#define NC_INT64 NC_INT
#endif
-#include "ne_nemesisI.h"
-#include "ne_nemesisI_int.h"
-
-int ne_put_loadbal_param_cc(int neid,
- int *num_int_nodes,
- int *num_bor_nodes,
- int *num_ext_nodes,
- int *num_int_elems,
- int *num_bor_elems,
- int *num_node_cmaps,
- int *num_elem_cmaps
+int ex_put_loadbal_param_cc(int exoid,
+ void_int *num_int_nodes,
+ void_int *num_bor_nodes,
+ void_int *num_ext_nodes,
+ void_int *num_int_elems,
+ void_int *num_bor_elems,
+ void_int *num_node_cmaps,
+ void_int *num_elem_cmaps
)
{
- char *func_name="ne_put_loadbal_param_cc";
+ const char *func_name="ex_put_loadbal_param_cc";
int status;
int iproc, varid, dimid_npf, dimid[3];
@@ -95,34 +93,48 @@ int ne_put_loadbal_param_cc(int neid,
char ftype[2];
int oldfill;
- long long num_int_elem = 0, num_int_node = 0, num_bor_elem = 0;
- long long num_bor_node = 0, num_ext_node = 0;
- long long num_n_cmaps = 0, num_e_cmaps = 0;
+#if defined(NC_NETCDF4)
+ int64_t num_int_elem = 0, num_int_node = 0, num_bor_elem = 0;
+ int64_t num_bor_node = 0, num_ext_node = 0;
+ int64_t num_n_cmaps = 0, num_e_cmaps = 0;
+#else
+ int num_int_elem = 0, num_int_node = 0, num_bor_elem = 0;
+ int num_bor_node = 0, num_ext_node = 0;
+ int num_n_cmaps = 0, num_e_cmaps = 0;
+#endif
int nmstat;
char errmsg[MAX_ERR_LENGTH];
int format;
- int index_type;
- /*-----------------------------Execution begins-----------------------------*/
+ int index_type = NC_INT;
+ int map_type = NC_INT;
+ int id_type = NC_INT;
+
+ /*-----------------------------Execution begins-----------------------------*/
exerrval = 0; /* clear error code */
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_DB) {
+ map_type = NC_INT64;
+ }
+ if (ex_int64_status(exoid) & EX_IDS_INT64_DB) {
+ id_type = NC_INT64;
+ }
+
/* See if using NC_FORMAT_NETCDF4 format... */
- nc_inq_format(neid, &format);
- if (format == NC_FORMAT_NETCDF4) {
+ nc_inq_format(exoid, &format);
+ if ((ex_int64_status(exoid) & EX_BULK_INT64_DB) || (format == NC_FORMAT_NETCDF4)) {
index_type = NC_INT64;
- } else {
- index_type = NC_INT;
}
/* Get the processor information from the file */
- if (ne_get_init_info(neid, &num_proc, &num_proc_in_f, ftype) != EX_NOERR) {
+ if (ex_get_init_info(exoid, &num_proc, &num_proc_in_f, ftype) != EX_NOERR) {
exerrval = EX_MSG;
sprintf(errmsg,
"Error: Unable to get processor info from file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -132,184 +144,184 @@ int ne_put_loadbal_param_cc(int neid,
* Get the dimension ID for the number of processors storing
* information in this file.
*/
- if ((status = nc_inq_dimid(neid, DIM_NUM_PROCS_F, &dimid_npf)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_PROCS_F, &dimid_npf)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NUM_PROCS_F, neid);
+ DIM_NUM_PROCS_F, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Put NetCDF file into define mode */
- if ((status = nc_redef(neid)) != NC_NOERR) {
+ if ((status = nc_redef(exoid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to put file id %d into define mode", neid);
+ "Error: failed to put file id %d into define mode", exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Set the fill mode */
- if ((status = nc_set_fill(neid, NC_NOFILL, &oldfill)) != NC_NOERR) {
+ if ((status = nc_set_fill(exoid, NC_NOFILL, &oldfill)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to put file ID %d into no-fill mode",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Output the file version */
- if ((status=ne_put_version(neid)) < 0) return (status);
+ if ((status=ex_put_nemesis_version(exoid)) < 0) return (status);
/* Output the file type */
- if (nc_inq_varid(neid, VAR_FILE_TYPE, &varid) != NC_NOERR) {
- if ((status = nc_def_var(neid, VAR_FILE_TYPE, NC_INT, 0, NULL, &varid)) != NC_NOERR) {
+ if (nc_inq_varid(exoid, VAR_FILE_TYPE, &varid) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_FILE_TYPE, NC_INT, 0, NULL, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define file type in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
}
/* Define the status variables for the nodal vectors */
- if (nc_inq_varid(neid, VAR_INT_N_STAT, &varid) != NC_NOERR) {
- if ((status = nc_def_var(neid, VAR_INT_N_STAT, NC_INT, 1, &dimid_npf, &varid)) != NC_NOERR) {
+ if (nc_inq_varid(exoid, VAR_INT_N_STAT, &varid) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_INT_N_STAT, NC_INT, 1, &dimid_npf, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_INT_N_STAT, neid);
+ VAR_INT_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
}
/* Set the dimension for status vectors */
- if (nc_inq_varid(neid, VAR_BOR_N_STAT, &varid) != NC_NOERR) {
- if ((status = nc_def_var(neid, VAR_BOR_N_STAT, NC_INT, 1, &dimid_npf, &varid)) != NC_NOERR) {
+ if (nc_inq_varid(exoid, VAR_BOR_N_STAT, &varid) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_BOR_N_STAT, NC_INT, 1, &dimid_npf, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_BOR_N_STAT, neid);
+ VAR_BOR_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
}
- if (nc_inq_varid(neid, VAR_EXT_N_STAT, &varid) != NC_NOERR) {
- if ((status = nc_def_var(neid, VAR_EXT_N_STAT, NC_INT, 1, &dimid_npf, &varid)) != NC_NOERR) {
+ if (nc_inq_varid(exoid, VAR_EXT_N_STAT, &varid) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_EXT_N_STAT, NC_INT, 1, &dimid_npf, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_EXT_N_STAT, neid);
+ VAR_EXT_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
}
/* Define the variable IDs for the elemental status vectors */
- if (nc_inq_varid(neid, VAR_INT_E_STAT, &varid) != NC_NOERR) {
- if ((status = nc_def_var(neid, VAR_INT_E_STAT, NC_INT, 1, &dimid_npf, &varid)) != NC_NOERR) {
+ if (nc_inq_varid(exoid, VAR_INT_E_STAT, &varid) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_INT_E_STAT, NC_INT, 1, &dimid_npf, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_INT_E_STAT, neid);
+ VAR_INT_E_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
}
- if (nc_inq_varid(neid, VAR_BOR_E_STAT, &varid) != NC_NOERR) {
- if ((status = nc_def_var(neid, VAR_BOR_E_STAT, NC_INT, 1, &dimid_npf, &varid)) != NC_NOERR) {
+ if (nc_inq_varid(exoid, VAR_BOR_E_STAT, &varid) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_BOR_E_STAT, NC_INT, 1, &dimid_npf, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: Failed to define variable \"%s\" in file ID %d",
- VAR_BOR_E_STAT, neid);
+ VAR_BOR_E_STAT, exoid);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
}
/* Get the variable ID for the nodal status vectors */
- if ((status = nc_inq_varid(neid, VAR_INT_N_STAT, &varid_nm[0])) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_INT_N_STAT, &varid_nm[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_INT_N_STAT, neid);
+ VAR_INT_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
- if ((status = nc_inq_varid(neid, VAR_BOR_N_STAT, &varid_nm[1])) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_BOR_N_STAT, &varid_nm[1])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_BOR_N_STAT, neid);
+ VAR_BOR_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
- if ((status = nc_inq_varid(neid, VAR_EXT_N_STAT, &varid_nm[2])) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_EXT_N_STAT, &varid_nm[2])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_EXT_N_STAT, neid);
+ VAR_EXT_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
/* Get the variable IDs for the elemental status vectors */
- if ((status = nc_inq_varid(neid, VAR_INT_E_STAT, &varid_em[0])) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_INT_E_STAT, &varid_em[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_INT_E_STAT, neid);
+ VAR_INT_E_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
- if ((status = nc_inq_varid(neid, VAR_BOR_E_STAT, &varid_em[1])) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_BOR_E_STAT, &varid_em[1])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_BOR_E_STAT, neid);
+ VAR_BOR_E_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
@@ -319,52 +331,65 @@ int ne_put_loadbal_param_cc(int neid,
** first need to loop through the processors in this
** file and get the counts of the element and cmap lists
*/
- for(iproc=0; iproc < num_proc_in_f; iproc++) {
- num_int_elem += num_int_elems[iproc];
- num_int_node += num_int_nodes[iproc];
- num_bor_elem += num_bor_elems[iproc];
- num_bor_node += num_bor_nodes[iproc];
- num_ext_node += num_ext_nodes[iproc];
- num_e_cmaps += num_elem_cmaps[iproc];
- num_n_cmaps += num_node_cmaps[iproc];
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ for(iproc=0; iproc < num_proc_in_f; iproc++) {
+ num_int_elem += ((int64_t*)num_int_elems)[iproc];
+ num_int_node += ((int64_t*)num_int_nodes)[iproc];
+ num_bor_elem += ((int64_t*)num_bor_elems)[iproc];
+ num_bor_node += ((int64_t*)num_bor_nodes)[iproc];
+ num_ext_node += ((int64_t*)num_ext_nodes)[iproc];
+ num_e_cmaps += ((int64_t*)num_elem_cmaps)[iproc];
+ num_n_cmaps += ((int64_t*)num_node_cmaps)[iproc];
+ }
+ } else {
+ for(iproc=0; iproc < num_proc_in_f; iproc++) {
+ num_int_elem += ((int*)num_int_elems)[iproc];
+ num_int_node += ((int*)num_int_nodes)[iproc];
+ num_bor_elem += ((int*)num_bor_elems)[iproc];
+ num_bor_node += ((int*)num_bor_nodes)[iproc];
+ num_ext_node += ((int*)num_ext_nodes)[iproc];
+ num_e_cmaps += ((int*)num_elem_cmaps)[iproc];
+ num_n_cmaps += ((int*)num_node_cmaps)[iproc];
+ }
}
/* Define variable for the internal element information */
if (num_int_elem > 0) {
- if ((status = nc_def_dim(neid, DIM_NUM_INT_ELEMS, num_int_elem, &dimid[0])) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NUM_INT_ELEMS, num_int_elem, &dimid[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to dimension \"%s\" in file id %d",
- DIM_NUM_INT_ELEMS, neid);
+ DIM_NUM_INT_ELEMS, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
- if ((status = nc_def_var(neid, VAR_ELEM_MAP_INT, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_ELEM_MAP_INT, map_type, 1, dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_ELEM_MAP_INT, neid);
+ VAR_ELEM_MAP_INT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, varid, 1);
/* and the index variable */
- if ((status = nc_def_var(neid, VAR_ELEM_MAP_INT_IDX, index_type, 1,
+ if ((status = nc_def_var(exoid, VAR_ELEM_MAP_INT_IDX, index_type, 1,
&dimid_npf, &varid_idx[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_ELEM_MAP_INT_IDX, neid);
+ VAR_ELEM_MAP_INT_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
@@ -372,40 +397,41 @@ int ne_put_loadbal_param_cc(int neid,
/* Define variable for the border element information */
if (num_bor_elem > 0) {
- if ((status = nc_def_dim(neid, DIM_NUM_BOR_ELEMS, num_bor_elem, &dimid[0])) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NUM_BOR_ELEMS, num_bor_elem, &dimid[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to dimension \"%s\" in file id %d",
- DIM_NUM_BOR_ELEMS, neid);
+ DIM_NUM_BOR_ELEMS, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
- if ((status = nc_def_var(neid, VAR_ELEM_MAP_BOR, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_ELEM_MAP_BOR, map_type, 1, dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_ELEM_MAP_BOR, neid);
+ VAR_ELEM_MAP_BOR, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, varid, 1);
/* and the index variable */
- if ((status = nc_def_var(neid, VAR_ELEM_MAP_BOR_IDX, index_type, 1,
+ if ((status = nc_def_var(exoid, VAR_ELEM_MAP_BOR_IDX, index_type, 1,
&dimid_npf, &varid_idx[1])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_ELEM_MAP_BOR_IDX, neid);
+ VAR_ELEM_MAP_BOR_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
@@ -414,40 +440,41 @@ int ne_put_loadbal_param_cc(int neid,
if (num_int_node > 0) {
/* Define variable for vector of internal FEM node IDs */
- if ((status = nc_def_dim(neid, DIM_NUM_INT_NODES, num_int_node, &dimid[0])) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NUM_INT_NODES, num_int_node, &dimid[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to dimension \"%s\" in file id %d",
- DIM_NUM_INT_NODES, neid);
+ DIM_NUM_INT_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
- if ((status = nc_def_var(neid, VAR_NODE_MAP_INT, NC_INT, 1, &dimid[0], &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_NODE_MAP_INT, map_type, 1, &dimid[0], &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_NODE_MAP_INT, neid);
+ VAR_NODE_MAP_INT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, varid, 1);
/* and the index variable */
- if ((status = nc_def_var(neid, VAR_NODE_MAP_INT_IDX, index_type, 1,
+ if ((status = nc_def_var(exoid, VAR_NODE_MAP_INT_IDX, index_type, 1,
&dimid_npf, &varid_idx[2])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_NODE_MAP_INT_IDX, neid);
+ VAR_NODE_MAP_INT_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
@@ -456,40 +483,41 @@ int ne_put_loadbal_param_cc(int neid,
if (num_bor_node > 0) {
/* Define variable for vector of border FEM node IDs */
- if ((status = nc_def_dim(neid, DIM_NUM_BOR_NODES, num_bor_node, &dimid[1])) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NUM_BOR_NODES, num_bor_node, &dimid[1])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to dimension \"%s\" in file id %d",
- DIM_NUM_BOR_NODES, neid);
+ DIM_NUM_BOR_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
- if ((status = nc_def_var(neid, VAR_NODE_MAP_BOR, NC_INT, 1, &dimid[1], &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_NODE_MAP_BOR, map_type, 1, &dimid[1], &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_NODE_MAP_BOR, neid);
+ VAR_NODE_MAP_BOR, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, varid, 1);
/* and the index variable */
- if ((status = nc_def_var(neid, VAR_NODE_MAP_BOR_IDX, index_type, 1,
+ if ((status = nc_def_var(exoid, VAR_NODE_MAP_BOR_IDX, index_type, 1,
&dimid_npf, &varid_idx[3])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_NODE_MAP_BOR_IDX, neid);
+ VAR_NODE_MAP_BOR_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
@@ -498,40 +526,41 @@ int ne_put_loadbal_param_cc(int neid,
if (num_ext_node > 0) {
/* Define dimension for vector of external FEM node IDs */
- if ((status = nc_def_dim(neid, DIM_NUM_EXT_NODES, num_ext_node, &dimid[2])) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NUM_EXT_NODES, num_ext_node, &dimid[2])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to dimension \"%s\" in file id %d",
- DIM_NUM_EXT_NODES, neid);
+ DIM_NUM_EXT_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
- if ((status = nc_def_var(neid, VAR_NODE_MAP_EXT, NC_INT, 1, &dimid[2], &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_NODE_MAP_EXT, map_type, 1, &dimid[2], &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_NODE_MAP_EXT, neid);
+ VAR_NODE_MAP_EXT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
+ ex_compress_variable(exoid, varid, 1);
/* and the index variable */
- if ((status = nc_def_var(neid, VAR_NODE_MAP_EXT_IDX, index_type, 1,
+ if ((status = nc_def_var(exoid, VAR_NODE_MAP_EXT_IDX, index_type, 1,
&dimid_npf, &varid_idx[4])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_NODE_MAP_EXT_IDX, neid);
+ VAR_NODE_MAP_EXT_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
@@ -540,53 +569,53 @@ int ne_put_loadbal_param_cc(int neid,
/* Output the communication map dimensions */
if (num_n_cmaps > 0) {
- if ((status = nc_def_dim(neid, DIM_NUM_N_CMAPS, num_n_cmaps, &dimid[0])) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NUM_N_CMAPS, num_n_cmaps, &dimid[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to add dimension \"%s\" in file ID %d",
- DIM_NUM_N_CMAPS, neid);
+ DIM_NUM_N_CMAPS, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
/* Add variables for communication maps */
- if ((status = nc_def_var(neid, VAR_N_COMM_IDS, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_N_COMM_IDS, id_type, 1, dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_N_COMM_IDS, neid);
+ VAR_N_COMM_IDS, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
- if ((status = nc_def_var(neid, VAR_N_COMM_STAT, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_N_COMM_STAT, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_N_COMM_STAT, neid);
+ VAR_N_COMM_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
/* and the index variable */
- if ((status = nc_def_var(neid, VAR_N_COMM_INFO_IDX, index_type, 1,
+ if ((status = nc_def_var(exoid, VAR_N_COMM_INFO_IDX, index_type, 1,
&dimid_npf, &varid_idx[5])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_N_COMM_INFO_IDX, neid);
+ VAR_N_COMM_INFO_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
@@ -594,53 +623,53 @@ int ne_put_loadbal_param_cc(int neid,
} /* End "if (num_n_cmaps > 0)" */
if (num_e_cmaps > 0) {
- if ((status = nc_def_dim(neid, DIM_NUM_E_CMAPS, num_e_cmaps, &dimid[0])) != NC_NOERR) {
+ if ((status = nc_def_dim(exoid, DIM_NUM_E_CMAPS, num_e_cmaps, &dimid[0])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to add dimension \"%s\" in file ID %d",
- DIM_NUM_E_CMAPS, neid);
+ DIM_NUM_E_CMAPS, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
/* Add variables for elemental communication maps */
- if ((status = nc_def_var(neid, VAR_E_COMM_IDS, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_E_COMM_IDS, id_type, 1, dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_E_COMM_IDS, neid);
+ VAR_E_COMM_IDS, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
- if ((status = nc_def_var(neid, VAR_E_COMM_STAT, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, VAR_E_COMM_STAT, NC_INT, 1, dimid, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_E_COMM_STAT, neid);
+ VAR_E_COMM_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
/* and the index variable */
- if ((status = nc_def_var(neid, VAR_E_COMM_INFO_IDX, index_type, 1,
+ if ((status = nc_def_var(exoid, VAR_E_COMM_INFO_IDX, index_type, 1,
&dimid_npf, &varid_idx[6])) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to define variable \"%s\" in file ID %d",
- VAR_E_COMM_INFO_IDX, neid);
+ VAR_E_COMM_INFO_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
/* Leave define mode before returning */
- ne_leavedef(neid, func_name);
+ ex_leavedef(exoid, func_name);
return (EX_FATAL);
}
@@ -648,7 +677,7 @@ int ne_put_loadbal_param_cc(int neid,
} /* End "if (num_e_cmaps > 0)" */
/* Leave define mode */
- if (ne_leavedef(neid, func_name) != EX_NOERR)
+ if (ex_leavedef(exoid, func_name) != EX_NOERR)
return (EX_FATAL);
/* need to reset these counters */
@@ -662,74 +691,99 @@ int ne_put_loadbal_param_cc(int neid,
/* Update the status vectors */
for(iproc=0; iproc < num_proc_in_f; iproc++) {
+ size_t nin;
+ size_t nbn;
+ size_t nen;
+ size_t nie;
+ size_t nbe;
+ size_t nnc;
+ size_t nec;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ nie = ((int64_t*)num_int_elems)[iproc];
+ nin = ((int64_t*)num_int_nodes)[iproc];
+ nbe = ((int64_t*)num_bor_elems)[iproc];
+ nbn = ((int64_t*)num_bor_nodes)[iproc];
+ nen = ((int64_t*)num_ext_nodes)[iproc];
+ nec = ((int64_t*)num_elem_cmaps)[iproc];
+ nnc = ((int64_t*)num_node_cmaps)[iproc];
+ } else {
+ nie = ((int*)num_int_elems)[iproc];
+ nin = ((int*)num_int_nodes)[iproc];
+ nbe = ((int*)num_bor_elems)[iproc];
+ nbn = ((int*)num_bor_nodes)[iproc];
+ nen = ((int*)num_ext_nodes)[iproc];
+ nec = ((int*)num_elem_cmaps)[iproc];
+ nnc = ((int*)num_node_cmaps)[iproc];
+ }
+
start[0] = iproc;
- if (num_int_nodes[iproc] > 0)
+ if (nin > 0)
nmstat = 1;
else
nmstat = 0;
- if ((status = nc_put_var1_int(neid, varid_nm[0], start, &nmstat)) != NC_NOERR) {
+ if ((status = nc_put_var1_int(exoid, varid_nm[0], start, &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output status int node map in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if (num_bor_nodes[iproc] > 0)
+ if (nbn > 0)
nmstat = 1;
else
nmstat = 0;
- if ((status = nc_put_var1_int(neid, varid_nm[1], start, &nmstat)) != NC_NOERR) {
+ if ((status = nc_put_var1_int(exoid, varid_nm[1], start, &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output status bor node map in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if (num_ext_nodes[iproc] > 0)
+ if (nen > 0)
nmstat = 1;
else
nmstat = 0;
- if ((status = nc_put_var1_int(neid, varid_nm[2], start, &nmstat)) != NC_NOERR) {
+ if ((status = nc_put_var1_int(exoid, varid_nm[2], start, &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output status ext node map in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if (num_int_elems[iproc] > 0)
+ if (nie > 0)
nmstat = 1;
else
nmstat = 0;
- if ((status = nc_put_var1_int(neid, varid_em[0], start, &nmstat)) != NC_NOERR) {
+ if ((status = nc_put_var1_int(exoid, varid_em[0], start, &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output status int elem map in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if (num_bor_elems[iproc] > 0)
+ if (nbe > 0)
nmstat = 1;
else
nmstat = 0;
- if ((status = nc_put_var1_int(neid, varid_em[1], start, &nmstat)) != NC_NOERR) {
+ if ((status = nc_put_var1_int(exoid, varid_em[1], start, &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output status bor elem map in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -737,13 +791,17 @@ int ne_put_loadbal_param_cc(int neid,
/* now fill the index variables */
if (varid_idx[0] > 0) {
/* increment to the next starting position */
- num_int_elem += num_int_elems[iproc];
- status = nc_put_var1_longlong(neid, varid_idx[0], start, &num_int_elem);
+ num_int_elem += nie;
+#if defined(NC_NETCDF4)
+ status = nc_put_var1_longlong(exoid, varid_idx[0], start, (long long*)&num_int_elem);
+#else
+ status = nc_put_var1_int(exoid, varid_idx[0], start, &num_int_elem);
+#endif
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output internal element map index in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -751,13 +809,17 @@ int ne_put_loadbal_param_cc(int neid,
if (varid_idx[1] > 0) {
/* increment to the next starting position */
- num_bor_elem += num_bor_elems[iproc];
- status = nc_put_var1_longlong(neid, varid_idx[1], start, &num_bor_elem);
+ num_bor_elem += nbe;
+#if defined(NC_NETCDF4)
+ status = nc_put_var1_longlong(exoid, varid_idx[1], start, (long long*)&num_bor_elem);
+#else
+ status = nc_put_var1_int(exoid, varid_idx[1], start, &num_bor_elem);
+#endif
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output border element map index in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -765,13 +827,17 @@ int ne_put_loadbal_param_cc(int neid,
if (varid_idx[2] > 0) {
/* increment to the next starting position */
- num_int_node += num_int_nodes[iproc];
- status = nc_put_var1_longlong(neid, varid_idx[2], start, &num_int_node);
+ num_int_node += nin;
+#if defined(NC_NETCDF4)
+ status = nc_put_var1_longlong(exoid, varid_idx[2], start, (long long*)&num_int_node);
+#else
+ status = nc_put_var1_int(exoid, varid_idx[2], start, &num_int_node);
+#endif
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output internal node map index in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -779,13 +845,17 @@ int ne_put_loadbal_param_cc(int neid,
if (varid_idx[3] > 0) {
/* increment to the next starting position */
- num_bor_node += num_bor_nodes[iproc];
- status = nc_put_var1_longlong(neid, varid_idx[3], start, &num_bor_node);
+ num_bor_node += nbn;
+#if defined(NC_NETCDF4)
+ status = nc_put_var1_longlong(exoid, varid_idx[3], start, (long long*)&num_bor_node);
+#else
+ status = nc_put_var1_int(exoid, varid_idx[3], start, &num_bor_node);
+#endif
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output border node map index in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -793,13 +863,17 @@ int ne_put_loadbal_param_cc(int neid,
if (varid_idx[4] > 0) {
/* increment to the next starting position */
- num_ext_node += num_ext_nodes[iproc];
- status = nc_put_var1_longlong(neid, varid_idx[4], start, &num_ext_node);
+ num_ext_node += nen;
+#if defined(NC_NETCDF4)
+ status = nc_put_var1_longlong(exoid, varid_idx[4], start, (long long*)&num_ext_node);
+#else
+ status = nc_put_var1_int(exoid, varid_idx[4], start, &num_ext_node);
+#endif
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output external node map index in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -807,13 +881,17 @@ int ne_put_loadbal_param_cc(int neid,
if (varid_idx[5] > 0) {
/* increment to the next starting position */
- num_n_cmaps += num_node_cmaps[iproc];
- status = nc_put_var1_longlong(neid, varid_idx[5], start, &num_n_cmaps);
+ num_n_cmaps += nnc;
+#if defined(NC_NETCDF4)
+ status = nc_put_var1_longlong(exoid, varid_idx[5], start, (long long*)&num_n_cmaps);
+#else
+ status = nc_put_var1_int(exoid, varid_idx[5], start, &num_n_cmaps);
+#endif
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output node communication map index in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -821,13 +899,17 @@ int ne_put_loadbal_param_cc(int neid,
if (varid_idx[6] > 0) {
/* increment to the next starting position */
- num_e_cmaps += num_elem_cmaps[iproc];
- status = nc_put_var1_longlong(neid, varid_idx[6], start, &num_e_cmaps);
+ num_e_cmaps += nec;
+#if defined(NC_NETCDF4)
+ status = nc_put_var1_longlong(exoid, varid_idx[6], start, (long long*)&num_e_cmaps);
+#else
+ status = nc_put_var1_int(exoid, varid_idx[6], start, &num_e_cmaps);
+#endif
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output elem communication map index in file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
diff --git a/exodus/cbind/src/expmap.c b/exodus/cbind/src/ex_put_map.c
similarity index 82%
rename from exodus/cbind/src/expmap.c
rename to exodus/cbind/src/ex_put_map.c
index 90292a4..2e9b413 100644
--- a/exodus/cbind/src/expmap.c
+++ b/exodus/cbind/src/ex_put_map.c
@@ -87,9 +87,10 @@ error = ex_put_map(exoid, elem_map);
*/
int ex_put_map (int exoid,
- const int *elem_map)
+ const void_int *elem_map)
{
int numelemdim, dims[1], mapid, status;
+ int map_int_type;
char errmsg[MAX_ERR_LENGTH];
exerrval = 0; /* clear error code */
@@ -103,43 +104,41 @@ int ex_put_map (int exoid,
}
/* put netcdf file into define mode */
+ if ((status = nc_redef (exoid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to put file id %d into define mode",
+ exoid);
+ ex_err("ex_put_map",errmsg,exerrval);
+ return (EX_FATAL);
+ }
- if ((status = nc_redef (exoid)) != NC_NOERR)
- {
+ /* create a variable array in which to store the element map */
+ dims[0] = numelemdim;
+
+ map_int_type = NC_INT;
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_DB) {
+ map_int_type = NC_INT64;
+ }
+
+ if ((status = nc_def_var(exoid, VAR_MAP, map_int_type, 1, dims, &mapid)) != NC_NOERR) {
+ if (status == NC_ENAMEINUSE) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to put file id %d into define mode",
+ "Error: element map already exists in file id %d",
exoid);
ex_err("ex_put_map",errmsg,exerrval);
- return (EX_FATAL);
}
-
-
- /* create a variable array in which to store the element map */
-
- dims[0] = numelemdim;
-
- if ((status = nc_def_var(exoid, VAR_MAP, NC_INT, 1, dims, &mapid)) != NC_NOERR)
- {
- if (status == NC_ENAMEINUSE)
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: element map already exists in file id %d",
- exoid);
- ex_err("ex_put_map",errmsg,exerrval);
- }
- else
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to create element map array in file id %d",
- exoid);
- ex_err("ex_put_map",errmsg,exerrval);
- }
- goto error_ret; /* exit define mode and return */
+ else {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to create element map array in file id %d",
+ exoid);
+ ex_err("ex_put_map",errmsg,exerrval);
}
-
+ goto error_ret; /* exit define mode and return */
+ }
+ ex_compress_variable(exoid, mapid, 1);
/* leave define mode */
if ((status = nc_enddef (exoid)) != NC_NOERR)
@@ -154,7 +153,11 @@ int ex_put_map (int exoid,
/* write out the element order map */
- status = nc_put_var_int(exoid, mapid, elem_map);
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_put_var_longlong(exoid, mapid, elem_map);
+ } else {
+ status = nc_put_var_int(exoid, mapid, elem_map);
+ }
if (status != NC_NOERR)
{
diff --git a/exodus/cbind/src/ex_put_map_param.c b/exodus/cbind/src/ex_put_map_param.c
new file mode 100644
index 0000000..ebf957f
--- /dev/null
+++ b/exodus/cbind/src/ex_put_map_param.c
@@ -0,0 +1,320 @@
+/*
+ * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
+ * retains certain rights in this software.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * * Neither the name of Sandia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/*****************************************************************************
+*
+* expmp - ex_put_map_param
+*
+* entry conditions -
+* input parameters:
+* int exoid exodus file id
+* int num_node_maps number of node maps
+* int num_elem_maps number of element maps
+*
+* exit conditions -
+*
+*
+*****************************************************************************/
+
+#include "exodusII.h"
+#include "exodusII_int.h"
+#include <assert.h>
+#include <stdlib.h>
+
+/*!
+ * defines the number of node and element maps. It is more efficient
+ * to define both of these at the same time; however, they can be
+ * defined in separate calls by setting only one of the counts to a
+ * non-zero value. It is an error to redefine the number of node or
+ * element maps.
+ * \param exoid exodus file id
+ * \param num_node_maps number of node maps
+ * \param num_elem_maps number of element maps
+ */
+
+int ex_put_map_param (int exoid,
+ int num_node_maps,
+ int num_elem_maps)
+{
+ int dim[2], dimid, strdim, varid, status;
+ int var_nm_id, var_em_id;
+ int i;
+ char errmsg[MAX_ERR_LENGTH];
+ int id_type = NC_INT;
+ int int_type = NC_INT;
+
+ exerrval = 0; /* clear error code */
+
+ if (ex_int64_status(exoid) & EX_IDS_INT64_DB) {
+ id_type = NC_INT64;
+ }
+ if (ex_int64_status(exoid) & EX_BULK_INT64_DB) {
+ int_type = NC_INT64;
+ }
+
+ /* return if these have been defined before */
+ if ( (num_node_maps > 0 && ((nc_inq_dimid (exoid, DIM_NUM_NM, &dimid)) == NC_NOERR)) ||
+ (num_elem_maps > 0 && ((nc_inq_dimid (exoid, DIM_NUM_EM, &dimid)) == NC_NOERR)) )
+ {
+ exerrval = EX_MSG;
+ sprintf(errmsg,
+ "Error: number of maps already defined for file id %d",exoid);
+ ex_err("ex_put_map_param",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ if ( (num_node_maps > 0) || (num_elem_maps > 0) ) {
+
+ /* inquire previously defined dimensions */
+ if ((status = nc_inq_dimid (exoid, DIM_STR_NAME, &strdim)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to get string length in file id %d",exoid);
+ ex_err("ex_put_map_param",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* put file into define mode */
+ if ((status = nc_redef (exoid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to put file id %d into define mode", exoid);
+ ex_err("ex_put_map_param",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+
+ /* node maps: */
+ if (num_node_maps > 0) {
+
+ if ((status = nc_def_dim(exoid, DIM_NUM_NM, num_node_maps, &dimid)) != NC_NOERR)
+ {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to define number of node maps in file id %d",exoid);
+ ex_err("ex_put_map_param",errmsg,exerrval);
+ goto error_ret; /* exit define mode and return */
+ }
+
+ /* node maps id array: */
+ dim[0] = dimid;
+ if ((status = nc_def_var(exoid, VAR_NM_PROP(1), id_type, 1, dim, &var_nm_id)) != NC_NOERR)
+ {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to create node maps property array in file id %d",
+ exoid);
+ ex_err("ex_put_map_param",errmsg,exerrval);
+ goto error_ret; /* exit define mode and return */
+ }
+
+ /* store property name as attribute of property array variable */
+ if ((status=nc_put_att_text(exoid, var_nm_id, ATT_PROP_NAME, 3, "ID")) != NC_NOERR)
+ {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to store node map property name %s in file id %d",
+ "ID",exoid);
+ ex_err("ex_put_map_param",errmsg,exerrval);
+ goto error_ret; /* exit define mode and return */
+ }
+
+ /* Node map names... */
+ dim[0] = dimid;
+ dim[1] = strdim;
+
+ if (nc_def_var(exoid, VAR_NAME_NM, NC_CHAR, 2, dim, &varid) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to define node map name array in file id %d",exoid);
+ ex_err("ex_put_map_param",errmsg,exerrval);
+ goto error_ret; /* exit define mode and return */
+ }
+
+ /* determine number of nodes */
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_NODES, &dimid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: couldn't determine number of nodes in file id %d",
+ exoid);
+ ex_err("ex_put_node_map",errmsg,exerrval);
+ goto error_ret; /* exit define mode and return */
+ }
+
+ dim[0] = dimid;
+
+ /* create variable array in which to store the node maps */
+ for (i=0; i < num_node_maps; i++) {
+ if ((status = nc_def_var(exoid,VAR_NODE_MAP(i+1),int_type,1,dim,&varid)) != NC_NOERR) {
+ if (status == NC_ENAMEINUSE) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: node map %d already defined in file id %d",
+ i,exoid);
+ ex_err("ex_put_node_map",errmsg,exerrval);
+ } else {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to create node map %d in file id %d",
+ i,exoid);
+ ex_err("ex_put_node_map",errmsg,exerrval);
+ }
+ goto error_ret; /* exit define mode and return */
+ }
+ ex_compress_variable(exoid, varid, 1);
+ }
+ }
+
+ /* element maps: */
+ if (num_elem_maps > 0) {
+ if ((status = nc_def_dim (exoid, DIM_NUM_EM, num_elem_maps,&dimid)) != NC_NOERR)
+ {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to define number of element maps in file id %d",
+ exoid);
+ ex_err("ex_put_map_param",errmsg,exerrval);
+ goto error_ret; /* exit define mode and return */
+ }
+
+ /* element maps id array: */
+ dim[0] = dimid;
+ if ((status = nc_def_var(exoid, VAR_EM_PROP(1), id_type, 1, dim, &var_em_id)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to create element maps property array in file id %d",
+ exoid);
+ ex_err("ex_put_map_param",errmsg,exerrval);
+ goto error_ret; /* exit define mode and return */
+ }
+
+ /* store property name as attribute of property array variable */
+ if ((status=nc_put_att_text(exoid, var_em_id, ATT_PROP_NAME, 3, "ID")) != NC_NOERR)
+ {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to store element map property name %s in file id %d",
+ "ID",exoid);
+ ex_err("ex_put_map_param",errmsg,exerrval);
+ goto error_ret; /* exit define mode and return */
+ }
+
+ /* Element map names... */
+ dim[0] = dimid;
+ dim[1] = strdim;
+
+ if ((status = nc_def_var(exoid, VAR_NAME_EM, NC_CHAR, 2, dim, &varid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to define element map name array in file id %d",exoid);
+ ex_err("ex_put_map_param",errmsg,exerrval);
+ goto error_ret; /* exit define mode and return */
+ }
+
+ /* determine number of elements */
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_ELEM, &dimid)) != NC_NOERR)
+ {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: couldn't determine number of elements in file id %d",
+ exoid);
+ ex_err("ex_put_elem_map",errmsg,exerrval);
+ goto error_ret; /* exit define mode and return */
+ }
+
+ /* create variable array in which to store the element maps */
+ dim[0] = dimid;
+ for (i = 0; i < num_elem_maps; i++) {
+ if ((status = nc_def_var(exoid,VAR_ELEM_MAP(i+1),int_type,1,dim, &varid)) != NC_NOERR) {
+ if (status == NC_ENAMEINUSE) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: element map %d already defined in file id %d",
+ i,exoid);
+ ex_err("ex_put_elem_map",errmsg,exerrval);
+ }
+ else {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to create element map %d in file id %d",
+ i,exoid);
+ ex_err("ex_put_elem_map",errmsg,exerrval);
+ }
+ goto error_ret; /* exit define mode and return */
+ }
+ ex_compress_variable(exoid, varid, 1);
+ }
+ }
+
+ /* leave define mode */
+ if ((status = nc_enddef (exoid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to complete variable definitions in file id %d",exoid);
+ ex_err("ex_put_map_param",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* Fill the id arrays with EX_INVALID_ID */
+ {
+ int maxset = num_node_maps > num_elem_maps ? num_node_maps : num_elem_maps;
+ int *invalid_ids = malloc(maxset*sizeof(int));
+ for (i=0; i < maxset; i++) {
+ invalid_ids[i] = EX_INVALID_ID;
+ }
+ if (num_node_maps > 0) {
+ status = nc_put_var_int(exoid, var_nm_id, invalid_ids);
+ assert(status == NC_NOERR);
+ }
+ if (num_elem_maps > 0) {
+ status = nc_put_var_int(exoid, var_em_id, invalid_ids);
+ assert(status == NC_NOERR);
+ }
+ free(invalid_ids);
+ }
+ }
+
+ return (EX_NOERR);
+
+ /* Fatal error: exit definition mode and return */
+ error_ret:
+ if (nc_enddef (exoid) != NC_NOERR) /* exit define mode */
+ {
+ sprintf(errmsg,
+ "Error: failed to complete definition for file id %d",
+ exoid);
+ ex_err("ex_put_map_param",errmsg,exerrval);
+ }
+ return (EX_FATAL);
+}
diff --git a/exodus/cbind/src/exgoea.c b/exodus/cbind/src/ex_put_n_attr.c
similarity index 76%
rename from exodus/cbind/src/exgoea.c
rename to exodus/cbind/src/ex_put_n_attr.c
index 5d9cf8d..a1dcaef 100644
--- a/exodus/cbind/src/exgoea.c
+++ b/exodus/cbind/src/ex_put_n_attr.c
@@ -34,15 +34,16 @@
*/
/*****************************************************************************
*
-* exgeat - ex_get_one_elem_attr
+* expatt - ex_put_n_attr
*
* entry conditions -
* input parameters:
* int exoid exodus file id
-* int elem_blk_id element block id
+* int blk_type block type
+* int blk_id block id
+* float* attrib array of attributes
*
* exit conditions -
-* float* attrib array of attributes
*
* revision history -
*
@@ -53,14 +54,21 @@
#include "exodusII_int.h"
/*!
- * reads the attributes for an element block
- * \deprecated Use ex_get_one_attr()(exoid, EX_ELEM_BLOCK, elem_blk_id, attrib_index, attrib)
+ * \deprecated use ex_put_partial_attr()
+ *
+ * writes the attributes for an edge/face/element block
+ * \param exoid exodus file id
+ * \param blk_type block type
+ * \param blk_id block id
+ * \param attrib array of attributes
*/
-int ex_get_one_elem_attr (int exoid,
- int elem_blk_id,
- int attrib_index,
- void *attrib)
+int ex_put_n_attr (int exoid,
+ ex_entity_type blk_type,
+ ex_entity_id blk_id,
+ int64_t start_entity,
+ int64_t num_entity,
+ const void *attrib)
{
- return ex_get_one_attr( exoid, EX_ELEM_BLOCK, elem_blk_id, attrib_index, attrib );
+ return ex_put_partial_attr(exoid, blk_type, blk_id, start_entity, num_entity, attrib);
}
diff --git a/exodus/cbind/src/exgssd.c b/exodus/cbind/src/ex_put_n_coord.c
similarity index 64%
rename from exodus/cbind/src/exgssd.c
rename to exodus/cbind/src/ex_put_n_coord.c
index 020688d..9ba35ac 100644
--- a/exodus/cbind/src/exgssd.c
+++ b/exodus/cbind/src/ex_put_n_coord.c
@@ -34,15 +34,18 @@
*/
/*****************************************************************************
*
-* exgssd - ex_get_side_set_dist_fact
+* expcor - ex_put_n_coord
*
* entry conditions -
* input parameters:
* int exoid exodus file id
-* int side_set_id side set id
+* int start_node_num starting index (1-based) of coordinates to be written.
+* int num_nodes number of nodes to write coordinates for.
+* float* x_coord X coord array
+* float* y_coord y coord array
+* float* z_coord z coord array
*
* exit conditions -
-* float* side_set_dist_fact array of dist factors for side set
*
* revision history -
*
@@ -50,17 +53,25 @@
*****************************************************************************/
#include "exodusII.h"
-#include "exodusII_int.h"
/*!
- * reads the distribution factors for a single side set
- * \deprecated Use ex_get_set_dist_fact()(exoid, EX_SIDE_SET, side_set_id, side_set_dist_fact)
+ * \deprecated Use ex_put_partial_coord() instead.
+ * writes the coordinates of some of the nodes in the model
+ * Only writes the 'non-null' arrays.
+ * \param exoid exodus file id
+ * \param start_node_num the starting index (1-based) of the coordinates to be written
+ * \param num_nodes the number of nodes to write coordinates for.
+ * \param x_coor x coord array
+ * \param y_coor y coord array
+ * \param z_coor z coord array
*/
-int ex_get_side_set_dist_fact (int exoid,
- int side_set_id,
- void *side_set_dist_fact)
+int ex_put_n_coord (int exoid,
+ int64_t start_node_num,
+ int64_t num_nodes,
+ const void *x_coor,
+ const void *y_coor,
+ const void *z_coor)
{
- return ex_get_set_dist_fact(exoid, EX_SIDE_SET, side_set_id,
- side_set_dist_fact);
+ return ex_put_partial_coord(exoid, start_node_num, num_nodes, x_coor, y_coor, z_coor);
}
diff --git a/exodus/cbind/src/exgsp.c b/exodus/cbind/src/ex_put_n_elem_attr.c
similarity index 59%
copy from exodus/cbind/src/exgsp.c
copy to exodus/cbind/src/ex_put_n_elem_attr.c
index 71cbf07..96fef2d 100644
--- a/exodus/cbind/src/exgsp.c
+++ b/exodus/cbind/src/ex_put_n_elem_attr.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -32,43 +32,41 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-
-/*****************************************************************************
- *
- * exgsp - ex_get_side_set_param
+/*****************************************************************************/
+/*****************************************************************************/
+/* Function(s) contained in this file:
*
- * entry conditions -
- * input parameters:
- * int exoid exodus file id
- * int side_set_id side set id
+ * ex_put_n_elem_attr()
*
- * exit conditions -
- * int* num_side_in_set number of sides in the side set
- * int* num_dist_fact_in_set number of distribution factors in the
- * side set
+ *****************************************************************************
*
- * revision history -
+ * Variable Index:
*
+ * exoid - The NetCDF ID of an already open NemesisI file.
+ * elem_blk_id - The element block ID.
+ * start_elem_num - The starting index of the elements to be
+ * obtained.
+ * num_elems - The number of FEM elements to read coords for.
+ * attrib - Pointer to the attribute vector.
*
- *****************************************************************************/
+ */
+/*****************************************************************************/
+/*****************************************************************************/
+/*****************************************************************************/
+#include <stdio.h>
#include "exodusII.h"
+#include "exodusII_int.h"
-/*!
- * reads the number of sides and the number of distribution factors which
- * describe a single side set
- * \param exoid exodus file id
- * \param side_set_id side set id
- * \param[out] num_side_in_set number of sides in the side set
- * \param[out] num_dist_fact_in_set number of distribution factors in the
- * \deprecated Use ex_get_set_param()(exoid, EX_SIDE_SET, side_set_id, num_side_in_set, num_dist_fact_in_set)
+/*
+ * \deprecated Use ex_put_partial_attr() instead.
*/
-int ex_get_side_set_param (int exoid,
- int side_set_id,
- int *num_side_in_set,
- int *num_dist_fact_in_set)
+int ex_put_n_elem_attr (int exoid,
+ ex_entity_id elem_blk_id,
+ int64_t start_elem_num,
+ int64_t num_elems,
+ void *attrib)
{
- return ex_get_set_param(exoid, EX_SIDE_SET, side_set_id,
- num_side_in_set, num_dist_fact_in_set);
+ return ex_put_partial_attr(exoid, EX_ELEM_BLOCK, elem_blk_id, start_elem_num, num_elems, attrib);
}
diff --git a/exodus/cbind/src/exgsp.c b/exodus/cbind/src/ex_put_n_elem_conn.c
similarity index 59%
copy from exodus/cbind/src/exgsp.c
copy to exodus/cbind/src/ex_put_n_elem_conn.c
index 71cbf07..d906cde 100644
--- a/exodus/cbind/src/exgsp.c
+++ b/exodus/cbind/src/ex_put_n_elem_conn.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -32,43 +32,38 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-
-/*****************************************************************************
- *
- * exgsp - ex_get_side_set_param
+/*****************************************************************************/
+/*****************************************************************************/
+/* Function(s) contained in this file:
*
- * entry conditions -
- * input parameters:
- * int exoid exodus file id
- * int side_set_id side set id
+ * ex_put_n_elem_conn()
*
- * exit conditions -
- * int* num_side_in_set number of sides in the side set
- * int* num_dist_fact_in_set number of distribution factors in the
- * side set
+ *****************************************************************************
*
- * revision history -
+ * Variable Index:
*
+ * exoid - The NetCDF ID of an already open NemesisI file.
+ * elem_blk_id - The element block ID.
+ * start_elem_num - The starting index of the elements to be
+ * obtained.
+ * num_elems - The number of FEM elements to read coords for.
+ * connect - Pointer to the connectivity vector.
*
- *****************************************************************************/
-
+ */
+/*****************************************************************************/
+/*****************************************************************************/
+/*****************************************************************************/
#include "exodusII.h"
/*!
- * reads the number of sides and the number of distribution factors which
- * describe a single side set
- * \param exoid exodus file id
- * \param side_set_id side set id
- * \param[out] num_side_in_set number of sides in the side set
- * \param[out] num_dist_fact_in_set number of distribution factors in the
- * \deprecated Use ex_get_set_param()(exoid, EX_SIDE_SET, side_set_id, num_side_in_set, num_dist_fact_in_set)
+ * \deprecated Use ex_put_partial_elem_conn() instead.
*/
-int ex_get_side_set_param (int exoid,
- int side_set_id,
- int *num_side_in_set,
- int *num_dist_fact_in_set)
+int ex_put_n_elem_conn (int exoid,
+ ex_entity_id elem_blk_id,
+ int64_t start_elem_num,
+ int64_t num_elems,
+ const void_int *connect)
{
- return ex_get_set_param(exoid, EX_SIDE_SET, side_set_id,
- num_side_in_set, num_dist_fact_in_set);
+ return ex_put_partial_elem_conn(exoid, elem_blk_id, start_elem_num, num_elems, connect);
}
diff --git a/exodus/cbind/src/exgns.c b/exodus/cbind/src/ex_put_n_elem_num_map.c
similarity index 73%
copy from exodus/cbind/src/exgns.c
copy to exodus/cbind/src/ex_put_n_elem_num_map.c
index eece0de..2e6dca6 100644
--- a/exodus/cbind/src/exgns.c
+++ b/exodus/cbind/src/ex_put_n_elem_num_map.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -34,34 +34,35 @@
*/
/*****************************************************************************
*
-* exgns - ex_get_node_set
+* ne_pennm - ex_put_n_elem_num_map
+*
+* environment - UNIX
*
* entry conditions -
* input parameters:
-* int exoid exodus file id
-* int node_set_id node set id
+* int exoid exodus file id
+* int start_ent first entry in elem_map
+* int num_ents number of entries in node_map
+* int* elem_map element numbering map array
*
* exit conditions -
-* int* node_set_node_list node list array for the node set
*
* revision history -
*
*
*****************************************************************************/
-#include <stdlib.h>
#include "exodusII.h"
-#include "exodusII_int.h"
-/*!
- * reads the node list for a single node set
- * \deprecated Use ex_get_set()(exoid, EX_NODE_SET, node_set_id, node_set_node_list, NULL)
+/*
+ * writes out a portion of the element numbering map to the database;
+ * this allows element numbers to be non-contiguous
*/
-int ex_get_node_set (int exoid,
- int node_set_id,
- int *node_set_node_list)
+int ex_put_n_elem_num_map (int exoid,
+ int64_t start_ent,
+ int64_t num_ents,
+ const void_int *elem_map)
{
- return ex_get_set(exoid, EX_NODE_SET, node_set_id, node_set_node_list,
- NULL);
+ return ex_put_partial_id_map(exoid, EX_ELEM_MAP, start_ent, num_ents, elem_map);
}
diff --git a/exodus/cbind/src/expnnv.c b/exodus/cbind/src/ex_put_n_nodal_var.c
similarity index 64%
copy from exodus/cbind/src/expnnv.c
copy to exodus/cbind/src/ex_put_n_nodal_var.c
index 347be4b..c41b46c 100644
--- a/exodus/cbind/src/expnnv.c
+++ b/exodus/cbind/src/ex_put_n_nodal_var.c
@@ -70,67 +70,10 @@
int ex_put_n_nodal_var (int exoid,
int time_step,
int nodal_var_index,
- int start_node,
- int num_nodes,
+ int64_t start_node,
+ int64_t num_nodes,
const void *nodal_var_vals)
{
- int status;
- int varid;
- size_t start[3], count[3];
- char errmsg[MAX_ERR_LENGTH];
-
- exerrval = 0; /* clear error code */
-
- if (ex_large_model(exoid) == 0) {
- /* write values of the nodal variable */
- if ((status = nc_inq_varid(exoid, VAR_NOD_VAR, &varid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Warning: could not find nodal variables in file id %d",
- exoid);
- ex_err("ex_put_n_nodal_var",errmsg,exerrval);
- return (EX_WARN);
- }
- start[0] = --time_step;
- start[1] = --nodal_var_index;
- start[2] = --start_node;
-
- count[0] = 1;
- count[1] = 1;
- count[2] = num_nodes;
- } else {
- /* nodal variables stored separately, find variable for this variable
- index */
- if ((status = nc_inq_varid(exoid, VAR_NOD_VAR_NEW(nodal_var_index), &varid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Warning: could not find nodal variable %d in file id %d",
- nodal_var_index, exoid);
- ex_err("ex_put_n_nodal_var",errmsg,exerrval);
- return (EX_WARN);
- }
-
- start[0] = --time_step;
- start[1] = --start_node;
-
- count[0] = 1;
- count[1] = num_nodes;
- }
-
- if (ex_comp_ws(exoid) == 4) {
- status = nc_put_vara_float(exoid, varid, start, count, nodal_var_vals);
- } else {
- status = nc_put_vara_double(exoid, varid, start, count, nodal_var_vals);
- }
-
- if (status != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to store nodal variables in file id %d",
- exoid);
- ex_err("ex_put_n_nodal_var",errmsg,exerrval);
- return (EX_FATAL);
- }
- return (EX_NOERR);
+ return ex_put_partial_nodal_var(exoid, time_step, nodal_var_index, start_node, num_nodes, nodal_var_vals);
}
diff --git a/exodus/cbind/src/exgnm.c b/exodus/cbind/src/ex_put_n_node_num_map.c
similarity index 75%
copy from exodus/cbind/src/exgnm.c
copy to exodus/cbind/src/ex_put_n_node_num_map.c
index 062c96e..7b77a2b 100644
--- a/exodus/cbind/src/exgnm.c
+++ b/exodus/cbind/src/ex_put_n_node_num_map.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -32,35 +32,37 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+
/*****************************************************************************
*
-* exgnm - ex_get_node_map
+* ne_pnnnm - ex_put_n_node_num_map
*
* entry conditions -
* input parameters:
-* int exoid exodus file id
-* int map_id node map id
+* int exoid exodus file id
+* int start_ent first entry in node_map
+* int num_ents number of entries in node_map
+* int* node_map node numbering map
*
* exit conditions -
-* int* node_map node map
*
* revision history -
*
*
*****************************************************************************/
-#include <stdlib.h>
#include "exodusII.h"
#include "exodusII_int.h"
-/*!
- * reads the node map with specified ID
- * \deprecated Use ex_get_num_map()(exoid, EX_NODE_MAP, map_id, node_map
+/*
+ * writes out the node numbering map to the database; allows node numbers
+ * to be non-contiguous
*/
-int ex_get_node_map( int exoid,
- int map_id,
- int *node_map )
+int ex_put_n_node_num_map (int exoid,
+ int64_t start_ent,
+ int64_t num_ents,
+ const void_int *node_map)
{
- return ex_get_num_map( exoid, EX_NODE_MAP, map_id, node_map );
+ return ex_put_partial_id_map(exoid, EX_NODE_MAP, start_ent, num_ents, node_map);
}
diff --git a/exodus/cbind/src/exgsp.c b/exodus/cbind/src/ex_put_n_node_set.c
similarity index 59%
copy from exodus/cbind/src/exgsp.c
copy to exodus/cbind/src/ex_put_n_node_set.c
index 71cbf07..e41e77a 100644
--- a/exodus/cbind/src/exgsp.c
+++ b/exodus/cbind/src/ex_put_n_node_set.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -33,42 +33,38 @@
*
*/
-/*****************************************************************************
+/*****************************************************************************/
+/*****************************************************************************/
+/* Function(s) contained in this file:
*
- * exgsp - ex_get_side_set_param
+ * ex_put_n_node_set()
*
- * entry conditions -
- * input parameters:
- * int exoid exodus file id
- * int side_set_id side set id
+ *****************************************************************************
*
- * exit conditions -
- * int* num_side_in_set number of sides in the side set
- * int* num_dist_fact_in_set number of distribution factors in the
- * side set
+ * Variable Index:
*
- * revision history -
- *
- *
- *****************************************************************************/
+ * exoid - The NetCDF ID of an already open NemesisI file.
+ * node_set_id - ID of node set to read.
+ * start_node_num - The starting index of the nodes to be read.
+ * num_nodes - The number of nodes to read in.
+ * node_set_node_list - List of node IDs in node set.
+ */
+/*****************************************************************************/
+/*****************************************************************************/
+/*****************************************************************************/
#include "exodusII.h"
-/*!
- * reads the number of sides and the number of distribution factors which
- * describe a single side set
- * \param exoid exodus file id
- * \param side_set_id side set id
- * \param[out] num_side_in_set number of sides in the side set
- * \param[out] num_dist_fact_in_set number of distribution factors in the
- * \deprecated Use ex_get_set_param()(exoid, EX_SIDE_SET, side_set_id, num_side_in_set, num_dist_fact_in_set)
+/*
+ * \deprecated Use ex_put_partial_set() instead
*/
-int ex_get_side_set_param (int exoid,
- int side_set_id,
- int *num_side_in_set,
- int *num_dist_fact_in_set)
+int ex_put_n_node_set (int exoid,
+ ex_entity_id node_set_id,
+ int64_t start_node_num,
+ int64_t num_nodes,
+ const void_int *node_set_node_list)
{
- return ex_get_set_param(exoid, EX_SIDE_SET, side_set_id,
- num_side_in_set, num_dist_fact_in_set);
+ return ex_put_partial_set(exoid, EX_NODE_SET, node_set_id, start_node_num, num_nodes,
+ node_set_node_list, NULL);
}
diff --git a/exodus/cbind/src/exgsp.c b/exodus/cbind/src/ex_put_n_node_set_df.c
similarity index 57%
copy from exodus/cbind/src/exgsp.c
copy to exodus/cbind/src/ex_put_n_node_set_df.c
index 71cbf07..eb7c9a0 100644
--- a/exodus/cbind/src/exgsp.c
+++ b/exodus/cbind/src/ex_put_n_node_set_df.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -33,42 +33,42 @@
*
*/
-/*****************************************************************************
+/*****************************************************************************/
+/*****************************************************************************/
+/*****************************************************************************/
+/* Function(s) contained in this file:
*
- * exgsp - ex_get_side_set_param
+ * ex_put_n_node_set_df()
*
- * entry conditions -
- * input parameters:
- * int exoid exodus file id
- * int side_set_id side set id
+ *****************************************************************************
*
- * exit conditions -
- * int* num_side_in_set number of sides in the side set
- * int* num_dist_fact_in_set number of distribution factors in the
- * side set
+ * Variable Index:
*
- * revision history -
- *
- *
- *****************************************************************************/
+ * exoid - The NetCDF ID of an already open NemesisI file.
+ * node_set_id - ID of node set to write.
+ * start_num - The starting index of the df's to be written.
+ * num_df_to_get - The number of distribution factors to write out.
+ * node_set_dist_fact - List of node distribution factors in node set.
+ */
+/*****************************************************************************/
+/*****************************************************************************/
+/*****************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
#include "exodusII.h"
+#include "exodusII_int.h"
/*!
- * reads the number of sides and the number of distribution factors which
- * describe a single side set
- * \param exoid exodus file id
- * \param side_set_id side set id
- * \param[out] num_side_in_set number of sides in the side set
- * \param[out] num_dist_fact_in_set number of distribution factors in the
- * \deprecated Use ex_get_set_param()(exoid, EX_SIDE_SET, side_set_id, num_side_in_set, num_dist_fact_in_set)
+ * \deprecated Use ex_put_partial_set_dist_fact()
*/
-int ex_get_side_set_param (int exoid,
- int side_set_id,
- int *num_side_in_set,
- int *num_dist_fact_in_set)
+int ex_put_n_node_set_df (int exoid,
+ ex_entity_id node_set_id,
+ int64_t start_num,
+ int64_t num_df_to_get,
+ void *node_set_dist_fact)
{
- return ex_get_set_param(exoid, EX_SIDE_SET, side_set_id,
- num_side_in_set, num_dist_fact_in_set);
+ return ex_put_partial_set_dist_fact(exoid, EX_NODE_SET, node_set_id, start_num, num_df_to_get,
+ node_set_dist_fact);
}
diff --git a/exodus/cbind/src/expoea.c b/exodus/cbind/src/ex_put_n_one_attr.c
similarity index 68%
copy from exodus/cbind/src/expoea.c
copy to exodus/cbind/src/ex_put_n_one_attr.c
index ddc1113..4296d2c 100644
--- a/exodus/cbind/src/expoea.c
+++ b/exodus/cbind/src/ex_put_n_one_attr.c
@@ -34,20 +34,18 @@
*/
/*****************************************************************************
*
-* expoea - ex_put_one_elem_attr
+* expoea - ex_put_n_one_attr
*
* entry conditions -
* input parameters:
* int exoid exodus file id
-* int elem_blk_id element block id
+* int obj_type object type (edge, face, elem block)
+* int obj_id object id (edge, face, elem block ID)
* int attrib_index index of attribute to write
* float* attrib array of attributes
*
* exit conditions -
*
-* revision history -
-* 20061003 - David Thompson - moved to ex_put_one_attr
-*
*
*****************************************************************************/
@@ -55,19 +53,24 @@
#include "exodusII_int.h"
/*!
- * writes the specified attribute for an element block
- * \param exoid exodus file id
- * \param elem_blk_id element block id
- * \param attrib_index index of attribute to write
- * \param attrib array of attributes
- * \deprecated Use ex_put_one_attr()(exoid, EX_ELEM_BLOCK, elem_blk_id, attrib_index, attrib)
-
+ * \deprecated Use ex_put_partial_one_attr() instead.
+ * writes the specified attribute for a block
+ * \param exoid exodus file id
+ * \param obj_type object type (edge, face, elem block)
+ * \param obj_id object id (edge, face, elem block ID)
+ * \param start_num the starting index of the attributes to be written
+ * \param num_ent the number of entities to write attributes for.
+ * \param attrib_index index of attribute to write
+ * \param attrib array of attributes
*/
-int ex_put_one_elem_attr (int exoid,
- int elem_blk_id,
- int attrib_index,
- const void *attrib)
+int ex_put_n_one_attr( int exoid,
+ ex_entity_type obj_type,
+ ex_entity_id obj_id,
+ int64_t start_num,
+ int64_t num_ent,
+ int attrib_index,
+ const void *attrib )
{
- return ex_put_one_attr( exoid, EX_ELEM_BLOCK, elem_blk_id, attrib_index, attrib );
+ return ex_put_partial_one_attr(exoid, obj_type, obj_id, start_num, num_ent, attrib_index, attrib);
}
diff --git a/exodus/cbind/src/exgsp.c b/exodus/cbind/src/ex_put_n_side_set.c
similarity index 55%
copy from exodus/cbind/src/exgsp.c
copy to exodus/cbind/src/ex_put_n_side_set.c
index 71cbf07..871fe11 100644
--- a/exodus/cbind/src/exgsp.c
+++ b/exodus/cbind/src/ex_put_n_side_set.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -33,42 +33,44 @@
*
*/
-/*****************************************************************************
+/*****************************************************************************/
+/*****************************************************************************/
+/*****************************************************************************/
+/* Function(s) contained in this file:
*
- * exgsp - ex_get_side_set_param
+ * ex_put_n_side_set()
*
- * entry conditions -
- * input parameters:
- * int exoid exodus file id
- * int side_set_id side set id
+ *****************************************************************************
*
- * exit conditions -
- * int* num_side_in_set number of sides in the side set
- * int* num_dist_fact_in_set number of distribution factors in the
- * side set
+ * Variable Index:
*
- * revision history -
- *
- *
- *****************************************************************************/
+ * exoid - The NetCDF ID of an already open NemesisI file.
+ * side_set_id - ID of side set to read.
+ * start_side_num - The starting index of the sides to be read.
+ * num_sides - The number of sides to read in.
+ * side_set_elem_list - List of element IDs in side set.
+ * side_set_side_list - List of side IDs in side set.
+ */
+/*****************************************************************************/
+/*****************************************************************************/
+/*****************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
#include "exodusII.h"
+#include "exodusII_int.h"
/*!
- * reads the number of sides and the number of distribution factors which
- * describe a single side set
- * \param exoid exodus file id
- * \param side_set_id side set id
- * \param[out] num_side_in_set number of sides in the side set
- * \param[out] num_dist_fact_in_set number of distribution factors in the
- * \deprecated Use ex_get_set_param()(exoid, EX_SIDE_SET, side_set_id, num_side_in_set, num_dist_fact_in_set)
+ * /deprecated use ex_put_partial_set() instead
*/
-int ex_get_side_set_param (int exoid,
- int side_set_id,
- int *num_side_in_set,
- int *num_dist_fact_in_set)
+int ex_put_n_side_set (int exoid,
+ ex_entity_id side_set_id,
+ int64_t start_side_num,
+ int64_t num_sides,
+ const void_int *side_set_elem_list,
+ const void_int *side_set_side_list)
{
- return ex_get_set_param(exoid, EX_SIDE_SET, side_set_id,
- num_side_in_set, num_dist_fact_in_set);
+ return ex_put_partial_set(exoid, EX_SIDE_SET, side_set_id, start_side_num, num_sides,
+ side_set_elem_list, side_set_side_list);
}
diff --git a/exodus/cbind/src/exgsp.c b/exodus/cbind/src/ex_put_n_side_set_df.c
similarity index 57%
rename from exodus/cbind/src/exgsp.c
rename to exodus/cbind/src/ex_put_n_side_set_df.c
index 71cbf07..6ce9fea 100644
--- a/exodus/cbind/src/exgsp.c
+++ b/exodus/cbind/src/ex_put_n_side_set_df.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -33,42 +33,41 @@
*
*/
-/*****************************************************************************
+/*****************************************************************************/
+/*****************************************************************************/
+/*****************************************************************************/
+/* Function(s) contained in this file:
*
- * exgsp - ex_get_side_set_param
+ * ex_put_n_side_set_df()
*
- * entry conditions -
- * input parameters:
- * int exoid exodus file id
- * int side_set_id side set id
+ *****************************************************************************
*
- * exit conditions -
- * int* num_side_in_set number of sides in the side set
- * int* num_dist_fact_in_set number of distribution factors in the
- * side set
+ * Variable Index:
*
- * revision history -
- *
- *
- *****************************************************************************/
+ * exoid - The NetCDF ID of an already open NemesisI file.
+ * side_set_id - ID of side set to written.
+ * start_num - The starting index of the df's to be written.
+ * num_df_to_get - The number of sides to write.
+ * side_set_dist_fact - List of distribution factors for the side set.
+ */
+/*****************************************************************************/
+/*****************************************************************************/
+/*****************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
#include "exodusII.h"
+#include "exodusII_int.h"
/*!
- * reads the number of sides and the number of distribution factors which
- * describe a single side set
- * \param exoid exodus file id
- * \param side_set_id side set id
- * \param[out] num_side_in_set number of sides in the side set
- * \param[out] num_dist_fact_in_set number of distribution factors in the
- * \deprecated Use ex_get_set_param()(exoid, EX_SIDE_SET, side_set_id, num_side_in_set, num_dist_fact_in_set)
+ * \deprecated use ex_put_partial_set_dist_fact() instead
*/
-int ex_get_side_set_param (int exoid,
- int side_set_id,
- int *num_side_in_set,
- int *num_dist_fact_in_set)
+int ex_put_n_side_set_df (int exoid,
+ ex_entity_id side_set_id,
+ int64_t start_num,
+ int64_t num_df_to_get,
+ void *side_set_dist_fact)
{
- return ex_get_set_param(exoid, EX_SIDE_SET, side_set_id,
- num_side_in_set, num_dist_fact_in_set);
+ return ex_put_partial_set_dist_fact(exoid, EX_SIDE_SET, side_set_id, start_num, num_df_to_get, side_set_dist_fact);
}
diff --git a/exodus/cbind/src/expssv.c b/exodus/cbind/src/ex_put_n_var.c
similarity index 59%
copy from exodus/cbind/src/expssv.c
copy to exodus/cbind/src/ex_put_n_var.c
index 817132f..583ac12 100644
--- a/exodus/cbind/src/expssv.c
+++ b/exodus/cbind/src/ex_put_n_var.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 2006 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -34,15 +34,17 @@
*/
/*****************************************************************************
*
-* expev - ex_put_sset_var
+* expvar - ex_put_var
*
* entry conditions -
* input parameters:
* int exoid exodus file id
* int time_step time step number
-* int sset_var_index sideset variable index
-* int sset_id sideset id
-* int num_faces_this_sset number of faces in this sideset
+* int var_type type (edge block, face block, edge set, ... )
+* int var_index element variable index
+* int obj_id element block id
+* int start_num starting index of the variables to be written
+* int num_ent number of entities to write variables for.
*
* exit conditions -
*
@@ -59,24 +61,28 @@
#include "exodusII_int.h"
/*!
- * writes the values of a single sideset variable for one sideset at
- * one time step to the database; assume the first time step and
- * sideset variable index are 1
- * \param exoid exodus file id
- * \param time_step time step number
- * \param sset_var_index sideset variable index
- * \param sset_id sideset id
- * \param num_faces_this_sset number of faces in this sideset
- * \param sset_var_vals the variable values to be written
- * \deprecated Use ex_put_var()(exoid, time_step, EX_SIDE_SET, sset_var_index, sset_id, num_faces_this_sset, sset_var_vals)
+ * \deprecated use ex_put_partial_var() instead
+ * writes the values of a single variable for a partial block at one time
+ * step to the database; assume the first time step and variable index
+ * are 1
+ * \param exoid exodus file id
+ * \param time_step time step number
+ * \param var_type type (edge block, face block, edge set, ... )
+ * \param var_index element variable index
+ * \param obj_id element block id
+ * \param start_index index of first entity in block to write (1-based)
+ * \param num_entities number of entries in this block/set
+ * \param var_vals the values to be written
*/
-int ex_put_sset_var (int exoid,
- int time_step,
- int sset_var_index,
- int sset_id,
- int num_faces_this_sset,
- const void *sset_var_vals)
+int ex_put_n_var (int exoid,
+ int time_step,
+ ex_entity_type var_type,
+ int var_index,
+ ex_entity_id obj_id,
+ int64_t start_index,
+ int64_t num_entities,
+ const void *var_vals)
{
- return ex_put_var(exoid, time_step, EX_SIDE_SET, sset_var_index, sset_id, num_faces_this_sset, sset_var_vals);
+ return ex_put_partial_var(exoid, time_step, var_type, var_index, obj_id, start_index, num_entities, var_vals);
}
diff --git a/exodus/cbind/src/expnam.c b/exodus/cbind/src/ex_put_name.c
similarity index 90%
rename from exodus/cbind/src/expnam.c
rename to exodus/cbind/src/ex_put_name.c
index 741ae48..760552a 100644
--- a/exodus/cbind/src/expnam.c
+++ b/exodus/cbind/src/ex_put_name.c
@@ -57,7 +57,9 @@
#include <string.h>
/*!
- * writes the name of the specified entity to the database.
+ * writes the name of the specified entity to the database. The entity
+ * with id `entity_id` must exist before calling ex_put_name().
+ *
* \param exoid exodus file id
* \param obj_type object type
* \param entity_id id of entity name to write
@@ -66,7 +68,7 @@
int ex_put_name (int exoid,
ex_entity_type obj_type,
- int entity_id,
+ ex_entity_id entity_id,
const char *name)
{
int status;
@@ -133,6 +135,15 @@ int ex_put_name (int exoid,
ent_ndx = ex_id_lkup(exoid, obj_type, entity_id);
+ if (exerrval == EX_LOOKUPFAIL) { /* could not find the element block id */
+ exerrval = EX_FATAL;
+ sprintf(errmsg,
+ "Error: %s id %"PRId64" not found in file id %d",
+ ex_name_of_object(obj_type), entity_id, exoid);
+ ex_err("ex_put_name",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
/* If this is a null entity, then 'ent_ndx' will be negative.
* We don't care in this routine, so make it positive and continue...
*/
diff --git a/exodus/cbind/src/expnams.c b/exodus/cbind/src/ex_put_names.c
similarity index 100%
rename from exodus/cbind/src/expnams.c
rename to exodus/cbind/src/ex_put_names.c
diff --git a/exodus/cbind/src/expnv.c b/exodus/cbind/src/ex_put_nodal_var.c
similarity index 99%
rename from exodus/cbind/src/expnv.c
rename to exodus/cbind/src/ex_put_nodal_var.c
index 28dbe20..349ca96 100644
--- a/exodus/cbind/src/expnv.c
+++ b/exodus/cbind/src/ex_put_nodal_var.c
@@ -94,7 +94,7 @@ for (k=1; k <= num_nod_vars; k++) {
int ex_put_nodal_var (int exoid,
int time_step,
int nodal_var_index,
- int num_nodes,
+ int64_t num_nodes,
const void *nodal_var_vals)
{
diff --git a/nemesis/ne_pnvs.c b/exodus/cbind/src/ex_put_nodal_var_slab.c
similarity index 82%
rename from nemesis/ne_pnvs.c
rename to exodus/cbind/src/ex_put_nodal_var_slab.c
index baa83d3..52ffc37 100644
--- a/nemesis/ne_pnvs.c
+++ b/exodus/cbind/src/ex_put_nodal_var_slab.c
@@ -38,13 +38,13 @@
/*****************************************************************************/
/* Function(s) contained in this file:
*
- * ne_put_nodal_var_slab()
+ * ex_put_nodal_var_slab()
*
*****************************************************************************
*
* Variable Index:
*
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* time_step - The time step to write this data to.
* nodal_var_index - The index of this nodal variable.
* start_pos - The start point for outputting data. The first
@@ -60,20 +60,17 @@
#include "exodusII.h"
#include "exodusII_int.h"
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
/*
* writes the values of a single nodal variable for a single time step to
* the database; assume the first time step and nodal variable index
* is 1
*/
-int ne_put_nodal_var_slab (int neid,
+int ex_put_nodal_var_slab (int exoid,
int time_step,
int nodal_var_index,
- int start_pos,
- int num_vals,
+ int64_t start_pos,
+ int64_t num_vals,
void *nodal_var_vals)
{
@@ -87,14 +84,14 @@ int ne_put_nodal_var_slab (int neid,
/* inquire previously defined variable -- if not found assume that
the new separate 'blob' per nodal var storage is being used */
- if (ex_large_model(neid) == 0) {
+ if (ex_large_model(exoid) == 0) {
/* write values of the nodal variable */
- if ((status = nc_inq_varid (neid, VAR_NOD_VAR, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid (exoid, VAR_NOD_VAR, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Warning: could not find nodal variable %d in file id %d",
- nodal_var_index, neid);
- ex_err("ne_put_nodal_var_slab",errmsg,exerrval);
+ nodal_var_index, exoid);
+ ex_err("ex_put_nodal_var_slab",errmsg,exerrval);
return (EX_WARN);
}
@@ -109,12 +106,12 @@ int ne_put_nodal_var_slab (int neid,
/* nodal variables stored separately, find variable for this variable
index */
- if ((status = nc_inq_varid (neid, VAR_NOD_VAR_NEW(nodal_var_index), &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid (exoid, VAR_NOD_VAR_NEW(nodal_var_index), &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Warning: could not find nodal variable %d in file id %d",
- nodal_var_index, neid);
- ex_err("ne_put_nodal_var_slab",errmsg,exerrval);
+ nodal_var_index, exoid);
+ ex_err("ex_put_nodal_var_slab",errmsg,exerrval);
return (EX_WARN);
}
@@ -125,18 +122,18 @@ int ne_put_nodal_var_slab (int neid,
count[1] = num_vals;
}
- if (ex_comp_ws(neid) == 4) {
- status = nc_put_vara_float(neid, varid, start, count, nodal_var_vals);
+ if (ex_comp_ws(exoid) == 4) {
+ status = nc_put_vara_float(exoid, varid, start, count, nodal_var_vals);
} else {
- status = nc_put_vara_double(neid, varid, start, count, nodal_var_vals);
+ status = nc_put_vara_double(exoid, varid, start, count, nodal_var_vals);
}
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to store nodal variables in file id %d",
- neid);
- ex_err("ne_put_nodal_var_slab",errmsg,exerrval);
+ exoid);
+ ex_err("ex_put_nodal_var_slab",errmsg,exerrval);
return (EX_FATAL);
}
diff --git a/nemesis/ne_pncm.c b/exodus/cbind/src/ex_put_node_cmap.c
similarity index 76%
rename from nemesis/ne_pncm.c
rename to exodus/cbind/src/ex_put_node_cmap.c
index 6e100d5..1de7728 100644
--- a/nemesis/ne_pncm.c
+++ b/exodus/cbind/src/ex_put_node_cmap.c
@@ -36,12 +36,12 @@
/****************************************************************************/
/****************************************************************************/
/* Function(s) contained in this file:
- * ne_put_node_cmap()
+ * ex_put_node_cmap()
****************************************************************************
* This function outputs a nodal communication map.
****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* map_id - The ID of the nodal communication map to retrieve.
* node_ids - Pointer to vector containing the FEM node IDs
* that make up this communication map.
@@ -61,17 +61,14 @@
#include <exodusII.h>
#include <exodusII_int.h>
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-int ne_put_node_cmap(int neid,
- int map_id,
- int *node_ids,
- int *proc_ids,
+int ex_put_node_cmap(int exoid,
+ ex_entity_id map_id,
+ void_int *node_ids,
+ void_int *proc_ids,
int processor
)
{
- char *func_name="ne_put_node_cmap";
+ const char *func_name="ex_put_node_cmap";
int map_idx, varid, dimid, status;
size_t start[1], count[1], ret_val;
@@ -84,20 +81,20 @@ int ne_put_node_cmap(int neid,
exerrval = 0; /* clear error code */
/* get the index for the comm map information variables */
- if (ne_get_idx(neid, VAR_N_COMM_INFO_IDX, varidx, processor) == -1) {
+ if (ex_get_idx(exoid, VAR_N_COMM_INFO_IDX, varidx, processor) == -1) {
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_N_COMM_INFO_IDX, neid);
+ VAR_N_COMM_INFO_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the index for this map_id */
- if ((map_idx=ne_id_lkup(neid, VAR_N_COMM_IDS, varidx, map_id)) == -1) {
+ if ((map_idx=ne_id_lkup(exoid, VAR_N_COMM_IDS, varidx, map_id)) == -1) {
sprintf(errmsg,
"Error: failed to find index for variable \"%s\" in file ID %d",
- VAR_N_COMM_IDS, neid);
+ VAR_N_COMM_IDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -106,21 +103,21 @@ int ne_put_node_cmap(int neid,
* Find out if this is a NULL comm map by checking it's entry in
* the status vector.
*/
- if ((status = nc_inq_varid(neid, VAR_N_COMM_STAT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_N_COMM_STAT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_N_COMM_STAT, neid);
+ VAR_N_COMM_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
start[0] = map_idx;
- if ((status = nc_get_var1_int(neid, varid, start, &value)) != NC_NOERR) {
+ if ((status = nc_get_var1_int(exoid, varid, start, &value)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: unable to get variable \"%s\" from file ID %d",
- VAR_N_COMM_STAT, neid);
+ VAR_N_COMM_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -128,11 +125,11 @@ int ne_put_node_cmap(int neid,
if (value == 0) return(EX_NOERR); /* NULL set */
/* now I need to get the comm map data index */
- if (ne_get_idx(neid, VAR_N_COMM_DATA_IDX, varidx, map_idx) == -1) {
+ if (ex_get_idx(exoid, VAR_N_COMM_DATA_IDX, varidx, map_idx) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_N_COMM_DATA_IDX, neid);
+ VAR_N_COMM_DATA_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -141,20 +138,20 @@ int ne_put_node_cmap(int neid,
/* check if I need to get the dimension of the cmap data */
if (varidx[1] == -1) {
/* Get the size of the comm maps */
- if ((status = nc_inq_dimid(neid, DIM_NCNT_CMAP, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NCNT_CMAP, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get dimension ID for \"%s\" in file ID %d",
- DIM_NCNT_CMAP, neid);
+ DIM_NCNT_CMAP, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid, &ret_val)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &ret_val)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NCNT_CMAP, neid);
+ DIM_NCNT_CMAP, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -166,42 +163,50 @@ int ne_put_node_cmap(int neid,
count[0] = varidx[1] - varidx[0];
/* Output the node IDs for this comm map */
- if ((status = nc_inq_varid(neid, VAR_N_COMM_NIDS, &varid )) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_N_COMM_NIDS, &varid )) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_N_COMM_NIDS, neid);
+ VAR_N_COMM_NIDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- status = nc_put_vara_int(neid, varid, start, count, node_ids);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_put_vara_longlong(exoid, varid, start, count, node_ids);
+ } else {
+ status = nc_put_vara_int(exoid, varid, start, count, node_ids);
+ }
if (status != NC_NOERR) {
- fprintf(stderr, "Start, Count = %zd\t%zd\n", start[0], count[0]);
+ fprintf(stderr, "Start, Count = %lu\t%lu\n", (unsigned long)start[0], (unsigned long)count[0]);
exerrval = status;
sprintf(errmsg,
"Error: failed to output vector \"%s\" in file ID %d",
- VAR_N_COMM_NIDS, neid);
+ VAR_N_COMM_NIDS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Output the processor IDs for this map */
- if ((status = nc_inq_varid(neid, VAR_N_COMM_PROC, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_N_COMM_PROC, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_N_COMM_PROC, neid);
+ VAR_N_COMM_PROC, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- status = nc_put_vara_int(neid, varid, start, count, proc_ids);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_put_vara_longlong(exoid, varid, start, count, proc_ids);
+ } else {
+ status = nc_put_vara_int(exoid, varid, start, count, proc_ids);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output variable \"%s\" in file ID %d",
- VAR_N_COMM_PROC, neid);
+ VAR_N_COMM_PROC, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
diff --git a/exodus/cbind/src/expnm.c b/exodus/cbind/src/ex_put_node_map.c
similarity index 96%
rename from exodus/cbind/src/expnm.c
rename to exodus/cbind/src/ex_put_node_map.c
index 4915097..8272030 100644
--- a/exodus/cbind/src/expnm.c
+++ b/exodus/cbind/src/ex_put_node_map.c
@@ -58,8 +58,8 @@
*/
int ex_put_node_map (int exoid,
- int map_id,
- const int *node_map)
+ ex_entity_id map_id,
+ const void_int *node_map)
{
return ex_put_num_map( exoid, EX_NODE_MAP, map_id, node_map );
}
diff --git a/exodus/cbind/src/expnnm.c b/exodus/cbind/src/ex_put_node_num_map.c
similarity index 98%
rename from exodus/cbind/src/expnnm.c
rename to exodus/cbind/src/ex_put_node_num_map.c
index 4a5b76b..bd6d5e3 100644
--- a/exodus/cbind/src/expnnm.c
+++ b/exodus/cbind/src/ex_put_node_num_map.c
@@ -74,7 +74,7 @@ error = ex_put_id_map(exoid, EX_NODE_MAP, node_map);
*/
int ex_put_node_num_map (int exoid,
- const int *node_map)
+ const void_int *node_map)
{
return ex_put_id_map(exoid, EX_NODE_MAP, node_map);
}
diff --git a/exodus/cbind/src/expns.c b/exodus/cbind/src/ex_put_node_set.c
similarity index 96%
rename from exodus/cbind/src/expns.c
rename to exodus/cbind/src/ex_put_node_set.c
index 93832b4..68e964d 100644
--- a/exodus/cbind/src/expns.c
+++ b/exodus/cbind/src/ex_put_node_set.c
@@ -60,8 +60,8 @@ segment to write out a node set.
*/
int ex_put_node_set (int exoid,
- int node_set_id,
- const int *node_set_node_list)
+ ex_entity_id node_set_id,
+ const void_int *node_set_node_list)
{
return ex_put_set(exoid, EX_NODE_SET, node_set_id,
node_set_node_list, NULL);
diff --git a/exodus/cbind/src/expnsd.c b/exodus/cbind/src/ex_put_node_set_dist_fact.c
similarity index 98%
rename from exodus/cbind/src/expnsd.c
rename to exodus/cbind/src/ex_put_node_set_dist_fact.c
index e27c622..d356800 100644
--- a/exodus/cbind/src/expnsd.c
+++ b/exodus/cbind/src/ex_put_node_set_dist_fact.c
@@ -65,7 +65,7 @@ segment to write out the distribution factors for a node set.
*/
int ex_put_node_set_dist_fact (int exoid,
- int node_set_id,
+ ex_entity_id node_set_id,
const void *node_set_dist_fact)
{
return ex_put_set_dist_fact(exoid, EX_NODE_SET, node_set_id,
diff --git a/exodus/cbind/src/expnp.c b/exodus/cbind/src/ex_put_node_set_param.c
similarity index 96%
rename from exodus/cbind/src/expnp.c
rename to exodus/cbind/src/ex_put_node_set_param.c
index b6173bf..a08f5f6 100644
--- a/exodus/cbind/src/expnp.c
+++ b/exodus/cbind/src/ex_put_node_set_param.c
@@ -93,9 +93,9 @@ error = ex_put_set_dist_fact(exoid, EX_NODE_SET, id, dist_fact);
*/
int ex_put_node_set_param (int exoid,
- int node_set_id,
- int num_nodes_in_set,
- int num_dist_in_set)
+ ex_entity_id node_set_id,
+ int64_t num_nodes_in_set,
+ int64_t num_dist_in_set)
{
return ex_put_set_param(exoid, EX_NODE_SET, node_set_id, num_nodes_in_set, num_dist_in_set);
}
diff --git a/nemesis/ne_pnspg.c b/exodus/cbind/src/ex_put_ns_param_global.c
similarity index 77%
rename from nemesis/ne_pnspg.c
rename to exodus/cbind/src/ex_put_ns_param_global.c
index b1a99c3..8ee0486 100644
--- a/nemesis/ne_pnspg.c
+++ b/exodus/cbind/src/ex_put_ns_param_global.c
@@ -37,12 +37,12 @@
/*****************************************************************************/
/*****************************************************************************/
/* Function(s) contained in this file:
- * ne_put_ns_param_global()
+ * ex_put_ns_param_global()
*****************************************************************************
* This function outputs the global node-set parameters.
*****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* global_ids - Pointer to a vector of global node-set IDs.
* node_cnts - Pointer to a vector of global node counts in
* each global node set.
@@ -58,16 +58,13 @@
#include <exodusII.h>
#include <exodusII_int.h>
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-int ne_put_ns_param_global(int neid,
- int *global_ids,
- int *node_cnts,
- int *df_cnts
+int ex_put_ns_param_global(int exoid,
+ void_int *global_ids,
+ void_int *node_cnts,
+ void_int *df_cnts
)
{
- char *func_name="ne_put_ns_param_global";
+ const char *func_name="ex_put_ns_param_global";
int varid, status;
char errmsg[MAX_ERR_LENGTH];
@@ -76,69 +73,81 @@ int ne_put_ns_param_global(int neid,
exerrval = 0; /* clear error code */
/* Get the variable ID for the vector of global node set IDs */
- if ((status = nc_inq_varid(neid, VAR_NS_IDS_GLOBAL, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_NS_IDS_GLOBAL, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_NS_IDS_GLOBAL, neid);
+ VAR_NS_IDS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Output the vector of global node set IDs */
- status = nc_put_var_int(neid, varid, global_ids);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ status = nc_put_var_longlong(exoid, varid, global_ids);
+ } else {
+ status = nc_put_var_int(exoid, varid, global_ids);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output variable \"%s\" to file ID %d",
- VAR_NS_IDS_GLOBAL, neid);
+ VAR_NS_IDS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the variable ID for the vector of global node-set node counts */
- if ((status = nc_inq_varid(neid, VAR_NS_NODE_CNT_GLOBAL, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_NS_NODE_CNT_GLOBAL, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_NS_NODE_CNT_GLOBAL, neid);
+ VAR_NS_NODE_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Output the vector of global node counts in each global node set */
- status = nc_put_var_int(neid, varid, node_cnts);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_put_var_longlong(exoid, varid, node_cnts);
+ } else {
+ status = nc_put_var_int(exoid, varid, node_cnts);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to put variable \"%s\" in file ID %d",
- VAR_NS_NODE_CNT_GLOBAL, neid);
+ VAR_NS_NODE_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the variable ID for the number of dist. factors in each node set */
- if ((status = nc_inq_varid(neid, VAR_NS_DF_CNT_GLOBAL, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_NS_DF_CNT_GLOBAL, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_NS_DF_CNT_GLOBAL, neid);
+ VAR_NS_DF_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Output the vector of dist. factor counts */
- status = nc_put_var_int(neid, varid, df_cnts);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_put_var_longlong(exoid, varid, df_cnts);
+ } else {
+ status = nc_put_var_int(exoid, varid, df_cnts);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output variable \"%s\" in file ID %d",
- VAR_NS_DF_CNT_GLOBAL, neid);
+ VAR_NS_DF_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
diff --git a/exodus/cbind/src/expnsv.c b/exodus/cbind/src/ex_put_nset_var.c
similarity index 97%
rename from exodus/cbind/src/expnsv.c
rename to exodus/cbind/src/ex_put_nset_var.c
index d8f6f92..32ea9a9 100644
--- a/exodus/cbind/src/expnsv.c
+++ b/exodus/cbind/src/ex_put_nset_var.c
@@ -75,8 +75,8 @@
int ex_put_nset_var (int exoid,
int time_step,
int nset_var_index,
- int nset_id,
- int num_nodes_this_nset,
+ ex_entity_id nset_id,
+ int64_t num_nodes_this_nset,
const void *nset_var_vals)
{
return ex_put_var(exoid, time_step, EX_NODE_SET, nset_var_index,
diff --git a/exodus/cbind/src/expnstt.c b/exodus/cbind/src/ex_put_nset_var_tab.c
similarity index 100%
rename from exodus/cbind/src/expnstt.c
rename to exodus/cbind/src/ex_put_nset_var_tab.c
diff --git a/exodus/cbind/src/ex_put_num_map.c b/exodus/cbind/src/ex_put_num_map.c
new file mode 100644
index 0000000..f12a391
--- /dev/null
+++ b/exodus/cbind/src/ex_put_num_map.c
@@ -0,0 +1,287 @@
+/*
+ * Copyright (c) 2006 Sandia Corporation. Under the terms of Contract
+ * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
+ * retains certain rights in this software.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * * Neither the name of Sandia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/*****************************************************************************
+*
+* expem - ex_put_num_map
+*
+* entry conditions -
+* input parameters:
+* int exoid exodus file id
+* int map_type type of map (node,edge,face,elem)
+* int map_id id to associate with new map
+* int *map_data map set value array
+*
+* exit conditions -
+*
+* revision history -
+*
+*****************************************************************************/
+
+#include "exodusII.h"
+#include "exodusII_int.h"
+#include <stdlib.h> /* for free() */
+
+/*!
+ * writes a map; this is a vector of integers of the same length as the
+ * number of entries in the source object (nodes, edges, faces, or elements
+ * in the file).
+ * \param exoid exodus file id
+ * \param map_type type of map (node,edge,face,elem)
+ * \param map_id id to associate with new map
+ * \param map map set value array
+ */
+
+int ex_put_num_map ( int exoid,
+ ex_entity_type map_type,
+ ex_entity_id map_id,
+ const void_int *map )
+{
+ int dimid, varid;
+ int map_int_type;
+ size_t start[1];
+ int ldum;
+ int num_maps;
+ size_t num_entries;
+ int cur_num_maps;
+ char errmsg[MAX_ERR_LENGTH];
+ const char* dnumentries;
+ const char* dnummaps;
+ const char* vmapids;
+ const char* vmap;
+ int status;
+
+ exerrval = 0; /* clear error code */
+
+ switch ( map_type ) {
+ case EX_NODE_MAP:
+ dnumentries = DIM_NUM_NODES;
+ dnummaps = DIM_NUM_NM;
+ vmapids = VAR_NM_PROP(1);
+ break;
+ case EX_EDGE_MAP:
+ dnumentries = DIM_NUM_EDGE;
+ dnummaps = DIM_NUM_EDM;
+ vmapids = VAR_EDM_PROP(1);
+ break;
+ case EX_FACE_MAP:
+ dnumentries = DIM_NUM_FACE;
+ dnummaps = DIM_NUM_FAM;
+ vmapids = VAR_FAM_PROP(1);
+ break;
+ case EX_ELEM_MAP:
+ dnumentries = DIM_NUM_ELEM;
+ dnummaps = DIM_NUM_EM;
+ vmapids = VAR_EM_PROP(1);
+ break;
+ default:
+ exerrval = EX_BADPARAM;
+ sprintf( errmsg,
+ "Error: Bad map type (%d) specified for file id %d",
+ map_type, exoid );
+ ex_err( "ex_put_num_map", errmsg, exerrval );
+ return (EX_FATAL);
+ }
+
+ /* Make sure the file contains entries */
+ if (nc_inq_dimid (exoid, dnumentries, &dimid) != NC_NOERR )
+ {
+ return (EX_NOERR);
+ }
+
+ /* first check if any maps are specified */
+ if ((status = nc_inq_dimid (exoid, dnummaps, &dimid)) != NC_NOERR )
+ {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: no %ss specified in file id %d",
+ ex_name_of_object(map_type),exoid);
+ ex_err("ex_put_num_map",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* Check for duplicate map id entry */
+ ex_id_lkup(exoid,map_type,map_id);
+ if (exerrval != EX_LOOKUPFAIL) /* found the map id */
+ {
+ sprintf(errmsg,
+ "Error: %s %"PRId64" already defined in file id %d",
+ ex_name_of_object(map_type),map_id,exoid);
+ ex_err("ex_put_num_map",errmsg,exerrval);
+ return(EX_FATAL);
+ }
+
+ /* Get number of maps initialized for this file */
+ if ((status = nc_inq_dimlen(exoid,dimid,&num_entries)) != NC_NOERR)
+ {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to get number of %ss in file id %d",
+ ex_name_of_object(map_type),exoid);
+ ex_err("ex_put_num_map",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ num_maps = num_entries;
+
+ /* Keep track of the total number of maps defined using a counter stored
+ in a linked list keyed by exoid.
+ NOTE: ex_get_file_item is used to find the number of maps
+ for a specific file and returns that value.
+ */
+ cur_num_maps = ex_get_file_item(exoid, ex_get_counter_list(map_type));
+ if (cur_num_maps >= num_maps) {
+ exerrval = EX_FATAL;
+ sprintf(errmsg,
+ "Error: exceeded number of %ss (%d) specified in file id %d",
+ ex_name_of_object(map_type),num_maps,exoid);
+ ex_err("ex_put_num_map",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* NOTE: ex_inc_file_item is used to find the number of maps
+ for a specific file and returns that value incremented. */
+ cur_num_maps = ex_inc_file_item(exoid, ex_get_counter_list(map_type));
+
+ /* write out information to previously defined variable */
+
+ /* first get id of variable */
+ if ((status = nc_inq_varid (exoid, vmapids, &varid)) == -1)
+ {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to locate %s ids in file id %d",
+ ex_name_of_object(map_type),exoid);
+ ex_err("ex_put_num_map",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* then, write out map id */
+ start[0] = cur_num_maps;
+
+ ldum = (int)map_id;
+ if ((status = nc_put_var1_int(exoid, varid, start, &ldum)) != NC_NOERR)
+ {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to store %s id %"PRId64" in file id %d",
+ ex_name_of_object(map_type),map_id,exoid);
+ ex_err("ex_put_num_map",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ switch ( map_type ) {
+ case EX_NODE_MAP:
+ vmap = VAR_NODE_MAP(cur_num_maps+1);
+ break;
+ case EX_EDGE_MAP:
+ vmap = VAR_EDGE_MAP(cur_num_maps+1);
+ break;
+ case EX_FACE_MAP:
+ vmap = VAR_FACE_MAP(cur_num_maps+1);
+ break;
+ case EX_ELEM_MAP:
+ vmap = VAR_ELEM_MAP(cur_num_maps+1);
+ break;
+ default:
+ exerrval = 1005;
+ sprintf(errmsg,
+ "Internal Error: unrecognized map type in switch: %d in file id %d",
+ map_type,exoid);
+ ex_err("ex_putt_n_one_attr",errmsg,EX_MSG);
+ return (EX_FATAL);
+ }
+
+ /* locate variable array in which to store the map */
+ if ((status = nc_inq_varid(exoid,vmap,&varid)) != NC_NOERR) {
+ int dims[2];
+
+ /* determine number of entries */
+ if ((status = nc_inq_dimid (exoid, dnumentries, &dimid)) == -1 ) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: couldn't determine number of %s entries in file id %d",
+ ex_name_of_object(map_type),exoid);
+ ex_err("ex_put_num_map",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ if ((status = nc_redef( exoid )) != NC_NOERR ) {
+ exerrval = status;
+ sprintf(errmsg, "Error: failed to place file id %d into define mode", exoid);
+ ex_err("ex_put_num_map",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* Check type to be used for maps... */
+ map_int_type = NC_INT;
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_DB) {
+ map_int_type = NC_INT64;
+ }
+
+ dims[0] = dimid;
+ if ((status = nc_def_var( exoid, vmap, map_int_type, 1, dims, &varid )) == -1 ) {
+ exerrval = status;
+ sprintf(errmsg, "Error: failed to define map %s in file id %d", vmap, exoid);
+ ex_err("ex_put_num_map",errmsg,exerrval);
+ }
+ ex_compress_variable(exoid, varid, 1);
+
+ if ((status = nc_enddef(exoid)) != NC_NOERR ) { /* exit define mode */
+ sprintf( errmsg, "Error: failed to complete definition for file id %d", exoid );
+ ex_err( "ex_put_num_map", errmsg, exerrval );
+ varid = -1; /* force early exit */
+ }
+
+ if ( varid == -1 ) /* we couldn't define variable and have prepared error message. */
+ return (EX_FATAL);
+ }
+
+ /* write out the map */
+
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_put_var_longlong(exoid, varid, map);
+ } else {
+ status = nc_put_var_int(exoid, varid, map);
+ }
+ if (status != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to store %s in file id %d",
+ ex_name_of_object(map_type),exoid);
+ ex_err("ex_put_num_map",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ return (EX_NOERR);
+}
diff --git a/exodus/cbind/src/expoatt.c b/exodus/cbind/src/ex_put_one_attr.c
similarity index 94%
rename from exodus/cbind/src/expoatt.c
rename to exodus/cbind/src/ex_put_one_attr.c
index 11383b1..6c31d08 100644
--- a/exodus/cbind/src/expoatt.c
+++ b/exodus/cbind/src/ex_put_one_attr.c
@@ -63,7 +63,7 @@
int ex_put_one_attr( int exoid,
ex_entity_type obj_type,
- int obj_id,
+ ex_entity_id obj_id,
int attrib_index,
const void *attrib )
{
@@ -85,13 +85,13 @@ int ex_put_one_attr( int exoid,
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no attributes allowed for NULL %s %d in file id %d",
+ "Warning: no attributes allowed for NULL %s %"PRId64" in file id %d",
ex_name_of_object(obj_type),obj_id,exoid);
ex_err("ex_put_one_attr",errmsg,EX_MSG);
return (EX_WARN); /* no attributes for this element block */
} else {
sprintf(errmsg,
- "Error: no %s id %d in id array in file id %d",
+ "Error: no %s id %"PRId64" in id array in file id %d",
ex_name_of_object(obj_type), obj_id, exoid);
ex_err("ex_put_one_attr",errmsg,exerrval);
return (EX_FATAL);
@@ -164,7 +164,7 @@ int ex_put_one_attr( int exoid,
if (attrib_index < 1 || attrib_index > (int)num_attr) {
exerrval = EX_FATAL;
sprintf(errmsg,
- "Error: Invalid attribute index specified: %d. Valid range is 1 to %d for %s %d in file id %d",
+ "Error: Invalid attribute index specified: %d. Valid range is 1 to %d for %s %"PRId64" in file id %d",
attrib_index, (int)num_attr, ex_name_of_object(obj_type), obj_id, exoid);
ex_err("ex_put_one_attr",errmsg,exerrval);
return (EX_FATAL);
@@ -173,7 +173,7 @@ int ex_put_one_attr( int exoid,
if ((status = nc_inq_varid(exoid, vattrbname, &attrid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate attribute variable for %s %d in file id %d",
+ "Error: failed to locate attribute variable for %s %"PRId64" in file id %d",
ex_name_of_object(obj_type),obj_id,exoid);
ex_err("ex_put_one_attr",errmsg,exerrval);
return (EX_FATAL);
@@ -199,7 +199,7 @@ int ex_put_one_attr( int exoid,
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to put attribute %d for %s %d in file id %d",
+ "Error: failed to put attribute %d for %s %"PRId64" in file id %d",
attrib_index, ex_name_of_object(obj_type), obj_id, exoid);
ex_err("ex_put_one_attr",errmsg,exerrval);
return (EX_FATAL);
diff --git a/exodus/cbind/src/expoea.c b/exodus/cbind/src/ex_put_one_elem_attr.c
similarity index 98%
rename from exodus/cbind/src/expoea.c
rename to exodus/cbind/src/ex_put_one_elem_attr.c
index ddc1113..b10178c 100644
--- a/exodus/cbind/src/expoea.c
+++ b/exodus/cbind/src/ex_put_one_elem_attr.c
@@ -65,7 +65,7 @@
*/
int ex_put_one_elem_attr (int exoid,
- int elem_blk_id,
+ ex_entity_id elem_blk_id,
int attrib_index,
const void *attrib)
{
diff --git a/exodus/cbind/src/expatt.c b/exodus/cbind/src/ex_put_partial_attr.c
similarity index 62%
rename from exodus/cbind/src/expatt.c
rename to exodus/cbind/src/ex_put_partial_attr.c
index 82cd55d..e9be9b9 100644
--- a/exodus/cbind/src/expatt.c
+++ b/exodus/cbind/src/ex_put_partial_attr.c
@@ -34,7 +34,7 @@
*/
/*****************************************************************************
*
-* expatt - ex_put_attr
+* expatt - ex_put_partial_attr
*
* entry conditions -
* input parameters:
@@ -61,13 +61,19 @@
* \param attrib array of attributes
*/
-int ex_put_attr (int exoid,
- ex_entity_type blk_type,
- int blk_id,
- const void *attrib)
+int ex_put_partial_attr (int exoid,
+ ex_entity_type blk_type,
+ ex_entity_id blk_id,
+ int64_t start_entity,
+ int64_t num_entity,
+ const void *attrib)
{
int status;
- int attrid, blk_id_ndx;
+ int attrid;
+ int blk_id_ndx = 0;
+ int numattrdim;
+ size_t start[2], count[2];
+ size_t num_attr;
char errmsg[MAX_ERR_LENGTH];
exerrval = 0; /* clear error code */
@@ -78,13 +84,13 @@ int ex_put_attr (int exoid,
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no attributes allowed for NULL %s %d in file id %d",
+ "Warning: no attributes allowed for NULL %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
ex_err("ex_put_attr",errmsg,EX_MSG);
return (EX_WARN); /* no attributes for this block */
} else {
sprintf(errmsg,
- "Error: no %s id %d in in file id %d",
+ "Error: no %s id %"PRId64" in in file id %d",
ex_name_of_object(blk_type), blk_id, exoid);
ex_err("ex_put_attr",errmsg,exerrval);
return (EX_FATAL);
@@ -125,32 +131,92 @@ int ex_put_attr (int exoid,
sprintf(errmsg,
"Internal Error: unrecognized object type in switch: %d in file id %d",
blk_type,exoid);
- ex_err("ex_put_attr",errmsg,EX_MSG);
+ ex_err("ex_put_partial_attr",errmsg,EX_MSG);
return (EX_FATAL); /* number of attributes not defined */
}
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate attribute variable for %s %d in file id %d",
+ "Error: failed to locate attribute variable for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_put_attr",errmsg,exerrval);
+ ex_err("ex_put_partial_attr",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* Determine number of attributes */
+ switch (blk_type) {
+ case EX_SIDE_SET:
+ status = nc_inq_dimid(exoid, DIM_NUM_ATT_IN_SS(blk_id_ndx), &numattrdim);
+ break;
+ case EX_NODE_SET:
+ status = nc_inq_dimid(exoid, DIM_NUM_ATT_IN_NS(blk_id_ndx), &numattrdim);
+ break;
+ case EX_EDGE_SET:
+ status = nc_inq_dimid(exoid, DIM_NUM_ATT_IN_ES(blk_id_ndx), &numattrdim);
+ break;
+ case EX_FACE_SET:
+ status = nc_inq_dimid(exoid, DIM_NUM_ATT_IN_FS(blk_id_ndx), &numattrdim);
+ break;
+ case EX_ELEM_SET:
+ status = nc_inq_dimid(exoid, DIM_NUM_ATT_IN_ELS(blk_id_ndx), &numattrdim);
+ break;
+ case EX_NODAL:
+ status = nc_inq_dimid(exoid, DIM_NUM_ATT_IN_NBLK, &numattrdim);
+ break;
+ case EX_EDGE_BLOCK:
+ status = nc_inq_dimid(exoid, DIM_NUM_ATT_IN_EBLK(blk_id_ndx), &numattrdim);
+ break;
+ case EX_FACE_BLOCK:
+ status = nc_inq_dimid(exoid, DIM_NUM_ATT_IN_FBLK(blk_id_ndx), &numattrdim);
+ break;
+ case EX_ELEM_BLOCK:
+ status = nc_inq_dimid(exoid, DIM_NUM_ATT_IN_BLK(blk_id_ndx), &numattrdim);
+ break;
+ default:
+ /* No need for error message, handled in previous switch; just to quiet compiler. */
+ return (EX_FATAL);
+ }
+
+ if (status != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: number of attributes not defined for %s %"PRId64" in file id %d",
+ ex_name_of_object(blk_type),blk_id,exoid);
+ ex_err("ex_put_partial_attr",errmsg,EX_MSG);
+ return (EX_FATAL); /* number of attributes not defined */
+ }
+
+ if ((status = nc_inq_dimlen(exoid, numattrdim, &num_attr)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to get number of attributes for %s %"PRId64" in file id %d",
+ ex_name_of_object(blk_type),blk_id,exoid);
+ ex_err("ex_put_partial_attr",errmsg,exerrval);
return (EX_FATAL);
}
/* write out the attributes */
+ start[0] = --start_entity;
+ start[1] = 0;
+
+ count[0] = num_entity;
+ count[1] = num_attr;
+ if (count[0] == 0)
+ start[0] = 0;
+
if (ex_comp_ws(exoid) == 4) {
- status = nc_put_var_float(exoid, attrid, attrib);
+ status = nc_put_vara_float(exoid, attrid, start, count, attrib);
} else {
- status = nc_put_var_double(exoid, attrid, attrib);
+ status = nc_put_vara_double(exoid, attrid, start, count, attrib);
}
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to put attributes for %s %d in file id %d",
+ "Error: failed to put attributes for %s %"PRId64" in file id %d",
ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_put_attr",errmsg,exerrval);
+ ex_err("ex_put_partial_attr",errmsg,exerrval);
return (EX_FATAL);
}
return(EX_NOERR);
diff --git a/exodus/cbind/src/expncor.c b/exodus/cbind/src/ex_put_partial_coord.c
similarity index 84%
rename from exodus/cbind/src/expncor.c
rename to exodus/cbind/src/ex_put_partial_coord.c
index 5b7a603..0cb4a94 100644
--- a/exodus/cbind/src/expncor.c
+++ b/exodus/cbind/src/ex_put_partial_coord.c
@@ -34,7 +34,7 @@
*/
/*****************************************************************************
*
-* expcor - ex_put_n_coord
+* expcor - ex_put_partial_coord
*
* entry conditions -
* input parameters:
@@ -66,9 +66,9 @@
* \param z_coor z coord array
*/
-int ex_put_n_coord (int exoid,
- int start_node_num,
- int num_nodes,
+int ex_put_partial_coord (int exoid,
+ int64_t start_node_num,
+ int64_t num_nodes,
const void *x_coor,
const void *y_coor,
const void *z_coor)
@@ -78,7 +78,8 @@ int ex_put_n_coord (int exoid,
int coordidx, coordidy, coordidz;
int numnoddim, ndimdim;
- size_t i, num_nod, num_dim, start[2], count[2];
+ int64_t num_nod;
+ size_t i, num_dim, start[2], count[2];
char errmsg[MAX_ERR_LENGTH];
exerrval = 0; /* clear error code */
@@ -91,13 +92,17 @@ int ex_put_n_coord (int exoid,
return (EX_NOERR);
}
- if ((status = nc_inq_dimlen(exoid, numnoddim, &num_nod)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: inquire failed to return number of nodes in file id %d",
- exoid);
- ex_err("ex_put_n_coord",errmsg,exerrval);
- return (EX_FATAL);
+ {
+ size_t tmp;
+ if ((status = nc_inq_dimlen(exoid, numnoddim, &tmp)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: inquire failed to return number of nodes in file id %d",
+ exoid);
+ ex_err("ex_put_partial_coord",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ num_nod = tmp;
}
if ((status = nc_inq_dimid(exoid, DIM_NUM_DIM, &ndimdim)) != NC_NOERR) {
@@ -105,7 +110,7 @@ int ex_put_n_coord (int exoid,
sprintf(errmsg,
"Error: failed to locate number of dimensions in file id %d",
exoid);
- ex_err("ex_put_n_coord",errmsg,exerrval);
+ ex_err("ex_put_partial_coord",errmsg,exerrval);
return (EX_FATAL);
}
@@ -114,16 +119,16 @@ int ex_put_n_coord (int exoid,
sprintf(errmsg,
"Error: failed to get number of dimensions in file id %d",
exoid);
- ex_err("ex_put_n_coord",errmsg,exerrval);
+ ex_err("ex_put_partial_coord",errmsg,exerrval);
return (EX_FATAL);
}
if (start_node_num + num_nodes -1 > (int)num_nod) {
exerrval = EX_BADPARAM;
sprintf(errmsg,
- "Error: start index (%d) + node count (%d) is larger than total number of nodes (%d) in file id %d",
- start_node_num, num_nodes, (int)num_nod, exoid);
- ex_err("ex_put_n_coord",errmsg,exerrval);
+ "Error: start index (%"PRId64") + node count (%"PRId64") is larger than total number of nodes (%"PRId64") in file id %d",
+ start_node_num, num_nodes, num_nod, exoid);
+ ex_err("ex_put_partial_coord",errmsg,exerrval);
return (EX_FATAL);
}
@@ -135,7 +140,7 @@ int ex_put_n_coord (int exoid,
exerrval = status;
sprintf(errmsg,
"Error: failed to locate nodal coordinates in file id %d", exoid);
- ex_err("ex_put_n_coord",errmsg,exerrval);
+ ex_err("ex_put_partial_coord",errmsg,exerrval);
return (EX_FATAL);
}
@@ -147,6 +152,9 @@ int ex_put_n_coord (int exoid,
count[0] = 1;
count[1] = num_nodes;
+ if (count[1] == 0)
+ start[1] = 0;
+
if (i == 0 && x_coor != NULL) {
which = "X";
if (ex_comp_ws(exoid) == 4) {
@@ -176,7 +184,7 @@ int ex_put_n_coord (int exoid,
exerrval = status;
sprintf(errmsg,
"Error: failed to put %s coord array in file id %d", which, exoid);
- ex_err("ex_put_n_coord",errmsg,exerrval);
+ ex_err("ex_put_partial_coord",errmsg,exerrval);
return (EX_FATAL);
}
}
@@ -185,7 +193,7 @@ int ex_put_n_coord (int exoid,
exerrval = status;
sprintf(errmsg,
"Error: failed to locate x nodal coordinates in file id %d", exoid);
- ex_err("ex_put_n_coord",errmsg,exerrval);
+ ex_err("ex_put_partial_coord",errmsg,exerrval);
return (EX_FATAL);
}
@@ -194,7 +202,7 @@ int ex_put_n_coord (int exoid,
exerrval = status;
sprintf(errmsg,
"Error: failed to locate y nodal coordinates in file id %d", exoid);
- ex_err("ex_put_n_coord",errmsg,exerrval);
+ ex_err("ex_put_partial_coord",errmsg,exerrval);
return (EX_FATAL);
}
} else {
@@ -205,7 +213,7 @@ int ex_put_n_coord (int exoid,
exerrval = status;
sprintf(errmsg,
"Error: failed to locate z nodal coordinates in file id %d", exoid);
- ex_err("ex_put_n_coord",errmsg,exerrval);
+ ex_err("ex_put_partial_coord",errmsg,exerrval);
return (EX_FATAL);
}
} else {
@@ -219,6 +227,8 @@ int ex_put_n_coord (int exoid,
start[0] = start_node_num;
count[0] = num_nodes;
+ if (count[0] == 0)
+ start[0] = 0;
if (i == 0) {
coor = x_coor;
@@ -245,7 +255,7 @@ int ex_put_n_coord (int exoid,
exerrval = status;
sprintf(errmsg,
"Error: failed to put %s coord array in file id %d", which, exoid);
- ex_err("ex_put_n_coord",errmsg,exerrval);
+ ex_err("ex_put_partial_coord",errmsg,exerrval);
return (EX_FATAL);
}
}
diff --git a/nemesis/ne_pneat.c b/exodus/cbind/src/ex_put_partial_elem_attr.c
similarity index 61%
rename from nemesis/ne_pneat.c
rename to exodus/cbind/src/ex_put_partial_elem_attr.c
index be8964b..93fdf47 100644
--- a/nemesis/ne_pneat.c
+++ b/exodus/cbind/src/ex_put_partial_elem_attr.c
@@ -36,13 +36,13 @@
/*****************************************************************************/
/* Function(s) contained in this file:
*
- * ne_put_n_elem_attr()
+ * ex_put_partial_elem_attr()
*
*****************************************************************************
*
* Variable Index:
*
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* elem_blk_id - The element block ID.
* start_elem_num - The starting index of the elements to be
* obtained.
@@ -58,17 +58,14 @@
#include "exodusII.h"
#include "exodusII_int.h"
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
/*
* writes the attributes for an element block
*/
-int ne_put_n_elem_attr (int neid,
- int elem_blk_id,
- int start_elem_num,
- int num_elems,
+int ex_put_partial_elem_attr (int exoid,
+ ex_entity_id elem_blk_id,
+ int64_t start_elem_num,
+ int64_t num_elems,
void *attrib)
{
int status;
@@ -79,75 +76,75 @@ int ne_put_n_elem_attr (int neid,
exerrval = 0; /* clear error code */
/* Determine index of elem_blk_id in VAR_ID_EL_BLK array */
- if ((elem_blk_id_ndx = ex_id_lkup(neid, EX_ELEM_BLOCK, elem_blk_id)) < 0) {
+ if ((elem_blk_id_ndx = ex_id_lkup(exoid, EX_ELEM_BLOCK, elem_blk_id)) < 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no attributes allowed for NULL block %d in file id %d",
- elem_blk_id, neid);
- ex_err("ne_put_n_elem_attr",errmsg,EX_MSG);
+ "Warning: no attributes allowed for NULL block %"PRId64" in file id %d",
+ elem_blk_id, exoid);
+ ex_err("ex_put_partial_elem_attr",errmsg,EX_MSG);
return (EX_WARN); /* no attributes for this element block */
} else {
sprintf(errmsg,
- "Error: no element block id %d in %s array in file id %d",
- elem_blk_id, VAR_ID_EL_BLK, neid);
- ex_err("ne_put_n_elem_attr",errmsg,exerrval);
+ "Error: no element block id %"PRId64" in %s array in file id %d",
+ elem_blk_id, VAR_ID_EL_BLK, exoid);
+ ex_err("ex_put_partial_elem_attr",errmsg,exerrval);
return (EX_FATAL);
}
}
/* inquire id's of previously defined dimensions */
- if ((status = nc_inq_dimid (neid, DIM_NUM_EL_IN_BLK(elem_blk_id_ndx), &numelbdim)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_EL_IN_BLK(elem_blk_id_ndx), &numelbdim)) != NC_NOERR) {
if (status == NC_EBADDIM) {
exerrval = status;
sprintf(errmsg,
- "Error: no element block with id %d in file id %d",
- elem_blk_id, neid);
- ex_err("ne_put_n_elem_attr",errmsg,exerrval);
+ "Error: no element block with id %"PRId64" in file id %d",
+ elem_blk_id, exoid);
+ ex_err("ex_put_partial_elem_attr",errmsg,exerrval);
return (EX_FATAL);
} else {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of elements for block %d in file id %d",
- elem_blk_id, neid);
- ex_err("ne_put_n_elem_attr",errmsg,exerrval);
+ "Error: failed to locate number of elements for block %"PRId64" in file id %d",
+ elem_blk_id, exoid);
+ ex_err("ex_put_partial_elem_attr",errmsg,exerrval);
return (EX_FATAL);
}
}
- if ((status = nc_inq_dimlen(neid, numelbdim, &num_elem_this_blk)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, numelbdim, &num_elem_this_blk)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of elements for block %d in file id %d",
- elem_blk_id, neid);
- ex_err("ne_put_n_elem_attr",errmsg,exerrval);
+ "Error: failed to get number of elements for block %"PRId64" in file id %d",
+ elem_blk_id, exoid);
+ ex_err("ex_put_partial_elem_attr",errmsg,exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimid(neid, DIM_NUM_ATT_IN_BLK(elem_blk_id_ndx), &numattrdim)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_ATT_IN_BLK(elem_blk_id_ndx), &numattrdim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: number of attributes not defined for block %d in file id %d",
- elem_blk_id, neid);
- ex_err("ne_put_n_elem_attr",errmsg,EX_MSG);
+ "Error: number of attributes not defined for block %"PRId64" in file id %d",
+ elem_blk_id, exoid);
+ ex_err("ex_put_partial_elem_attr",errmsg,EX_MSG);
return (EX_FATAL); /* number of attributes not defined */
}
- if ((status = nc_inq_dimlen(neid, numattrdim, &num_attr)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, numattrdim, &num_attr)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of attributes for block %d in file id %d",
- elem_blk_id, neid);
- ex_err("ne_put_n_elem_attr",errmsg,exerrval);
+ "Error: failed to get number of attributes for block %"PRId64" in file id %d",
+ elem_blk_id, exoid);
+ ex_err("ex_put_partial_elem_attr",errmsg,exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_varid (neid, VAR_ATTRIB(elem_blk_id_ndx), &attrid)) != NC_NOERR) {
+ if ((status = nc_inq_varid (exoid, VAR_ATTRIB(elem_blk_id_ndx), &attrid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate attribute variable for block %d in file id %d",
- elem_blk_id, neid);
- ex_err("ne_put_n_elem_attr",errmsg,exerrval);
+ "Error: failed to locate attribute variable for block %"PRId64" in file id %d",
+ elem_blk_id, exoid);
+ ex_err("ex_put_partial_elem_attr",errmsg,exerrval);
return (EX_FATAL);
}
@@ -155,9 +152,9 @@ int ne_put_n_elem_attr (int neid,
if (num_elem_this_blk < (start_elem_num + num_elems - 1)) {
exerrval = status;
sprintf(errmsg,
- "Error: requested attributes from too many elements in this block, %d",
+ "Error: requested attributes from too many elements in block %"PRId64,
elem_blk_id);
- ex_err("ne_put_n_elem_attr",errmsg, exerrval);
+ ex_err("ex_put_partial_elem_attr",errmsg, exerrval);
return(EX_FATAL);
}
@@ -168,18 +165,21 @@ int ne_put_n_elem_attr (int neid,
count[0] = num_elems;
count[1] = num_attr;
- if (ex_comp_ws(neid) == 4) {
- status = nc_put_vara_float(neid, attrid, start, count, attrib);
+ if (count[0] == 0)
+ start[0] = 0;
+
+ if (ex_comp_ws(exoid) == 4) {
+ status = nc_put_vara_float(exoid, attrid, start, count, attrib);
} else {
- status = nc_put_vara_double(neid, attrid, start, count, attrib);
+ status = nc_put_vara_double(exoid, attrid, start, count, attrib);
}
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to put attributes for block %d in file id %d",
- elem_blk_id, neid);
- ex_err("ne_put_n_elem_attr",errmsg,exerrval);
+ "Error: failed to put attributes for block %"PRId64" in file id %d",
+ elem_blk_id, exoid);
+ ex_err("ex_put_partial_elem_attr",errmsg,exerrval);
return (EX_FATAL);
}
return(EX_NOERR);
diff --git a/nemesis/ne_pnelc.c b/exodus/cbind/src/ex_put_partial_elem_conn.c
similarity index 63%
rename from nemesis/ne_pnelc.c
rename to exodus/cbind/src/ex_put_partial_elem_conn.c
index 19aa568..cd53297 100644
--- a/nemesis/ne_pnelc.c
+++ b/exodus/cbind/src/ex_put_partial_elem_conn.c
@@ -36,13 +36,13 @@
/*****************************************************************************/
/* Function(s) contained in this file:
*
- * ne_put_n_elem_conn()
+ * ex_put_partial_elem_conn()
*
*****************************************************************************
*
* Variable Index:
*
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* elem_blk_id - The element block ID.
* start_elem_num - The starting index of the elements to be
* obtained.
@@ -59,18 +59,15 @@
#include "exodusII.h"
#include "exodusII_int.h"
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
/*
* writes the connectivity array for an element block
*/
-int ne_put_n_elem_conn (int neid,
- int elem_blk_id,
- int start_elem_num,
- int num_elems,
- int *connect)
+int ex_put_partial_elem_conn (int exoid,
+ ex_entity_id elem_blk_id,
+ int64_t start_elem_num,
+ int64_t num_elems,
+ const void_int *connect)
{
int numelbdim, nelnoddim, connid, elem_blk_id_ndx, status;
size_t num_elem_this_blk, num_nod_per_elem, start[2], count[2];
@@ -79,69 +76,69 @@ int ne_put_n_elem_conn (int neid,
exerrval = 0; /* clear error code */
/* Determine index of elem_blk_id in VAR_ID_EL_BLK array */
- if ((elem_blk_id_ndx = ex_id_lkup(neid, EX_ELEM_BLOCK, elem_blk_id)) == -1)
+ if ((elem_blk_id_ndx = ex_id_lkup(exoid, EX_ELEM_BLOCK, elem_blk_id)) == -1)
{
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: connectivity array not allowed for NULL element block %d in file id %d",
- elem_blk_id, neid);
- ex_err("ne_put_n_elem_conn",errmsg,EX_MSG);
+ "Warning: connectivity array not allowed for NULL element block %"PRId64" in file id %d",
+ elem_blk_id, exoid);
+ ex_err("ex_put_partial_elem_conn",errmsg,EX_MSG);
return (EX_WARN);
} else {
sprintf(errmsg,
- "Error: failed to locate element block id %d in %s array in file id %d",
- elem_blk_id,VAR_ID_EL_BLK, neid);
- ex_err("ne_put_n_elem_conn",errmsg,exerrval);
+ "Error: failed to locate element block id %"PRId64" in %s array in file id %d",
+ elem_blk_id,VAR_ID_EL_BLK, exoid);
+ ex_err("ex_put_partial_elem_conn",errmsg,exerrval);
return (EX_FATAL);
}
}
/* inquire id's of previously defined dimensions */
- if ((status = nc_inq_dimid (neid, DIM_NUM_EL_IN_BLK(elem_blk_id_ndx), &numelbdim)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_EL_IN_BLK(elem_blk_id_ndx), &numelbdim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of elements in block %d in file id %d",
- elem_blk_id, neid);
- ex_err("ne_put_n_elem_conn",errmsg, exerrval);
+ "Error: failed to locate number of elements in block %"PRId64" in file id %d",
+ elem_blk_id, exoid);
+ ex_err("ex_put_partial_elem_conn",errmsg, exerrval);
return(EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, numelbdim, &num_elem_this_blk)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, numelbdim, &num_elem_this_blk)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of elements in block %d in file id %d",
- elem_blk_id, neid);
- ex_err("ne_put_n_elem_conn",errmsg,exerrval);
+ "Error: failed to get number of elements in block %"PRId64" in file id %d",
+ elem_blk_id, exoid);
+ ex_err("ex_put_partial_elem_conn",errmsg,exerrval);
return(EX_FATAL);
}
- if ((status = nc_inq_dimid (neid, DIM_NUM_NOD_PER_EL(elem_blk_id_ndx), &nelnoddim)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_NOD_PER_EL(elem_blk_id_ndx), &nelnoddim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of nodes/elem in block %d in file id %d",
- elem_blk_id, neid);
- ex_err("ne_put_n_elem_conn",errmsg,exerrval);
+ "Error: failed to locate number of nodes/elem in block %"PRId64" in file id %d",
+ elem_blk_id, exoid);
+ ex_err("ex_put_partial_elem_conn",errmsg,exerrval);
return(EX_FATAL);
}
- if ((status = nc_inq_dimlen (neid, nelnoddim, &num_nod_per_elem)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen (exoid, nelnoddim, &num_nod_per_elem)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of nodes/elem in block %d in file id %d",
- elem_blk_id, neid);
- ex_err("ne_put_n_elem_conn",errmsg,exerrval);
+ "Error: failed to get number of nodes/elem in block %"PRId64" in file id %d",
+ elem_blk_id, exoid);
+ ex_err("ex_put_partial_elem_conn",errmsg,exerrval);
return(EX_FATAL);
}
- if ((status = nc_inq_varid (neid, VAR_CONN(elem_blk_id_ndx), &connid)) != NC_NOERR) {
+ if ((status = nc_inq_varid (exoid, VAR_CONN(elem_blk_id_ndx), &connid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate connectivity array for element block %d in file id %d",
- elem_blk_id, neid);
- ex_err("ne_put_n_elem_conn",errmsg, exerrval);
+ "Error: failed to locate connectivity array for element block %"PRId64" in file id %d",
+ elem_blk_id, exoid);
+ ex_err("ex_put_partial_elem_conn",errmsg, exerrval);
return(EX_FATAL);
}
@@ -149,9 +146,9 @@ int ne_put_n_elem_conn (int neid,
if (num_elem_this_blk < (start_elem_num + num_elems - 1)) {
exerrval = status;
sprintf(errmsg,
- "Error: requested connectivity from too many elements in this block, %d",
+ "Error: requested connectivity from too many elements in block, %"PRId64,
elem_blk_id);
- ex_err("ne_put_n_elem_conn",errmsg, exerrval);
+ ex_err("ex_put_partial_elem_conn",errmsg, exerrval);
return(EX_FATAL);
}
@@ -162,14 +159,21 @@ int ne_put_n_elem_conn (int neid,
count[0] = num_elems;
count[1] = num_nod_per_elem;
- status = nc_put_vara_int(neid, connid, start, count, connect);
+ if (count[0] == 0)
+ start[0] = 0;
+
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_put_vara_longlong(exoid, connid, start, count, connect);
+ } else {
+ status = nc_put_vara_int(exoid, connid, start, count, connect);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to write connectivity array for block %d in file id %d",
- elem_blk_id, neid);
- ex_err("ne_put_n_elem_conn",errmsg, exerrval);
+ "Error: failed to write connectivity array for block %"PRId64" in file id %d",
+ elem_blk_id, exoid);
+ ex_err("ex_put_partial_elem_conn",errmsg, exerrval);
return(EX_FATAL);
}
return (EX_NOERR);
diff --git a/exodus/cbind/src/expem.c b/exodus/cbind/src/ex_put_partial_elem_map.c
similarity index 78%
rename from exodus/cbind/src/expem.c
rename to exodus/cbind/src/ex_put_partial_elem_map.c
index 34a660a..16d68f4 100644
--- a/exodus/cbind/src/expem.c
+++ b/exodus/cbind/src/ex_put_partial_elem_map.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -34,12 +34,14 @@
*/
/*****************************************************************************
*
-* expem - ex_put_elem_map
+* exppem - ex_put_partial_elem_map
*
* entry conditions -
* input parameters:
* int exoid exodus file id
* int map_id element map id
+* int ent_start first entry in map
+* int ent_count number of entries in map
* int *elem_map element map
*
* exit conditions -
@@ -51,19 +53,18 @@
#include "exodusII.h"
#include "exodusII_int.h"
+#include <stdlib.h> /* for free() */
/*!
* writes an element map; this is a vector of integers of length number
* of elements
- * \param exoid exodus file id
- * \param map_id element map id
- * \param elem_map element map
- * \deprecated Use ex_put_num_map()(exoid, EX_ELEM_MAP, map_id, elem_map)
+ * \deprecated Use ex_put_partial_num_map()(exoid, EX_ELEM_MAP, map_id, ent_start, ent_count, elem_map) instead
*/
-
-int ex_put_elem_map (int exoid,
- int map_id,
- const int *elem_map)
+int ex_put_partial_elem_map (int exoid,
+ ex_entity_id map_id,
+ int64_t ent_start,
+ int64_t ent_count,
+ const void_int *elem_map)
{
- return ex_put_num_map( exoid, EX_ELEM_MAP, map_id, elem_map );
+ return ex_put_partial_num_map(exoid, EX_ELEM_MAP, map_id, ent_start, ent_count, elem_map);
}
diff --git a/exodus/cbind/src/exgns.c b/exodus/cbind/src/ex_put_partial_elem_num_map.c
similarity index 73%
rename from exodus/cbind/src/exgns.c
rename to exodus/cbind/src/ex_put_partial_elem_num_map.c
index eece0de..b2a2735 100644
--- a/exodus/cbind/src/exgns.c
+++ b/exodus/cbind/src/ex_put_partial_elem_num_map.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -34,34 +34,35 @@
*/
/*****************************************************************************
*
-* exgns - ex_get_node_set
+* ne_pennm - ex_put_partial_elem_num_map
+*
+* environment - UNIX
*
* entry conditions -
* input parameters:
-* int exoid exodus file id
-* int node_set_id node set id
+* int exoid exodus file id
+* int start_ent first entry in elem_map
+* int num_ents number of entries in node_map
+* int* elem_map element numbering map array
*
* exit conditions -
-* int* node_set_node_list node list array for the node set
*
* revision history -
*
*
*****************************************************************************/
-#include <stdlib.h>
#include "exodusII.h"
-#include "exodusII_int.h"
-/*!
- * reads the node list for a single node set
- * \deprecated Use ex_get_set()(exoid, EX_NODE_SET, node_set_id, node_set_node_list, NULL)
+/*
+ * writes out a portion of the element numbering map to the database;
+ * this allows element numbers to be non-contiguous
*/
-int ex_get_node_set (int exoid,
- int node_set_id,
- int *node_set_node_list)
+int ex_put_partial_elem_num_map (int exoid,
+ int64_t start_ent,
+ int64_t num_ents,
+ const void_int *elem_map)
{
- return ex_get_set(exoid, EX_NODE_SET, node_set_id, node_set_node_list,
- NULL);
+ return ex_put_partial_id_map(exoid, EX_ELEM_MAP, start_ent, num_ents, elem_map);
}
diff --git a/exodus/cbind/src/exppidm.c b/exodus/cbind/src/ex_put_partial_id_map.c
similarity index 76%
rename from exodus/cbind/src/exppidm.c
rename to exodus/cbind/src/ex_put_partial_id_map.c
index da04ce9..ef4d4b9 100644
--- a/exodus/cbind/src/exppidm.c
+++ b/exodus/cbind/src/ex_put_partial_id_map.c
@@ -34,7 +34,7 @@
*/
/*****************************************************************************
*
-* expenm - ex_put_id_map
+* expenm - ex_put_partial_id_map
*
* entry conditions -
* input parameters:
@@ -66,11 +66,12 @@
int ex_put_partial_id_map (int exoid,
ex_entity_type map_type,
- int start_entity_num,
- int num_entities,
- const int *map)
+ int64_t start_entity_num,
+ int64_t num_entities,
+ const void_int *map)
{
int dimid, mapid, status, dims[1];
+ int map_int_type;
size_t start[1], count[1];
char errmsg[MAX_ERR_LENGTH];
const char* tname;
@@ -78,7 +79,9 @@ int ex_put_partial_id_map (int exoid,
const char* vmap;
exerrval = 0; /* clear error code */
-
+ if (num_entities == 0)
+ return (EX_NOERR);
+
switch ( map_type ) {
case EX_NODE_MAP:
tname = "node";
@@ -105,13 +108,24 @@ int ex_put_partial_id_map (int exoid,
sprintf( errmsg,
"Error: Bad map type (%d) specified for file id %d",
map_type, exoid );
- ex_err( "ex_put_id_map", errmsg, exerrval );
+ ex_err( "ex_put_partial_id_map", errmsg, exerrval );
return (EX_FATAL);
}
/* Make sure the file contains entries */
if (nc_inq_dimid (exoid, dnumentries, &dimid) != NC_NOERR) {
- return (EX_NOERR);
+ /* Error -- if we made it this far, num_entities is > 0,
+ * but the dimension 'dnumentries' is not defined which
+ * indicates that either the entity count is zero, or
+ * there is an error in that the dimension has not yet
+ * been defined.
+ */
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Error: The %s count is %ld, but the %s dimension is not defined on file id %d.",
+ tname, num_entities, dnumentries, exoid);
+ ex_err("ex_put_partial_id_map",errmsg,exerrval);
+ return (EX_FATAL);
}
/* define the map if it doesn't already exist... */
@@ -121,29 +135,36 @@ int ex_put_partial_id_map (int exoid,
sprintf(errmsg,
"Error: failed to put file id %d into define mode",
exoid);
- ex_err("ex_put_id_map",errmsg,exerrval);
+ ex_err("ex_put_partial_id_map",errmsg,exerrval);
return (EX_FATAL);
}
/* create a variable array in which to store the id map */
dims[0] = dimid;
- if ((status = nc_def_var(exoid, vmap, NC_INT, 1, dims, &mapid)) != NC_NOERR) {
+ /* Check type to be used for maps... */
+ map_int_type = NC_INT;
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_DB) {
+ map_int_type = NC_INT64;
+ }
+
+ if ((status = nc_def_var(exoid, vmap, map_int_type, 1, dims, &mapid)) != NC_NOERR) {
if (status == NC_ENAMEINUSE) {
exerrval = status;
sprintf(errmsg,
"Error: %s numbering map already exists in file id %d",
tname, exoid);
- ex_err("ex_put_id_map",errmsg,exerrval);
+ ex_err("ex_put_partial_id_map",errmsg,exerrval);
} else {
exerrval = status;
sprintf(errmsg,
"Error: failed to create %s id map in file id %d",
tname, exoid);
- ex_err("ex_put_id_map",errmsg,exerrval);
+ ex_err("ex_put_partial_id_map",errmsg,exerrval);
}
goto error_ret; /* exit define mode and return */
}
+ ex_compress_variable(exoid, mapid, 1);
/* leave define mode */
@@ -152,7 +173,7 @@ int ex_put_partial_id_map (int exoid,
sprintf(errmsg,
"Error: failed to complete definition in file id %d",
exoid);
- ex_err("ex_put_id_map",errmsg,exerrval);
+ ex_err("ex_put_partial_id_map",errmsg,exerrval);
return (EX_FATAL);
}
}
@@ -160,15 +181,22 @@ int ex_put_partial_id_map (int exoid,
/* write out the entity numbering map */
start[0] = start_entity_num-1;
count[0] = num_entities;
+ if (num_entities == 0)
+ start[0] = 0;
- status = nc_put_vara_int(exoid, mapid, start, count, map);
+ /* write out the entity numbering map */
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_put_vara_longlong(exoid, mapid, start, count, map);
+ } else {
+ status = nc_put_vara_int(exoid, mapid, start, count, map);
+ }
if (status!= NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to store %s numbering map in file id %d",
tname, exoid);
- ex_err("ex_put_id_map",errmsg,exerrval);
+ ex_err("ex_put_partial_id_map",errmsg,exerrval);
return (EX_FATAL);
}
@@ -182,7 +210,7 @@ int ex_put_partial_id_map (int exoid,
sprintf(errmsg,
"Error: failed to complete definition for file id %d",
exoid);
- ex_err("ex_put_id_map",errmsg,exerrval);
+ ex_err("ex_put_partial_id_map",errmsg,exerrval);
}
return (EX_FATAL);
}
diff --git a/exodus/cbind/src/expnnv.c b/exodus/cbind/src/ex_put_partial_nodal_var.c
similarity index 92%
rename from exodus/cbind/src/expnnv.c
rename to exodus/cbind/src/ex_put_partial_nodal_var.c
index 347be4b..78a26a6 100644
--- a/exodus/cbind/src/expnnv.c
+++ b/exodus/cbind/src/ex_put_partial_nodal_var.c
@@ -34,7 +34,7 @@
*/
/*****************************************************************************
*
-* expnv - ex_put_n_nodal_var
+* expnv - ex_put_partial_nodal_var
*
* entry conditions -
* input parameters:
@@ -67,11 +67,11 @@
* \param nodal_var_vals array of nodal variable values
*/
-int ex_put_n_nodal_var (int exoid,
+int ex_put_partial_nodal_var (int exoid,
int time_step,
int nodal_var_index,
- int start_node,
- int num_nodes,
+ int64_t start_node,
+ int64_t num_nodes,
const void *nodal_var_vals)
{
@@ -89,7 +89,7 @@ int ex_put_n_nodal_var (int exoid,
sprintf(errmsg,
"Warning: could not find nodal variables in file id %d",
exoid);
- ex_err("ex_put_n_nodal_var",errmsg,exerrval);
+ ex_err("ex_put_partial_nodal_var",errmsg,exerrval);
return (EX_WARN);
}
start[0] = --time_step;
@@ -107,7 +107,7 @@ int ex_put_n_nodal_var (int exoid,
sprintf(errmsg,
"Warning: could not find nodal variable %d in file id %d",
nodal_var_index, exoid);
- ex_err("ex_put_n_nodal_var",errmsg,exerrval);
+ ex_err("ex_put_partial_nodal_var",errmsg,exerrval);
return (EX_WARN);
}
@@ -116,6 +116,8 @@ int ex_put_n_nodal_var (int exoid,
count[0] = 1;
count[1] = num_nodes;
+ if (num_nodes == 0)
+ start[1] = 0;
}
if (ex_comp_ws(exoid) == 4) {
@@ -129,7 +131,7 @@ int ex_put_n_nodal_var (int exoid,
sprintf(errmsg,
"Error: failed to store nodal variables in file id %d",
exoid);
- ex_err("ex_put_n_nodal_var",errmsg,exerrval);
+ ex_err("ex_put_partial_nodal_var",errmsg,exerrval);
return (EX_FATAL);
}
return (EX_NOERR);
diff --git a/exodus/cbind/src/exgnm.c b/exodus/cbind/src/ex_put_partial_node_num_map.c
similarity index 75%
rename from exodus/cbind/src/exgnm.c
rename to exodus/cbind/src/ex_put_partial_node_num_map.c
index 062c96e..64cd248 100644
--- a/exodus/cbind/src/exgnm.c
+++ b/exodus/cbind/src/ex_put_partial_node_num_map.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 Sandia Corporation. Under the terms of Contract
+ * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
* DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
* retains certain rights in this software.
*
@@ -32,35 +32,37 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+
/*****************************************************************************
*
-* exgnm - ex_get_node_map
+* ne_pnnnm - ex_put_partial_node_num_map
*
* entry conditions -
* input parameters:
-* int exoid exodus file id
-* int map_id node map id
+* int exoid exodus file id
+* int start_ent first entry in node_map
+* int num_ents number of entries in node_map
+* int* node_map node numbering map
*
* exit conditions -
-* int* node_map node map
*
* revision history -
*
*
*****************************************************************************/
-#include <stdlib.h>
#include "exodusII.h"
#include "exodusII_int.h"
-/*!
- * reads the node map with specified ID
- * \deprecated Use ex_get_num_map()(exoid, EX_NODE_MAP, map_id, node_map
+/*
+ * writes out the node numbering map to the database; allows node numbers
+ * to be non-contiguous
*/
-int ex_get_node_map( int exoid,
- int map_id,
- int *node_map )
+int ex_put_partial_node_num_map (int exoid,
+ int64_t start_ent,
+ int64_t num_ents,
+ const void_int *node_map)
{
- return ex_get_num_map( exoid, EX_NODE_MAP, map_id, node_map );
+ return ex_put_partial_id_map(exoid, EX_NODE_MAP, start_ent, num_ents, node_map);
}
diff --git a/nemesis/ne_pnns.c b/exodus/cbind/src/ex_put_partial_node_set.c
similarity index 65%
rename from nemesis/ne_pnns.c
rename to exodus/cbind/src/ex_put_partial_node_set.c
index 639f7a9..4e68d55 100644
--- a/nemesis/ne_pnns.c
+++ b/exodus/cbind/src/ex_put_partial_node_set.c
@@ -37,13 +37,13 @@
/*****************************************************************************/
/* Function(s) contained in this file:
*
- * ne_put_n_node_set()
+ * ex_put_partial_node_set()
*
*****************************************************************************
*
* Variable Index:
*
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* node_set_id - ID of node set to read.
* start_node_num - The starting index of the nodes to be read.
* num_nodes - The number of nodes to read in.
@@ -58,18 +58,15 @@
#include "exodusII.h"
#include "exodusII_int.h"
-#include "ne_nemesisI.h"
-#include "ne_nemesisI_int.h"
-
/*
* writes the node list for a single node set
*/
-int ne_put_n_node_set (int neid,
- int node_set_id,
- int start_node_num,
- int num_nodes,
- int *node_set_node_list)
+int ex_put_partial_node_set (int exoid,
+ ex_entity_id node_set_id,
+ int64_t start_node_num,
+ int64_t num_nodes,
+ const void_int *node_set_node_list)
{
int dimid, node_list_id, node_set_id_ndx, status;
size_t num_nodes_in_set, start[1], count[1];
@@ -79,56 +76,56 @@ int ne_put_n_node_set (int neid,
/* first check if any node sets are specified */
- if ((status = nc_inq_dimid (neid, DIM_NUM_NS, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_NS, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: no node sets specified in file id %d",
- neid);
- ex_err("ne_put_n_node_set",errmsg,exerrval);
+ exoid);
+ ex_err("ex_put_partial_node_set",errmsg,exerrval);
return (EX_FATAL);
}
/* Lookup index of node set id in VAR_NS_IDS array */
- if ((node_set_id_ndx = ex_id_lkup(neid, EX_NODE_SET, node_set_id)) < 0)
+ if ((node_set_id_ndx = ex_id_lkup(exoid, EX_NODE_SET, node_set_id)) < 0)
{
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no data allowed for NULL node set %d in file id %d",
- node_set_id, neid);
- ex_err("ne_put_n_node_set",errmsg,EX_MSG);
+ "Warning: no data allowed for NULL node set %"PRId64" in file id %d",
+ node_set_id, exoid);
+ ex_err("ex_put_partial_node_set",errmsg,EX_MSG);
return (EX_WARN);
} else {
sprintf(errmsg,
- "Error: failed to locate node set id %d in VAR_NS_IDS array in file id %d",
- node_set_id, neid);
- ex_err("ne_put_n_node_set",errmsg,exerrval);
+ "Error: failed to locate node set id %"PRId64" in VAR_NS_IDS array in file id %d",
+ node_set_id, exoid);
+ ex_err("ex_put_partial_node_set",errmsg,exerrval);
return (EX_FATAL);
}
}
/* inquire id's of previously defined dimensions */
- if ((status = nc_inq_dimid (neid, DIM_NUM_NOD_NS(node_set_id_ndx), &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_NOD_NS(node_set_id_ndx), &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of nodes in set %d in file id %d",
- node_set_id, neid);
- ex_err("ne_put_n_node_set",errmsg,exerrval);
+ "Error: failed to locate number of nodes in set %"PRId64" in file id %d",
+ node_set_id, exoid);
+ ex_err("ex_put_partial_node_set",errmsg,exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid, &num_nodes_in_set)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &num_nodes_in_set)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of nodes in set %d in file id %d",
- node_set_id, neid);
- ex_err("ne_put_n_node_set",errmsg,exerrval);
+ "Error: failed to get number of nodes in set %"PRId64" in file id %d",
+ node_set_id, exoid);
+ ex_err("ex_put_partial_node_set",errmsg,exerrval);
return (EX_FATAL);
}
/* Check input parameters for a valid range of numbers */
if (start_node_num < 0 || start_node_num > num_nodes_in_set) {
- fprintf(stderr, "ERROR: Invalid input to function ne_get_n_node_set!\n");
+ fprintf(stderr, "ERROR: Invalid input to function ex_get_partial_node_set!\n");
return -1;
}
@@ -144,28 +141,34 @@ int ne_put_n_node_set (int neid,
}
/* inquire if variable for node set node list has been defined */
- if ((status = nc_inq_varid (neid, VAR_NODE_NS(node_set_id_ndx), &node_list_id)) != NC_NOERR) {
+ if ((status = nc_inq_varid (exoid, VAR_NODE_NS(node_set_id_ndx), &node_list_id)) != NC_NOERR) {
/* variable doesn't exist */
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate node set %d node list in file id %d",
- node_set_id, neid);
- ex_err("ne_put_n_node_set",errmsg,exerrval);
+ "Error: failed to locate node set %"PRId64" node list in file id %d",
+ node_set_id, exoid);
+ ex_err("ex_put_partial_node_set",errmsg,exerrval);
return (EX_FATAL);
}
/* write out the node list array */
start[0] = --start_node_num;
count[0] = num_nodes;
+ if (count[0] == 0)
+ start[0] = 0;
- status = nc_put_vara_int(neid, node_list_id, start, count, node_set_node_list);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_put_vara_longlong(exoid, node_list_id, start, count, node_set_node_list);
+ } else {
+ status = nc_put_vara_int(exoid, node_list_id, start, count, node_set_node_list);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to store node set %d node list in file id %d",
- node_set_id, neid);
- ex_err("ne_put_n_node_set",errmsg,exerrval);
+ "Error: failed to store node set %"PRId64" node list in file id %d",
+ node_set_id, exoid);
+ ex_err("ex_put_partial_node_set",errmsg,exerrval);
return (EX_FATAL);
}
return (EX_NOERR);
diff --git a/nemesis/ne_pnnsd.c b/exodus/cbind/src/ex_put_partial_node_set_df.c
similarity index 66%
rename from nemesis/ne_pnnsd.c
rename to exodus/cbind/src/ex_put_partial_node_set_df.c
index 90fcdf8..2f69a27 100644
--- a/nemesis/ne_pnnsd.c
+++ b/exodus/cbind/src/ex_put_partial_node_set_df.c
@@ -38,13 +38,13 @@
/*****************************************************************************/
/* Function(s) contained in this file:
*
- * ne_put_n_node_set_df()
+ * ex_put_partial_node_set_df()
*
*****************************************************************************
*
* Variable Index:
*
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* node_set_id - ID of node set to write.
* start_num - The starting index of the df's to be written.
* num_df_to_get - The number of distribution factors to write out.
@@ -59,17 +59,14 @@
#include "exodusII.h"
#include "exodusII_int.h"
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
/*
* writes the node set distribution factors for a single node set
*/
-int ne_put_n_node_set_df (int neid,
- int node_set_id,
- int start_num,
- int num_df_to_get,
+int ex_put_partial_node_set_df (int exoid,
+ ex_entity_id node_set_id,
+ int64_t start_num,
+ int64_t num_df_to_get,
void *node_set_dist_fact)
{
int status;
@@ -81,49 +78,49 @@ int ne_put_n_node_set_df (int neid,
/* first check if any node sets are specified */
- if ((status = nc_inq_dimid (neid, DIM_NUM_NS, &dimid)) < 0) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_NS, &dimid)) < 0) {
exerrval = status;
sprintf(errmsg,
"Error: no node sets specified in file id %d",
- neid);
- ex_err("ne_put_n_node_set_df",errmsg,exerrval);
+ exoid);
+ ex_err("ex_put_partial_node_set_df",errmsg,exerrval);
return (EX_FATAL);
}
/* Lookup index of node set id in VAR_NS_IDS array */
- if ((node_set_id_ndx = ex_id_lkup(neid, EX_NODE_SET, node_set_id)) < 0)
+ if ((node_set_id_ndx = ex_id_lkup(exoid, EX_NODE_SET, node_set_id)) < 0)
{
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no data allowed for NULL node set %d in file id %d",
- node_set_id, neid);
- ex_err("ne_put_n_node_set_df",errmsg,EX_MSG);
+ "Warning: no data allowed for NULL node set %"PRId64" in file id %d",
+ node_set_id, exoid);
+ ex_err("ex_put_partial_node_set_df",errmsg,EX_MSG);
return (EX_WARN);
} else {
sprintf(errmsg,
- "Error: failed to locate node set id %d in VAR_NS_IDS array in file id %d",
- node_set_id, neid);
- ex_err("ne_put_n_node_set_df",errmsg,exerrval);
+ "Error: failed to locate node set id %"PRId64" in VAR_NS_IDS array in file id %d",
+ node_set_id, exoid);
+ ex_err("ex_put_partial_node_set_df",errmsg,exerrval);
return (EX_FATAL);
}
}
/* inquire id's of previously defined dimensions */
- if ((status = nc_inq_dimid (neid, DIM_NUM_NOD_NS(node_set_id_ndx), &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_NOD_NS(node_set_id_ndx), &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of nodes in node set %d in file id %d",
- node_set_id, neid);
- ex_err("ne_put_n_node_set_df",errmsg,exerrval);
+ "Error: failed to locate number of nodes in node set %"PRId64" in file id %d",
+ node_set_id, exoid);
+ ex_err("ex_put_partial_node_set_df",errmsg,exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid, &num_nodes_in_set)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &num_nodes_in_set)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of nodes in set %d in file id %d",
- node_set_id, neid);
- ex_err("ne_put_n_node_set_df",errmsg,exerrval);
+ "Error: failed to get number of nodes in set %"PRId64" in file id %d",
+ node_set_id, exoid);
+ ex_err("ex_put_partial_node_set_df",errmsg,exerrval);
return (EX_FATAL);
}
@@ -131,14 +128,14 @@ int ne_put_n_node_set_df (int neid,
if (start_num < 0 || start_num > num_nodes_in_set) {
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: Invalid input");
- ex_err("ne_put_n_node_set_df",errmsg,exerrval);
+ ex_err("ex_put_partial_node_set_df",errmsg,exerrval);
return (EX_FATAL);
}
if (num_df_to_get < 0) {
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: Invalid number of nodes in nodes set!");
- ex_err("ne_put_n_node_set_df",errmsg,exerrval);
+ ex_err("ex_put_partial_node_set_df",errmsg,exerrval);
return (EX_FATAL);
}
@@ -146,26 +143,26 @@ int ne_put_n_node_set_df (int neid,
if ((start_num + num_df_to_get - 1) > num_nodes_in_set) {
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: request larger than number of nodes in set!");
- ex_err("ne_put_n_node_set_df",errmsg,exerrval);
+ ex_err("ex_put_partial_node_set_df",errmsg,exerrval);
return (EX_FATAL);
}
/* find id of distribution factors variable */
- if ((status = nc_inq_varid (neid, VAR_FACT_NS(node_set_id_ndx), &dist_id)) != NC_NOERR) {
+ if ((status = nc_inq_varid (exoid, VAR_FACT_NS(node_set_id_ndx), &dist_id)) != NC_NOERR) {
if (status == NC_ENOTVAR) {
exerrval = EX_BADPARAM;
sprintf(errmsg,
- "Warning: no dist factors defined for node set %d in file id %d",
- node_set_id, neid);
- ex_err("ne_put_n_node_set_df",errmsg,exerrval);
+ "Warning: no dist factors defined for node set %"PRId64" in file id %d",
+ node_set_id, exoid);
+ ex_err("ex_put_partial_node_set_df",errmsg,exerrval);
return (EX_WARN);
} else {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate node set %d dist factors in file id %d",
- node_set_id, neid);
- ex_err("ne_put_n_node_set_df",errmsg,exerrval);
+ "Error: failed to locate node set %"PRId64" dist factors in file id %d",
+ node_set_id, exoid);
+ ex_err("ex_put_partial_node_set_df",errmsg,exerrval);
return (EX_FATAL);
}
}
@@ -174,19 +171,21 @@ int ne_put_n_node_set_df (int neid,
/* write out the distribution factors array */
start[0] = --start_num;
count[0] = num_df_to_get;
+ if (count[0] == 0)
+ start[0] = 0;
- if (ex_comp_ws(neid) == 4) {
- status = nc_put_vara_float(neid, dist_id, start, count, node_set_dist_fact);
+ if (ex_comp_ws(exoid) == 4) {
+ status = nc_put_vara_float(exoid, dist_id, start, count, node_set_dist_fact);
} else {
- status = nc_put_vara_double(neid, dist_id, start, count, node_set_dist_fact);
+ status = nc_put_vara_double(exoid, dist_id, start, count, node_set_dist_fact);
}
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to store node set %d dist factors in file id %d",
- node_set_id, neid);
- ex_err("ne_put_n_node_set_df",errmsg,exerrval);
+ "Error: failed to store node set %"PRId64" dist factors in file id %d",
+ node_set_id, exoid);
+ ex_err("ex_put_partial_node_set_df",errmsg,exerrval);
return (EX_FATAL);
}
return (EX_NOERR);
diff --git a/exodus/cbind/src/ex_put_partial_num_map.c b/exodus/cbind/src/ex_put_partial_num_map.c
new file mode 100644
index 0000000..921b2aa
--- /dev/null
+++ b/exodus/cbind/src/ex_put_partial_num_map.c
@@ -0,0 +1,300 @@
+/*
+ * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
+ * retains certain rights in this software.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * * Neither the name of Sandia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/*****************************************************************************
+*
+* exppem - ex_put_partial_num_map
+*
+* entry conditions -
+* input parameters:
+* int exoid exodus file id
+* int map_id element map id
+* int ent_start first entry in map
+* int ent_count number of entries in map
+* int *map map
+*
+* exit conditions -
+*
+* revision history -
+*
+*
+*****************************************************************************/
+
+#include "exodusII.h"
+#include "exodusII_int.h"
+#include <stdlib.h> /* for free() */
+
+/*!
+ * writes a map; this is a vector of integers of length number of mesh
+ * objects of that type (element, node, face, edge)
+ */
+int ex_put_partial_num_map (int exoid,
+ ex_entity_type map_type,
+ ex_entity_id map_id,
+ int64_t ent_start,
+ int64_t ent_count,
+ const void_int *map)
+{
+ int status;
+ int dimid, varid, map_ndx, map_exists;
+ size_t start[1];
+ size_t num_maps, num_mobj, count[1];
+ int cur_num_maps;
+ char errmsg[MAX_ERR_LENGTH];
+ const char* dnumentries;
+ const char* dnummaps;
+ const char* vmapids;
+ const char* vmap;
+
+ exerrval = 0; /* clear error code */
+
+ switch ( map_type ) {
+ case EX_NODE_MAP:
+ dnumentries = DIM_NUM_NODES;
+ dnummaps = DIM_NUM_NM;
+ vmapids = VAR_NM_PROP(1);
+ break;
+ case EX_EDGE_MAP:
+ dnumentries = DIM_NUM_EDGE;
+ dnummaps = DIM_NUM_EDM;
+ vmapids = VAR_EDM_PROP(1);
+ break;
+ case EX_FACE_MAP:
+ dnumentries = DIM_NUM_FACE;
+ dnummaps = DIM_NUM_FAM;
+ vmapids = VAR_FAM_PROP(1);
+ break;
+ case EX_ELEM_MAP:
+ dnumentries = DIM_NUM_ELEM;
+ dnummaps = DIM_NUM_EM;
+ vmapids = VAR_EM_PROP(1);
+ break;
+ default:
+ exerrval = EX_BADPARAM;
+ sprintf( errmsg,
+ "Error: Bad map type (%d) specified for file id %d",
+ map_type, exoid );
+ ex_err( "ex_put_num_map", errmsg, exerrval );
+ return (EX_FATAL);
+ }
+
+ /* Make sure the file contains entries */
+ if (nc_inq_dimid (exoid, dnumentries, &dimid) != NC_NOERR ) {
+ return (EX_NOERR);
+ }
+
+ /* first check if any maps are specified */
+ if ((status = nc_inq_dimid (exoid, dnummaps, &dimid)) != NC_NOERR )
+ {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: no %ss specified in file id %d",
+ ex_name_of_object(map_type),exoid);
+ ex_err("ex_put_partial_num_map",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* Check for duplicate map id entry */
+ ex_id_lkup(exoid,map_type,map_id);
+ if (exerrval == EX_LOOKUPFAIL) { /* did not find the map id */
+ map_exists = 0; /* Map is being defined */
+ } else {
+ map_exists = 1; /* A portion of this map has already been written */
+ }
+
+ /* Check for duplicate map id entry */
+ if (!map_exists) {
+ /* Get number of maps initialized for this file */
+ if ((status = nc_inq_dimlen(exoid,dimid,&num_maps)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to get number of %ss in file id %d",
+ ex_name_of_object(map_type),exoid);
+ ex_err("ex_put_partial_num_map",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* Keep track of the total number of maps defined using a
+ counter stored in a linked list keyed by exoid. NOTE:
+ ex_get_file_item is used to find the number of element maps for a
+ specific file and returns that value.
+ */
+ cur_num_maps = ex_get_file_item(exoid, ex_get_counter_list(map_type));
+ if (cur_num_maps >= (int)num_maps) {
+ exerrval = EX_FATAL;
+ sprintf(errmsg,
+ "Error: exceeded number of %ss (%"ST_ZU") specified in file id %d",
+ ex_name_of_object(map_type),num_maps,exoid);
+ ex_err("ex_put_num_map",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* NOTE: ex_inc_file_item is used to find the number of element maps
+ for a specific file and returns that value incremented. */
+ cur_num_maps = ex_inc_file_item(exoid, ex_get_counter_list(map_type));
+ } else {
+ map_ndx = ex_id_lkup(exoid,map_type,map_id);
+ cur_num_maps = map_ndx-1;
+ }
+
+ /* determine number of elements */
+ if ((status = nc_inq_dimid(exoid, dnumentries, &dimid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: couldn't determine number of mesh objects in file id %d",
+ exoid);
+ ex_err("ex_put_partial_num_map",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ if ((status = nc_inq_dimlen(exoid, dimid, &num_mobj)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to get number of mesh objects in file id %d",
+ exoid);
+ ex_err("ex_put_partial_num_map",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* Check input parameters for a valid range of numbers */
+ if (ent_start <= 0 || ent_start > (int)num_mobj) {
+ exerrval = EX_FATAL;
+ sprintf(errmsg,
+ "Error: start count is invalid in file id %d",
+ exoid);
+ ex_err("ex_put_partial_num_map",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ if (ent_count < 0) {
+ exerrval = EX_FATAL;
+ sprintf(errmsg,
+ "Error: Invalid count value in file id %d",
+ exoid);
+ ex_err("ex_put_partial_num_map",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ if (ent_start+ent_count-1 > (int)num_mobj) {
+ exerrval = EX_FATAL;
+ sprintf(errmsg,
+ "Error: start+count-1 is larger than mesh object count in file id %d",
+ exoid);
+ ex_err("ex_put_partial_num_map",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+
+ /* write out information to previously defined variable */
+
+ /* first get id of variable */
+ if ((status = nc_inq_varid (exoid, vmapids, &varid)) == -1)
+ {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to locate %s ids in file id %d",
+ ex_name_of_object(map_type),exoid);
+ ex_err("ex_put_num_map",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* then, write out map id */
+ if (!map_exists) {
+ start[0] = cur_num_maps;
+ {
+ if ((status = nc_put_var1_longlong(exoid, varid, start, (long long*)&map_id)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to store %s id %"PRId64" in file id %d",
+ ex_name_of_object(map_type),map_id,exoid);
+ ex_err("ex_put_num_map",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ }
+ }
+
+ switch ( map_type ) {
+ case EX_NODE_MAP:
+ vmap = VAR_NODE_MAP(cur_num_maps+1);
+ break;
+ case EX_EDGE_MAP:
+ vmap = VAR_EDGE_MAP(cur_num_maps+1);
+ break;
+ case EX_FACE_MAP:
+ vmap = VAR_FACE_MAP(cur_num_maps+1);
+ break;
+ case EX_ELEM_MAP:
+ vmap = VAR_ELEM_MAP(cur_num_maps+1);
+ break;
+ default:
+ exerrval = 1005;
+ sprintf(errmsg,
+ "Internal Error: unrecognized map type in switch: %d in file id %d",
+ map_type,exoid);
+ ex_err("ex_putt_partial_one_attr",errmsg,EX_MSG);
+ return (EX_FATAL);
+ }
+
+ /* locate variable array in which to store the map */
+ if ((status = nc_inq_varid(exoid,vmap, &varid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to locate %s %"PRId64" in file id %d",
+ ex_name_of_object(map_type),map_id,exoid);
+ ex_err("ex_put_partial_num_map",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* write out the map */
+ start[0] = ent_start-1;
+ count[0] = ent_count;
+
+ if (count[0] == 0)
+ start[0] = 0;
+
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_put_vara_longlong(exoid, varid, start, count, map);
+ } else {
+ status = nc_put_vara_int(exoid, varid, start, count, map);
+ }
+
+ if (status != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to store %s in file id %d",
+ ex_name_of_object(map_type),exoid);
+ ex_err("ex_put_partial_num_map",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ return (EX_NOERR);
+}
diff --git a/exodus/cbind/src/expnoatt.c b/exodus/cbind/src/ex_put_partial_one_attr.c
similarity index 83%
rename from exodus/cbind/src/expnoatt.c
rename to exodus/cbind/src/ex_put_partial_one_attr.c
index ee19507..344efe3 100644
--- a/exodus/cbind/src/expnoatt.c
+++ b/exodus/cbind/src/ex_put_partial_one_attr.c
@@ -34,7 +34,7 @@
*/
/*****************************************************************************
*
-* expoea - ex_put_n_one_attr
+* expoea - ex_put_partial_one_attr
*
* entry conditions -
* input parameters:
@@ -63,11 +63,11 @@
* \param attrib array of attributes
*/
-int ex_put_n_one_attr( int exoid,
+int ex_put_partial_one_attr( int exoid,
ex_entity_type obj_type,
- int obj_id,
- int start_num,
- int num_ent,
+ ex_entity_id obj_id,
+ int64_t start_num,
+ int64_t num_ent,
int attrib_index,
const void *attrib )
{
@@ -89,15 +89,15 @@ int ex_put_n_one_attr( int exoid,
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no attributes allowed for NULL %s %d in file id %d",
+ "Warning: no attributes allowed for NULL %s %"PRId64" in file id %d",
ex_name_of_object(obj_type),obj_id,exoid);
- ex_err("ex_put_n_one_attr",errmsg,EX_MSG);
+ ex_err("ex_put_partial_one_attr",errmsg,EX_MSG);
return (EX_WARN); /* no attributes for this element block */
} else {
sprintf(errmsg,
- "Error: no %s id %d in id array in file id %d",
+ "Error: no %s id %"PRId64" in id array in file id %d",
ex_name_of_object(obj_type), obj_id, exoid);
- ex_err("ex_put_n_one_attr",errmsg,exerrval);
+ ex_err("ex_put_partial_one_attr",errmsg,exerrval);
return (EX_FATAL);
}
}
@@ -154,41 +154,41 @@ int ex_put_n_one_attr( int exoid,
sprintf(errmsg,
"Internal Error: unrecognized object type in switch: %d in file id %d",
obj_type,exoid);
- ex_err("ex_putt_n_one_attr",errmsg,EX_MSG);
+ ex_err("ex_putt_partial_one_attr",errmsg,EX_MSG);
return (EX_FATAL);
}
/* inquire id's of previously defined dimensions */
- if (ex_get_dimension(exoid, dnumobjent,"entries", &num_entries_this_obj, &temp, "ex_put_n_one_attr") != NC_NOERR)
+ if (ex_get_dimension(exoid, dnumobjent,"entries", &num_entries_this_obj, &temp, "ex_put_partial_one_attr") != NC_NOERR)
return EX_FATAL;
- if (start_num + num_ent -1 > (int)num_entries_this_obj) {
+ if (start_num + num_ent -1 > num_entries_this_obj) {
exerrval = EX_BADPARAM;
sprintf(errmsg,
- "Error: start index (%d) + count (%d) is larger than total number of entities (%d) in file id %d",
- start_num, num_ent, (int)num_entries_this_obj, exoid);
- ex_err("ex_put_n_one_attr",errmsg,exerrval);
+ "Error: start index (%"PRId64") + count (%"PRId64") is larger than total number of entities (%"ST_ZU") in file id %d",
+ start_num, num_ent, num_entries_this_obj, exoid);
+ ex_err("ex_put_partial_one_attr",errmsg,exerrval);
return (EX_FATAL);
}
- if (ex_get_dimension(exoid, dnumobjatt,"attributes", &num_attr, &temp, "ex_put_n_one_attr") != NC_NOERR)
+ if (ex_get_dimension(exoid, dnumobjatt,"attributes", &num_attr, &temp, "ex_put_partial_one_attr") != NC_NOERR)
return EX_FATAL;
if (attrib_index < 1 || attrib_index > (int)num_attr) {
exerrval = EX_FATAL;
sprintf(errmsg,
- "Error: Invalid attribute index specified: %d. Valid range is 1 to %d for %s %d in file id %d",
- attrib_index, (int)num_attr, ex_name_of_object(obj_type), obj_id, exoid);
- ex_err("ex_put_n_one_attr",errmsg,exerrval);
+ "Error: Invalid attribute index specified: %d. Valid range is 1 to %"ST_ZU" for %s %"PRId64" in file id %d",
+ attrib_index, num_attr, ex_name_of_object(obj_type), obj_id, exoid);
+ ex_err("ex_put_partial_one_attr",errmsg,exerrval);
return (EX_FATAL);
}
if ((status = nc_inq_varid(exoid, vattrbname, &attrid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate attribute variable for %s %d in file id %d",
+ "Error: failed to locate attribute variable for %s %"PRId64" in file id %d",
ex_name_of_object(obj_type),obj_id,exoid);
- ex_err("ex_put_n_one_attr",errmsg,exerrval);
+ ex_err("ex_put_partial_one_attr",errmsg,exerrval);
return (EX_FATAL);
}
@@ -203,6 +203,9 @@ int ex_put_n_one_attr( int exoid,
stride[0] = 1;
stride[1] = num_attr;
+ if (count[0] == 0)
+ start[0] = 0;
+
if (ex_comp_ws(exoid) == 4) {
status = nc_put_vars_float(exoid, attrid, start, count, stride, attrib);
} else {
@@ -212,9 +215,9 @@ int ex_put_n_one_attr( int exoid,
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to put attribute %d for %s %d in file id %d",
+ "Error: failed to put attribute %d for %s %"PRId64" in file id %d",
attrib_index, ex_name_of_object(obj_type), obj_id, exoid);
- ex_err("ex_put_n_one_attr",errmsg,exerrval);
+ ex_err("ex_put_partial_one_attr",errmsg,exerrval);
return (EX_FATAL);
}
return(EX_NOERR);
diff --git a/exodus/cbind/src/expset.c b/exodus/cbind/src/ex_put_partial_set.c
similarity index 80%
copy from exodus/cbind/src/expset.c
copy to exodus/cbind/src/ex_put_partial_set.c
index 1c5ae80..d07ebc9 100644
--- a/exodus/cbind/src/expset.c
+++ b/exodus/cbind/src/ex_put_partial_set.c
@@ -64,14 +64,17 @@
* \param *set_extra_list array of extras in set. Set to NULL to not write.
*/
-int ex_put_set (int exoid,
- ex_entity_type set_type,
- int set_id,
- const int *set_entry_list,
- const int *set_extra_list)
+int ex_put_partial_set (int exoid,
+ ex_entity_type set_type,
+ ex_entity_id set_id,
+ int64_t offset,
+ int64_t num_to_put,
+ const void_int *set_entry_list,
+ const void_int *set_extra_list)
{
int dimid, status;
int entry_list_id, extra_list_id, set_id_ndx;
+ size_t start[1], count[1];
char errmsg[MAX_ERR_LENGTH];
char* entryptr = NULL;
char* extraptr = NULL;
@@ -93,13 +96,13 @@ int ex_put_set (int exoid,
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no data allowed for NULL %s %d in file id %d",
+ "Warning: no data allowed for NULL %s %"PRId64" in file id %d",
ex_name_of_object(set_type),set_id,exoid);
ex_err("ex_put_set",errmsg,EX_MSG);
return (EX_WARN);
} else {
sprintf(errmsg,
- "Error: failed to locate %s id %d in VAR_*S_IDS array in file id %d",
+ "Error: failed to locate %s id %"PRId64" in VAR_*S_IDS array in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_set",errmsg,exerrval);
return (EX_FATAL);
@@ -132,7 +135,7 @@ int ex_put_set (int exoid,
if ((status = nc_inq_varid(exoid, entryptr, &entry_list_id)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate entry list for %s %d in file id %d",
+ "Error: failed to locate entry list for %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_set",errmsg,exerrval);
return (EX_FATAL);
@@ -143,7 +146,7 @@ int ex_put_set (int exoid,
if ((status = nc_inq_varid(exoid, extraptr, &extra_list_id)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate extra list for %s %d in file id %d",
+ "Error: failed to locate extra list for %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_set",errmsg,exerrval);
return (EX_FATAL);
@@ -153,12 +156,21 @@ int ex_put_set (int exoid,
/* write out the entry list and extra list arrays */
if (set_entry_list != NULL) {
- status = nc_put_var_int(exoid, entry_list_id, set_entry_list);
+ start[0] = offset-1;
+ count[0] = num_to_put;
+ if (count[0] == 0)
+ start[0] = 0;
+
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_put_vara_longlong(exoid, entry_list_id, start, count, set_entry_list);
+ } else {
+ status = nc_put_vara_int(exoid, entry_list_id, start, count, set_entry_list);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to store entry list for %s %d in file id %d",
+ "Error: failed to store entry list for %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_set",errmsg,exerrval);
return (EX_FATAL);
@@ -169,12 +181,18 @@ int ex_put_set (int exoid,
/* only do for edge, face and side sets */
if (extraptr && set_extra_list != NULL ) {
- status = nc_put_var_int(exoid, extra_list_id, set_extra_list);
-
+ start[0] = offset-1;
+ count[0] = num_to_put;
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_put_vara_longlong(exoid, extra_list_id, start, count, set_extra_list);
+ } else {
+ status = nc_put_vara_int(exoid, extra_list_id, start, count, set_extra_list);
+ }
+
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to store extra list for %s %d in file id %d",
+ "Error: failed to store extra list for %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_set",errmsg,exerrval);
return (EX_FATAL);
@@ -185,7 +203,7 @@ int ex_put_set (int exoid,
if ((set_type == EX_NODE_SET || set_type == EX_ELEM_SET) &&
set_extra_list != NULL) {
sprintf(errmsg,
- "Warning: extra list was ignored for %s %d in file id %d",
+ "Warning: extra list was ignored for %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id, exoid);
ex_err("ex_put_set",errmsg,EX_MSG);
return(EX_WARN);
diff --git a/exodus/cbind/src/exppsetd.c b/exodus/cbind/src/ex_put_partial_set_dist_fact.c
similarity index 91%
rename from exodus/cbind/src/exppsetd.c
rename to exodus/cbind/src/ex_put_partial_set_dist_fact.c
index 7fd9b40..1b521ad 100644
--- a/exodus/cbind/src/exppsetd.c
+++ b/exodus/cbind/src/ex_put_partial_set_dist_fact.c
@@ -67,9 +67,9 @@
int ex_put_partial_set_dist_fact (int exoid,
ex_entity_type set_type,
- int set_id,
- int offset,
- int num_to_put,
+ ex_entity_id set_id,
+ int64_t offset,
+ int64_t num_to_put,
const void *set_dist_fact)
{
int status;
@@ -96,13 +96,13 @@ int ex_put_partial_set_dist_fact (int exoid,
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no data allowed for NULL %s %d in file id %d",
+ "Warning: no data allowed for NULL %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_set_fact",errmsg,EX_MSG);
return (EX_WARN);
} else {
sprintf(errmsg,
- "Error: failed to locate %s id %d in VAR_*S_IDS array in file id %d",
+ "Error: failed to locate %s id %"PRId64" in VAR_*S_IDS array in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_set_dist_fact",errmsg,exerrval);
return (EX_FATAL);
@@ -136,14 +136,14 @@ int ex_put_partial_set_dist_fact (int exoid,
if (status == NC_ENOTVAR) {
exerrval = EX_BADPARAM;
sprintf(errmsg,
- "Warning: no dist factors defined for %s %d in file id %d",
+ "Warning: no dist factors defined for %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id, exoid);
ex_err("ex_put_set_dist_fact",errmsg,exerrval);
return (EX_WARN);
} else {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate dist factors list for %s %d in file id %d",
+ "Error: failed to locate dist factors list for %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_set_dist_fact",errmsg,exerrval);
return (EX_FATAL);
@@ -152,6 +152,9 @@ int ex_put_partial_set_dist_fact (int exoid,
start[0] = offset-1;
count[0] = num_to_put;
+ if (num_to_put == 0)
+ start[0] = 0;
+
/* write out the distribution factors array */
if (ex_comp_ws(exoid) == 4) {
status = nc_put_vara_float(exoid, dist_id, start, count, set_dist_fact);
@@ -162,7 +165,7 @@ int ex_put_partial_set_dist_fact (int exoid,
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to store dist factors for %s %d in file id %d",
+ "Error: failed to store dist factors for %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_partial_set_dist_fact",errmsg,exerrval);
return (EX_FATAL);
diff --git a/nemesis/ne_pnss.c b/exodus/cbind/src/ex_put_partial_side_set.c
similarity index 59%
rename from nemesis/ne_pnss.c
rename to exodus/cbind/src/ex_put_partial_side_set.c
index 0d728d0..46f4e68 100644
--- a/nemesis/ne_pnss.c
+++ b/exodus/cbind/src/ex_put_partial_side_set.c
@@ -38,13 +38,13 @@
/*****************************************************************************/
/* Function(s) contained in this file:
*
- * ne_put_n_side_set()
+ * ex_put_partial_side_set()
*
*****************************************************************************
*
* Variable Index:
*
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* side_set_id - ID of side set to read.
* start_side_num - The starting index of the sides to be read.
* num_sides - The number of sides to read in.
@@ -60,19 +60,16 @@
#include "exodusII.h"
#include "exodusII_int.h"
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
/*
* writes the side set element list and side set side list for a single side set
*/
-int ne_put_n_side_set (int neid,
- int side_set_id,
- int start_side_num,
- int num_sides,
- int *side_set_elem_list,
- int *side_set_side_list)
+int ex_put_partial_side_set (int exoid,
+ ex_entity_id side_set_id,
+ int64_t start_side_num,
+ int64_t num_sides,
+ const void_int *side_set_elem_list,
+ const void_int *side_set_side_list)
{
int status;
int dimid;
@@ -84,93 +81,93 @@ int ne_put_n_side_set (int neid,
/* first check if any side sets are specified */
- if ((status = nc_inq_dimid (neid, DIM_NUM_SS, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_SS, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: no side sets defined in file id %d",
- neid);
- ex_err("ne_put_n_side_set",errmsg,exerrval);
+ exoid);
+ ex_err("ex_put_partial_side_set",errmsg,exerrval);
return (EX_FATAL);
}
/* Lookup index of side set id in VAR_SS_IDS array */
- if ((side_set_id_ndx = ex_id_lkup(neid, EX_SIDE_SET, side_set_id)) < 0)
+ if ((side_set_id_ndx = ex_id_lkup(exoid, EX_SIDE_SET, side_set_id)) < 0)
{
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no data allowed for NULL side set %d in file id %d",
- side_set_id, neid);
- ex_err("ne_put_n_side_set",errmsg,EX_MSG);
+ "Warning: no data allowed for NULL side set %"PRId64" in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_put_partial_side_set",errmsg,EX_MSG);
return (EX_WARN);
} else {
sprintf(errmsg,
- "Error: failed to locate side set id %d in VAR_SS_IDS array in file id %d",
- side_set_id, neid);
- ex_err("ne_put_n_side_set",errmsg,exerrval);
+ "Error: failed to locate side set id %"PRId64" in VAR_SS_IDS array in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_put_partial_side_set",errmsg,exerrval);
return (EX_FATAL);
}
}
/* inquire id's of previously defined dimensions */
- if ((status = nc_inq_dimid (neid, DIM_NUM_SIDE_SS(side_set_id_ndx), &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_SIDE_SS(side_set_id_ndx), &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of sides in side set %d in file id %d",
- side_set_id, neid);
- ex_err("ne_put_n_side_set",errmsg,exerrval);
+ "Error: failed to locate number of sides in side set %"PRId64" in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_put_partial_side_set",errmsg,exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid, &num_side_in_set)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &num_side_in_set)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of sides in side set %d in file id %d",
- side_set_id, neid);
- ex_err("ne_put_n_side_set",errmsg,exerrval);
+ "Error: failed to get number of sides in side set %"PRId64" in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_put_partial_side_set",errmsg,exerrval);
return (EX_FATAL);
}
/* Check input parameters for a valid range of side numbers */
- if (start_side_num < 0 || start_side_num > num_side_in_set) {
+ if (start_side_num < 0 || (num_sides > 0 && start_side_num > num_side_in_set)) {
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: Invalid input");
- ex_err("ne_put_n_side_set",errmsg,exerrval);
+ ex_err("ex_put_partial_side_set",errmsg,exerrval);
return (EX_FATAL);
}
if (num_sides < 0) {
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: Invalid number of elements in side set!");
- ex_err("ne_put_n_side_set",errmsg,exerrval);
+ ex_err("ex_put_partial_side_set",errmsg,exerrval);
return (EX_FATAL);
}
/* start_side_num now starts at 1, not 0 */
- if ((start_side_num + num_sides - 1) > num_side_in_set) {
+ if ((start_side_num + num_sides) > num_side_in_set+1) {
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: request larger than number of elements in set!");
- ex_err("ne_put_n_side_set",errmsg,exerrval);
+ ex_err("ex_put_partial_side_set",errmsg,exerrval);
return (EX_FATAL);
}
/* inquire id's of previously defined variables */
- if ((status = nc_inq_varid (neid, VAR_ELEM_SS(side_set_id_ndx), &elem_list_id)) != NC_NOERR) {
+ if ((status = nc_inq_varid (exoid, VAR_ELEM_SS(side_set_id_ndx), &elem_list_id)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate element list for side set %d in file id %d",
- side_set_id, neid);
- ex_err("ne_put_n_side_set",errmsg,exerrval);
+ "Error: failed to locate element list for side set %"PRId64" in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_put_partial_side_set",errmsg,exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_varid (neid, VAR_SIDE_SS(side_set_id_ndx), &side_list_id)) != NC_NOERR) {
+ if ((status = nc_inq_varid (exoid, VAR_SIDE_SS(side_set_id_ndx), &side_list_id)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate side list for side set %d in file id %d",
- side_set_id, neid);
- ex_err("ne_put_n_side_set",errmsg,exerrval);
+ "Error: failed to locate side list for side set %"PRId64" in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_put_partial_side_set",errmsg,exerrval);
return (EX_FATAL);
}
@@ -178,27 +175,36 @@ int ne_put_n_side_set (int neid,
/* write out the element list and side list arrays */
start[0] = --start_side_num;
count[0] = num_sides;
+ if (num_sides == 0)
+ start[0] = 0;
- status = nc_put_vara_int(neid, elem_list_id, start, count, side_set_elem_list);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_put_vara_longlong(exoid, elem_list_id, start, count, side_set_elem_list);
+ } else {
+ status = nc_put_vara_int(exoid, elem_list_id, start, count, side_set_elem_list);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to store element list for side set %d in file id %d",
- side_set_id, neid);
- ex_err("ne_put_n_side_set",errmsg,exerrval);
+ "Error: failed to store element list for side set %"PRId64" in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_put_partial_side_set",errmsg,exerrval);
return (EX_FATAL);
}
-
- status = nc_put_vara_int(neid, side_list_id, start, count, side_set_side_list);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_put_vara_longlong(exoid, side_list_id, start, count, side_set_side_list);
+ } else {
+ status = nc_put_vara_int(exoid, side_list_id, start, count, side_set_side_list);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to store side list for side set %d in file id %d",
- side_set_id, neid);
- ex_err("ne_put_n_side_set",errmsg,exerrval);
+ "Error: failed to store side list for side set %"PRId64" in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_put_partial_side_set",errmsg,exerrval);
return (EX_FATAL);
}
return (EX_NOERR);
diff --git a/nemesis/ne_pnssd.c b/exodus/cbind/src/ex_put_partial_side_set_df.c
similarity index 64%
rename from nemesis/ne_pnssd.c
rename to exodus/cbind/src/ex_put_partial_side_set_df.c
index f03cebc..0c35db2 100644
--- a/nemesis/ne_pnssd.c
+++ b/exodus/cbind/src/ex_put_partial_side_set_df.c
@@ -38,13 +38,13 @@
/*****************************************************************************/
/* Function(s) contained in this file:
*
- * ne_put_n_side_set_df()
+ * ex_put_partial_side_set_df()
*
*****************************************************************************
*
* Variable Index:
*
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* side_set_id - ID of side set to written.
* start_num - The starting index of the df's to be written.
* num_df_to_get - The number of sides to write.
@@ -59,17 +59,14 @@
#include "exodusII.h"
#include "exodusII_int.h"
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
/*
* writes the distribution factors for a single side set
*/
-int ne_put_n_side_set_df (int neid,
- int side_set_id,
- int start_num,
- int num_df_to_get,
+int ex_put_partial_side_set_df (int exoid,
+ ex_entity_id side_set_id,
+ int64_t start_num,
+ int64_t num_df_to_get,
void *side_set_dist_fact)
{
int status;
@@ -82,93 +79,93 @@ int ne_put_n_side_set_df (int neid,
/* first check if any side sets are specified */
- if ((status = nc_inq_dimid (neid, DIM_NUM_SS, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_SS, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: no side sets specified in file id %d",
- neid);
- ex_err("ne_put_n_side_set_df",errmsg,exerrval);
+ exoid);
+ ex_err("ex_put_partial_side_set_df",errmsg,exerrval);
return (EX_FATAL);
}
/* Lookup index of side set id in VAR_SS_IDS array */
- if ((side_set_id_ndx = ex_id_lkup(neid, EX_SIDE_SET, side_set_id)) < 0)
+ if ((side_set_id_ndx = ex_id_lkup(exoid, EX_SIDE_SET, side_set_id)) < 0)
{
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no data allowed for NULL side set %d in file id %d",
- side_set_id, neid);
+ "Warning: no data allowed for NULL side set %"PRId64" in file id %d",
+ side_set_id, exoid);
ex_err("ex_put_side_set_fact",errmsg,EX_MSG);
return (EX_WARN);
} else {
sprintf(errmsg,
- "Error: failed to locate side set id %d in VAR_SS_IDS array in file id %d",
- side_set_id, neid);
- ex_err("ne_put_n_side_set_df",errmsg,exerrval);
+ "Error: failed to locate side set id %"PRId64" in VAR_SS_IDS array in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_put_partial_side_set_df",errmsg,exerrval);
return (EX_FATAL);
}
}
/* inquire id's of previously defined dimension and variable */
- if ((status = nc_inq_dimid (neid, DIM_NUM_DF_SS(side_set_id_ndx), &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid (exoid, DIM_NUM_DF_SS(side_set_id_ndx), &dimid)) != NC_NOERR) {
if (status == NC_EBADDIM) {
exerrval = EX_BADPARAM;
sprintf(errmsg,
- "Warning: no dist factors defined for side set %d in file id %d",
- side_set_id, neid);
- ex_err("ne_put_n_side_set_df",errmsg,exerrval);
+ "Warning: no dist factors defined for side set %"PRId64" in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_put_partial_side_set_df",errmsg,exerrval);
return (EX_WARN);
} else {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate number of dist factors in side set %d in file id %d",
- side_set_id, neid);
- ex_err("ne_put_n_side_set_df",errmsg,exerrval);
+ "Error: failed to locate number of dist factors in side set %"PRId64" in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_put_partial_side_set_df",errmsg,exerrval);
return (EX_FATAL);
}
}
- if ((status = nc_inq_dimlen(neid, dimid, &num_df_in_set)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, &num_df_in_set)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to get number of dist factors in side set %d in file id %d",
- side_set_id, neid);
- ex_err("ne_put_n_side_set_df",errmsg,exerrval);
+ "Error: failed to get number of dist factors in side set %"PRId64" in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_put_partial_side_set_df",errmsg,exerrval);
return (EX_FATAL);
}
/* Check input parameters for a valid range of numbers */
- if (start_num < 0 || start_num > num_df_in_set) {
+ if (start_num < 0 || (num_df_to_get > 0 && start_num > num_df_in_set)) {
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: Invalid input");
- ex_err("ne_put_n_side_set_df", errmsg, exerrval);
+ ex_err("ex_put_partial_side_set_df", errmsg, exerrval);
return (EX_FATAL);
}
if (num_df_to_get < 0) {
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: Invalid number of df's to put!");
- ex_err("ne_put_n_side_set_df", errmsg, exerrval);
+ ex_err("ex_put_partial_side_set_df", errmsg, exerrval);
return (EX_FATAL);
}
/* start_num now starts at 1, not 0 */
- if ((start_num + num_df_to_get - 1) > num_df_in_set) {
+ if ((start_num + num_df_to_get) > num_df_in_set+1) {
exerrval = EX_BADPARAM;
sprintf(errmsg, "Error: request larger than number of df's in set!");
- ex_err("ne_put_n_side_set_df", errmsg, exerrval);
+ ex_err("ex_put_partial_side_set_df", errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_varid (neid, VAR_FACT_SS(side_set_id_ndx), &dist_id)) != NC_NOERR) {
+ if ((status = nc_inq_varid (exoid, VAR_FACT_SS(side_set_id_ndx), &dist_id)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate dist factors list for side set %d in file id %d",
- side_set_id, neid);
- ex_err("ne_put_n_side_set_df",errmsg,exerrval);
+ "Error: failed to locate dist factors list for side set %"PRId64" in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_put_partial_side_set_df",errmsg,exerrval);
return (EX_FATAL);
}
@@ -176,19 +173,21 @@ int ne_put_n_side_set_df (int neid,
/* write out the distribution factors array */
start[0] = --start_num;
count[0] = num_df_to_get;
-
- if (ex_comp_ws(neid) == 4) {
- status = nc_put_vara_float(neid, dist_id, start, count, side_set_dist_fact);
+ if (num_df_to_get == 0)
+ start[0] = 0;
+
+ if (ex_comp_ws(exoid) == 4) {
+ status = nc_put_vara_float(exoid, dist_id, start, count, side_set_dist_fact);
} else {
- status = nc_put_vara_double(neid, dist_id, start, count, side_set_dist_fact);
+ status = nc_put_vara_double(exoid, dist_id, start, count, side_set_dist_fact);
}
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to store dist factors for side set %d in file id %d",
- side_set_id, neid);
- ex_err("ne_put_n_side_set_df",errmsg,exerrval);
+ "Error: failed to store dist factors for side set %"PRId64" in file id %d",
+ side_set_id, exoid);
+ ex_err("ex_put_partial_side_set_df",errmsg,exerrval);
return (EX_FATAL);
}
return (EX_NOERR);
diff --git a/exodus/cbind/src/expnvar.c b/exodus/cbind/src/ex_put_partial_var.c
similarity index 82%
rename from exodus/cbind/src/expnvar.c
rename to exodus/cbind/src/ex_put_partial_var.c
index e47ab78..eec641a 100644
--- a/exodus/cbind/src/expnvar.c
+++ b/exodus/cbind/src/ex_put_partial_var.c
@@ -32,29 +32,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
-/*****************************************************************************
-*
-* expvar - ex_put_var
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-* int time_step time step number
-* int var_type type (edge block, face block, edge set, ... )
-* int var_index element variable index
-* int obj_id element block id
-* int start_num starting index of the variables to be written
-* int num_ent number of entities to write variables for.
-*
-* exit conditions -
-*
-*
-* exit conditions -
-*
-* revision history -
-*
-*
-*****************************************************************************/
#include <stdlib.h>
#include "exodusII.h"
@@ -74,14 +51,14 @@
* \param var_vals the values to be written
*/
-int ex_put_n_var (int exoid,
- int time_step,
- ex_entity_type var_type,
- int var_index,
- int obj_id,
- int start_index,
- int num_entities,
- const void *var_vals)
+int ex_put_partial_var (int exoid,
+ int time_step,
+ ex_entity_type var_type,
+ int var_index,
+ ex_entity_id obj_id,
+ int64_t start_index,
+ int64_t num_entities,
+ const void *var_vals)
{
int varid, dimid,time_dim, numobjdim, dims[2], obj_id_ndx;
size_t num_obj;
@@ -102,17 +79,17 @@ int ex_put_n_var (int exoid,
if (exerrval == EX_NULLENTITY) \
{ \
sprintf(errmsg, \
- "Warning: no variables allowed for NULL block %d in file id %d", \
+ "Warning: no variables allowed for NULL block %"PRId64" in file id %d", \
obj_id,exoid); \
- ex_err("ex_put_n_var",errmsg,EX_MSG); \
+ ex_err("ex_put_partial_var",errmsg,EX_MSG); \
return (EX_WARN); \
} \
else \
{ \
sprintf(errmsg, \
- "Error: failed to locate %s id %d in %s array in file id %d", \
+ "Error: failed to locate %s id %"PRId64" in %s array in file id %d", \
ex_name_of_object(var_type), obj_id, VOBJID, exoid); \
- ex_err("ex_put_n_var",errmsg,exerrval); \
+ ex_err("ex_put_partial_var",errmsg,exerrval); \
return (EX_FATAL); \
} \
} \
@@ -124,10 +101,10 @@ int ex_put_n_var (int exoid,
/* check for the existance of an TNAME variable truth table */ \
if (nc_inq_varid(exoid, VOBJTAB, &varid) == NC_NOERR) { \
/* find out number of TNAMEs and TNAME variables */ \
- status = ex_get_dimension(exoid, DNUMOBJ, ex_name_of_object(var_type), &num_obj, &dimid, "ex_put_n_var"); \
+ status = ex_get_dimension(exoid, DNUMOBJ, ex_name_of_object(var_type), &num_obj, &dimid, "ex_put_partial_var"); \
if (status != NC_NOERR) return status; \
\
- status = ex_get_dimension(exoid, DNUMOBJVAR, ex_name_of_object(var_type), &num_obj_var, &dimid, "ex_put_n_var"); \
+ status = ex_get_dimension(exoid, DNUMOBJVAR, ex_name_of_object(var_type), &num_obj_var, &dimid, "ex_put_partial_var"); \
if (status != NC_NOERR) return status; \
\
if (!(obj_var_truth_tab = malloc(num_obj*num_obj_var*sizeof(int)))) \
@@ -136,7 +113,7 @@ int ex_put_n_var (int exoid,
sprintf(errmsg, \
"Error: failed to allocate memory for %s variable truth table in file id %d", \
ex_name_of_object(var_type), exoid); \
- ex_err("ex_put_n_var",errmsg,exerrval); \
+ ex_err("ex_put_partial_var",errmsg,exerrval); \
return (EX_FATAL); \
} \
\
@@ -146,7 +123,7 @@ int ex_put_n_var (int exoid,
exerrval = status; \
sprintf(errmsg, \
"Error: failed to get truth table from file id %d", exoid); \
- ex_err("ex_put_n_var",errmsg,exerrval); \
+ ex_err("ex_put_partial_var",errmsg,exerrval); \
return (EX_FATAL); \
} \
\
@@ -156,9 +133,9 @@ int ex_put_n_var (int exoid,
free(obj_var_truth_tab); \
exerrval = EX_BADPARAM; \
sprintf(errmsg, \
- "Error: Invalid %s variable %d, %s %d in file id %d", \
+ "Error: Invalid %s variable %d, %s %"PRId64" in file id %d", \
ex_name_of_object(var_type), var_index, ex_name_of_object(var_type), obj_id, exoid); \
- ex_err("ex_put_n_var",errmsg,exerrval); \
+ ex_err("ex_put_partial_var",errmsg,exerrval); \
return (EX_FATAL); \
} \
free(obj_var_truth_tab); \
@@ -168,19 +145,19 @@ int ex_put_n_var (int exoid,
exerrval = status; \
sprintf(errmsg, \
"Error: failed to locate time dimension in file id %d", exoid); \
- ex_err("ex_put_n_var",errmsg,exerrval); \
+ ex_err("ex_put_partial_var",errmsg,exerrval); \
goto error_ret; /* exit define mode and return */ \
} \
\
ex_get_dimension(exoid, ex_dim_num_entries_in_object(var_type, obj_id_ndx), \
- ex_name_of_object(var_type), &num_entity, &numobjdim, "ex_put_n_var"); \
+ ex_name_of_object(var_type), &num_entity, &numobjdim, "ex_put_partial_var"); \
\
/* variable doesn't exist so put file into define mode */ \
if ((status = nc_redef (exoid)) != NC_NOERR) { \
exerrval = status; \
sprintf(errmsg, \
"Error: failed to put file id %d into define mode", exoid); \
- ex_err("ex_put_n_var",errmsg,exerrval); \
+ ex_err("ex_put_partial_var",errmsg,exerrval); \
return (EX_FATAL); \
} \
\
@@ -194,9 +171,10 @@ int ex_put_n_var (int exoid,
sprintf(errmsg, \
"Error: failed to define %s variable %d in file id %d", \
ex_name_of_object(var_type), var_index,exoid); \
- ex_err("ex_put_n_var",errmsg,exerrval); \
+ ex_err("ex_put_partial_var",errmsg,exerrval); \
goto error_ret; \
} \
+ ex_compress_variable(exoid, varid, 2); \
\
/* leave define mode */ \
\
@@ -206,7 +184,7 @@ int ex_put_n_var (int exoid,
sprintf(errmsg, \
"Error: failed to complete %s variable %s definition to file id %d", \
ex_name_of_object(var_type), VVAR(var_index,obj_id_ndx), exoid); \
- ex_err("ex_put_n_var",errmsg,exerrval); \
+ ex_err("ex_put_partial_var",errmsg,exerrval); \
return (EX_FATAL); \
} \
} \
@@ -216,7 +194,7 @@ int ex_put_n_var (int exoid,
sprintf(errmsg, \
"Error: failed to locate %s variable %s in file id %d", \
ex_name_of_object(var_type), VVAR(var_index,obj_id_ndx),exoid); \
- ex_err("ex_put_n_var",errmsg,exerrval); \
+ ex_err("ex_put_partial_var",errmsg,exerrval); \
return (EX_FATAL); \
} \
}
@@ -252,7 +230,7 @@ int ex_put_n_var (int exoid,
}
break;
case EX_NODAL:
- return ex_put_n_nodal_var(exoid, time_step, var_index, start_index, num_entities, var_vals);
+ return ex_put_partial_nodal_var(exoid, time_step, var_index, start_index, num_entities, var_vals);
break;
case EX_EDGE_BLOCK:
EX_LOOK_UP_VAR(VAR_ID_ED_BLK,VAR_EDGE_VAR,VAR_EBLK_TAB,DIM_NUM_ED_BLK,DIM_NUM_EDG_VAR);
@@ -282,7 +260,7 @@ int ex_put_n_var (int exoid,
exerrval = EX_MSG;
sprintf( errmsg, "Error: invalid variable type (%d) specified for file id %d",
var_type, exoid );
- ex_err( "ex_put_n_var", errmsg, exerrval );
+ ex_err( "ex_put_partial_var", errmsg, exerrval );
return (EX_FATAL);
}
/* store element variable values */
@@ -299,7 +277,9 @@ int ex_put_n_var (int exoid,
count[0] = 1;
}
count[1] = num_entities;
-
+ if (count[1] == 0)
+ start[1] = 0;
+
if (ex_comp_ws(exoid) == 4) {
status = nc_put_vara_float(exoid, varid, start, count, var_vals);
} else {
@@ -309,9 +289,9 @@ int ex_put_n_var (int exoid,
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to store %s %d variable %d in file id %d",
+ "Error: failed to store %s %"PRId64" variable %d in file id %d",
ex_name_of_object(var_type), obj_id, var_index,exoid);
- ex_err("ex_put_n_var",errmsg,exerrval);
+ ex_err("ex_put_partial_var",errmsg,exerrval);
return (EX_FATAL);
}
@@ -324,7 +304,7 @@ int ex_put_n_var (int exoid,
sprintf(errmsg,
"Error: failed to complete definition for file id %d",
exoid);
- ex_err("ex_put_n_var",errmsg,exerrval);
+ ex_err("ex_put_partial_var",errmsg,exerrval);
}
return (EX_FATAL);
}
diff --git a/nemesis/ne_pelm.c b/exodus/cbind/src/ex_put_processor_elem_maps.c
similarity index 74%
rename from nemesis/ne_pelm.c
rename to exodus/cbind/src/ex_put_processor_elem_maps.c
index baa5ea5..11cf63c 100644
--- a/nemesis/ne_pelm.c
+++ b/exodus/cbind/src/ex_put_processor_elem_maps.c
@@ -36,12 +36,12 @@
/*****************************************************************************/
/*****************************************************************************/
/* Function(s) contained in this file:
- * ne_put_elem_map()
+ * ex_put_elem_map()
*****************************************************************************
* This function outputs the elemental map.
*****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* elem_mapi - Vector of internal element IDs.
* elem_mapb - Vector of border element IDs.
* processor - The processor ID for which info is to be read.
@@ -57,16 +57,13 @@
#include <exodusII.h>
#include <exodusII_int.h>
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-int ne_put_elem_map(int neid,
- int *elem_mapi,
- int *elem_mapb,
- int processor
- )
+int ex_put_processor_elem_maps(int exoid,
+ void_int *elem_mapi,
+ void_int *elem_mapb,
+ int processor
+ )
{
- char *func_name="ne_put_elem_map";
+ const char *func_name="ex_put_processor_elem_maps";
char ftype[2];
int status, dimid, varid;
@@ -78,22 +75,22 @@ int ne_put_elem_map(int neid,
/*-----------------------------Execution begins-----------------------------*/
/* Get the file type */
- if (ne_get_file_type(neid, ftype) != EX_NOERR) {
+ if (ex_get_file_type(exoid, ftype) != EX_NOERR) {
exerrval = EX_MSG;
sprintf(errmsg,
"Error: unable to find file type for file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the status of the internal element map */
- if ((status = nc_inq_varid(neid, VAR_INT_E_STAT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_INT_E_STAT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_INT_E_STAT, neid);
+ VAR_INT_E_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -104,11 +101,11 @@ int ne_put_elem_map(int neid,
else
start[0] = 0;
- if ((status = nc_get_var1_int(neid, varid, start, &nmstat)) != NC_NOERR) {
+ if ((status = nc_get_var1_int(exoid, varid, start, &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get variable \"%s\" from file ID %d",
- VAR_INT_E_STAT, neid);
+ VAR_INT_E_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -116,11 +113,11 @@ int ne_put_elem_map(int neid,
if (nmstat == 1) {
/* get the index */
- if (ne_get_idx(neid, VAR_ELEM_MAP_INT_IDX, varidx, processor) == -1) {
+ if (ex_get_idx(exoid, VAR_ELEM_MAP_INT_IDX, varidx, processor) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_ELEM_MAP_INT_IDX, neid);
+ VAR_ELEM_MAP_INT_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -128,20 +125,20 @@ int ne_put_elem_map(int neid,
if (varidx[1] == -1) {
/* Get the size of the internal element map */
- if ((status = nc_inq_dimid(neid, DIM_NUM_INT_ELEMS, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_INT_ELEMS, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NUM_INT_ELEMS, neid);
+ DIM_NUM_INT_ELEMS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid, count)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, count)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_INT_ELEMS, neid);
+ DIM_NUM_INT_ELEMS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -149,11 +146,11 @@ int ne_put_elem_map(int neid,
varidx[1] = count[0];
}
- if ((status = nc_inq_varid(neid, VAR_ELEM_MAP_INT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_ELEM_MAP_INT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_ELEM_MAP_INT, neid);
+ VAR_ELEM_MAP_INT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -161,12 +158,16 @@ int ne_put_elem_map(int neid,
/* Output the map */
start[0] = varidx[0];
count[0] = varidx[1] - varidx[0];
- status = nc_put_vara_int(neid, varid, start, count, elem_mapi);
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_put_vara_longlong(exoid, varid, start, count, elem_mapi);
+ } else {
+ status = nc_put_vara_int(exoid, varid, start, count, elem_mapi);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output variable \"%s\" in file ID %d",
- VAR_ELEM_MAP_INT, neid);
+ VAR_ELEM_MAP_INT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -174,11 +175,11 @@ int ne_put_elem_map(int neid,
} /* End "if (nmstat == 1)" */
/* Get the status of the border element map */
- if ((status = nc_inq_varid(neid, VAR_BOR_E_STAT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_BOR_E_STAT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_BOR_E_STAT, neid);
+ VAR_BOR_E_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -189,11 +190,11 @@ int ne_put_elem_map(int neid,
else
start[0] = 0;
- if ((status = nc_get_var1_int(neid, varid, start, &nmstat)) != NC_NOERR) {
+ if ((status = nc_get_var1_int(exoid, varid, start, &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get status for \"%s\" from file %d",
- VAR_BOR_E_STAT, neid);
+ VAR_BOR_E_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -201,11 +202,11 @@ int ne_put_elem_map(int neid,
if (nmstat == 1) {
/* get the index */
- if (ne_get_idx(neid, VAR_ELEM_MAP_BOR_IDX, varidx, processor) == -1) {
+ if (ex_get_idx(exoid, VAR_ELEM_MAP_BOR_IDX, varidx, processor) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_ELEM_MAP_BOR_IDX, neid);
+ VAR_ELEM_MAP_BOR_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -213,20 +214,20 @@ int ne_put_elem_map(int neid,
if (varidx[1] == -1) {
/* Get the size of the border element map */
- if ((status = nc_inq_dimid(neid, DIM_NUM_BOR_ELEMS, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_BOR_ELEMS, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NUM_BOR_ELEMS, neid);
+ DIM_NUM_BOR_ELEMS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid, count)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, count)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_BOR_ELEMS, neid);
+ DIM_NUM_BOR_ELEMS, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -234,11 +235,11 @@ int ne_put_elem_map(int neid,
varidx[1] = count[0];
}
- if ((status = nc_inq_varid(neid, VAR_ELEM_MAP_BOR, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_ELEM_MAP_BOR, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_ELEM_MAP_BOR, neid);
+ VAR_ELEM_MAP_BOR, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -246,12 +247,16 @@ int ne_put_elem_map(int neid,
/* Output the map */
start[0] = varidx[0];
count[0] = varidx[1] - varidx[0];
- status = nc_put_vara_int(neid, varid, start, count, elem_mapb);
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_put_vara_longlong(exoid, varid, start, count, elem_mapb);
+ } else {
+ status = nc_put_vara_int(exoid, varid, start, count, elem_mapb);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output variable \"%s\" in file ID %d",
- VAR_ELEM_MAP_BOR, neid);
+ VAR_ELEM_MAP_BOR, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
diff --git a/nemesis/ne_pnm.c b/exodus/cbind/src/ex_put_processor_node_maps.c
similarity index 72%
rename from nemesis/ne_pnm.c
rename to exodus/cbind/src/ex_put_processor_node_maps.c
index dd62b5e..e9316a4 100644
--- a/nemesis/ne_pnm.c
+++ b/exodus/cbind/src/ex_put_processor_node_maps.c
@@ -37,7 +37,7 @@
* This function outputs the nodal map.
*****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* node_mapi - Pointer to vector containing the internal FEM
* nodal IDs.
* node_mapb - Pointer to vector containing the border FEM
@@ -57,17 +57,14 @@
#include <exodusII.h>
#include <exodusII_int.h>
-#include "ne_nemesisI.h"
-#include "ne_nemesisI_int.h"
-
-int ne_put_node_map(int neid,
- int *node_mapi,
- int *node_mapb,
- int *node_mape,
- int proc_id
- )
+int ex_put_processor_node_maps(int exoid,
+ void_int *node_mapi,
+ void_int *node_mapb,
+ void_int *node_mape,
+ int proc_id
+ )
{
- char *func_name="ne_put_node_map";
+ const char *func_name="ex_put_processor_node_maps";
int status, varid, dimid;
char ftype[2];
@@ -81,22 +78,22 @@ int ne_put_node_map(int neid,
exerrval = 0; /* clear error code */
/* Get the file type */
- if (ne_get_file_type(neid, ftype) != EX_NOERR) {
+ if (ex_get_file_type(exoid, ftype) != EX_NOERR) {
exerrval = EX_MSG;
sprintf(errmsg,
"Error: unable to find file type for file ID %d",
- neid);
+ exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the status of this node map */
- if ((status = nc_inq_varid(neid, VAR_INT_N_STAT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_INT_N_STAT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" from file ID %d",
- VAR_INT_N_STAT, neid);
+ VAR_INT_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -106,11 +103,11 @@ int ne_put_node_map(int neid,
else
start[0] = proc_id;
- if ((status = nc_get_var1_int(neid, varid, start, &nmstat)) != NC_NOERR) {
+ if ((status = nc_get_var1_int(exoid, varid, start, &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get status for \"%s\" from file %d",
- VAR_INT_N_STAT, neid);
+ VAR_INT_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -118,11 +115,11 @@ int ne_put_node_map(int neid,
/* Write out the internal node-number map */
if (nmstat == 1) {
/* get the index */
- if (ne_get_idx(neid, VAR_NODE_MAP_INT_IDX, varidx, proc_id) == -1) {
+ if (ex_get_idx(exoid, VAR_NODE_MAP_INT_IDX, varidx, proc_id) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_NODE_MAP_INT_IDX, neid);
+ VAR_NODE_MAP_INT_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -130,20 +127,20 @@ int ne_put_node_map(int neid,
/* check if I need to get the dimension */
if (varidx[1] == -1) {
- if ((status = nc_inq_dimid(neid, DIM_NUM_INT_NODES, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_INT_NODES, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NUM_INT_NODES, neid);
+ DIM_NUM_INT_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid, count)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, count)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_INT_NODES, neid);
+ DIM_NUM_INT_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -151,11 +148,11 @@ int ne_put_node_map(int neid,
varidx[1] = count[0];
}
- if ((status = nc_inq_varid(neid, VAR_NODE_MAP_INT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_NODE_MAP_INT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_NODE_MAP_INT, neid);
+ VAR_NODE_MAP_INT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -163,23 +160,27 @@ int ne_put_node_map(int neid,
start[0] = varidx[0];
count[0] = varidx[1] - varidx[0];
- status = nc_put_vara_int(neid, varid, start, count, node_mapi);
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_put_vara_longlong(exoid, varid, start, count, node_mapi);
+ } else {
+ status = nc_put_vara_int(exoid, varid, start, count, node_mapi);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output variable \"%s\" in file ID %d",
- VAR_NODE_MAP_INT, neid);
+ VAR_NODE_MAP_INT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
} /* End "if (nmstat == 1)" */
/* Get the status of this node map */
- if ((status = nc_inq_varid(neid, VAR_BOR_N_STAT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_BOR_N_STAT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" from file ID %d",
- VAR_BOR_N_STAT, neid);
+ VAR_BOR_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -189,11 +190,11 @@ int ne_put_node_map(int neid,
else
start[0] = proc_id;
- if ((status = nc_get_var1_int(neid, varid, start, &nmstat)) != NC_NOERR) {
+ if ((status = nc_get_var1_int(exoid, varid, start, &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get status for \"%s\" from file %d",
- VAR_BOR_N_STAT, neid);
+ VAR_BOR_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -201,11 +202,11 @@ int ne_put_node_map(int neid,
if (nmstat == 1) {
/* Write out the border node-number map */
/* get the index */
- if (ne_get_idx(neid, VAR_NODE_MAP_BOR_IDX, varidx, proc_id) == -1) {
+ if (ex_get_idx(exoid, VAR_NODE_MAP_BOR_IDX, varidx, proc_id) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_NODE_MAP_BOR_IDX, neid);
+ VAR_NODE_MAP_BOR_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -213,20 +214,20 @@ int ne_put_node_map(int neid,
/* check if I need to get the dimension */
if (varidx[1] == -1) {
- if ((status = nc_inq_dimid(neid, DIM_NUM_BOR_NODES, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_BOR_NODES, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NUM_BOR_NODES, neid);
+ DIM_NUM_BOR_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid, count)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, count)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_BOR_NODES, neid);
+ DIM_NUM_BOR_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -234,11 +235,11 @@ int ne_put_node_map(int neid,
varidx[1] = count[0];
}
- if ((status = nc_inq_varid(neid, VAR_NODE_MAP_BOR, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_NODE_MAP_BOR, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_NODE_MAP_BOR, neid);
+ VAR_NODE_MAP_BOR, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -247,23 +248,27 @@ int ne_put_node_map(int neid,
/* Output the map */
start[0] = varidx[0];
count[0] = varidx[1] - varidx[0];
- status = nc_put_vara_int(neid, varid, start, count, node_mapb);
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_put_vara_longlong(exoid, varid, start, count, node_mapb);
+ } else {
+ status = nc_put_vara_int(exoid, varid, start, count, node_mapb);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output variable \"%s\" in file ID %d",
- VAR_NODE_MAP_BOR, neid);
+ VAR_NODE_MAP_BOR, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
} /* End "if (nmstat == 1)" */
/* Get the status of this node map */
- if ((status = nc_inq_varid(neid, VAR_EXT_N_STAT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_EXT_N_STAT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" from file ID %d",
- VAR_EXT_N_STAT, neid);
+ VAR_EXT_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
@@ -273,22 +278,22 @@ int ne_put_node_map(int neid,
else
start[0] = proc_id;
- if ((status = nc_get_var1_int(neid, varid, start, &nmstat)) != NC_NOERR) {
+ if ((status = nc_get_var1_int(exoid, varid, start, &nmstat)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get status for \"%s\" from file %d",
- VAR_EXT_N_STAT, neid);
+ VAR_EXT_N_STAT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
if (nmstat == 1) {
/* Write out the external node-number map */
- if (ne_get_idx(neid, VAR_NODE_MAP_EXT_IDX, varidx, proc_id) == -1) {
+ if (ex_get_idx(exoid, VAR_NODE_MAP_EXT_IDX, varidx, proc_id) == -1) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find index variable, \"%s\", in file ID %d",
- VAR_NODE_MAP_EXT_IDX, neid);
+ VAR_NODE_MAP_EXT_IDX, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -296,31 +301,31 @@ int ne_put_node_map(int neid,
/* check if I need to get the dimension */
if (varidx[1] == -1) {
- if ((status = nc_inq_dimid(neid, DIM_NUM_EXT_NODES, &dimid)) != NC_NOERR) {
+ if ((status = nc_inq_dimid(exoid, DIM_NUM_EXT_NODES, &dimid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find dimension ID for \"%s\" in file ID %d",
- DIM_NUM_EXT_NODES, neid);
+ DIM_NUM_EXT_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
- if ((status = nc_inq_dimlen(neid, dimid, count)) != NC_NOERR) {
+ if ((status = nc_inq_dimlen(exoid, dimid, count)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find length of dimension \"%s\" in file ID %d",
- DIM_NUM_EXT_NODES, neid);
+ DIM_NUM_EXT_NODES, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
varidx[1] = count[0];
}
- if ((status = nc_inq_varid(neid, VAR_NODE_MAP_EXT, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_NODE_MAP_EXT, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_NODE_MAP_EXT, neid);
+ VAR_NODE_MAP_EXT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
@@ -329,12 +334,16 @@ int ne_put_node_map(int neid,
/* Output the map */
start[0] = varidx[0];
count[0] = varidx[1] - varidx[0];
- status = nc_put_vara_int(neid, varid, start, count, node_mape);
+ if (ex_int64_status(exoid) & EX_MAPS_INT64_API) {
+ status = nc_put_vara_longlong(exoid, varid, start, count, node_mape);
+ } else {
+ status = nc_put_vara_int(exoid, varid, start, count, node_mape);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output variable \"%s\" in file ID %d",
- VAR_NODE_MAP_EXT, neid);
+ VAR_NODE_MAP_EXT, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
diff --git a/exodus/cbind/src/expp.c b/exodus/cbind/src/ex_put_prop.c
similarity index 94%
rename from exodus/cbind/src/expp.c
rename to exodus/cbind/src/ex_put_prop.c
index 9ea0a4e..b8b99ae 100644
--- a/exodus/cbind/src/expp.c
+++ b/exodus/cbind/src/ex_put_prop.c
@@ -102,21 +102,22 @@ description for ex_put_prop_names().
int ex_put_prop (int exoid,
ex_entity_type obj_type,
- int obj_id,
+ ex_entity_id obj_id,
const char *prop_name,
- int value)
+ ex_entity_id value)
{
int status;
- int oldfill, temp;
+ int oldfill = 0;
+ int temp;
int found = FALSE;
int num_props, i, dimid, propid, dims[1];
+ int int_type;
size_t start[1];
size_t prop_name_len, name_length;
- int ldum;
char name[MAX_VAR_NAME_LENGTH+1];
char tmpstr[MAX_STR_LENGTH+1];
char dim_name[MAX_VAR_NAME_LENGTH+1];
- int vals[1];
+ long long vals[1];
char errmsg[MAX_ERR_LENGTH];
@@ -286,7 +287,12 @@ int ex_put_prop (int exoid,
dims[0] = dimid;
nc_set_fill(exoid, NC_FILL, &oldfill); /* fill with zeros per routine spec */
- if ((status = nc_def_var(exoid, name, NC_INT, 1, dims, &propid)) != NC_NOERR) {
+ int_type = NC_INT;
+ if (ex_int64_status(exoid) & EX_IDS_INT64_DB) {
+ int_type = NC_INT64;
+ }
+
+ if ((status = nc_def_var(exoid, name, int_type, 1, dims, &propid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to create property array variable in file id %d",
@@ -297,7 +303,7 @@ int ex_put_prop (int exoid,
vals[0] = 0; /* fill value */
/* create attribute to cause variable to fill with zeros per routine spec */
- if ((status = nc_put_att_int(exoid, propid, _FillValue, NC_INT, 1, vals)) != NC_NOERR) {
+ if ((status = nc_put_att_longlong(exoid, propid, _FillValue, int_type, 1, vals)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to create property name fill attribute in file id %d",
@@ -352,7 +358,7 @@ int ex_put_prop (int exoid,
{
exerrval = EX_BADPARAM;
sprintf(errmsg,
- "Warning: attempt to assign duplicate %s ID %d in file id %d",
+ "Warning: attempt to assign duplicate %s ID %"PRId64" in file id %d",
ex_name_of_object(obj_type), value, exoid);
ex_err("ex_put_prop",errmsg,exerrval);
return (EX_WARN);
@@ -363,13 +369,13 @@ int ex_put_prop (int exoid,
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no properties allowed for NULL %s id %d in file id %d",
+ "Warning: no properties allowed for NULL %s id %"PRId64" in file id %d",
ex_name_of_object(obj_type), obj_id,exoid);
ex_err("ex_put_prop",errmsg,EX_MSG);
return (EX_WARN);
} else {
sprintf(errmsg,
- "Error: failed to find value %d in %s property array in file id %d",
+ "Error: failed to find value %"PRId64" in %s property array in file id %d",
obj_id, ex_name_of_object(obj_type), exoid);
ex_err("ex_put_prop",errmsg,exerrval);
return (EX_FATAL);
@@ -378,8 +384,10 @@ int ex_put_prop (int exoid,
start[0] = start[0] - 1;
- ldum = (int)value;
- if ((status = nc_put_var1_int(exoid, propid, start, &ldum)) != NC_NOERR) {
+ /* value is of type 'ex_entity_id' which is a typedef to int64_t or long long */
+ status = nc_put_var1_longlong(exoid, propid, start, (long long*)&value);
+
+ if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to store property value in file id %d",
diff --git a/exodus/cbind/src/exppa.c b/exodus/cbind/src/ex_put_prop_array.c
similarity index 95%
rename from exodus/cbind/src/exppa.c
rename to exodus/cbind/src/ex_put_prop_array.c
index 77a6fac..e785cb4 100644
--- a/exodus/cbind/src/exppa.c
+++ b/exodus/cbind/src/ex_put_prop_array.c
@@ -98,11 +98,13 @@ to the description for ex_put_prop_names().
int ex_put_prop_array (int exoid,
ex_entity_type obj_type,
const char *prop_name,
- const int *values)
+ const void_int *values)
{
- int oldfill, temp;
+ int oldfill = 0;
+ int temp;
int num_props, i, propid, dimid, dims[1], status;
int found = FALSE;
+ int int_type;
size_t num_obj;
char name[MAX_VAR_NAME_LENGTH+1];
char tmpstr[MAX_STR_LENGTH+1];
@@ -252,7 +254,12 @@ int ex_put_prop_array (int exoid,
dims[0] = dimid;
nc_set_fill(exoid, NC_FILL, &oldfill); /* fill with zeros per routine spec */
- if ((status = nc_def_var(exoid, name, NC_INT, 1, dims, &propid)) != NC_NOERR) {
+ int_type = NC_INT;
+ if (ex_int64_status(exoid) & EX_IDS_INT64_DB) {
+ int_type = NC_INT64;
+ }
+
+ if ((status = nc_def_var(exoid, name, int_type, 1, dims, &propid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to create property array variable in file id %d",
@@ -287,7 +294,11 @@ int ex_put_prop_array (int exoid,
}
/* put num_obj values in property array */
- status = nc_put_var_int(exoid, propid, values);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ status = nc_put_var_longlong(exoid, propid, values);
+ } else {
+ status = nc_put_var_int(exoid, propid, values);
+ }
if (status != NC_NOERR) {
exerrval = status;
diff --git a/exodus/cbind/src/exppn.c b/exodus/cbind/src/ex_put_prop_names.c
similarity index 97%
rename from exodus/cbind/src/exppn.c
rename to exodus/cbind/src/ex_put_prop_names.c
index 4a2ca97..85b508f 100644
--- a/exodus/cbind/src/exppn.c
+++ b/exodus/cbind/src/ex_put_prop_names.c
@@ -130,13 +130,18 @@ int ex_put_prop_names (int exoid,
int i, propid, dimid, dims[1];
size_t name_length, prop_name_len;
char name[MAX_VAR_NAME_LENGTH+1];
- int vals[1];
+ long long vals[1];
int max_name_len = 0;
+ int int_type = NC_INT;
char errmsg[MAX_ERR_LENGTH];
exerrval = 0; /* clear error code */
+ if (ex_int64_status(exoid) & EX_IDS_INT64_DB) {
+ int_type = NC_INT64;
+ }
+
/* Get the name string length */
name_length = ex_inquire_int(exoid, EX_INQ_DB_MAX_ALLOWED_NAME_LENGTH)+1;
@@ -210,7 +215,7 @@ int ex_put_prop_names (int exoid,
goto error_ret; /* Exit define mode and return */
}
- if ((status = nc_def_var(exoid, name, NC_INT, 1, dims, &propid)) != NC_NOERR) {
+ if ((status = nc_def_var(exoid, name, int_type, 1, dims, &propid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to create property array variable in file id %d",
@@ -222,7 +227,7 @@ int ex_put_prop_names (int exoid,
vals[0] = 0; /* fill value */
/* create attribute to cause variable to fill with zeros per routine spec */
- if ((status = nc_put_att_int(exoid, propid, _FillValue, NC_INT, 1, vals)) != NC_NOERR) {
+ if ((status = nc_put_att_longlong(exoid, propid, _FillValue, int_type, 1, vals)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to create property name fill attribute in file id %d",
diff --git a/exodus/cbind/src/expqa.c b/exodus/cbind/src/ex_put_qa.c
similarity index 56%
rename from exodus/cbind/src/expqa.c
rename to exodus/cbind/src/ex_put_qa.c
index acdce83..4f279fa 100644
--- a/exodus/cbind/src/expqa.c
+++ b/exodus/cbind/src/ex_put_qa.c
@@ -58,7 +58,10 @@ strings. The character strings are:
\param[in] exoid exodus file ID returned from a previous call to ex_create() or ex_open().
\param[in] num_qa_records The number of QA records.
-\param[in] qa_record Array containing the QA records.
+\param[in] qa_record Array containing the QA records. To only
+ define the number of qa records instead of
+ defining and outputting, pass NULL for
+ qa_record argument.
The following code segment will write out two QA records:
@@ -99,92 +102,108 @@ int ex_put_qa (int exoid,
/* only do this if there are records */
if (num_qa_records > 0) {
- /* inquire previously defined dimensions */
-
- if ((status = nc_inq_dimid(exoid, DIM_STR, &strdim)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate string length in file id %d", exoid);
- ex_err("ex_put_qa",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- if ((status = nc_inq_dimid(exoid, DIM_N4, &n4dim)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate record length in file id %d", exoid);
- ex_err("ex_put_qa",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* put file into define mode */
- if ((status = nc_redef(exoid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to put file id %d into define mode", exoid);
- ex_err("ex_put_qa",errmsg,exerrval);
- return (EX_FATAL);
- }
-
-
- /* define dimensions */
- if ((status = nc_def_dim(exoid,DIM_NUM_QA,num_qa_records, &num_qa_dim)) != NC_NOERR) {
- if (status == NC_ENAMEINUSE) { /* duplicate entry? */
+ /* See if the number of qa records has already been defined.
+ Assume that if the DIM_NUM_QA dimension exists, then the
+ VAR_QA_TITLE variable also exists...
+ */
+ status = nc_inq_dimid(exoid, DIM_NUM_QA, &num_qa_dim);
+ if (status != NC_NOERR) {
+
+ /* inquire previously defined dimensions */
+ if ((status = nc_inq_dimid(exoid, DIM_STR, &strdim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: qa records already exist in file id %d", exoid);
+ "Error: failed to locate string length in file id %d", exoid);
ex_err("ex_put_qa",errmsg,exerrval);
- } else {
+ return (EX_FATAL);
+ }
+
+ if ((status = nc_inq_dimid(exoid, DIM_N4, &n4dim)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to define qa record array size in file id %d", exoid);
+ "Error: failed to locate record length in file id %d", exoid);
ex_err("ex_put_qa",errmsg,exerrval);
+ return (EX_FATAL);
}
- goto error_ret; /* exit define mode and return */
- }
+ /* put file into define mode */
+ if ((status = nc_redef(exoid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to put file id %d into define mode", exoid);
+ ex_err("ex_put_qa",errmsg,exerrval);
+ return (EX_FATAL);
+ }
- /* define variable */
- dims[0] = num_qa_dim;
- dims[1] = n4dim;
- dims[2] = strdim;
-
- if ((status = nc_def_var(exoid, VAR_QA_TITLE, NC_CHAR, 3, dims, &varid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to define qa record array in file id %d", exoid);
- ex_err("ex_put_qa",errmsg,exerrval);
- goto error_ret; /* exit define mode and return */
- }
- /* leave define mode */
- if ((status = nc_enddef (exoid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to complete definition in file id %d", exoid);
- ex_err("ex_put_qa",errmsg,exerrval);
- return (EX_FATAL);
- }
+ /* define dimensions */
+ if ((status = nc_def_dim(exoid,DIM_NUM_QA,num_qa_records, &num_qa_dim)) != NC_NOERR) {
+ if (status == NC_ENAMEINUSE) { /* duplicate entry? */
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: qa records already exist in file id %d", exoid);
+ ex_err("ex_put_qa",errmsg,exerrval);
+ } else {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to define qa record array size in file id %d", exoid);
+ ex_err("ex_put_qa",errmsg,exerrval);
+ }
+ goto error_ret; /* exit define mode and return */
+ }
- /* write out QA records */
+ /* define variable */
+ dims[0] = num_qa_dim;
+ dims[1] = n4dim;
+ dims[2] = strdim;
- for (i=0; i<num_qa_records; i++) {
- for (j=0; j<4; j++) {
- start[0] = i;
- start[1] = j;
- start[2] = 0;
+ if ((status = nc_def_var(exoid, VAR_QA_TITLE, NC_CHAR, 3, dims, &varid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to define qa record array in file id %d", exoid);
+ ex_err("ex_put_qa",errmsg,exerrval);
+ goto error_ret; /* exit define mode and return */
+ }
- count[0] = 1;
- count[1] = 1;
- count[2] = strlen(qa_record[i][j]) + 1;
+ /* leave define mode */
+ if ((status = nc_enddef (exoid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to complete definition in file id %d", exoid);
+ ex_err("ex_put_qa",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ } else {
+ if ((status = nc_inq_varid(exoid, VAR_QA_TITLE, &varid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to find qa records variable in file id %d", exoid);
+ ex_err("ex_put_qa",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ }
- if ((status = nc_put_vara_text(exoid, varid, start, count, qa_record[i][j])) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to store qa record in file id %d", exoid);
- ex_err("ex_put_qa",errmsg,exerrval);
- return (EX_FATAL);
+ if (qa_record != NULL) {
+ /* write out QA records */
+
+ for (i=0; i<num_qa_records; i++) {
+ for (j=0; j<4; j++) {
+ start[0] = i;
+ start[1] = j;
+ start[2] = 0;
+
+ count[0] = 1;
+ count[1] = 1;
+ count[2] = strlen(qa_record[i][j]) + 1;
+
+ if ((status = nc_put_vara_text(exoid, varid, start, count, qa_record[i][j])) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to store qa record in file id %d", exoid);
+ ex_err("ex_put_qa",errmsg,exerrval);
+ return (EX_FATAL);
+ }
}
}
}
diff --git a/exodus/cbind/src/expset.c b/exodus/cbind/src/ex_put_set.c
similarity index 85%
rename from exodus/cbind/src/expset.c
rename to exodus/cbind/src/ex_put_set.c
index 1c5ae80..f944e3c 100644
--- a/exodus/cbind/src/expset.c
+++ b/exodus/cbind/src/ex_put_set.c
@@ -66,9 +66,9 @@
int ex_put_set (int exoid,
ex_entity_type set_type,
- int set_id,
- const int *set_entry_list,
- const int *set_extra_list)
+ ex_entity_id set_id,
+ const void_int *set_entry_list,
+ const void_int *set_extra_list)
{
int dimid, status;
int entry_list_id, extra_list_id, set_id_ndx;
@@ -93,13 +93,13 @@ int ex_put_set (int exoid,
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no data allowed for NULL %s %d in file id %d",
+ "Warning: no data allowed for NULL %s %"PRId64" in file id %d",
ex_name_of_object(set_type),set_id,exoid);
ex_err("ex_put_set",errmsg,EX_MSG);
return (EX_WARN);
} else {
sprintf(errmsg,
- "Error: failed to locate %s id %d in VAR_*S_IDS array in file id %d",
+ "Error: failed to locate %s id %"PRId64" in VAR_*S_IDS array in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_set",errmsg,exerrval);
return (EX_FATAL);
@@ -132,7 +132,7 @@ int ex_put_set (int exoid,
if ((status = nc_inq_varid(exoid, entryptr, &entry_list_id)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate entry list for %s %d in file id %d",
+ "Error: failed to locate entry list for %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_set",errmsg,exerrval);
return (EX_FATAL);
@@ -143,7 +143,7 @@ int ex_put_set (int exoid,
if ((status = nc_inq_varid(exoid, extraptr, &extra_list_id)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate extra list for %s %d in file id %d",
+ "Error: failed to locate extra list for %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_set",errmsg,exerrval);
return (EX_FATAL);
@@ -153,12 +153,16 @@ int ex_put_set (int exoid,
/* write out the entry list and extra list arrays */
if (set_entry_list != NULL) {
- status = nc_put_var_int(exoid, entry_list_id, set_entry_list);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_put_var_longlong(exoid, entry_list_id, set_entry_list);
+ } else {
+ status = nc_put_var_int(exoid, entry_list_id, set_entry_list);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to store entry list for %s %d in file id %d",
+ "Error: failed to store entry list for %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_set",errmsg,exerrval);
return (EX_FATAL);
@@ -169,12 +173,16 @@ int ex_put_set (int exoid,
/* only do for edge, face and side sets */
if (extraptr && set_extra_list != NULL ) {
- status = nc_put_var_int(exoid, extra_list_id, set_extra_list);
-
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_put_var_longlong(exoid, extra_list_id, set_extra_list);
+ } else {
+ status = nc_put_var_int(exoid, extra_list_id, set_extra_list);
+ }
+
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to store extra list for %s %d in file id %d",
+ "Error: failed to store extra list for %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_set",errmsg,exerrval);
return (EX_FATAL);
@@ -185,7 +193,7 @@ int ex_put_set (int exoid,
if ((set_type == EX_NODE_SET || set_type == EX_ELEM_SET) &&
set_extra_list != NULL) {
sprintf(errmsg,
- "Warning: extra list was ignored for %s %d in file id %d",
+ "Warning: extra list was ignored for %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id, exoid);
ex_err("ex_put_set",errmsg,EX_MSG);
return(EX_WARN);
diff --git a/exodus/cbind/src/expsetd.c b/exodus/cbind/src/ex_put_set_dist_fact.c
similarity index 92%
rename from exodus/cbind/src/expsetd.c
rename to exodus/cbind/src/ex_put_set_dist_fact.c
index 6c4c3e3..61a1a0b 100644
--- a/exodus/cbind/src/expsetd.c
+++ b/exodus/cbind/src/ex_put_set_dist_fact.c
@@ -63,7 +63,7 @@
int ex_put_set_dist_fact (int exoid,
ex_entity_type set_type,
- int set_id,
+ ex_entity_id set_id,
const void *set_dist_fact)
{
int status;
@@ -89,13 +89,13 @@ int ex_put_set_dist_fact (int exoid,
if (exerrval != 0) {
if (exerrval == EX_NULLENTITY) {
sprintf(errmsg,
- "Warning: no data allowed for NULL %s %d in file id %d",
+ "Warning: no data allowed for NULL %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_set_fact",errmsg,EX_MSG);
return (EX_WARN);
} else {
sprintf(errmsg,
- "Error: failed to locate %s id %d in VAR_*S_IDS array in file id %d",
+ "Error: failed to locate %s id %"PRId64" in VAR_*S_IDS array in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_set_dist_fact",errmsg,exerrval);
return (EX_FATAL);
@@ -129,14 +129,14 @@ int ex_put_set_dist_fact (int exoid,
if (status == NC_ENOTVAR) {
exerrval = EX_BADPARAM;
sprintf(errmsg,
- "Warning: no dist factors defined for %s %d in file id %d",
+ "Warning: no dist factors defined for %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id, exoid);
ex_err("ex_put_set_dist_fact",errmsg,exerrval);
return (EX_WARN);
} else {
exerrval = status;
sprintf(errmsg,
- "Error: failed to locate dist factors list for %s %d in file id %d",
+ "Error: failed to locate dist factors list for %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_set_dist_fact",errmsg,exerrval);
return (EX_FATAL);
@@ -153,7 +153,7 @@ int ex_put_set_dist_fact (int exoid,
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
- "Error: failed to store dist factors for %s %d in file id %d",
+ "Error: failed to store dist factors for %s %"PRId64" in file id %d",
ex_name_of_object(set_type), set_id,exoid);
ex_err("ex_put_set_dist_fact",errmsg,exerrval);
return (EX_FATAL);
diff --git a/exodus/cbind/src/expsp.c b/exodus/cbind/src/ex_put_set_param.c
similarity index 69%
copy from exodus/cbind/src/expsp.c
copy to exodus/cbind/src/ex_put_set_param.c
index 3e36d87..8f4ccbf 100644
--- a/exodus/cbind/src/expsp.c
+++ b/exodus/cbind/src/ex_put_set_param.c
@@ -34,15 +34,16 @@
*/
/*****************************************************************************
*
-* expsp - ex_put_side_set_param
+* expsetp - ex_put_set_param
*
* entry conditions -
* input parameters:
* int exoid exodus file id
-* int side_set_id side set id
-* int num_side_in_set number of sides in the side set
+* int set_type the type of set
+* int set_id set id
+* int num_entries_in_set number of entries in the set
* int num_dist_fact_in_set number of distribution factors in the
-* side set
+* set
*
* exit conditions -
*
@@ -55,20 +56,28 @@
#include "exodusII_int.h"
/*!
- * writes the side set id and the number of sides (edges or faces)
- * which describe a single side set
+ * writes the set id and the number of entries which describe a single set
* \param exoid exodus file id
- * \param side_set_id side set id
- * \param num_side_in_set number of sides in the side set
- * \param num_dist_fact_in_set number of distribution factors in the side set
- * \deprecated Use ex_put_set_param()(exoid, EX_SIDE_SET, side_set_id, num_side_in_set, num_dist_fact_in_set)
+ * \param set_type the type of set
+ * \param set_id set id
+ * \param num_entries_in_set number of entries in the set
+ * \param num_dist_fact_in_set number of distribution factors in the set
*/
-int ex_put_side_set_param (int exoid,
- int side_set_id,
- int num_side_in_set,
- int num_dist_fact_in_set)
+int ex_put_set_param (int exoid,
+ ex_entity_type set_type,
+ ex_entity_id set_id,
+ int64_t num_entries_in_set,
+ int64_t num_dist_fact_in_set)
{
- return ex_put_set_param(exoid, EX_SIDE_SET, side_set_id,
- num_side_in_set, num_dist_fact_in_set);
+ struct ex_set set[1];
+ set[0].type = set_type;
+ set[0].id = set_id;
+ set[0].num_entry = num_entries_in_set;
+ set[0].num_distribution_factor = num_dist_fact_in_set;
+ set[0].entry_list = NULL;
+ set[0].extra_list = NULL;
+ set[0].distribution_factor_list = NULL;
+
+ return ex_put_sets(exoid, 1, set);
}
diff --git a/exodus/cbind/src/ex_put_sets.c b/exodus/cbind/src/ex_put_sets.c
new file mode 100644
index 0000000..6cb926e
--- /dev/null
+++ b/exodus/cbind/src/ex_put_sets.c
@@ -0,0 +1,385 @@
+/*
+ * Copyright (c) 2012 Sandia Corporation. Under the terms of Contract
+ * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
+ * retains certain rights in this software.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * * Neither the name of Sandia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include "exodusII.h"
+#include "exodusII_int.h"
+#include <stdlib.h> /* for free() */
+
+/*!
+ * writes the set parameters and optionally set data for 1 or more sets
+ * \param exoid exodus file id
+ * \param set_count number of sets to write
+ * \param *sets array of ex_set structures
+ */
+
+int ex_put_sets (int exoid,
+ size_t set_count,
+ const struct ex_set *sets)
+{
+ size_t i;
+ int needs_define = 0;
+ int set_stat;
+ int dimid, varid, status, dims[1];
+ int set_id_ndx;
+ size_t start[1];
+ int cur_num_sets;
+ char errmsg[MAX_ERR_LENGTH];
+ int* sets_to_define = NULL;
+ char* numentryptr = NULL;
+ char* entryptr = NULL;
+ char* extraptr = NULL;
+ char* idsptr = NULL;
+ char* statptr = NULL;
+ char* numdfptr = NULL;
+ char* factptr = NULL;
+
+ size_t int_size;
+
+ exerrval = 0; /* clear error code */
+
+ sets_to_define = malloc(set_count*sizeof(int));
+
+ /* Note that this routine can be called:
+ 1) just define the sets
+ 2) just output the set data (after a previous call to define)
+ 3) define and output the set data in one call.
+ */
+ for (i=0; i < set_count; i++) {
+ /* first check if any sets are specified */
+ if ((status = nc_inq_dimid(exoid, ex_dim_num_objects(sets[i].type), &dimid)) != NC_NOERR) {
+ if (status == NC_EBADDIM) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: no %ss defined for file id %d", ex_name_of_object(sets[i].type), exoid);
+ ex_err("ex_put_sets",errmsg,exerrval);
+ } else {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to locate %ss defined in file id %d",
+ ex_name_of_object(sets[i].type), exoid);
+ ex_err("ex_put_sets",errmsg,exerrval);
+ }
+ return (EX_FATAL);
+ }
+
+ set_id_ndx = ex_id_lkup(exoid, sets[i].type, sets[i].id);
+ if (exerrval != EX_LOOKUPFAIL) { /* found the side set id, so set is already defined... */
+ sets_to_define[i] = 0;
+ continue;
+ } else {
+ needs_define++;
+ sets_to_define[i] = 1;
+ }
+ }
+
+ if (needs_define > 0) {
+ /* put netcdf file into define mode */
+ if ((status = nc_redef (exoid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to put file id %d into define mode",
+ exoid);
+ ex_err("ex_put_sets",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ for (i=0; i < set_count; i++) {
+ if (sets_to_define[i] == 0)
+ continue;
+
+ /* NOTE: ex_inc_file_item finds the current number of sets defined
+ for a specific file and returns that value incremented. */
+ cur_num_sets=ex_inc_file_item(exoid, ex_get_counter_list(sets[i].type));
+ set_id_ndx = cur_num_sets + 1;
+ sets_to_define[i] = set_id_ndx;
+
+ if (sets[i].num_entry == 0)
+ continue;
+
+ /* setup pointers based on set_type */
+ if (sets[i].type == EX_NODE_SET) {
+ numentryptr = DIM_NUM_NOD_NS(set_id_ndx);
+ entryptr = VAR_NODE_NS(set_id_ndx);
+ extraptr = NULL;
+ /* note we are using DIM_NUM_NODE_NS instead of DIM_NUM_DF_NS */
+ numdfptr = DIM_NUM_NOD_NS(set_id_ndx);
+ factptr = VAR_FACT_NS(set_id_ndx);
+ }
+ else if (sets[i].type == EX_EDGE_SET) {
+ numentryptr = DIM_NUM_EDGE_ES(set_id_ndx);
+ entryptr = VAR_EDGE_ES(set_id_ndx);
+ extraptr = VAR_ORNT_ES(set_id_ndx);
+ numdfptr = DIM_NUM_DF_ES(set_id_ndx);
+ factptr = VAR_FACT_ES(set_id_ndx);
+ }
+ else if (sets[i].type == EX_FACE_SET) {
+ numentryptr = DIM_NUM_FACE_FS(set_id_ndx);
+ entryptr = VAR_FACE_FS(set_id_ndx);
+ extraptr = VAR_ORNT_FS(set_id_ndx);
+ numdfptr = DIM_NUM_DF_FS(set_id_ndx);
+ factptr = VAR_FACT_FS(set_id_ndx);
+ }
+ else if (sets[i].type == EX_SIDE_SET) {
+ numentryptr = DIM_NUM_SIDE_SS(set_id_ndx);
+ entryptr = VAR_ELEM_SS(set_id_ndx);
+ extraptr = VAR_SIDE_SS(set_id_ndx);
+ numdfptr = DIM_NUM_DF_SS(set_id_ndx);
+ factptr = VAR_FACT_SS(set_id_ndx);
+ }
+ else if (sets[i].type == EX_ELEM_SET) {
+ numentryptr = DIM_NUM_ELE_ELS(set_id_ndx);
+ entryptr = VAR_ELEM_ELS(set_id_ndx);
+ extraptr = NULL;
+ numdfptr = DIM_NUM_DF_ELS(set_id_ndx);
+ factptr = VAR_FACT_ELS(set_id_ndx);
+ }
+
+ /* define dimensions and variables */
+ if ((status = nc_def_dim(exoid, numentryptr,
+ sets[i].num_entry, &dimid)) != NC_NOERR) {
+ exerrval = status;
+ if (status == NC_ENAMEINUSE) {
+ sprintf(errmsg,
+ "Error: %s %"PRId64" -- size already defined in file id %d",
+ ex_name_of_object(sets[i].type), sets[i].id,exoid);
+ ex_err("ex_put_sets",errmsg,exerrval);
+ }
+ else {
+ sprintf(errmsg,
+ "Error: failed to define number of entries in %s %"PRId64" in file id %d",
+ ex_name_of_object(sets[i].type), sets[i].id,exoid);
+ ex_err("ex_put_sets",errmsg,exerrval);
+ }
+ goto error_ret;
+ }
+
+ int_size = sizeof(int);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_DB) {
+ int_size = sizeof(int64_t);
+ }
+
+ /* create variable array in which to store the entry lists */
+ dims[0] = dimid;
+ if ((status = nc_def_var(exoid, entryptr, int_size, 1, dims, &varid)) != NC_NOERR) {
+ exerrval = status;
+ if (status == NC_ENAMEINUSE) {
+ sprintf(errmsg,
+ "Error: entry list already exists for %s %"PRId64" in file id %d",
+ ex_name_of_object(sets[i].type), sets[i].id,exoid);
+ ex_err("ex_put_sets",errmsg,exerrval);
+ } else {
+ sprintf(errmsg,
+ "Error: failed to create entry list for %s %"PRId64" in file id %d",
+ ex_name_of_object(sets[i].type), sets[i].id,exoid);
+ ex_err("ex_put_sets",errmsg,exerrval);
+ }
+ goto error_ret; /* exit define mode and return */
+ }
+ ex_compress_variable(exoid, varid, 1);
+
+ if (extraptr) {
+ if ((status = nc_def_var(exoid, extraptr, int_size, 1, dims, &varid)) != NC_NOERR) {
+ exerrval = status;
+ if (status == NC_ENAMEINUSE) {
+ sprintf(errmsg,
+ "Error: extra list already exists for %s %"PRId64" in file id %d",
+ ex_name_of_object(sets[i].type), sets[i].id, exoid);
+ ex_err("ex_put_sets",errmsg,exerrval);
+ } else {
+ sprintf(errmsg,
+ "Error: failed to create extra list for %s %"PRId64" in file id %d",
+ ex_name_of_object(sets[i].type), sets[i].id,exoid);
+ ex_err("ex_put_sets",errmsg,exerrval);
+ }
+ goto error_ret; /* exit define mode and return */
+ }
+ ex_compress_variable(exoid, varid, 1);
+ }
+
+ /* Create distribution factors variable if required */
+ if (sets[i].num_distribution_factor > 0) {
+ if (sets[i].type != EX_SIDE_SET) {
+ /* but sets[i].num_distribution_factor must equal number of nodes */
+ if (sets[i].num_distribution_factor != sets[i].num_entry) {
+ exerrval = EX_FATAL;
+ sprintf(errmsg,
+ "Error: # dist fact (%"PRId64") not equal to # nodes (%"PRId64") in node set %"PRId64" file id %d",
+ sets[i].num_distribution_factor, sets[i].num_entry, sets[i].id, exoid);
+ ex_err("ex_put_sets",errmsg,exerrval);
+ goto error_ret; /* exit define mode and return */
+ }
+ } else {
+ /* resuse dimid from entry lists */
+ if ((status = nc_def_dim(exoid, numdfptr,
+ sets[i].num_distribution_factor, &dimid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to define number of dist factors in %s %"PRId64" in file id %d",
+ ex_name_of_object(sets[i].type), sets[i].id,exoid);
+ ex_err("ex_put_sets",errmsg,exerrval);
+ goto error_ret; /* exit define mode and return */
+ }
+ }
+
+ /* create variable array in which to store the set distribution factors
+ */
+ dims[0] = dimid;
+ if ((status = nc_def_var(exoid, factptr, nc_flt_code(exoid), 1, dims, &varid)) != NC_NOERR) {
+ exerrval = status;
+ if (status == NC_ENAMEINUSE) {
+ sprintf(errmsg,
+ "Error: dist factors list already exists for %s %"PRId64" in file id %d",
+ ex_name_of_object(sets[i].type), sets[i].id,exoid);
+ ex_err("ex_put_sets",errmsg,exerrval);
+ } else {
+ sprintf(errmsg,
+ "Error: failed to create dist factors list for %s %"PRId64" in file id %d",
+ ex_name_of_object(sets[i].type), sets[i].id,exoid);
+ ex_err("ex_put_sets",errmsg,exerrval);
+ }
+ goto error_ret; /* exit define mode and return */
+ }
+ ex_compress_variable(exoid, varid, 2);
+ }
+ }
+
+ /* leave define mode */
+ if ((status = nc_enddef (exoid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to complete definition in file id %d", exoid);
+ ex_err("ex_put_sets",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* Output the set ids and status... */
+ for (i=0; i < set_count; i++) {
+ /* setup pointers based on sets[i].type */
+ if (sets[i].type == EX_NODE_SET) {
+ idsptr = VAR_NS_IDS;
+ statptr = VAR_NS_STAT;
+ }
+ else if (sets[i].type == EX_EDGE_SET) {
+ idsptr = VAR_ES_IDS;
+ statptr = VAR_ES_STAT;
+ }
+ else if (sets[i].type == EX_FACE_SET) {
+ idsptr = VAR_FS_IDS;
+ statptr = VAR_FS_STAT;
+ }
+ else if (sets[i].type == EX_SIDE_SET) {
+ idsptr = VAR_SS_IDS;
+ statptr = VAR_SS_STAT;
+ }
+ else if (sets[i].type == EX_ELEM_SET) {
+ idsptr = VAR_ELS_IDS;
+ statptr = VAR_ELS_STAT;
+ }
+
+ /* first: get id of set id variable */
+ if ((status = nc_inq_varid(exoid, idsptr, &varid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to locate %s %"PRId64" in file id %d", ex_name_of_object(sets[i].type),
+ sets[i].id, exoid);
+ ex_err("ex_put_sets",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* write out set id */
+ start[0] = sets_to_define[i]-1;
+ status = nc_put_var1_longlong(exoid, varid, start, (long long*)&sets[i].id);
+
+ if (status != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to store %s id %"PRId64" in file id %d", ex_name_of_object(sets[i].type),
+ sets[i].id, exoid);
+ ex_err("ex_put_sets",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ set_stat = (sets[i].num_entry == 0) ? 0 : 1;
+
+ if ((status = nc_inq_varid(exoid, statptr, &varid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to locate %s status in file id %d", ex_name_of_object(sets[i].type),
+ exoid);
+ ex_err("ex_put_sets",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ if ((status = nc_put_var1_int(exoid, varid, start, &set_stat)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to store %s %"PRId64" status to file id %d", ex_name_of_object(sets[i].type),
+ sets[i].id, exoid);
+ ex_err("ex_put_sets",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ }
+ free(sets_to_define);
+ }
+
+ /* Sets are now all defined; see if any set data needs to be output... */
+ status = EX_NOERR;
+ for (i=0; i < set_count; i++) {
+ int stat;
+ if (sets[i].entry_list != NULL || sets[i].extra_list != NULL) {
+ /* NOTE: ex_put_set will write the warning/error message... */
+ stat = ex_put_set(exoid, sets[i].type, sets[i].id, sets[i].entry_list, sets[i].extra_list);
+ if (stat != EX_NOERR) status = EX_FATAL;
+ }
+ if (sets[i].distribution_factor_list != NULL) {
+ /* NOTE: ex_put_set_dist_fact will write the warning/error message... */
+ stat = ex_put_set_dist_fact(exoid, sets[i].type, sets[i].id, sets[i].distribution_factor_list);
+ if (stat != EX_NOERR) status = EX_FATAL;
+ }
+ }
+ return (status);
+
+ /* Fatal error: exit definition mode and return */
+ error_ret:
+ free(sets_to_define);
+
+ if (nc_enddef (exoid) != NC_NOERR) { /* exit define mode */
+ sprintf(errmsg,
+ "Error: failed to complete definition for file id %d",
+ exoid);
+ ex_err("ex_put_sets",errmsg,exerrval);
+ }
+ return (EX_FATAL);
+}
diff --git a/exodus/cbind/src/expss.c b/exodus/cbind/src/ex_put_side_set.c
similarity index 94%
rename from exodus/cbind/src/expss.c
rename to exodus/cbind/src/ex_put_side_set.c
index 5c717c2..6b58f9f 100644
--- a/exodus/cbind/src/expss.c
+++ b/exodus/cbind/src/ex_put_side_set.c
@@ -63,9 +63,9 @@
*/
int ex_put_side_set (int exoid,
- int side_set_id,
- const int *side_set_elem_list,
- const int *side_set_side_list)
+ ex_entity_id side_set_id,
+ const void_int *side_set_elem_list,
+ const void_int *side_set_side_list)
{
return ex_put_set(exoid, EX_SIDE_SET, side_set_id,
side_set_elem_list, side_set_side_list);
diff --git a/exodus/cbind/src/expssd.c b/exodus/cbind/src/ex_put_side_set_dist_fact.c
similarity index 97%
rename from exodus/cbind/src/expssd.c
rename to exodus/cbind/src/ex_put_side_set_dist_fact.c
index 63b20f9..e9b55c3 100644
--- a/exodus/cbind/src/expssd.c
+++ b/exodus/cbind/src/ex_put_side_set_dist_fact.c
@@ -61,7 +61,7 @@
*/
int ex_put_side_set_dist_fact (int exoid,
- int side_set_id,
+ ex_entity_id side_set_id,
const void *side_set_dist_fact)
{
return ex_put_set_dist_fact(exoid, EX_SIDE_SET, side_set_id,
diff --git a/exodus/cbind/src/expsp.c b/exodus/cbind/src/ex_put_side_set_param.c
similarity index 94%
rename from exodus/cbind/src/expsp.c
rename to exodus/cbind/src/ex_put_side_set_param.c
index 3e36d87..aa92d58 100644
--- a/exodus/cbind/src/expsp.c
+++ b/exodus/cbind/src/ex_put_side_set_param.c
@@ -65,9 +65,9 @@
*/
int ex_put_side_set_param (int exoid,
- int side_set_id,
- int num_side_in_set,
- int num_dist_fact_in_set)
+ ex_entity_id side_set_id,
+ int64_t num_side_in_set,
+ int64_t num_dist_fact_in_set)
{
return ex_put_set_param(exoid, EX_SIDE_SET, side_set_id,
num_side_in_set, num_dist_fact_in_set);
diff --git a/nemesis/ne_psspg.c b/exodus/cbind/src/ex_put_ss_param_global.c
similarity index 77%
rename from nemesis/ne_psspg.c
rename to exodus/cbind/src/ex_put_ss_param_global.c
index af72584..ee0ea32 100644
--- a/nemesis/ne_psspg.c
+++ b/exodus/cbind/src/ex_put_ss_param_global.c
@@ -37,12 +37,12 @@
/*****************************************************************************/
/*****************************************************************************/
/* Function(s) contained in this file:
- * ne_put_ss_param_global()
+ * ex_put_ss_param_global()
*****************************************************************************
* This function outputs the global side-set parameters.
*****************************************************************************
* Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
+ * exoid - The NetCDF ID of an already open NemesisI file.
* global_ids - Pointer to a vector of global side-set IDs.
* side_cnts - Pointer to a vector of global side counts in
* each global side set.
@@ -59,16 +59,13 @@
#include <exodusII.h>
#include <exodusII_int.h>
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-int ne_put_ss_param_global(int neid,
- int *global_ids,
- int *side_cnts,
- int *df_cnts
+int ex_put_ss_param_global(int exoid,
+ void_int *global_ids,
+ void_int *side_cnts,
+ void_int *df_cnts
)
{
- char *func_name="ne_put_ss_param_global";
+ const char *func_name="ex_put_ss_param_global";
int varid;
int status;
@@ -78,69 +75,81 @@ int ne_put_ss_param_global(int neid,
exerrval = 0; /* clear error code */
/* Get the variable ID for the vector of global side set IDs */
- if ((status = nc_inq_varid(neid, VAR_SS_IDS_GLOBAL, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_SS_IDS_GLOBAL, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_SS_IDS_GLOBAL, neid);
+ VAR_SS_IDS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Output the vector of global side set IDs */
- status = nc_put_var_int(neid, varid, global_ids);
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ status = nc_put_var_longlong(exoid, varid, global_ids);
+ } else {
+ status = nc_put_var_int(exoid, varid, global_ids);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output variable \"%s\" to file ID %d",
- VAR_SS_IDS_GLOBAL, neid);
+ VAR_SS_IDS_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the variable ID for the vector of global side-set side counts */
- if ((status = nc_inq_varid(neid, VAR_SS_SIDE_CNT_GLOBAL, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_SS_SIDE_CNT_GLOBAL, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_SS_SIDE_CNT_GLOBAL, neid);
+ VAR_SS_SIDE_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Output the vector of global side counts in each global side set */
- status = nc_put_var_int(neid, varid, side_cnts);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_put_var_longlong(exoid, varid, side_cnts);
+ } else {
+ status = nc_put_var_int(exoid, varid, side_cnts);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to put variable \"%s\" in file ID %d",
- VAR_SS_SIDE_CNT_GLOBAL, neid);
+ VAR_SS_SIDE_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Get the variable ID for the number of dist. factors in each side set */
- if ((status = nc_inq_varid(neid, VAR_SS_DF_CNT_GLOBAL, &varid)) != NC_NOERR) {
+ if ((status = nc_inq_varid(exoid, VAR_SS_DF_CNT_GLOBAL, &varid)) != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to find variable ID for \"%s\" in file ID %d",
- VAR_SS_DF_CNT_GLOBAL, neid);
+ VAR_SS_DF_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
}
/* Output the vector of dist. factor counts */
- status = nc_put_var_int(neid, varid, df_cnts);
+ if (ex_int64_status(exoid) & EX_BULK_INT64_API) {
+ status = nc_put_var_longlong(exoid, varid, df_cnts);
+ } else {
+ status = nc_put_var_int(exoid, varid, df_cnts);
+ }
if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to output variable \"%s\" in file ID %d",
- VAR_SS_DF_CNT_GLOBAL, neid);
+ VAR_SS_DF_CNT_GLOBAL, exoid);
ex_err(func_name, errmsg, exerrval);
return (EX_FATAL);
diff --git a/exodus/cbind/src/expssv.c b/exodus/cbind/src/ex_put_sset_var.c
similarity index 97%
rename from exodus/cbind/src/expssv.c
rename to exodus/cbind/src/ex_put_sset_var.c
index 817132f..60b076d 100644
--- a/exodus/cbind/src/expssv.c
+++ b/exodus/cbind/src/ex_put_sset_var.c
@@ -74,8 +74,8 @@
int ex_put_sset_var (int exoid,
int time_step,
int sset_var_index,
- int sset_id,
- int num_faces_this_sset,
+ ex_entity_id sset_id,
+ int64_t num_faces_this_sset,
const void *sset_var_vals)
{
return ex_put_var(exoid, time_step, EX_SIDE_SET, sset_var_index, sset_id, num_faces_this_sset, sset_var_vals);
diff --git a/exodus/cbind/src/expsstt.c b/exodus/cbind/src/ex_put_sset_var_tab.c
similarity index 100%
rename from exodus/cbind/src/expsstt.c
rename to exodus/cbind/src/ex_put_sset_var_tab.c
diff --git a/exodus/cbind/src/exptim.c b/exodus/cbind/src/ex_put_time.c
similarity index 100%
rename from exodus/cbind/src/exptim.c
rename to exodus/cbind/src/ex_put_time.c
diff --git a/exodus/cbind/src/expvartab.c b/exodus/cbind/src/ex_put_truth_table.c
similarity index 90%
rename from exodus/cbind/src/expvartab.c
rename to exodus/cbind/src/ex_put_truth_table.c
index 578bec2..a440d34 100644
--- a/exodus/cbind/src/expvartab.c
+++ b/exodus/cbind/src/ex_put_truth_table.c
@@ -82,7 +82,7 @@ int ex_put_truth_table (int exoid,
size_t num_entity = 0;
size_t num_var_db = 0;
int *stat_vals;
- int i, j, k, id, *ids;
+ int i, j, k;
int status;
char errmsg[MAX_ERR_LENGTH];
const char* routine = "ex_put_truth_table";
@@ -103,7 +103,7 @@ int ex_put_truth_table (int exoid,
if (obj_type == EX_ELEM_BLOCK) {
ex_get_dimension(exoid, DIM_NUM_ELE_VAR, "element variables",
&num_var_db, &numelvardim, routine);
- status = nc_inq_varid (exoid, VAR_ELEM_TAB, &varid);
+ nc_inq_varid (exoid, VAR_ELEM_TAB, &varid);
var_name = "vals_elem_var";
ent_type = "eb";
ent_size = "num_el_in_blk";
@@ -113,7 +113,7 @@ int ex_put_truth_table (int exoid,
else if (obj_type == EX_EDGE_BLOCK) {
ex_get_dimension(exoid, DIM_NUM_EDG_VAR, "edge block variables",
&num_var_db, &numelvardim, routine);
- status = nc_inq_varid (exoid, VAR_EBLK_TAB, &varid);
+ nc_inq_varid (exoid, VAR_EBLK_TAB, &varid);
var_name = "vals_edge_var";
ent_type = "eb";
ent_size = "num_ed_in_blk";
@@ -123,7 +123,7 @@ int ex_put_truth_table (int exoid,
else if (obj_type == EX_FACE_BLOCK) {
ex_get_dimension(exoid, DIM_NUM_FAC_VAR, "face block variables",
&num_var_db, &numelvardim, routine);
- status = nc_inq_varid (exoid, VAR_FBLK_TAB, &varid);
+ nc_inq_varid (exoid, VAR_FBLK_TAB, &varid);
var_name = "vals_face_var";
ent_type = "fb";
ent_size = "num_fa_in_blk";
@@ -133,7 +133,7 @@ int ex_put_truth_table (int exoid,
else if (obj_type == EX_SIDE_SET) {
ex_get_dimension(exoid, DIM_NUM_SSET_VAR, "sideset variables",
&num_var_db, &numelvardim, routine);
- status = nc_inq_varid (exoid, VAR_SSET_TAB, &varid);
+ nc_inq_varid (exoid, VAR_SSET_TAB, &varid);
var_name = "vals_sset_var";
ent_type = "ss";
ent_size = "num_side_ss";
@@ -143,7 +143,7 @@ int ex_put_truth_table (int exoid,
else if (obj_type == EX_NODE_SET) {
ex_get_dimension(exoid, DIM_NUM_NSET_VAR, "nodeset variables",
&num_var_db, &numelvardim, routine);
- status = nc_inq_varid (exoid, VAR_NSET_TAB, &varid);
+ nc_inq_varid (exoid, VAR_NSET_TAB, &varid);
var_name = "vals_nset_var";
ent_type = "ns";
ent_size = "num_nod_ns";
@@ -153,7 +153,7 @@ int ex_put_truth_table (int exoid,
else if (obj_type == EX_EDGE_SET) {
ex_get_dimension(exoid, DIM_NUM_ESET_VAR, "edge set variables",
&num_var_db, &numelvardim, routine);
- status = nc_inq_varid (exoid, VAR_ESET_TAB, &varid);
+ nc_inq_varid (exoid, VAR_ESET_TAB, &varid);
var_name = "vals_eset_var";
ent_type = "es";
ent_size = "num_edge_es";
@@ -163,7 +163,7 @@ int ex_put_truth_table (int exoid,
else if (obj_type == EX_FACE_SET) {
ex_get_dimension(exoid, DIM_NUM_FSET_VAR, "face set variables",
&num_var_db, &numelvardim, routine);
- status = nc_inq_varid (exoid, VAR_FSET_TAB, &varid);
+ nc_inq_varid (exoid, VAR_FSET_TAB, &varid);
var_name = "vals_fset_var";
ent_type = "fs";
ent_size = "num_face_fs";
@@ -173,7 +173,7 @@ int ex_put_truth_table (int exoid,
else if (obj_type == EX_ELEM_SET) {
ex_get_dimension(exoid, DIM_NUM_ELSET_VAR, "element set variables",
&num_var_db, &numelvardim, routine);
- status = nc_inq_varid (exoid, VAR_ELSET_TAB, &varid);
+ nc_inq_varid (exoid, VAR_ELSET_TAB, &varid);
var_name = "vals_elset_var";
ent_type = "es";
ent_size = "num_ele_els";
@@ -208,20 +208,9 @@ int ex_put_truth_table (int exoid,
return (EX_FATAL);
}
- /* get block IDs */
- if (!(ids = malloc(num_blk*sizeof(int)))) {
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate memory for %s id array for file id %d",
- ex_name_of_object(obj_type), exoid);
- ex_err(routine,errmsg,exerrval);
- return (EX_FATAL);
- }
-
/* Get status array for later use */
if (!(stat_vals = malloc(num_blk*sizeof(int)))) {
exerrval = EX_MEMFAIL;
- free(ids);
sprintf(errmsg,
"Error: failed to allocate memory for %s status array for file id %d",
ex_name_of_object(obj_type), exoid);
@@ -229,7 +218,6 @@ int ex_put_truth_table (int exoid,
return (EX_FATAL);
}
- ex_get_ids (exoid, obj_type, ids);
status = nc_inq_varid (exoid, sta_type, &varid);
/* get variable id of status array */
@@ -255,7 +243,6 @@ int ex_put_truth_table (int exoid,
/* put netcdf file into define mode */
if ((status = nc_redef (exoid)) != NC_NOERR) {
free(stat_vals);
- free (ids);
exerrval = status;
sprintf(errmsg,
"Error: failed to put file id %d into define mode",
@@ -268,7 +255,6 @@ int ex_put_truth_table (int exoid,
if ((status = nc_inq_dimid (exoid, DIM_TIME, &timedim)) != NC_NOERR) {
exerrval = status;
free(stat_vals);
- free (ids);
sprintf(errmsg,
"Error: failed to locate time variable in file id %d",
exoid);
@@ -298,12 +284,10 @@ int ex_put_truth_table (int exoid,
/* Determine number of entities in block */
if ((status = nc_inq_dimid(exoid, ex_catstr(ent_size, (i+1)), &dims[1])) != NC_NOERR) {
exerrval = status;
- id=ids[i];
free(stat_vals);
- free (ids);
sprintf(errmsg,
- "Error: failed to locate number of entities in %s %d in file id %d",
- ex_name_of_object(obj_type), id,exoid);
+ "Error: failed to locate number of entities in %d'th %s in file id %d",
+ i+1, ex_name_of_object(obj_type), exoid);
ex_err(routine,errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
@@ -320,15 +304,14 @@ int ex_put_truth_table (int exoid,
nc_flt_code(exoid), 2, dims, &varid)) != NC_NOERR) {
if (status != NC_ENAMEINUSE) {
exerrval = status;
- id=ids[i];
free(stat_vals);
- free (ids);
sprintf(errmsg,
- "Error: failed to define variable for %s %d in file id %d",
- ex_name_of_object(obj_type), id,exoid);
+ "Error: failed to define variable for %d'th %s in file id %d",
+ i+1, ex_name_of_object(obj_type), exoid);
ex_err(routine,errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
+ ex_compress_variable(exoid, varid, 2);
}
}
} /* if */
@@ -337,7 +320,6 @@ int ex_put_truth_table (int exoid,
} /* for i */
free (stat_vals);
- free (ids);
/* create a variable array in which to store the truth table
*/
diff --git a/exodus/cbind/src/ex_put_var.c b/exodus/cbind/src/ex_put_var.c
new file mode 100644
index 0000000..c2e740b
--- /dev/null
+++ b/exodus/cbind/src/ex_put_var.c
@@ -0,0 +1,340 @@
+/*
+ * Copyright (c) 2006 Sandia Corporation. Under the terms of Contract
+ * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
+ * retains certain rights in this software.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * * Neither the name of Sandia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/*****************************************************************************
+*
+* expvar - ex_put_var
+*
+* entry conditions -
+* input parameters:
+* int exoid exodus file id
+* int time_step time step number
+* int var_type type (edge block, face block, edge set, ... )
+* int var_index element variable index
+* int obj_id element block id
+* int num_entries_this_obj number of entries in this block/set
+*
+* exit conditions -
+*
+*
+* exit conditions -
+*
+* revision history -
+*
+*
+*****************************************************************************/
+
+#include <stdlib.h>
+#include "exodusII.h"
+#include "exodusII_int.h"
+
+static int
+ex_look_up_var(int exoid, ex_entity_type var_type, int var_index, ex_entity_id obj_id,
+ const char *VOBJID, const char *VOBJTAB, const char *DNUMOBJ,
+ const char *DNUMOBJVAR, int *varid)
+{
+ int status;
+ int obj_id_ndx;
+ int dimid,time_dim, numobjdim, dims[2];
+
+ size_t num_obj;
+ size_t num_obj_var;
+ size_t num_entity;
+
+ int *obj_var_truth_tab;
+ char errmsg[MAX_ERR_LENGTH];
+
+ /* Determine index of obj_id in VOBJID array */
+ obj_id_ndx = ex_id_lkup(exoid,var_type,obj_id);
+ if (exerrval != 0) {
+ if (exerrval == EX_NULLENTITY) {
+ sprintf(errmsg,
+ "Warning: no variables allowed for NULL block %"PRId64" in file id %d",
+ obj_id,exoid);
+ ex_err("ex_put_var",errmsg,EX_MSG);
+ return (EX_WARN);
+ }
+ else {
+ sprintf(errmsg,
+ "Error: failed to locate %s id %"PRId64" in %s array in file id %d",
+ ex_name_of_object(var_type), obj_id, VOBJID, exoid);
+ ex_err("ex_put_var",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ }
+
+ if ((status = nc_inq_varid (exoid, ex_name_var_of_object(var_type, var_index, obj_id_ndx), varid)) != NC_NOERR) {
+ if (status == NC_ENOTVAR) {/* variable doesn't exist, create it! */
+ /* check for the existance of an TNAME variable truth table */
+ if (nc_inq_varid(exoid, VOBJTAB, varid) == NC_NOERR) {
+ /* find out number of TNAMEs and TNAME variables */
+ status = ex_get_dimension(exoid, DNUMOBJ, ex_name_of_object(var_type), &num_obj, &dimid, "ex_put_var");
+ if (status != NC_NOERR) return status;
+
+ status = ex_get_dimension(exoid, DNUMOBJVAR, ex_name_of_object(var_type), &num_obj_var, &dimid, "ex_put_var");
+ if (status != NC_NOERR) return status;
+
+ if (!(obj_var_truth_tab = malloc(num_obj*num_obj_var*sizeof(int)))) {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate memory for %s variable truth table in file id %d",
+ ex_name_of_object(var_type), exoid);
+ ex_err("ex_put_var",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* read in the TNAME variable truth table */
+ if ((status = nc_get_var_int (exoid, *varid, obj_var_truth_tab)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to get truth table from file id %d", exoid);
+ ex_err("ex_put_var",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ if(obj_var_truth_tab[num_obj_var*(obj_id_ndx-1)+var_index-1] == 0L) {
+ free(obj_var_truth_tab);
+ exerrval = EX_BADPARAM;
+ sprintf(errmsg,
+ "Error: Invalid %s variable %d, %s %"PRId64" in file id %d",
+ ex_name_of_object(var_type), var_index, ex_name_of_object(var_type), obj_id, exoid);
+ ex_err("ex_put_var",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ free(obj_var_truth_tab);
+ }
+
+ if ((status = nc_inq_dimid(exoid, DIM_TIME, &time_dim)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to locate time dimension in file id %d", exoid);
+ ex_err("ex_put_var",errmsg,exerrval);
+ goto error_ret; /* exit define mode and return */
+ }
+
+ ex_get_dimension(exoid, ex_dim_num_entries_in_object(var_type, obj_id_ndx),
+ ex_name_of_object(var_type), &num_entity, &numobjdim, "ex_put_var");
+
+ /* variable doesn't exist so put file into define mode */
+ if ((status = nc_redef (exoid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to put file id %d into define mode", exoid);
+ ex_err("ex_put_var",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ /* define netCDF variable to store TNAME variable values */
+ dims[0] = time_dim;
+ dims[1] = numobjdim;
+ if ((status = nc_def_var(exoid, ex_name_var_of_object(var_type, var_index, obj_id_ndx),
+ nc_flt_code(exoid), 2, dims, varid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to define %s variable %d in file id %d",
+ ex_name_of_object(var_type), var_index,exoid);
+ ex_err("ex_put_var",errmsg,exerrval);
+ goto error_ret;
+ }
+ ex_compress_variable(exoid, *varid, 2);
+
+ /* leave define mode */
+ if ((status = nc_enddef (exoid)) != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to complete %s variable %s definition to file id %d",
+ ex_name_of_object(var_type), ex_name_var_of_object(var_type, var_index, obj_id_ndx), exoid);
+ ex_err("ex_put_var",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ }
+ else {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to locate %s variable %s in file id %d",
+ ex_name_of_object(var_type), ex_name_var_of_object(var_type, var_index, obj_id_ndx), exoid);
+ ex_err("ex_put_var",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ }
+ return (EX_NOERR);
+
+ /* Fatal error: exit definition mode and return */
+ error_ret:
+ if (nc_enddef (exoid) != NC_NOERR) { /* exit define mode */
+ sprintf(errmsg,
+ "Error: failed to complete definition for file id %d",
+ exoid);
+ ex_err("ex_put_var",errmsg,exerrval);
+ }
+ return (EX_FATAL);
+}
+
+/*!
+ * writes the values of a single variable for one entity at one time
+ * step to the database; assume the first time step and variable index
+ * are 1
+ * \param exoid exodus file id
+ * \param time_step time step number
+ * \param var_type type (edge block, face block, edge set, ... )
+ * \param var_index variable index
+ * \param obj_id entity block id
+ * \param num_entries_this_obj number of entries in this block/set
+ * \param var_vals the values to be written
+ */
+
+int ex_put_var (int exoid,
+ int time_step,
+ ex_entity_type var_type,
+ int var_index,
+ ex_entity_id obj_id,
+ int64_t num_entries_this_obj,
+ const void *var_vals)
+{
+ int varid;
+ size_t start[2], count[2];
+ int status;
+ char errmsg[MAX_ERR_LENGTH];
+
+ exerrval = 0; /* clear error code */
+
+ switch (var_type) {
+ case EX_GLOBAL:
+ if ( num_entries_this_obj <= 0 ) {
+ exerrval = EX_MSG;
+ sprintf(errmsg,
+ "Warning: no global variables specified for file id %d",
+ exoid);
+ ex_err("ex_put_glob_vars",errmsg,exerrval);
+
+ return (EX_WARN);
+ }
+
+ /* inquire previously defined variable */
+ if ((status = nc_inq_varid (exoid, VAR_GLO_VAR, &varid)) != NC_NOERR) {
+ if (status == NC_ENOTVAR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: no global variables defined in file id %d",
+ exoid);
+ ex_err("ex_put_glob_vars",errmsg,exerrval);
+ } else {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to get global variables parameters in file id %d",
+ exoid);
+ ex_err("ex_put_glob_vars",errmsg,exerrval);
+ }
+ return (EX_FATAL);
+ }
+ break;
+ case EX_NODAL:
+ return ex_put_nodal_var(exoid, time_step, var_index, num_entries_this_obj, var_vals);
+ break;
+ case EX_EDGE_BLOCK:
+ status = ex_look_up_var(exoid, var_type, var_index, obj_id,
+ VAR_ID_ED_BLK,VAR_EBLK_TAB,DIM_NUM_ED_BLK,DIM_NUM_EDG_VAR, &varid);
+ break;
+ case EX_FACE_BLOCK:
+ status = ex_look_up_var(exoid, var_type, var_index, obj_id,
+ VAR_ID_FA_BLK,VAR_FBLK_TAB,DIM_NUM_FA_BLK,DIM_NUM_FAC_VAR, &varid);
+ break;
+ case EX_ELEM_BLOCK:
+ status = ex_look_up_var(exoid, var_type, var_index, obj_id,
+ VAR_ID_EL_BLK,VAR_ELEM_TAB,DIM_NUM_EL_BLK,DIM_NUM_ELE_VAR, &varid);
+ break;
+ case EX_NODE_SET:
+ status = ex_look_up_var(exoid, var_type, var_index, obj_id,
+ VAR_NS_IDS,VAR_NSET_TAB,DIM_NUM_NS,DIM_NUM_NSET_VAR, &varid);
+ break;
+ case EX_EDGE_SET:
+ status = ex_look_up_var(exoid, var_type, var_index, obj_id,
+ VAR_ES_IDS,VAR_ESET_TAB,DIM_NUM_ES,DIM_NUM_ESET_VAR, &varid);
+ break;
+ case EX_FACE_SET:
+ status = ex_look_up_var(exoid, var_type, var_index, obj_id,
+ VAR_FS_IDS,VAR_FSET_TAB,DIM_NUM_FS,DIM_NUM_FSET_VAR, &varid);
+ break;
+ case EX_SIDE_SET:
+ status = ex_look_up_var(exoid, var_type, var_index, obj_id,
+ VAR_SS_IDS,VAR_SSET_TAB,DIM_NUM_SS,DIM_NUM_SSET_VAR, &varid);
+ break;
+ case EX_ELEM_SET:
+ status = ex_look_up_var(exoid, var_type, var_index, obj_id,
+ VAR_ELS_IDS,VAR_ELSET_TAB,DIM_NUM_ELS,DIM_NUM_ELSET_VAR, &varid);
+ break;
+ default:
+ exerrval = EX_MSG;
+ sprintf( errmsg, "Error: invalid variable type (%d) specified for file id %d",
+ var_type, exoid );
+ ex_err( "ex_put_var", errmsg, exerrval );
+ return (EX_FATAL);
+ }
+
+ if (status != EX_NOERR) {
+ return status;
+ }
+
+ /* store element variable values */
+ start[0] = --time_step;
+ start[1] = 0;
+
+ if ( var_type == EX_GLOBAL ) {
+ /* global variables may be written
+ * - all at once (by setting var_index to 1 and num_entries_this_obj to num_glob, or
+ * - one at a time (by setting var_index to the desired index and num_entries_this_obj to 1.
+ */
+ count[0] = var_index;
+ } else {
+ count[0] = 1;
+ }
+ count[1] = num_entries_this_obj;
+
+ if (ex_comp_ws(exoid) == 4) {
+ status = nc_put_vara_float(exoid, varid, start, count, var_vals);
+ } else {
+ status = nc_put_vara_double(exoid, varid, start, count, var_vals);
+ }
+
+ if (status != NC_NOERR) {
+ exerrval = status;
+ sprintf(errmsg,
+ "Error: failed to store %s %"PRId64" variable %d in file id %d",
+ ex_name_of_object(var_type), obj_id, var_index,exoid);
+ ex_err("ex_put_var",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+
+ return (EX_NOERR);
+}
diff --git a/exodus/cbind/src/expvnm.c b/exodus/cbind/src/ex_put_var_name.c
similarity index 100%
rename from exodus/cbind/src/expvnm.c
rename to exodus/cbind/src/ex_put_var_name.c
diff --git a/exodus/cbind/src/expvan.c b/exodus/cbind/src/ex_put_var_names.c
similarity index 100%
rename from exodus/cbind/src/expvan.c
rename to exodus/cbind/src/ex_put_var_names.c
diff --git a/exodus/cbind/src/expvp.c b/exodus/cbind/src/ex_put_var_param.c
similarity index 100%
rename from exodus/cbind/src/expvp.c
rename to exodus/cbind/src/ex_put_var_param.c
diff --git a/exodus/cbind/src/exptt.c b/exodus/cbind/src/ex_put_var_tab.c
similarity index 100%
rename from exodus/cbind/src/exptt.c
rename to exodus/cbind/src/ex_put_var_tab.c
diff --git a/exodus/cbind/src/expvarnam.c b/exodus/cbind/src/ex_put_variable_name.c
similarity index 100%
rename from exodus/cbind/src/expvarnam.c
rename to exodus/cbind/src/ex_put_variable_name.c
diff --git a/exodus/cbind/src/expvarnams.c b/exodus/cbind/src/ex_put_variable_names.c
similarity index 100%
rename from exodus/cbind/src/expvarnams.c
rename to exodus/cbind/src/ex_put_variable_names.c
diff --git a/exodus/cbind/src/expvarparam.c b/exodus/cbind/src/ex_put_variable_param.c
similarity index 98%
rename from exodus/cbind/src/expvarparam.c
rename to exodus/cbind/src/ex_put_variable_param.c
index e1878cf..1b6a3e8 100644
--- a/exodus/cbind/src/expvarparam.c
+++ b/exodus/cbind/src/ex_put_variable_param.c
@@ -179,11 +179,7 @@ int ex_put_variable_param (int exoid,
if ((status = nc_inq_dimid (exoid, DIM_NUM_NODES, &num_nod_dim)) != NC_NOERR) {
if (obj_type == EX_NODAL) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate number of nodes in file id %d", exoid);
- ex_err("ex_put_variable_param",errmsg,exerrval);
- return (EX_FATAL);
+ return (EX_NOERR); /* Probably no nodes on database (e.g., badly load-balanced parallel run) */
}
}
@@ -221,6 +217,7 @@ int ex_put_variable_param (int exoid,
ex_err("ex_put_variable_param",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
+ ex_compress_variable(exoid, varid, 2);
}
else if (obj_type == EX_NODAL) {
@@ -267,6 +264,7 @@ int ex_put_variable_param (int exoid,
ex_err("ex_put_variable_param",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
+ ex_compress_variable(exoid, varid, 2);
} else { /* New way */
int i;
for (i = 1; i <= num_vars; i++) {
@@ -281,6 +279,7 @@ int ex_put_variable_param (int exoid,
ex_err("ex_put_variable_param",errmsg,exerrval);
goto error_ret; /* exit define mode and return */
}
+ ex_compress_variable(exoid, varid, 2);
}
}
diff --git a/exodus/cbind/src/exupda.c b/exodus/cbind/src/ex_update.c
similarity index 100%
rename from exodus/cbind/src/exupda.c
rename to exodus/cbind/src/ex_update.c
diff --git a/exodus/cbind/src/ex_utils.c b/exodus/cbind/src/ex_utils.c
index 030361d..d245d10 100644
--- a/exodus/cbind/src/ex_utils.c
+++ b/exodus/cbind/src/ex_utils.c
@@ -46,6 +46,8 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#include <unistd.h>
+
#include "exodusII.h"
#include "exodusII_int.h"
@@ -138,7 +140,7 @@ int ex_set_max_name_length(int exoid, int length)
return (EX_FATAL);
}
else {
- ex_max_name_length = length;
+ ex_set_option(exoid, EX_OPT_MAX_NAME_LENGTH, length);
}
return EX_NOERR;
}
@@ -275,10 +277,11 @@ int ex_get_names_internal(int exoid, int varid, size_t num_entity, char **names,
int status;
/* Query size of names on file
- * Use the smaller of the size on file or ex_max_name_length
+ * Use the smaller of the size on file or user-specified length
*/
int db_name_size = ex_inquire_int(exoid, EX_INQ_DB_MAX_ALLOWED_NAME_LENGTH);
- int name_size = db_name_size < ex_max_name_length ? db_name_size : ex_max_name_length;
+ int api_name_size = ex_inquire_int(exoid, EX_INQ_MAX_READ_NAME_LENGTH);
+ int name_size = db_name_size < api_name_size ? db_name_size : api_name_size;
for (i=0; i<num_entity; i++) {
status = ex_get_name_internal(exoid, varid, i, names[i], name_size, obj_type, routine);
@@ -294,6 +297,7 @@ int ex_get_name_internal(int exoid, int varid, size_t index, char *name, int nam
size_t start[2], count[2];
int status;
char errmsg[MAX_ERR_LENGTH];
+ int api_name_size = ex_inquire_int(exoid, EX_INQ_MAX_READ_NAME_LENGTH);
/* read the name */
start[0] = index; count[0] = 1;
@@ -308,7 +312,7 @@ int ex_get_name_internal(int exoid, int varid, size_t index, char *name, int nam
return (EX_FATAL);
}
- name[ex_max_name_length] = '\0';
+ name[api_name_size] = '\0';
ex_trim_internal(name);
return EX_NOERR;
@@ -551,14 +555,11 @@ char* ex_name_of_map(ex_entity_type map_type, int map_index)
* exit conditions -
* int return index into table (1-based)
*
-* revision history -
-*
-*
*****************************************************************************/
int ex_id_lkup( int exoid,
ex_entity_type id_type,
- int num)
+ ex_entity_id num)
{
char id_table[MAX_VAR_NAME_LENGTH+1];
@@ -566,7 +567,8 @@ int ex_id_lkup( int exoid,
char stat_table[MAX_VAR_NAME_LENGTH+1];
int varid, dimid;
size_t dim_len, i;
- int *id_vals=NULL, *stat_vals=NULL;
+ int64_t *id_vals=NULL;
+ int *stat_vals=NULL;
static int filled=FALSE;
struct obj_stats *tmp_stats;
@@ -698,8 +700,9 @@ int ex_id_lkup( int exoid,
return (EX_FATAL);
}
- /* allocate space for id array */
- if (!(id_vals = malloc((int)dim_len*sizeof(int)))) {
+ /* allocate space for id array and initialize to zero to ensure
+ that the higher bits don't contain garbage while copy from ints */
+ if (!(id_vals = calloc(dim_len,sizeof(int64_t)))) {
exerrval = EX_MEMFAIL;
sprintf(errmsg,
"Error: failed to allocate memory for %s array for file id %d",
@@ -708,7 +711,28 @@ int ex_id_lkup( int exoid,
return (EX_FATAL);
}
- if ((status = nc_get_var_int (exoid, varid, id_vals)) != NC_NOERR) {
+ if (ex_int64_status(exoid) & EX_IDS_INT64_API) {
+ status = nc_get_var_longlong (exoid, varid, (long long*)id_vals);
+ }
+ else {
+ int *id_vals_int;
+ if (!(id_vals_int = malloc(dim_len*sizeof(int)))) {
+ exerrval = EX_MEMFAIL;
+ sprintf(errmsg,
+ "Error: failed to allocate memory for temporary array id_vals_int for file id %d",
+ exoid);
+ ex_err("ex_id_lkup",errmsg,exerrval);
+ return (EX_FATAL);
+ }
+ status = nc_get_var_int(exoid, varid, (int *)id_vals_int);
+ if (status == NC_NOERR) {
+ for (i=0;i<dim_len;i++)
+ id_vals[i] = (int64_t) id_vals_int[i];
+ }
+ free(id_vals_int);
+ }
+
+ if (status != NC_NOERR) {
exerrval = status;
sprintf(errmsg,
"Error: failed to get %s array from file id %d",
@@ -817,9 +841,6 @@ int ex_id_lkup( int exoid,
*
* ex_get_stat_ptr - returns a pointer to a structure of object ids
*
-* revision history -
-*
-*
*****************************************************************************/
/*! this routine returns a pointer to a structure containing the ids of
@@ -860,9 +881,6 @@ struct obj_stats *ex_get_stat_ptr (int exoid, struct obj_stats **obj_ptr)
*
* ex_rm_stat_ptr - removes a pointer to a structure of object ids
*
-* revision history -
-*
-*
*****************************************************************************/
/*! this routine removes a pointer to a structure containing the ids of
@@ -1125,13 +1143,6 @@ void ex_rm_file_item( int exoid, /* file id */
*
* ex_get_num_props - get number of properties
*
-* entry conditions -
-*
-* exit conditions -
-*
-* revision history -
-*
-*
*****************************************************************************/
int ex_get_num_props (int exoid, ex_entity_type obj_type)
{
@@ -1217,6 +1228,15 @@ static void ex_swap (int v[], int i, int j)
v[j] = temp;
}
+static void ex_swap64 (int64_t v[], int64_t i, int64_t j)
+{
+ int64_t temp;
+
+ temp = v[i];
+ v[i] = v[j];
+ v[j] = temp;
+}
+
/*!
* The following 'indexed qsort' routine is modified from Sedgewicks
* algorithm It selects the pivot based on the median of the left,
@@ -1235,8 +1255,8 @@ static void ex_swap (int v[], int i, int j)
static int ex_int_median3(int v[], int iv[], int left, int right)
{
- int center;
- center = (left + right) / 2;
+ ssize_t center;
+ center = ((ssize_t)left + (ssize_t)right) / 2;
if (v[iv[left]] > v[iv[center]])
ex_swap(iv, left, center);
@@ -1249,6 +1269,22 @@ static int ex_int_median3(int v[], int iv[], int left, int right)
return iv[right-1];
}
+static int64_t ex_int_median3_64(int64_t v[], int64_t iv[], int64_t left, int64_t right)
+{
+ int64_t center;
+ center = (left + right) / 2;
+
+ if (v[iv[left]] > v[iv[center]])
+ ex_swap64(iv, left, center);
+ if (v[iv[left]] > v[iv[right]])
+ ex_swap64(iv, left, right);
+ if (v[iv[center]] > v[iv[right]])
+ ex_swap64(iv, center, right);
+
+ ex_swap64(iv, center, right-1);
+ return iv[right-1];
+}
+
static void ex_int_iqsort(int v[], int iv[], int left, int right)
{
int pivot;
@@ -1275,6 +1311,32 @@ static void ex_int_iqsort(int v[], int iv[], int left, int right)
}
}
+static void ex_int_iqsort64(int64_t v[], int64_t iv[], int64_t left, int64_t right)
+{
+ int64_t pivot;
+ int64_t i, j;
+
+ if (left + EX_QSORT_CUTOFF <= right) {
+ pivot = ex_int_median3_64(v, iv, left, right);
+ i = left;
+ j = right - 1;
+
+ for ( ; ; ) {
+ while (v[iv[++i]] < v[pivot]);
+ while (v[iv[--j]] > v[pivot]);
+ if (i < j) {
+ ex_swap64(iv, i, j);
+ } else {
+ break;
+ }
+ }
+
+ ex_swap64(iv, i, right-1);
+ ex_int_iqsort64(v, iv, left, i-1);
+ ex_int_iqsort64(v, iv, i+1, right);
+ }
+}
+
static void ex_int_iisort(int v[], int iv[], int N)
{
int i,j;
@@ -1301,6 +1363,32 @@ static void ex_int_iisort(int v[], int iv[], int N)
}
}
+static void ex_int_iisort64(int64_t v[], int64_t iv[], int64_t N)
+{
+ int64_t i,j;
+ int64_t ndx = 0;
+ int64_t small;
+ int64_t tmp;
+
+ small = v[iv[0]];
+ for (i = 1; i < N; i++) {
+ if (v[iv[i]] < small) {
+ small = v[iv[i]];
+ ndx = i;
+ }
+ }
+ /* Put smallest value in slot 0 */
+ ex_swap64(iv, 0, ndx);
+
+ for (i=1; i <N; i++) {
+ tmp = iv[i];
+ for (j=i; v[tmp] < v[iv[j-1]]; j--) {
+ iv[j] = iv[j-1];
+ }
+ iv[j] = tmp;
+ }
+}
+
void ex_iqsort(int v[], int iv[], int N)
{
ex_int_iqsort(v, iv, 0, N-1);
@@ -1315,6 +1403,20 @@ void ex_iqsort(int v[], int iv[], int N)
#endif
}
+void ex_iqsort64(int64_t v[], int64_t iv[], int64_t N)
+{
+ ex_int_iqsort64(v, iv, 0, N-1);
+ ex_int_iisort64(v, iv, N);
+
+#if defined(DEBUG_QSORT)
+ fprintf(stderr, "Checking sort of %d values\n", N+1);
+ int i;
+ for (i=1; i < N; i++) {
+ assert(v[iv[i-1]] <= v[iv[i]]);
+ }
+#endif
+}
+
/*!
* Determine whether the new large model storage is being used in this
* file, or old method. Basically, the difference is whether the
@@ -1402,123 +1504,36 @@ int ex_get_dimension(int exoid, const char* DIMENSION, const char *label,
return status;
}
-/*! Calculate the number of words of storage required to store the
- * header information. Total bytes can be obtained by multiplying
- * words by 4. Size is slightly underestimated since it only
- * considers the bulk data storage...
- */
+/* Deprecated. do not use */
size_t ex_header_size(int exoid)
{
- const char *routine = NULL;
- int iows = 0;
- size_t ndim = 0;
- size_t num_nodes = 0;
- size_t num_elem = 0;
- size_t num_eblk = 0;
- size_t num_map = 0;
- size_t num_nset = 0;
- size_t num_sset = 0;
- int mapid;
- int temp;
-
- size_t size = 0;
- /* Get word size (2 = 8-byte reals, 1 = 4-byte reals */
-
- if (nc_flt_code(exoid) == NC_DOUBLE)
- iows = 2;
- else
- iows = 1;
-
- /* coordinates = (ndim * numnp)*iows + maps */
- ex_get_dimension(exoid, DIM_NUM_DIM, "dimension", &ndim, &temp, routine);
- ex_get_dimension(exoid, DIM_NUM_NODES, "nodes", &num_nodes, &temp, routine);
- size += iows * ndim * num_nodes;
+ return 0;
+}
- /* node maps */
- if (nc_inq_varid(exoid, VAR_NODE_NUM_MAP, &mapid) != -1)
- size += num_nodes;
+/* type = 1 for integer, 2 for real, 3 for character */
+void ex_compress_variable(int exoid, int varid, int type)
+{
+#if !defined(NOT_NETCDF4)
- ex_get_dimension(exoid, DIM_NUM_NM, "node maps", &num_map, &temp, routine);
- size += num_map * num_nodes;
+ struct file_item* file = ex_find_file_item(exoid);
- /* Element Data */
- ex_get_dimension(exoid, DIM_NUM_ELEM, "elements", &num_elem, &temp, routine);
-
- /* Element order map */
- if (nc_inq_varid (exoid, VAR_MAP, &mapid) != -1)
- size += num_elem;
-
- if (nc_inq_varid (exoid, VAR_ELEM_NUM_MAP, &mapid) != -1)
- size += num_elem;
-
- /* Element map(s) */
- ex_get_dimension(exoid, DIM_NUM_EM, "element maps", &num_map, &temp, routine);
- size += num_map * num_elem;
-
- /* Element Blocks... */
- ex_get_dimension(exoid, DIM_NUM_EL_BLK, "element blocks", &num_eblk, &temp, routine);
- if (num_eblk > 0) {
- /* Allocate storage for element block parameters... */
- int *ids = malloc(num_eblk * sizeof(int));
- size_t i;
-
- size += 2*num_eblk; /* status + ids */
-
- ex_get_ids(exoid, EX_ELEM_BLOCK, ids);
- for (i=0; i < num_eblk; i++) {
- int num_elem_this_blk = 0;
- int num_nodes_per_elem = 0;
- int num_attr = 0;
- char elem_type[MAX_STR_LENGTH+1];
- ex_get_elem_block(exoid, ids[i], elem_type, &num_elem_this_blk,
- &num_nodes_per_elem, &num_attr);
- size += num_elem_this_blk * num_nodes_per_elem;
- size += num_elem_this_blk * num_attr * iows;
- }
- free(ids);
- }
-
- /* Nodesets */
- ex_get_dimension(exoid, DIM_NUM_NS, "nodesets", &num_nset, &temp, routine);
- if (num_nset > 0) {
- /* Allocate storage for nodeset parameters... */
- int *ids = malloc(num_nset * sizeof(int));
- size_t i;
-
- size += 2*num_nset; /* Status + ids */
- ex_get_ids(exoid, EX_NODE_SET, ids);
- for (i=0; i < num_nset; i++) {
- int num_nodes_in_set = 0;
- int num_df_in_set = 0;
- ex_get_node_set_param(exoid, ids[i], &num_nodes_in_set, &num_df_in_set);
- size += num_nodes_in_set;
- size += num_df_in_set * iows;
- }
- free(ids);
+ if (!file ) {
+ char errmsg[MAX_ERR_LENGTH];
+ exerrval = EX_BADFILEID;
+ sprintf(errmsg,"Error: unknown file id %d for ex_compress_variable().",exoid);
+ ex_err("ex_compress_variable",errmsg,exerrval);
}
-
- /* Sidesets */
- ex_get_dimension(exoid, DIM_NUM_SS, "sidesets", &num_sset, &temp, routine);
- if (num_sset > 0) {
- /* Allocate storage for sideset parameters... */
- int *ids = malloc(num_sset * sizeof(int));
- size_t i;
-
- size += 2*num_sset; /* Status + ids */
- ex_get_ids(exoid, EX_SIDE_SET, ids);
- for (i=0; i < num_sset; i++) {
- int num_sides_in_set = 0;
- int num_df_in_set = 0;
- ex_get_side_set_param(exoid, ids[i], &num_sides_in_set, &num_df_in_set);
- size += num_sides_in_set * 2;
- size += num_df_in_set * iows;
+ else {
+ int deflate_level = file->compression_level;
+ int compress = 1;
+ int shuffle = file->shuffle;
+#if 0
+ if (type == 2)
+ shuffle = 0;
+#endif
+ if (deflate_level > 0 && (file->file_type == 2 || file->file_type == 3)) {
+ nc_def_var_deflate(exoid, varid, shuffle, compress, deflate_level);
}
- free(ids);
- }
-
- if (ex_large_model(exoid) == 0 && size > (1<<29)) {
-
- fprintf(stderr, "ERROR: Size to store header information exceeds 2GB in file id %d\n File is probably corrupt, rerun with environment variable EXODUS_LARGE_MODEL set.\n", exoid);
}
- return size;
+#endif
}
diff --git a/exodus/cbind/src/excn2s.c b/exodus/cbind/src/excn2s.c
deleted file mode 100644
index 97529aa..0000000
--- a/exodus/cbind/src/excn2s.c
+++ /dev/null
@@ -1,1025 +0,0 @@
-/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include <ctype.h>
-#include <string.h>
-#include <stdlib.h>
-#include "exodusII.h"
-#include "exodusII_int.h"
-
-/*!
-
-The function ex_cvt_nodes_to_sides() is used to convert a side set
-node list to a side set side list. This routine is provided for
-application programs that utilize side sets defined by nodes (as was
-done previous to release 2.0) rather than local faces or edges. The
-application program must allocate memory for the returned array of
-sides. The length of this array is the same as the length of the
-concatenated side sets element list, which can be determined with a
-call to ex_inquire() or ex_inquire_int().
-
-\return In case of an error, ex_cvt_nodes_to_sides() returns a
-negative number; a warning will return a positive number. Possible
-causes of errors include:
- - a warning value is returned if no side sets are stored in the file.
- - because the faces of a wedge require a different number of
- nodes to describe them (quadrilateral vs. triangular faces), the
- function will abort with a fatal return code if a wedge is
- encountered in the side set element list.
-
-\param[in] exoid exodus file ID returned from a previous call to ex_create()
- or ex_open().
-
-\param[in] num_elem_per_set Array containing the number of sides for each set. The number
- of sides is equal to the number of elements for each set.
-
-\param[in] num_nodes_per_set Array containing the number of nodes for each set.
-
-\param[in] side_sets_elem_index Array containing indices into the \c side_sets_elem_list which are
- the locations of the first element for each set. These indices are
- 0-based. Unused.
-
-\param[in] side_sets_node_index Array containing indices into the \c side_sets_node_list
- which are the locations of the first node for each set. These
- indices are 0-based. Unused.
-
-\param[in] side_sets_elem_list Array containing the elements for all side sets. Internal element IDs
- are used in this list (see Section LocalElementIds).
-
-\param[in] side_sets_node_list Array containing the nodes for all side sets. Internal node
- IDs are used in this list (see Section LocalNodeIds).
-
-\param[out] side_sets_side_list Returned array containing the sides for all side sets.
-
-
-The following code segment will convert side sets described
-by nodes to side sets described by local side numbers:
-
-\code
-int error, exoid, ids[2], num_side_per_set[2],
- num_nodes_per_set[2], elem_ind[2], node_ind[2],
- elem_list[4], node_list[8], el_lst_len, *side_list;
-
-ids[0] = 30 ; ids[1] = 31;
-num_side_per_set[0] = 2; num_side_per_set[1] = 2;
-num_nodes_per_set[0] = 4; num_nodes_per_set[1] = 4;
-
-elem_ind[0] = 0; elem_ind[1] = 2;
-node_ind[0] = 0; node_ind[1] = 4;
-
-\comment{side set #1}
-elem_list[0] = 2; elem_list[1] = 2;
-node_list[0] = 8; node_list[1] = 5;
-node_list[2] = 6; node_list[3] = 7;
-
-\comment{side set #2}
-elem_list[2] = 1; elem_list[3] = 2;
-node_list[4] = 2; node_list[5] = 3;
-node_list[6] = 7; node_list[7] = 8;
-
-el_lst_len = ex_inquire_int(exoid, EX_INQ_SS_ELEM_LEN);
-
-\comment{side set element list is same length as side list}
-side_list = (int *) calloc (el_lst_len, sizeof(int));
-
-ex_cvt_nodes_to_sides(exoid, num_side_per_set, num_nodes_per_set,
- elem_ind, node_ind, elem_list,
- node_list, side_list);
-\endcode
-
- <b>Algorithm:</b>
-
-\verbatim
- Read elem_block_ids --> elem_blk_id[array]
-
- Read element block parameters --> elem_blk_parms[array]
-
- Determine total number of elements in side set by summing num_elem_per_set
-
- Build side set element to side set node list index --> ss_elem_node_ndx[array]
-
- For each element in the side_set_elem_list {
- If Jth element is not in current element block (e.g. J>elem_ctr) {
- get element block parameters (num_elem_in_blk, ...)
- elem_ctr += num_elem_in_blk
-
- free old connectity array space
- allocate connectivity array: size=num_elem_in_blk*num_nodes_per_elem
- get connectivity array
- }
-
- If Jth element is in current element block (e.g. J<=elem_ctr) {
- For each node in element (linear search of up to num_nodes_per_elem) {
- If side set element node[1] == element node[i] {
- Case element type = Hex {
- If side set element node[2] == element node[Hex_table[i,1]]
- Jth side = Hex_table[i,2]
-
- break
- }
- Case element type = Wedge {
- If side set element node[2] == element node[Wedge_table[i,1]]
- Jth side = Wedge_table[i,2]
-
- break
- }
- }
- }
- }
- }
-\endverbatim
-
- */
-
-int ex_cvt_nodes_to_sides(int exoid,
- int *num_elem_per_set,
- int *num_nodes_per_set,
- int *side_sets_elem_index, /* unused */
- int *side_sets_node_index, /* unused */
- int *side_sets_elem_list,
- int *side_sets_node_list,
- int *side_sets_side_list)
-{
- size_t m;
- int i, j, k, n;
- int num_side_sets, num_elem_blks;
- int tot_num_elem = 0, tot_num_ss_elem = 0, elem_num = 0, ndim;
- int *elem_blk_ids = NULL;
- int *connect = NULL;
- int *ss_elem_ndx, *ss_elem_node_ndx, *ss_parm_ndx;
- int elem_ctr, node_ctr, elem_num_pos;
- int num_elem_in_blk, num_nodes_per_elem, num_node_per_side, num_attr;
- int *same_elem_type = NULL;
- int el_type = 0;
- float fdum;
- char *cdum, elem_type[MAX_STR_LENGTH+1];
-
- struct elem_blk_parm *elem_blk_parms;
-
-/* node to side translation tables -
- These tables are used to look up the side number based on the
- first and second node in the side/face list. The side node order
- is found in the original Exodus document, SAND87-2997. The element
- node order is found in the ExodusII document, SAND92-2137. These
- tables were generated by following the right-hand rule for determining
- the outward normal. Note: Only the more complex 3-D shapes require
- these tables, the simple shapes are trivial - the first node found
- is also the side number.
-*/
-
- /* 1 2 3 4 node 1 */
- static int shell_table[2][8] = {
- {2,4, 3,1, 4,2, 1,3}, /* node 2 */
- {1,2, 1,2, 1,2, 1,2} /* side # */
- };
-
- /* 1 2 3 4 node 1 */
- static int shell_edge_table[2][8] = {
- {2,4, 3,1, 4,2, 1,3}, /* node 2 */
- {3,6, 4,3, 5,4, 6,5} /* side # */
- };
-
- /* 1 2 3 node 1 */
- static int trishell_table[2][6] = {
- {2,3, 3,1, 1,2}, /* node 2 */
- {1,2, 1,2, 1,2} /* side # */
- };
-
- /* 1 2 3 4 node 1 */
- static int tetra_table[2][12] = {
- {2,3,4, 1,3,4, 4,1,2, 1,2,3}, /* node 2 */
- {1,4,3, 4,2,1, 2,3,4, 1,2,3} /* side # */
- };
-
-#if 0
- static int wedge_table[2][18] = {
- /* 1 2 3 4 5 6 node 1 */
- {2,4,3, 5,1,3, 6,1,2, 1,6,5, 6,2,4, 4,3,5}, /* node 2 */
- {1,3,4, 1,4,2, 2,3,4, 1,3,5, 5,2,1, 5,3,2} /* side # */
- };
-#endif
-
- static int hex_table[2][24] = {
- /* 1 2 3 4 5 6 7 8 node 1 */
- {4,2,5, 1,3,6, 7,4,2, 3,1,8, 6,8,1, 5,2,7, 8,6,3, 7,5,4},/* node 2 */
- {5,1,4, 5,2,1, 2,3,5, 5,4,3, 6,4,1, 1,2,6, 6,2,3, 3,6,4} /* side # */
- };
-
- char errmsg[MAX_ERR_LENGTH];
-
- exerrval = 0; /* clear error code */
-
- cdum = 0; /* initialize even though it is not used */
-
-/* first check if any side sets are specified */
-/* inquire how many side sets have been stored */
-
- if ((ex_inquire(exoid, EX_INQ_SIDE_SETS, &num_side_sets, &fdum, cdum)) == -1)
- {
- sprintf(errmsg,
- "Error: failed to get number of side sets in file id %d",exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- return(EX_FATAL);
- }
-
- if (num_side_sets == 0)
- {
- sprintf(errmsg,
- "Warning: no side sets defined in file id %d",exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,EX_WARN);
- return(EX_WARN);
- }
-
- if ((ex_inquire(exoid, EX_INQ_ELEM_BLK, &num_elem_blks, &fdum, cdum)) == -1)
- {
- sprintf(errmsg,
- "Error: failed to get number of element blocks in file id %d",exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- return(EX_FATAL);
- }
-
- if ((ex_inquire(exoid, EX_INQ_ELEM, &tot_num_elem, &fdum, cdum)) == -1)
- {
- sprintf(errmsg,
- "Error: failed to get total number of elements in file id %d",exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- return(EX_FATAL);
- }
-
-/* get the dimensionality of the coordinates; this is necessary to
- distinguish between 2d TRIs and 3d TRIs */
-
- if ((ex_inquire(exoid, EX_INQ_DIM, &ndim, &fdum, cdum)) == -1)
- {
- sprintf(errmsg,
- "Error: failed to get dimensionality in file id %d",exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- return(EX_FATAL);
- }
-
- /* First count up # of elements in the side sets*/
- for (i=0;i<num_side_sets;i++)
- tot_num_ss_elem += num_elem_per_set[i];
-
- /* Allocate space for the ss element index array */
- if (!(ss_elem_ndx=malloc(tot_num_ss_elem*sizeof(int))))
- {
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for side set elem sort array for file id %d",
- exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* Sort side set element list into index array - non-destructive */
- for (i=0;i<tot_num_ss_elem;i++)
- ss_elem_ndx[i] = i; /* init index array to current position */
-
- ex_iqsort(side_sets_elem_list, ss_elem_ndx,tot_num_ss_elem);
-
-
- /* Allocate space for the element block ids */
- if (!(elem_blk_ids=malloc(num_elem_blks*sizeof(int))))
- {
- free(ss_elem_ndx);
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for element block ids for file id %d",
- exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- if (ex_get_elem_blk_ids(exoid, elem_blk_ids))
- {
- free(elem_blk_ids);
- free(ss_elem_ndx);
- sprintf(errmsg,
- "Error: failed to get element block ids in file id %d",
- exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,EX_MSG);
- return(EX_FATAL);
- }
-
- /* Allocate space for the element block params */
- if (!(elem_blk_parms=malloc(num_elem_blks*sizeof(struct elem_blk_parm))))
- {
- free(elem_blk_ids);
- free(ss_elem_ndx);
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for element block params for file id %d",
- exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- return (EX_FATAL);
- }
- elem_ctr = 0;
- for (i=0; i<num_elem_blks; i++)
- {
- /* read in an element block parameter */
- if ((ex_get_elem_block (exoid,
- elem_blk_ids[i],
- elem_type,
- &num_elem_in_blk,
- &num_nodes_per_elem,
- &num_attr)) == -1)
- {
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- sprintf(errmsg,
- "Error: failed to get element block %d parameters in file id %d",
- elem_blk_ids[i], exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,EX_MSG);
- return(EX_FATAL);
- }
-
- elem_blk_parms[i].num_elem_in_blk = num_elem_in_blk;
- elem_blk_parms[i].num_nodes_per_elem = num_nodes_per_elem;
- elem_blk_parms[i].num_attr = num_attr;
-
- for (m=0; m < strlen(elem_type); m++)
- elem_blk_parms[i].elem_type[m] =
- toupper(elem_type[m]);
- elem_blk_parms[i].elem_type[m] = '\0';
-
- if (strncmp(elem_blk_parms[i].elem_type,"CIRCLE",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_CIRCLE;
- /* set side set node stride */
- elem_blk_parms[i].num_nodes_per_side[0] = 1;
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"SPHERE",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_SPHERE;
- /* set side set node stride */
- elem_blk_parms[i].num_nodes_per_side[0] = 1;
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"QUAD",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_QUAD;
- /* determine side set node stride */
- if (elem_blk_parms[i].num_nodes_per_elem == 4)
- elem_blk_parms[i].num_nodes_per_side[0] = 2;
- else if (elem_blk_parms[i].num_nodes_per_elem == 5)
- elem_blk_parms[i].num_nodes_per_side[0] = 2;
- else
- elem_blk_parms[i].num_nodes_per_side[0] = 3;
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"TRIANGLE",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_TRIANGLE;
- /* determine side set node stride */
- if (ndim == 2) /* 2d TRIs */
- {
- if (elem_blk_parms[i].num_nodes_per_elem == 3)
- elem_blk_parms[i].num_nodes_per_side[0] = 2;
- else
- elem_blk_parms[i].num_nodes_per_side[0] = 3;
- }
- else if (ndim == 3) /* 3d TRIs */
- {
- elem_blk_parms[i].elem_type_val = EX_EL_TRISHELL;
- elem_blk_parms[i].num_nodes_per_side[0] =
- elem_blk_parms[i].num_nodes_per_elem;
- }
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"SHELL",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_SHELL;
- /* determine side set node stride */
- if (elem_blk_parms[i].num_nodes_per_elem == 2)
- {
- /* 2d SHELL; same as BEAM or TRUSS or BAR */
- elem_blk_parms[i].num_nodes_per_side[0] = 2;
- elem_blk_parms[i].elem_type_val = EX_EL_BEAM;
- }
- else if (elem_blk_parms[i].num_nodes_per_elem == 4)
- elem_blk_parms[i].num_nodes_per_side[0] = 4;
- else
- elem_blk_parms[i].num_nodes_per_side[0] = 8;
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"HEX",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_HEX;
- /* determine side set node stride */
- if (elem_blk_parms[i].num_nodes_per_elem == 8)
- elem_blk_parms[i].num_nodes_per_side[0] = 4;
- else if (elem_blk_parms[i].num_nodes_per_elem == 9)
- elem_blk_parms[i].num_nodes_per_side[0] = 4;
- else if (elem_blk_parms[i].num_nodes_per_elem == 12) /* HEXSHELL */
- elem_blk_parms[i].num_nodes_per_side[0] = 4;
- else if (elem_blk_parms[i].num_nodes_per_elem == 27)
- elem_blk_parms[i].num_nodes_per_side[0] = 9;
- else
- elem_blk_parms[i].num_nodes_per_side[0] = 8;
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"TETRA",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_TETRA;
- /* determine side set node stride */
- if (elem_blk_parms[i].num_nodes_per_elem == 4)
- elem_blk_parms[i].num_nodes_per_side[0] = 3;
- else if (elem_blk_parms[i].num_nodes_per_elem == 8)
- elem_blk_parms[i].num_nodes_per_side[0] = 4;
- else
- elem_blk_parms[i].num_nodes_per_side[0] = 6;
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"WEDGE",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_WEDGE;
- /* determine side set node stride */
- if (elem_blk_parms[i].num_nodes_per_elem == 6)
- elem_blk_parms[i].num_nodes_per_side[0] = 4;
- else
- elem_blk_parms[i].num_nodes_per_side[0] = 8;
- sprintf(errmsg,
- "Warning: WEDGE%d is assumed to have %d nodes per face",
- elem_blk_parms[i].num_nodes_per_elem,
- elem_blk_parms[i].num_nodes_per_side[0]);
- ex_err("ex_cvt_nodes_to_sides",errmsg,EX_MSG);
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"PYRAMID",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_PYRAMID;
- /* determine side set node stride */
- if (elem_blk_parms[i].num_nodes_per_elem == 5)
- elem_blk_parms[i].num_nodes_per_side[0] = 4;
- else
- elem_blk_parms[i].num_nodes_per_side[0] = 8;
- sprintf(errmsg,
- "Warning: PYRAMID%d is assumed to have %d nodes per face",
- elem_blk_parms[i].num_nodes_per_elem,
- elem_blk_parms[i].num_nodes_per_side[0]);
- ex_err("ex_cvt_nodes_to_sides",errmsg,EX_MSG);
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"BEAM",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_BEAM;
- /* determine side set node stride */
- if (elem_blk_parms[i].num_nodes_per_elem == 2)
- elem_blk_parms[i].num_nodes_per_side[0] = 2;
- else
- elem_blk_parms[i].num_nodes_per_side[0] = 3;
- }
- else if ( (strncmp(elem_blk_parms[i].elem_type,"TRUSS",3) == 0) ||
- (strncmp(elem_blk_parms[i].elem_type,"BAR",3) == 0) ||
- (strncmp(elem_blk_parms[i].elem_type,"EDGE",3) == 0) )
- {
- elem_blk_parms[i].elem_type_val = EX_EL_TRUSS;
- /* determine side set node stride */
- if (elem_blk_parms[i].num_nodes_per_elem == 2)
- elem_blk_parms[i].num_nodes_per_side[0] = 2;
- else
- elem_blk_parms[i].num_nodes_per_side[0] = 3;
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"NULL",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_NULL_ELEMENT;
- /* set side set node stride */
- elem_blk_parms[i].num_nodes_per_side[0] = 0;
- }
- else
- { /* unsupported element type; no problem if no sides specified for
- this element block */
- elem_blk_parms[i].elem_type_val = EX_EL_UNK;
- elem_blk_parms[i].num_nodes_per_side[0] = 0;
- }
- elem_blk_parms[i].elem_blk_id = elem_blk_ids[i]; /* save id */
- elem_ctr += elem_blk_parms[i].num_elem_in_blk;
- elem_blk_parms[i].elem_ctr = elem_ctr; /* save elem number max */
- }
-
-
- /* Allocate space for the ss element to element block parameter index array */
- if (!(ss_parm_ndx=malloc(tot_num_ss_elem*sizeof(int))))
- {
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
-"Error: failed to allocate space for side set elem parms index for file id %d"
-,
- exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- return (EX_FATAL);
- }
-
-
- /* Allocate space for the ss element to node list index array */
- if (!(ss_elem_node_ndx=malloc((tot_num_ss_elem+1)*sizeof(int))))
- {
- free(ss_parm_ndx);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
-"Error: failed to allocate space for side set elem to node index for file id %d",
- exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- return (EX_FATAL);
- }
-
-/* determine if each side set has uniform element types; this will
- be used to help determine the stride through the node list
-*/
-
- /* Allocate space for same element type flag array*/
- if (!(same_elem_type=malloc(num_side_sets*sizeof(int))))
- {
- free(ss_elem_ndx);
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for element type flag array for file id %d",
- exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- elem_ctr = num_elem_per_set[0];
- same_elem_type[0] = TRUE;
- for (i=0,k=0;i<tot_num_ss_elem;i++)
- {
- for (j=0; j<num_elem_blks; j++)
- {
- if (side_sets_elem_list[i] <= elem_blk_parms[j].elem_ctr) break;
- }
-
- if (i==0) {
- el_type = elem_blk_parms[j].elem_type_val;
- }
-
- /* determine which side set this element is in; assign to kth side set */
- if (i >= elem_ctr) {
- elem_ctr += num_elem_per_set[++k];
- el_type = elem_blk_parms[j].elem_type_val;
- same_elem_type[k] = TRUE;
- }
-
- if (el_type != elem_blk_parms[j].elem_type_val) same_elem_type[k] = FALSE;
-
- }
-
-/* Build side set element to node list index and side set element
- parameter index.
-*/
- node_ctr = 0;
- elem_ctr = num_elem_per_set[0];
- for (i=0,k=0;i<tot_num_ss_elem;i++)
- {
- for (j=0; j<num_elem_blks; j++)
- {
- if (side_sets_elem_list[i] <= elem_blk_parms[j].elem_ctr)
- {
- ss_parm_ndx[i] = j; /* assign parameter block index */
- break;
- }
- }
- ss_elem_node_ndx[i] = node_ctr; /* assign node list index */
-
- /* determine which side set this element is in; assign to kth side set */
- if (i >= elem_ctr) {
- /* skip over NULL side sets */
- while (num_elem_per_set[++k] == 0);
- elem_ctr += num_elem_per_set[k];
- }
-
- /* determine number of nodes per side */
- if (((num_nodes_per_set[k] % num_elem_per_set[k]) == 0) &&
- (same_elem_type[k])) { /* all side set elements are same type */
- node_ctr += num_nodes_per_set[k] /num_elem_per_set[k];
- } else {
- node_ctr += elem_blk_parms[j].num_nodes_per_side[0];
- }
- }
-
- ss_elem_node_ndx[i] = node_ctr; /* assign node list index */
- free(same_elem_type);
-
- /* All setup, ready to go ... */
-
- elem_ctr=0;
-
- for (j=0; j < tot_num_ss_elem; j++)
- {
-
- if (side_sets_elem_list[ss_elem_ndx[j]] > elem_ctr)
- {
- /* release connectivity array space and get next one */
- if (elem_ctr > 0)
- free(connect);
-
- /* Allocate space for the connectivity array for new element block */
- if (!(connect=
- malloc(elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].num_elem_in_blk*
- elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].num_nodes_per_elem*
- sizeof(int))))
- {
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for connectivity array for file id %d",
- exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- free(ss_elem_node_ndx);
- free(ss_parm_ndx);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- return (EX_FATAL);
- }
-
- /* get connectivity array */
- if (ex_get_elem_conn(
- exoid,
- elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].elem_blk_id,
- connect) == -1)
- {
- sprintf(errmsg,
- "Error: failed to get connectivity array for elem blk %d for file id %d",
- elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].elem_blk_id,
- exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- free(connect);
- free(ss_elem_node_ndx);
- free(ss_parm_ndx);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- return (EX_FATAL);
- }
- elem_ctr = elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].elem_ctr;
- }
-/* For the first node of each side in side set, using a linear search
- (of up to num_nodes_per_elem) of the connectivity array,
- locate the node position in the element. The first node position
- and the second node position are used with a element type specific
- table to determine the side. */
-
- elem_num = side_sets_elem_list[ss_elem_ndx[j]]-1;/* element number 0-based*/
- /* calculate the relative element number position in it's block*/
- elem_num_pos = elem_num -
- (elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].elem_ctr -
- elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].num_elem_in_blk);
- /* calculate the beginning of the node list for this element by
- using the ss_elem_node_ndx index into the side_sets_node_index
- and adding the element number position * number of nodes per elem */
-
- num_nodes_per_elem =
- elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].num_nodes_per_elem;
- for (n=0; n<num_nodes_per_elem; n++)
- {
- /* find node in connectivity array that matches first node in side set */
- if (side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]] ==
- connect[num_nodes_per_elem*(elem_num_pos)+n])
- {
- switch (elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].elem_type_val)
- {
- case EX_EL_CIRCLE:
- case EX_EL_SPHERE:
- {
- /* simple case: 1st node number is same as side # */
- side_sets_side_list[ss_elem_ndx[j]] = n+1;
- break;
- }
- case EX_EL_QUAD:
- case EX_EL_TRIANGLE:
- case EX_EL_TRUSS:
- case EX_EL_BEAM:
- {
- /* simple case: 1st node number is same as side # */
- side_sets_side_list[ss_elem_ndx[j]] = n+1;
- break;
- }
- case EX_EL_TRISHELL:
- {
- /* use table to find which node to compare to next */
- num_node_per_side = ss_elem_node_ndx[ss_elem_ndx[j]+1] -
- ss_elem_node_ndx[ss_elem_ndx[j]];
-
- if (side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]+1] ==
- connect[num_nodes_per_elem*(elem_num_pos)+
- (trishell_table[0][2*n]-1)])
- {
- /* Assume only front or back, no edges... */
- side_sets_side_list[ss_elem_ndx[j]] = trishell_table[1][2*n];
- }
- else if (side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]+1] ==
- connect[num_nodes_per_elem*(elem_num_pos)+
- (trishell_table[0][2*n+1]-1)])
- {
- /* Assume only front or back, no edges... */
- side_sets_side_list[ss_elem_ndx[j]] = trishell_table[1][2*n+1];
- }
- else if (side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]+1] ==
- connect[num_nodes_per_elem*(elem_num_pos)+
- (trishell_table[0][2*n+2]-1)])
- {
- /* Assume only front or back, no edges... */
- side_sets_side_list[ss_elem_ndx[j]] = trishell_table[1][2*n+2];
- }
- else
- {
- exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "Error: failed to find TRIANGULAR SHELL element %d, node %d in connectivity array %d for file id %d",
- side_sets_elem_list[ss_elem_ndx[j]],
- side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]+1],
- elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].elem_blk_id,
- exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- free(connect);
- free(ss_elem_node_ndx);
- free(ss_parm_ndx);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- return (EX_FATAL);
- }
- break;
-
- }
- case EX_EL_SHELL:
- {
- /* use table to find which node to compare to next */
-
- num_node_per_side = ss_elem_node_ndx[ss_elem_ndx[j]+1] -
- ss_elem_node_ndx[ss_elem_ndx[j]];
-
- if (side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]+1] ==
- connect[num_nodes_per_elem*(elem_num_pos)+
- (shell_table[0][2*n]-1)])
- {
- if (num_node_per_side >= 4)
- /* 4- or 8-node side (front or back face) */
- side_sets_side_list[ss_elem_ndx[j]] = shell_table[1][2*n];
- else
- /* 2- or 3-node side (edge of shell) */
- side_sets_side_list[ss_elem_ndx[j]] = shell_edge_table[1][2*n];
- }
- else if (side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]+1] ==
- connect[num_nodes_per_elem*(elem_num_pos)+
- (shell_table[0][2*n+1]-1)])
- {
- if (num_node_per_side >= 4)
- /* 4- or 8-node side (front or back face) */
- side_sets_side_list[ss_elem_ndx[j]] = shell_table[1][2*n+1];
- else
- /* 2- or 3-node side (edge of shell) */
- side_sets_side_list[ss_elem_ndx[j]]=shell_edge_table[1][2*n+1];
- }
- else if (side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]+1] ==
- connect[num_nodes_per_elem*(elem_num_pos)+
- (shell_table[0][2*n+2]-1)])
- {
- if (num_node_per_side >= 4)
- /* 4- or 8-node side (front or back face) */
- side_sets_side_list[ss_elem_ndx[j]] = shell_table[1][2*n+2];
- else
- /* 2- or 3-node side (edge of shell) */
- side_sets_side_list[ss_elem_ndx[j]]=shell_edge_table[1][2*n+2];
- }
- else
- {
- exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "Error: failed to find SHELL element %d, node %d in connectivity array %d for file id %d",
- side_sets_elem_list[ss_elem_ndx[j]],
- side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]+1],
- elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].elem_blk_id,
- exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- free(connect);
- free(ss_elem_node_ndx);
- free(ss_parm_ndx);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- return (EX_FATAL);
- }
- break;
-
- }
- case EX_EL_HEX:
- {
- /* use table to find which node to compare to next */
-
- if (side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]+1] ==
- connect[num_nodes_per_elem*(elem_num_pos)+
- (hex_table[0][3*n]-1)])
- side_sets_side_list[ss_elem_ndx[j]] = hex_table[1][3*n];
- else if (side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]+1] ==
- connect[num_nodes_per_elem*(elem_num_pos)+
- (hex_table[0][3*n+1]-1)])
- side_sets_side_list[ss_elem_ndx[j]] = hex_table[1][3*n+1];
- else if (side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]+1] ==
- connect[num_nodes_per_elem*(elem_num_pos)+
- (hex_table[0][3*n+2]-1)])
- side_sets_side_list[ss_elem_ndx[j]] = hex_table[1][3*n+2];
- else
- {
- exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "Error: failed to find HEX element %d, node %d in connectivity array %d for file id %d",
- side_sets_elem_list[ss_elem_ndx[j]],
- side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]+1],
- elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].elem_blk_id,
- exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- free(connect);
- free(ss_elem_node_ndx);
- free(ss_parm_ndx);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- return (EX_FATAL);
- }
- break;
- }
- case EX_EL_TETRA:
- {
- /* use table to find which node to compare to next */
-
- if (side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]+1] ==
- connect[num_nodes_per_elem*(elem_num_pos)+
- (tetra_table[0][3*n]-1)])
- side_sets_side_list[ss_elem_ndx[j]] = tetra_table[1][3*n];
- else if (side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]+1] ==
- connect[num_nodes_per_elem*(elem_num_pos)+
- (tetra_table[0][3*n+1]-1)])
- side_sets_side_list[ss_elem_ndx[j]] = tetra_table[1][3*n+1];
- else if (side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]+1] ==
- connect[num_nodes_per_elem*(elem_num_pos)+
- (tetra_table[0][3*n+2]-1)])
- side_sets_side_list[ss_elem_ndx[j]] = tetra_table[1][3*n+2];
- else
- {
- exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "Error: failed to find TETRA element %d, node %d in connectivity array %d for file id %d",
- side_sets_elem_list[ss_elem_ndx[j]],
- side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]+1],
- elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].elem_blk_id,
- exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- free(connect);
- free(ss_elem_node_ndx);
- free(ss_parm_ndx);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- return (EX_FATAL);
- }
- break;
- }
- case EX_EL_PYRAMID:
- {
- /* NOTE: PYRAMID elements in side set node lists are currently not supported */
- exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "ERROR: unsupported PYRAMID element found in side set node list in file id %d",
- exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- free(connect);
- free(ss_elem_node_ndx);
- free(ss_parm_ndx);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- return (EX_FATAL);
- }
- case EX_EL_WEDGE:
- {
-#if 1
- /* NOTE: WEDGE elements in side set node lists are currently not supported */
- exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "ERROR: unsupported WEDGE element found in side set node list in file id %d",
- exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- free(connect);
- free(ss_elem_node_ndx);
- free(ss_parm_ndx);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- return (EX_FATAL);
-
-#else
- /* use wedge_table to find which node to compare to next */
-
-/* This section is commented out because Wedges are no longer supported !!!*/
-
- if (side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]+1] ==
- connect[num_nodes_per_elem*(elem_num_pos)+
- (wedge_table[0][3*n]-1)])
- side_sets_side_list[ss_elem_ndx[j]] = wedge_table[1][3*n];
- else if (side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]+1] ==
- connect[num_nodes_per_elem*(elem_num_pos)+
- (wedge_table[0][3*n+1]-1)])
- side_sets_side_list[ss_elem_ndx[j]] = wedge_table[1][3*n+1];
- else if (side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]+1] ==
- connect[num_nodes_per_elem*(elem_num_pos)+
- (wedge_table[0][3*n+2]-1)])
- side_sets_side_list[ss_elem_ndx[j]] = wedge_table[1][3*n+2];
- else
- {
- exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "Error: failed to find WEDGE element %d, node %d in connectivity array %d for file id %d",
- side_sets_elem_list[ss_elem_ndx[j]],
- side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]+1],
- elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].elem_blk_id,
- exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- free(connect);
- free(ss_elem_node_ndx);
- free(ss_parm_ndx);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- return (EX_FATAL);
- }
- break;
-#endif
- }
- default:
- {
- exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "Error: %s is an unsupported element type",
- elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].elem_type);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- return(EX_FATAL);
- }
- }
- break; /* done with this element */
- }
- }
- if (n >= num_nodes_per_elem) /* did we find the node? */
- {
- exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "Error: failed to find element %d, node %d in element block %d for file id %d",
- side_sets_elem_list[ss_elem_ndx[j]],
- side_sets_node_list[ss_elem_node_ndx[ss_elem_ndx[j]]],
- elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].elem_blk_id,
- exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- free(connect);
- free(ss_elem_node_ndx);
- free(ss_parm_ndx);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- return (EX_FATAL);
- }
-
- }
-
- /* All done: release connectivity array space, element block ids array,
- element block parameters array, and side set element index array */
- free(connect);
- free(ss_elem_node_ndx);
- free(ss_parm_ndx);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
-
- return (EX_NOERR);
-}
-
diff --git a/exodus/cbind/src/exgblk.c b/exodus/cbind/src/exgblk.c
deleted file mode 100644
index 6fba0c3..0000000
--- a/exodus/cbind/src/exgblk.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * Copyright (c) 2006 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*!
-*
-* \undoc exgblk - read block parameters
-*
-* entry conditions -
-* input parameters:
-* int idexo exodus file id
-* int blk_type block type (edge,face,element)
-* int blk_id block id
-*
-* exit conditions -
-* char* elem_type element type name
-* int* num_entries_this_blk number of elements in this element block
-* int* num_nodes_per_entry number of nodes per element block
-* int* num_attr_per_entry number of attributes
-*
-* revision history -
-*
-*
-*/
-
-#include <string.h>
-#include <stdio.h>
-#include "exodusII.h"
-#include "exodusII_int.h"
-
-/*
- * reads the parameters used to describe an edge, face, or element block
- */
-
-int ex_get_block( int exoid,
- ex_entity_type blk_type,
- int blk_id,
- char* elem_type,
- int* num_entries_this_blk,
- int* num_nodes_per_entry,
- int* num_edges_per_entry,
- int* num_faces_per_entry,
- int* num_attr_per_entry )
-{
- int dimid, connid, blk_id_ndx;
- size_t len;
- char *ptr;
- char errmsg[MAX_ERR_LENGTH];
- int status;
- const char* dnument;
- const char* dnumnod;
- const char* dnumedg;
- const char* dnumfac;
- const char* dnumatt;
- const char* ablknam;
- const char* vblkcon;
-
- exerrval = 0;
-
- /* First, locate index of element block id in VAR_ID_EL_BLK array */
- blk_id_ndx = ex_id_lkup(exoid,blk_type,blk_id);
- if (exerrval != 0) {
- if (exerrval == EX_NULLENTITY) { /* NULL element block? */
- if ( elem_type )
- strcpy(elem_type, "NULL"); /* NULL element type name */
- *num_entries_this_blk = 0; /* no elements */
- *num_nodes_per_entry = 0; /* no nodes */
- *num_attr_per_entry = 0; /* no attributes */
- return (EX_NOERR);
- } else {
- sprintf(errmsg,
- "Error: failed to locate %s id %d in id array in file id %d",
- ex_name_of_object(blk_type), blk_id,exoid);
- ex_err("ex_get_block",errmsg,exerrval);
- return (EX_FATAL);
- }
- }
-
- switch (blk_type) {
- case EX_EDGE_BLOCK:
- dnument = DIM_NUM_ED_IN_EBLK(blk_id_ndx);
- dnumnod = DIM_NUM_NOD_PER_ED(blk_id_ndx);
- dnumedg = 0;
- dnumfac = 0;
- dnumatt = DIM_NUM_ATT_IN_EBLK(blk_id_ndx);
- vblkcon = VAR_EBCONN(blk_id_ndx);
- ablknam = ATT_NAME_ELB;
- break;
- case EX_FACE_BLOCK:
- dnument = DIM_NUM_FA_IN_FBLK(blk_id_ndx);
- dnumnod = DIM_NUM_NOD_PER_FA(blk_id_ndx);
- dnumedg = 0; /* it is possible this might be non-NULL some day */
- dnumfac = 0;
- dnumatt = DIM_NUM_ATT_IN_FBLK(blk_id_ndx);
- vblkcon = VAR_FBCONN(blk_id_ndx);
- ablknam = ATT_NAME_ELB;
- break;
- case EX_ELEM_BLOCK:
- dnument = DIM_NUM_EL_IN_BLK(blk_id_ndx);
- dnumnod = DIM_NUM_NOD_PER_EL(blk_id_ndx);
- dnumedg = DIM_NUM_EDG_PER_EL(blk_id_ndx);
- dnumfac = DIM_NUM_FAC_PER_EL(blk_id_ndx);
- dnumatt = DIM_NUM_ATT_IN_BLK(blk_id_ndx);
- vblkcon = VAR_CONN(blk_id_ndx);
- ablknam = ATT_NAME_ELB;
- break;
- default:
- exerrval = EX_BADPARAM;
- sprintf( errmsg, "Bad block type parameter (%d) specified for file id %d.",
- blk_type, exoid );
- return (EX_FATAL);
- }
-
- /* inquire values of some dimensions */
- if ( num_entries_this_blk ) {
- if ((status = nc_inq_dimid (exoid, dnument, &dimid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate number of entities in %s %d in file id %d",
- ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_block",errmsg, exerrval);
- return(EX_FATAL);
- }
-
- if ((status = nc_inq_dimlen (exoid, dimid, &len)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get number of %ss in block %d in file id %d",
- ex_name_of_object(blk_type),blk_id, exoid);
- ex_err("ex_get_block",errmsg, exerrval);
- return(EX_FATAL);
- }
- *num_entries_this_blk = len;
- }
-
- if ( num_nodes_per_entry ) {
- if ((status = nc_inq_dimid (exoid, dnumnod, &dimid)) != NC_NOERR) {
- /* undefined => no node entries per element */
- len = 0;
- } else {
- if ((status = nc_inq_dimlen (exoid, dimid, &len)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get number of nodes/entity in %s %d in file id %d",
- ex_name_of_object(blk_type),blk_id, exoid);
- ex_err("ex_get_block",errmsg, exerrval);
- return(EX_FATAL);
- }
- }
- *num_nodes_per_entry = len;
- }
-
- if ( num_edges_per_entry ) {
- if ( blk_type != EX_ELEM_BLOCK ) {
- exerrval = (EX_WARN);
- sprintf(errmsg,
- "Warning: non-NULL pointer passed to num_edges_per_entry for %s query in file id %d",
- ex_name_of_object(blk_type),exoid);
- ex_err("ex_get_block",errmsg,exerrval);
- } else {
- if ((status = nc_inq_dimid (exoid, dnumedg, &dimid)) != NC_NOERR) {
- /* undefined => no edge entries per element */
- len = 0;
- } else {
- if ((status = nc_inq_dimlen (exoid, dimid, &len)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get number of edges/entry in %s %d in file id %d",
- ex_name_of_object(blk_type),blk_id, exoid);
- ex_err("ex_get_block",errmsg, exerrval);
- return(EX_FATAL);
- }
- }
- *num_edges_per_entry = len;
- }
- }
-
- if ( num_faces_per_entry ) {
- if ( blk_type != EX_ELEM_BLOCK ) {
- exerrval = (EX_WARN);
- sprintf(errmsg,
- "Warning: non-NULL pointer passed to num_faces_per_entry for %s query in file id %d",
- ex_name_of_object(blk_type),exoid);
- ex_err("ex_get_block",errmsg,exerrval);
- } else {
- if ((status = nc_inq_dimid (exoid, dnumfac, &dimid)) != NC_NOERR) {
- /* undefined => no face entries per element */
- len = 0;
- } else {
- if ((status = nc_inq_dimlen(exoid, dimid, &len)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get number of faces/entity in %s %d in file id %d",
- ex_name_of_object(blk_type),blk_id, exoid);
- ex_err("ex_get_block",errmsg, exerrval);
- return(EX_FATAL);
- }
- }
- *num_faces_per_entry = len;
- }
- }
-
- if ( num_attr_per_entry ) {
- if ((status = nc_inq_dimid (exoid, dnumatt, &dimid)) != NC_NOERR) {
- /* dimension is undefined */
- *num_attr_per_entry = 0;
- } else {
- if ((status = nc_inq_dimlen(exoid, dimid, &len)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get number of attributes in %s %d in file id %d",
- ex_name_of_object(blk_type),blk_id, exoid);
- ex_err("ex_get_block",errmsg, exerrval);
- return(EX_FATAL);
- }
- *num_attr_per_entry = len;
- }
- }
-
- if ( elem_type ) {
- if (*num_nodes_per_entry > 0) {
- ; /* Do nothing, vblkcon should be correctly set already */
- } else if (*num_edges_per_entry > 0) {
- vblkcon = VAR_EBCONN(blk_id_ndx);
- } else if (*num_faces_per_entry > 0) {
- vblkcon = VAR_FCONN(blk_id_ndx);
- }
-
- if (vblkcon) {
- /* look up connectivity array for this element block id */
- if ((status = nc_inq_varid (exoid, vblkcon, &connid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate connectivity array for %s %d in file id %d",
- ex_name_of_object(blk_type), blk_id,exoid);
- ex_err("ex_get_block",errmsg, exerrval);
- return(EX_FATAL);
- }
-
- if ((status = nc_inq_attlen (exoid, connid, ablknam, &len)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get %s %d type in file id %d",
- ex_name_of_object(blk_type), blk_id,exoid);
- ex_err("ex_get_block",errmsg, exerrval);
- return(EX_FATAL);
- }
-
- if (len > (MAX_STR_LENGTH+1)) {
- len = MAX_STR_LENGTH;
- sprintf (errmsg,
- "Warning: %s %d type will be truncated to %ld chars",
- ex_name_of_object(blk_type), blk_id, (long)len);
- ex_err("ex_get_block",errmsg,EX_MSG);
- }
-
- /* get the element type name */
- if ((status = nc_get_att_text (exoid, connid, ablknam, elem_type)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,"Error: failed to get %s %d type in file id %d",
- ex_name_of_object(blk_type), blk_id, exoid);
- ex_err("ex_get_block",errmsg, exerrval);
- return(EX_FATAL);
- }
-
- /* get rid of trailing blanks */
- ptr = elem_type;
- /* fprintf(stderr,"[exgblk] %s, len: %d\n",ptr,len); */
- while (ptr < elem_type + len && *ptr != ' ') {
- ptr++;
- }
- *(ptr) = '\0';
- }
- }
- return (EX_NOERR);
-}
diff --git a/exodus/cbind/src/exgconn.c b/exodus/cbind/src/exgconn.c
deleted file mode 100644
index 3f4f3a3..0000000
--- a/exodus/cbind/src/exgconn.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * Copyright (c) 2006 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*!
-*
-* \undoc exgconn - exodusII read edge/face/element block connectivity
-*
-* entry conditions -
-* expelb must be called first to establish element block parameters.
-* input parameters:
-* int exoid exodus file id
-* int blk_type block type (edge, face, element)
-* int blk_id block id
-*
-* exit conditions -
-* int* nodeconn nodal connectivity array
-* int* edgeconn edge connectivity array (where applicable)
-* int* faceconn face connectivity array (where applicable)
-*
-*
-*/
-#include <stdlib.h>
-#include "exodusII.h"
-#include "exodusII_int.h"
-
-int ex_get_conn( int exoid,
- ex_entity_type blk_type,
- int blk_id,
- int* nodeconn,
- int* edgeconn,
- int* faceconn )
-{
- int connid, econnid, fconnid, blk_id_ndx, status;
- int numnodperentdim, numedgperentdim, numfacperentdim;
- int iexit = (EX_NOERR); /* exit status */
- size_t num_nodes_per_entry, num_edges_per_entry, num_faces_per_entry;
- char errmsg[MAX_ERR_LENGTH];
-
- const char* dnumnodent;
- const char* dnumedgent;
- const char* dnumfacent;
- const char* vnodeconn;
- const char* vedgeconn;
- const char* vfaceconn;
-
- /* Should we warn if edgeconn or faceconn are non-NULL?
- * No, fail silently so the same code can be used to read any type of block info.
- * However, we will warn if edgeconn or faceconn are NULL but num_edges_per_entry
- * or num_faces_per_entry (respectively) are positive.
- */
- exerrval = 0; /* clear error code */
-
- /* Locate index of element block id in VAR_ID_EL_BLK array */
-
- blk_id_ndx = ex_id_lkup(exoid,blk_type,blk_id);
- if (exerrval != 0)
- {
- if (exerrval == EX_NULLENTITY)
- {
- sprintf(errmsg,
- "Warning: no connectivity array for NULL %s %d in file id %d",
- ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_conn",errmsg,EX_MSG);
- return (EX_WARN); /* no connectivity array for this element block */
- }
- else
- {
- sprintf(errmsg,
- "Error: failed to locate %s id %d in id array in file id %d",
- ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_conn",errmsg,exerrval);
- return (EX_FATAL);
- }
- }
-
- switch (blk_type) {
- case EX_EDGE_BLOCK:
- dnumnodent = DIM_NUM_NOD_PER_ED(blk_id_ndx);
- dnumedgent = 0;
- dnumfacent = 0;
- vnodeconn = VAR_EBCONN(blk_id_ndx);
- vedgeconn = 0;
- vfaceconn = 0;
- break;
- case EX_FACE_BLOCK:
- dnumnodent = DIM_NUM_NOD_PER_FA(blk_id_ndx);
- dnumedgent = 0;
- dnumfacent = 0;
- vnodeconn = VAR_FBCONN(blk_id_ndx);
- vedgeconn = 0;
- vfaceconn = 0;
- break;
- case EX_ELEM_BLOCK:
- dnumnodent = DIM_NUM_NOD_PER_EL(blk_id_ndx);
- dnumedgent = DIM_NUM_EDG_PER_EL(blk_id_ndx);
- dnumfacent = DIM_NUM_FAC_PER_EL(blk_id_ndx);
- vnodeconn = VAR_CONN(blk_id_ndx);
- vedgeconn = VAR_ECONN(blk_id_ndx);
- vfaceconn = VAR_FCONN(blk_id_ndx);
- break;
- default:
- exerrval = 1005;
- sprintf(errmsg,
- "Internal Error: unrecognized block type in switch: %d in file id %d",
- blk_type,exoid);
- ex_err("ex_get_conn",errmsg,EX_MSG);
- return (EX_FATAL); /* number of attributes not defined */
- }
-/* inquire id's of previously defined dimensions */
-
- num_nodes_per_entry = 0;
- if ((status = nc_inq_dimid (exoid, dnumnodent, &numnodperentdim)) != NC_NOERR) {
- numnodperentdim = -1;
- } else {
- if ((status = nc_inq_dimlen(exoid, numnodperentdim, &num_nodes_per_entry)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get number of nodes/entity for %s %d in file id %d",
- ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_conn",errmsg, exerrval);
- return(EX_FATAL);
- }
- }
-
- if ( dnumedgent ) {
- num_edges_per_entry = 0;
- if ((status = nc_inq_dimid(exoid, dnumedgent, &numedgperentdim)) != NC_NOERR) {
- numedgperentdim = -1;
- } else {
- if ((status = nc_inq_dimlen(exoid, numedgperentdim, &num_edges_per_entry)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get number of edges/entry for %s %d in file id %d",
- ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_conn",errmsg, exerrval);
- return(EX_FATAL);
- }
- }
- }
-
- if ( dnumfacent ) {
- num_faces_per_entry = 0;
- if ((status = nc_inq_dimid(exoid, dnumfacent, &numfacperentdim)) != NC_NOERR) {
- numfacperentdim = -1;
- } else {
- if ((status = nc_inq_dimlen(exoid, numfacperentdim, &num_faces_per_entry)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get number of faces/entry for %s %d in file id %d",
- ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_conn",errmsg, exerrval);
- return(EX_FATAL);
- }
- }
- }
-
-
- status = 0;
- if (nodeconn && (numnodperentdim >= 0) &&
- ((status = nc_inq_varid(exoid, vnodeconn, &connid)) != NC_NOERR))
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate node connectivity array for %s %d in file id %d",
- ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_conn",errmsg, exerrval);
- return(EX_FATAL);
- }
-
- status = 0;
- if (edgeconn && (numedgperentdim >= 0) &&
- ((status = nc_inq_varid (exoid, vedgeconn, &econnid)) != NC_NOERR))
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate edge connectivity array for %s %d in file id %d",
- ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_conn",errmsg, exerrval);
- return(EX_FATAL);
- }
-
- if (faceconn && (numfacperentdim >= 0) &&
- ((status = nc_inq_varid (exoid, vfaceconn, &fconnid)) != NC_NOERR))
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate face connectivity array for %s %d in file id %d",
- ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_conn",errmsg, exerrval);
- return(EX_FATAL);
- }
-
-
- /* read in the connectivity array */
- if ( edgeconn && num_edges_per_entry > 0) {
- status = nc_get_var_int(exoid, econnid, edgeconn);
-
- if (status != NC_NOERR)
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get edge connectivity array for %s %d in file id %d",
- ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_conn",errmsg, exerrval);
- return(EX_FATAL);
- }
- }
-
- if ( faceconn && num_faces_per_entry > 0) {
- status = nc_get_var_int(exoid, fconnid, faceconn);
-
- if (status != NC_NOERR)
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get face connectivity array for %s %d in file id %d",
- ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_conn",errmsg, exerrval);
- return(EX_FATAL);
- }
- }
-
- if ( nodeconn && num_nodes_per_entry > 0) {
- status = nc_get_var_int(exoid, connid, nodeconn);
-
- if (status != NC_NOERR)
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get node connectivity array for %s %d in file id %d",
- ex_name_of_object(blk_type),blk_id,exoid);
- ex_err("ex_get_conn",errmsg, exerrval);
- return(EX_FATAL);
- }
- }
-
- return iexit;
-}
diff --git a/exodus/cbind/src/exgnnv.c b/exodus/cbind/src/exgnnv.c
deleted file mode 100644
index 8ef5d03..0000000
--- a/exodus/cbind/src/exgnnv.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*****************************************************************************
-*
-* exgnv - ex_get_n_nodal_var
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-* int time_step whole time step number
-* int nodal_var_index index of desired nodal variable
-* int start_node index (1-based) of first node to get
-* int num_nodes number of nodal points
-*
-* exit conditions -
-* float* nodal_var_vals array of nodal variable values
-*
-* revision history -
-*
-*
-*****************************************************************************/
-
-#include "exodusII.h"
-#include "exodusII_int.h"
-
-/*!
- * reads the values of a single nodal variable for a partial block at one time
- * step from the database; assume the first time step and variable index
- * and start_node are 1
- * \param exoid exodus file id
- * \param time_step time step number
- * \param nodal_var_index index of desired nodal variable (1-based)
- * \param start_node index of first node to read (1-based)
- * \param num_nodes number of nodes to read
- * \param var_vals the values to be read
- */
-
-int ex_get_n_nodal_var (int exoid,
- int time_step,
- int nodal_var_index,
- int start_node,
- int num_nodes,
- void *var_vals)
-{
- int varid;
- int status;
- size_t start[3], count[3];
- char errmsg[MAX_ERR_LENGTH];
-
- exerrval = 0; /* clear error code */
-
- /* inquire previously defined variable */
-
- if (ex_large_model(exoid) == 0) {
- /* read values of the nodal variable */
- if ((status = nc_inq_varid(exoid, VAR_NOD_VAR, &varid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Warning: could not find nodal variables in file id %d",
- exoid);
- ex_err("ex_get_n_nodal_var",errmsg,exerrval);
- return (EX_WARN);
- }
-
- start[0] = --time_step;
- start[1] = --nodal_var_index;
- start[2] = --start_node;
-
- count[0] = 1;
- count[1] = 1;
- count[2] = num_nodes;
-
- } else {
- /* read values of the nodal variable -- stored as separate variables... */
- /* Get the varid.... */
- if ((status = nc_inq_varid(exoid, VAR_NOD_VAR_NEW(nodal_var_index), &varid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Warning: could not find nodal variable %d in file id %d",
- nodal_var_index, exoid);
- ex_err("ex_get_n_nodal_var",errmsg,exerrval);
- return (EX_WARN);
- }
-
- start[0] = --time_step;
- start[1] = --start_node;
-
- count[0] = 1;
- count[1] = num_nodes;
- }
-
- if (ex_comp_ws(exoid) == 4) {
- status = nc_get_vara_float(exoid, varid, start, count, var_vals);
- } else {
- status = nc_get_vara_double(exoid, varid, start, count, var_vals);
- }
-
- if (status != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get nodal variables in file id %d",
- exoid);
- ex_err("ex_get_n_nodal_var",errmsg,exerrval);
- return (EX_FATAL);
- }
- return (EX_NOERR);
-}
diff --git a/exodus/cbind/src/exgnvid.c b/exodus/cbind/src/exgnvid.c
deleted file mode 100644
index 900c3a8..0000000
--- a/exodus/cbind/src/exgnvid.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*****************************************************************************
-*
-* exgnvid - ex_get_nodal_varid
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-*
-* exit conditions -
-* int* varid array of nodal variable varids
-*
-* revision history -
-*
-*
-*****************************************************************************/
-
-#include <stdlib.h>
-#include "exodusII.h"
-#include "exodusII_int.h"
-
-/*
- * returns the varids for the nodal variables.
- */
-
-int ex_get_nodal_varid(int exoid, int *varid)
-{
- int status;
- int dimid, nvarid;
- size_t num_vars, i;
- char errmsg[MAX_ERR_LENGTH];
-
- exerrval = 0; /* clear error code */
-
- if ((status = nc_inq_dimid(exoid, DIM_NUM_NOD_VAR, &dimid)) != NC_NOERR) {
- num_vars = 0;
- if (status == NC_EBADDIM)
- return(EX_NOERR); /* no nodal variables defined */
- else
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate nodal variable names in file id %d",
- exoid);
- ex_err("ex_get_nodal_varid",errmsg,exerrval);
- return (EX_FATAL);
- }
- }
-
- if ((status = nc_inq_dimlen(exoid, dimid, &num_vars)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get number of nodal variables in file id %d",
- exoid);
- ex_err("ex_get_nodal_varid",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- if (ex_large_model(exoid) == 0) {
- /* All varids are the same; */
- if ((status = nc_inq_varid(exoid, VAR_NOD_VAR, &nvarid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Warning: could not find nodal variables in file id %d",
- exoid);
- ex_err("ex_get_nodal_varid",errmsg,exerrval);
- return (EX_WARN);
- }
-
- for (i=0; i < num_vars; i++) {
- varid[i] = nvarid;
- }
-
- } else {
- /* Variables stored separately; each has a unique varid */
- for (i=0; i < num_vars; i++) {
- if ((status = nc_inq_varid(exoid, VAR_NOD_VAR_NEW(i+1), &nvarid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Warning: could not find nodal variable %d in file id %d",
- (int)i+1, exoid);
- ex_err("ex_get_nodal_varid",errmsg,exerrval);
- return (EX_WARN);
- }
- varid[i] = nvarid;
- }
- }
- return(EX_NOERR);
-}
diff --git a/exodus/cbind/src/exgnvv.c b/exodus/cbind/src/exgnvv.c
deleted file mode 100644
index 3877258..0000000
--- a/exodus/cbind/src/exgnvv.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*****************************************************************************
-*
-* exgnv - ex_get_nodal_varid_var
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-* int time_step whole time step number
-* int nodal_var_index index of desired nodal variable
-* int num_nodes number of nodal points
-* int varid id of variable on exodus database
-*
-* exit conditions -
-* float* nodal_var_vals array of nodal variable values
-*
-* revision history -
-*
-*
-*****************************************************************************/
-
-#include "exodusII.h"
-#include "exodusII_int.h"
-
-/*
- * reads the values of a single nodal variable for a single time step from
- * the database; assume the first time step and nodal variable index is 1
- */
-
-int ex_get_nodal_varid_var(int exoid,
- int time_step,
- int nodal_var_index,
- int num_nodes,
- int varid,
- void *nodal_var_vals)
-{
- int status;
- size_t start[3], count[3];
- char errmsg[MAX_ERR_LENGTH];
-
- exerrval = 0; /* clear error code */
-
- /* inquire previously defined variable */
-
- if (ex_large_model(exoid) == 0) {
- start[0] = --time_step;
- start[1] = --nodal_var_index;
- start[2] = 0;
-
- count[0] = 1;
- count[1] = 1;
- count[2] = num_nodes;
- } else {
-
- start[0] = --time_step;
- start[1] = 0;
-
- count[0] = 1;
- count[1] = num_nodes;
- }
-
- if (ex_comp_ws(exoid) == 4) {
- status = nc_get_vara_float(exoid, varid, start, count, nodal_var_vals);
- } else {
- status = nc_get_vara_double(exoid, varid, start, count, nodal_var_vals);
- }
-
- if (status != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get nodal variables in file id %d",
- exoid);
- ex_err("ex_get_nodal_varid_var",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- return (EX_NOERR);
-}
diff --git a/exodus/cbind/src/exgssc.c b/exodus/cbind/src/exgssc.c
deleted file mode 100644
index 0f586e5..0000000
--- a/exodus/cbind/src/exgssc.c
+++ /dev/null
@@ -1,607 +0,0 @@
-/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*****************************************************************************
-*
-* exgssc - ex_get_side_set_node_count
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-* int side_set_id side set id
-*
-* exit conditions -
-* int *side_set_node_cnt_list returned array of number of nodes for
-* side or face
-* revision history -
-*
-*****************************************************************************/
-
-#include <ctype.h>
-#include <string.h>
-#include <stdlib.h>
-#include <assert.h>
-#include "exodusII.h"
-#include "exodusII_int.h"
-
-/* Generic error message for element type/node count mapping...*/
-static int el_node_count_error(struct elem_blk_parm elem_blk_parms)
-{
- char errmsg[MAX_ERR_LENGTH];
- sprintf(errmsg,
- "Error: An element of type '%s' with %d nodes is not valid.",
- elem_blk_parms.elem_type,
- elem_blk_parms.num_nodes_per_elem);
- ex_err("ex_get_side_set_node_count",errmsg,EX_MSG);
- return(EX_FATAL);
-}
-
-int ex_get_side_set_node_count(int exoid,
- int side_set_id,
- int *side_set_node_cnt_list)
-{
- size_t m;
- int ii, i, j;
- int num_side_sets, num_elem_blks, num_df, ndim;
- int tot_num_elem = 0, tot_num_ss_elem = 0, side, elem;
- int *elem_blk_ids;
- int *ss_elem_ndx;
- int *side_set_elem_list, *side_set_side_list;
- int elem_ctr;
- int num_elem_in_blk, num_nodes_per_elem, num_attr;
- float fdum;
- char *cdum, elem_type[MAX_STR_LENGTH+1];
-
- struct elem_blk_parm *elem_blk_parms;
-
- char errmsg[MAX_ERR_LENGTH];
-
- exerrval = 0; /* clear error code */
-
- cdum = 0; /* initialize even though it is not used */
-
- /* first check if any side sets are specified */
- /* inquire how many side sets have been stored */
- if ((ex_inquire(exoid, EX_INQ_SIDE_SETS, &num_side_sets, &fdum, cdum)) == -1)
- {
- sprintf(errmsg,
- "Error: failed to get number of side sets in file id %d",exoid);
- ex_err("ex_get_side_set_node_count",errmsg,exerrval);
- return(EX_FATAL);
- }
-
- if (num_side_sets == 0)
- {
- sprintf(errmsg,
- "Warning: no side sets defined in file id %d",exoid);
- ex_err("ex_get_side_set_node_count",errmsg,EX_WARN);
- return(EX_WARN);
- }
-
- /* Lookup index of side set id in VAR_SS_IDS array */
- ex_id_lkup(exoid,EX_SIDE_SET,side_set_id);
- if (exerrval != 0)
- {
- if (exerrval == EX_NULLENTITY)
- {
- sprintf(errmsg,
- "Warning: side set %d is NULL in file id %d",
- side_set_id,exoid);
- ex_err("ex_get_side_set_node_count",errmsg,EX_MSG);
- return (EX_WARN);
- }
- else
- {
-
- sprintf(errmsg,
- "Error: failed to locate side set id %d in VAR_SS_IDS array in file id %d",
- side_set_id,exoid);
- ex_err("ex_get_side_set_node_count",errmsg,exerrval);
- return (EX_FATAL);
- }
- }
-
- if ((ex_inquire(exoid, EX_INQ_ELEM_BLK, &num_elem_blks, &fdum, cdum)) == -1)
- {
- sprintf(errmsg,
- "Error: failed to get number of element blocks in file id %d",exoid);
- ex_err("ex_get_side_set_node_count",errmsg,exerrval);
- return(EX_FATAL);
- }
-
- if ((ex_inquire(exoid, EX_INQ_ELEM, &tot_num_elem, &fdum, cdum)) == -1)
- {
- sprintf(errmsg,
- "Error: failed to get total number of elements in file id %d",exoid);
- ex_err("ex_get_side_set_node_count",errmsg,exerrval);
- return(EX_FATAL);
- }
-
- /* get the dimensionality of the coordinates; this is necessary to
- distinguish between 2d TRIs and 3d TRIs */
- if ((ex_inquire(exoid, EX_INQ_DIM, &ndim, &fdum, cdum)) == -1)
- {
- sprintf(errmsg,
- "Error: failed to get dimensionality in file id %d",exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- return(EX_FATAL);
- }
-
- /* First determine the # of elements in the side set*/
- if ((ex_get_side_set_param(exoid,side_set_id,&tot_num_ss_elem,&num_df)) == -1)
- {
- sprintf(errmsg,
- "Error: failed to get number of elements in side set %d in file id %d",
- side_set_id, exoid);
- ex_err("ex_get_side_set_node_count",errmsg,exerrval);
- return(EX_FATAL);
- }
-
- /* Allocate space for the side set element list */
- if (!(side_set_elem_list=malloc(tot_num_ss_elem*sizeof(int))))
- {
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for side set element list for file id %d",
- exoid);
- ex_err("ex_get_side_set_node_count",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* Allocate space for the side set side list */
- if (!(side_set_side_list=malloc(tot_num_ss_elem*sizeof(int))))
- {
- free(side_set_elem_list);
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for side set side list for file id %d",
- exoid);
- ex_err("ex_get_side_set_node_count",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- if (ex_get_side_set(exoid, side_set_id,
- side_set_elem_list, side_set_side_list) == -1)
- {
- free(side_set_elem_list);
- free(side_set_side_list);
- sprintf(errmsg,
- "Error: failed to get side set %d in file id %d",
- side_set_id, exoid);
- ex_err("ex_get_side_set_node_count",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* Allocate space for the ss element index array */
- if (!(ss_elem_ndx=malloc(tot_num_ss_elem*sizeof(int))))
- {
- free(side_set_elem_list);
- free(side_set_side_list);
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for side set elem sort array for file id %d",
- exoid);
- ex_err("ex_get_side_set_node_count",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* Sort side set element list into index array - non-destructive */
- for (i=0;i<tot_num_ss_elem;i++) {
- ss_elem_ndx[i] = i; /* init index array to current position */
- }
- ex_iqsort(side_set_elem_list, ss_elem_ndx,tot_num_ss_elem);
-
-
- /* Allocate space for the element block ids */
- if (!(elem_blk_ids=malloc(num_elem_blks*sizeof(int))))
- {
- exerrval = EX_MEMFAIL;
- free(ss_elem_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- sprintf(errmsg,
- "Error: failed to allocate space for element block ids for file id %d",
- exoid);
- ex_err("ex_get_side_set_node_count",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- if (ex_get_elem_blk_ids(exoid, elem_blk_ids) == -1)
- {
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- sprintf(errmsg,
- "Error: failed to get element block ids in file id %d",
- exoid);
- ex_err("ex_get_side_set_node_count",errmsg,EX_MSG);
- return(EX_FATAL);
- }
-
- /* Allocate space for the element block params */
- if (!(elem_blk_parms=malloc(num_elem_blks*sizeof(struct elem_blk_parm))))
- {
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for element block params for file id %d",
- exoid);
- ex_err("ex_get_side_set_node_count",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- elem_ctr = 0;
- for (i=0; i<num_elem_blks; i++)
- {
- /* read in an element block parameter */
- if ((ex_get_elem_block (exoid, elem_blk_ids[i], elem_type, &num_elem_in_blk,
- &num_nodes_per_elem, &num_attr)) == -1) {
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- sprintf(errmsg,
- "Error: failed to get element block %d parameters in file id %d",
- elem_blk_ids[i], exoid);
- ex_err("ex_get_side_set_node_count",errmsg,EX_MSG);
- return(EX_FATAL);
- }
-
- elem_blk_parms[i].num_elem_in_blk = num_elem_in_blk;
- elem_blk_parms[i].num_nodes_per_elem = num_nodes_per_elem;
- elem_blk_parms[i].num_attr = num_attr;
-
- for (m=0; m < strlen(elem_type); m++) {
- elem_blk_parms[i].elem_type[m] = toupper(elem_type[m]);
- }
- elem_blk_parms[i].elem_type[m] = '\0';
-
- if (strncmp(elem_blk_parms[i].elem_type,"CIRCLE",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_CIRCLE;
- elem_blk_parms[i].num_sides = 1;
- elem_blk_parms[i].num_nodes_per_side[0] = 1;
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"SPHERE",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_SPHERE;
- elem_blk_parms[i].num_sides = 1;
- elem_blk_parms[i].num_nodes_per_side[0] = 1;
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"QUAD",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_QUAD;
- elem_blk_parms[i].num_sides = 4;
- if (elem_blk_parms[i].num_nodes_per_elem == 4) {
- elem_blk_parms[i].num_nodes_per_side[0] = 2;
- elem_blk_parms[i].num_nodes_per_side[1] = 2;
- elem_blk_parms[i].num_nodes_per_side[2] = 2;
- elem_blk_parms[i].num_nodes_per_side[3] = 2;
- } else if (elem_blk_parms[i].num_nodes_per_elem == 5) {
- elem_blk_parms[i].num_nodes_per_side[0] = 2;
- elem_blk_parms[i].num_nodes_per_side[1] = 2;
- elem_blk_parms[i].num_nodes_per_side[2] = 2;
- elem_blk_parms[i].num_nodes_per_side[3] = 2;
- } else if (elem_blk_parms[i].num_nodes_per_elem == 9 ||
- elem_blk_parms[i].num_nodes_per_elem == 8) {
- elem_blk_parms[i].num_nodes_per_side[0] = 3;
- elem_blk_parms[i].num_nodes_per_side[1] = 3;
- elem_blk_parms[i].num_nodes_per_side[2] = 3;
- elem_blk_parms[i].num_nodes_per_side[3] = 3;
- } else {
- return el_node_count_error(elem_blk_parms[i]);
- }
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"TRIANGLE",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_TRIANGLE;
- if (ndim == 2) { /* 2d TRIs */
- elem_blk_parms[i].num_sides = 3;
- if (elem_blk_parms[i].num_nodes_per_elem == 3) {
- elem_blk_parms[i].num_nodes_per_side[0] = 2;
- elem_blk_parms[i].num_nodes_per_side[1] = 2;
- elem_blk_parms[i].num_nodes_per_side[2] = 2;
- } else if (elem_blk_parms[i].num_nodes_per_elem == 6) {
- elem_blk_parms[i].num_nodes_per_side[0] = 3;
- elem_blk_parms[i].num_nodes_per_side[1] = 3;
- elem_blk_parms[i].num_nodes_per_side[2] = 3;
- }
- } else if (ndim == 3) { /* 3d TRIs -- triangular shell*/
- elem_blk_parms[i].num_sides = 5; /* 2 Faces and 3 Edges */
- if (elem_blk_parms[i].num_nodes_per_elem == 3) {
- elem_blk_parms[i].num_nodes_per_side[0] = 3;
- elem_blk_parms[i].num_nodes_per_side[1] = 3;
- elem_blk_parms[i].num_nodes_per_side[2] = 2;
- elem_blk_parms[i].num_nodes_per_side[3] = 2;
- elem_blk_parms[i].num_nodes_per_side[4] = 2;
- } else if (elem_blk_parms[i].num_nodes_per_elem == 6) {
- elem_blk_parms[i].num_nodes_per_side[0] = 6;
- elem_blk_parms[i].num_nodes_per_side[1] = 6;
- elem_blk_parms[i].num_nodes_per_side[2] = 3;
- elem_blk_parms[i].num_nodes_per_side[3] = 3;
- elem_blk_parms[i].num_nodes_per_side[4] = 3;
- } else {
- return el_node_count_error(elem_blk_parms[i]);
- }
- }
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"SHELL",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_SHELL;
-
- if (elem_blk_parms[i].num_nodes_per_elem == 2) {/* KLUDGE for 2D Shells*/
- elem_blk_parms[i].num_sides = 2;
- elem_blk_parms[i].num_nodes_per_side[0] = 2;
- elem_blk_parms[i].num_nodes_per_side[1] = 2;
- } else if (elem_blk_parms[i].num_nodes_per_elem == 4) {
- elem_blk_parms[i].num_sides = 6; /* 2 Faces, 4 Edges */
- elem_blk_parms[i].num_nodes_per_side[0] = 4;
- elem_blk_parms[i].num_nodes_per_side[1] = 4;
- elem_blk_parms[i].num_nodes_per_side[2] = 2;
- elem_blk_parms[i].num_nodes_per_side[3] = 2;
- elem_blk_parms[i].num_nodes_per_side[4] = 2;
- elem_blk_parms[i].num_nodes_per_side[5] = 2;
- } else if (elem_blk_parms[i].num_nodes_per_elem == 8 ||
- elem_blk_parms[i].num_nodes_per_elem == 9) {
- elem_blk_parms[i].num_sides = 6; /* 2 Faces, 4 Edges */
- elem_blk_parms[i].num_nodes_per_side[0] =
- elem_blk_parms[i].num_nodes_per_elem; /* 8 or 9 */
- elem_blk_parms[i].num_nodes_per_side[1] =
- elem_blk_parms[i].num_nodes_per_elem; /* 8 or 9 */
- elem_blk_parms[i].num_nodes_per_side[2] = 3;
- elem_blk_parms[i].num_nodes_per_side[3] = 3;
- elem_blk_parms[i].num_nodes_per_side[4] = 3;
- elem_blk_parms[i].num_nodes_per_side[5] = 3;
- } else {
- return el_node_count_error(elem_blk_parms[i]);
- }
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"HEX",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_HEX;
- elem_blk_parms[i].num_sides = 6;
- /* determine side set node stride */
- if (elem_blk_parms[i].num_nodes_per_elem == 8) { /* 8-node bricks */
- elem_blk_parms[i].num_nodes_per_side[0] = 4;
- elem_blk_parms[i].num_nodes_per_side[1] = 4;
- elem_blk_parms[i].num_nodes_per_side[2] = 4;
- elem_blk_parms[i].num_nodes_per_side[3] = 4;
- elem_blk_parms[i].num_nodes_per_side[4] = 4;
- elem_blk_parms[i].num_nodes_per_side[5] = 4;
- } else if (elem_blk_parms[i].num_nodes_per_elem == 9) { /* 9-node bricks */
- elem_blk_parms[i].num_nodes_per_side[0] = 4;
- elem_blk_parms[i].num_nodes_per_side[1] = 4;
- elem_blk_parms[i].num_nodes_per_side[2] = 4;
- elem_blk_parms[i].num_nodes_per_side[3] = 4;
- elem_blk_parms[i].num_nodes_per_side[4] = 4;
- elem_blk_parms[i].num_nodes_per_side[5] = 4;
- } else if (elem_blk_parms[i].num_nodes_per_elem == 12) { /* HEXSHELLS */
- elem_blk_parms[i].num_nodes_per_side[0] = 6;
- elem_blk_parms[i].num_nodes_per_side[1] = 6;
- elem_blk_parms[i].num_nodes_per_side[2] = 6;
- elem_blk_parms[i].num_nodes_per_side[3] = 6;
- elem_blk_parms[i].num_nodes_per_side[4] = 4;
- elem_blk_parms[i].num_nodes_per_side[5] = 4;
- } else if (elem_blk_parms[i].num_nodes_per_elem == 20) { /* 20-node bricks */
- elem_blk_parms[i].num_nodes_per_side[0] = 8;
- elem_blk_parms[i].num_nodes_per_side[1] = 8;
- elem_blk_parms[i].num_nodes_per_side[2] = 8;
- elem_blk_parms[i].num_nodes_per_side[3] = 8;
- elem_blk_parms[i].num_nodes_per_side[4] = 8;
- elem_blk_parms[i].num_nodes_per_side[5] = 8;
- } else if (elem_blk_parms[i].num_nodes_per_elem == 27) { /* 27-node bricks */
- elem_blk_parms[i].num_nodes_per_side[0] = 9;
- elem_blk_parms[i].num_nodes_per_side[1] = 9;
- elem_blk_parms[i].num_nodes_per_side[2] = 9;
- elem_blk_parms[i].num_nodes_per_side[3] = 9;
- elem_blk_parms[i].num_nodes_per_side[4] = 9;
- elem_blk_parms[i].num_nodes_per_side[5] = 9;
- } else {
- return el_node_count_error(elem_blk_parms[i]);
- }
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"TETRA",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_TETRA;
- elem_blk_parms[i].num_sides = 4;
- /* determine side set node stride */
- if (elem_blk_parms[i].num_nodes_per_elem == 4) {
- elem_blk_parms[i].num_nodes_per_side[0] = 3;
- elem_blk_parms[i].num_nodes_per_side[1] = 3;
- elem_blk_parms[i].num_nodes_per_side[2] = 3;
- elem_blk_parms[i].num_nodes_per_side[3] = 3;
- } else if (elem_blk_parms[i].num_nodes_per_elem == 8) {
- elem_blk_parms[i].num_nodes_per_side[0] = 4;
- elem_blk_parms[i].num_nodes_per_side[1] = 4;
- elem_blk_parms[i].num_nodes_per_side[2] = 4;
- elem_blk_parms[i].num_nodes_per_side[3] = 4;
- } else if (elem_blk_parms[i].num_nodes_per_elem == 10) {
- elem_blk_parms[i].num_nodes_per_side[0] = 6;
- elem_blk_parms[i].num_nodes_per_side[1] = 6;
- elem_blk_parms[i].num_nodes_per_side[2] = 6;
- elem_blk_parms[i].num_nodes_per_side[3] = 6;
- } else {
- return el_node_count_error(elem_blk_parms[i]);
- }
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"WEDGE",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_WEDGE;
- elem_blk_parms[i].num_sides = 5;
- if (elem_blk_parms[i].num_nodes_per_elem == 6) {
- elem_blk_parms[i].num_nodes_per_side[0] = 4;
- elem_blk_parms[i].num_nodes_per_side[1] = 4;
- elem_blk_parms[i].num_nodes_per_side[2] = 4;
- elem_blk_parms[i].num_nodes_per_side[3] = 3;
- elem_blk_parms[i].num_nodes_per_side[4] = 3;
- } else if (elem_blk_parms[i].num_nodes_per_elem == 15){
- elem_blk_parms[i].num_nodes_per_side[0] = 8;
- elem_blk_parms[i].num_nodes_per_side[1] = 8;
- elem_blk_parms[i].num_nodes_per_side[2] = 8;
- elem_blk_parms[i].num_nodes_per_side[3] = 6;
- elem_blk_parms[i].num_nodes_per_side[4] = 6;
- } else {
- return el_node_count_error(elem_blk_parms[i]);
- }
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"PYRAMID",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_PYRAMID;
- elem_blk_parms[i].num_sides = 5;
- if (elem_blk_parms[i].num_nodes_per_elem == 5) {
- elem_blk_parms[i].num_nodes_per_side[0] = 3;
- elem_blk_parms[i].num_nodes_per_side[1] = 3;
- elem_blk_parms[i].num_nodes_per_side[2] = 3;
- elem_blk_parms[i].num_nodes_per_side[3] = 3;
- elem_blk_parms[i].num_nodes_per_side[4] = 4;
- } else if (elem_blk_parms[i].num_nodes_per_elem == 13){
- elem_blk_parms[i].num_nodes_per_side[0] = 6;
- elem_blk_parms[i].num_nodes_per_side[1] = 6;
- elem_blk_parms[i].num_nodes_per_side[2] = 6;
- elem_blk_parms[i].num_nodes_per_side[3] = 6;
- elem_blk_parms[i].num_nodes_per_side[4] = 8;
- } else {
- return el_node_count_error(elem_blk_parms[i]);
- }
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"BEAM",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_BEAM;
- elem_blk_parms[i].num_sides = 2;
-
- if (elem_blk_parms[i].num_nodes_per_elem == 2) {
- elem_blk_parms[i].num_nodes_per_side[0] = 2;
- elem_blk_parms[i].num_nodes_per_side[1] = 2;
- } else if (elem_blk_parms[i].num_nodes_per_elem == 3){
- elem_blk_parms[i].num_nodes_per_side[0] = 3;
- elem_blk_parms[i].num_nodes_per_side[1] = 3;
- } else {
- return el_node_count_error(elem_blk_parms[i]);
- }
- }
- else if ( (strncmp(elem_blk_parms[i].elem_type,"TRUSS",3) == 0) ||
- (strncmp(elem_blk_parms[i].elem_type,"BAR",3) == 0) ||
- (strncmp(elem_blk_parms[i].elem_type,"EDGE",3) == 0) )
- {
- elem_blk_parms[i].elem_type_val = EX_EL_TRUSS;
- elem_blk_parms[i].num_sides = 2;
-
- if (elem_blk_parms[i].num_nodes_per_elem == 2) {
- elem_blk_parms[i].num_nodes_per_side[0] = 2;
- elem_blk_parms[i].num_nodes_per_side[1] = 2;
- } else if (elem_blk_parms[i].num_nodes_per_elem == 3) {
- elem_blk_parms[i].num_nodes_per_side[0] = 3;
- elem_blk_parms[i].num_nodes_per_side[1] = 3;
- } else {
- return el_node_count_error(elem_blk_parms[i]);
- }
- }
- /* Used for an empty block in a parallel decomposition */
- else if (strncmp(elem_blk_parms[i].elem_type,"NULL",3) == 0) {
- elem_blk_parms[i].elem_type_val = EX_EL_NULL_ELEMENT;
- elem_blk_parms[i].num_sides = 0;
- elem_blk_parms[i].num_nodes_per_side[0] = 0;
- elem_blk_parms[i].num_elem_in_blk = 0;
- } else {
- /* unsupported element type; no problem if no sides specified for
- this element block */
- elem_blk_parms[i].elem_type_val = EX_EL_UNK;
- elem_blk_parms[i].num_sides = 0;
- elem_blk_parms[i].num_nodes_per_side[0] = 0;
- }
-
- elem_blk_parms[i].elem_blk_id = elem_blk_ids[i]; /* save id */
- elem_ctr += elem_blk_parms[i].num_elem_in_blk;
- elem_blk_parms[i].elem_ctr = elem_ctr; /* save elem number max */
- }
-
-
- /* Finally... Create the list of node counts for each face in the
- * side set.
- */
-
- j = 0; /* The current element block... */
- for (ii=0;ii<tot_num_ss_elem;ii++) {
-
- i = ss_elem_ndx[ii];
- elem = side_set_elem_list[i];
- side = side_set_side_list[i]-1; /* Convert to 0-based sides */
-
- /*
- * Since the elements are being accessed in sorted, order, the
- * block that contains the elements must progress sequentially
- * from block 0 to block[num_elem_blks-1]. Once we find an element
- * not in this block, find a following block that contains it...
- */
- for ( ; j<num_elem_blks; j++) {
- if (elem <= elem_blk_parms[j].elem_ctr) {
- break;
- }
- }
-
- if (j < num_elem_blks) {
- assert(side < elem_blk_parms[j].num_sides);
- side_set_node_cnt_list[i] = elem_blk_parms[j].num_nodes_per_side[side];
- } else {
- exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "Error: Invalid element number %d found in side set %d in file %d",
- side_set_elem_list[i], side_set_id, exoid);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- ex_err("ex_get_side_set_node_count",errmsg,EX_MSG);
- return (EX_FATAL);
- }
- }
-
- /* All done: release connectivity array space, element block ids
- * array, element block parameters array, and side set element index
- * array
- */
- free(elem_blk_ids);
- free(elem_blk_parms);
- free(ss_elem_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
-
- return(EX_NOERR);
-}
diff --git a/exodus/cbind/src/exgssn.c b/exodus/cbind/src/exgssn.c
deleted file mode 100644
index 6a50452..0000000
--- a/exodus/cbind/src/exgssn.c
+++ /dev/null
@@ -1,1113 +0,0 @@
-/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*****************************************************************************
-*
-* exgssn - ex_get_side_set_node_list
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-* int side_set_id side set id
-*
-* exit conditions -
-* int *side_set_node_cnt_list returned array of number of nodes for
-* side or face
-* int *side_set_node_list array of nodes
-*
-* revision history -
-*
-*
-*****************************************************************************/
-
-#include <ctype.h>
-#include <string.h>
-#include <stdlib.h>
-#include "exodusII.h"
-#include "exodusII_int.h"
-/*!
- * This routine is designed to read the Exodus II V 2.0 side set side
- * definition and return a ExodusI style side set node definition.
- */
-
-int ex_get_side_set_node_list(int exoid,
- int side_set_id,
- int *side_set_node_cnt_list,
- int *side_set_node_list)
-{
- size_t m;
- int i, j;
- int num_side_sets, num_elem_blks, num_df, ndim;
- int tot_num_elem = 0, tot_num_ss_elem = 0, elem_num = 0;
- int connect_offset, side_num, node_pos;
- int *elem_blk_ids = NULL;
- int *connect = NULL;
- int *ss_elem_ndx = NULL;
- int *ss_elem_node_ndx = NULL;
- int *ss_parm_ndx = NULL;
- int *side_set_elem_list = NULL;
- int *side_set_side_list = NULL;
- int elem_ctr, node_ctr, elem_num_pos;
- int num_elem_in_blk, num_nodes_per_elem, num_attr;
- float fdum;
- char *cdum, elem_type[MAX_STR_LENGTH+1];
-
- struct elem_blk_parm *elem_blk_parms;
-
-/* side to node translation tables -
- These tables are used to look up the side number based on the
- first and second node in the side/face list. The side node order
- is found in the original Exodus document, SAND87-2997. The element
- node order is found in the ExodusII document, SAND92-2137. These
- tables were generated by following the right-hand rule for determining
- the outward normal.
-*/
- /* triangle */
- static int tri_table[3][3] = {
- /* 1 2 3 side */
- {1,2,4}, {2,3,5}, {3,1,6} /* nodes */
- };
-
- /* triangle 3d */
- static int tri3_table[5][7] = {
- /* 1 2 side */
- {1,2,3,4,5,6,7}, {3,2,1,6,5,4,7}, /* nodes */
- /* 3 4 5 side */
- {1,2,4,0,0,0,0}, {2,3,5,0,0,0,0}, {3,1,6,0,0,0,0} /* nodes */
- };
-
- /* quad */
- static int quad_table[4][3] = {
- /* 1 2 3 4 side */
- {1,2,5}, {2,3,6}, {3,4,7}, {4,1,8} /* nodes */
- };
-
- /* shell */
- static int shell_table[6][8] = {
- /* 1 2 side */
- {1,2,3,4,5,6,7,8}, {1,4,3,2,8,7,6,5} , /* nodes */
- /* 3 4 side */
- {1,2,5,0,0,0,0,0}, {2,3,6,0,0,0,0,0} , /* nodes */
- /* 5 6 side */
- {3,4,7,0,0,0,0,0}, {4,1,8,0,0,0,0,0} /* nodes */
- };
-
- /* tetra */
- static int tetra_table[4][6] = {
- /* 1 2 3 4 side */
- {1,2,4,5,9,8}, {2,3,4,6,10,9}, {1,4,3,8,10,7}, {1,3,2,7,6,5} /* nodes */
- };
-
- /* wedge */
- static int wedge_table[5][8] = {
- /* 1 2 3 side */
- {1,2,5,4,7,11,13,10}, {2,3,6,5,8,12,14,11}, {1,4,6,3,10,15,12,9},
- /* 4 5 side */
- {1,3,2,0,9,8,7,0}, {4,5,6,0,13,14,15,0} /* nodes */
- };
-
- /* hex */
- static int hex_table[6][9] = {
- /* 1 2 side */
- {1,2,6,5,9,14,17,13,26}, {2,3,7,6,10,15,18,14,25}, /* nodes */
- /* 3 4 side */
- {3,4,8,7,11,16,19,15,27}, {1,5,8,4,13,20,16,12,24}, /* nodes */
- /* 5 6 side */
- {1,4,3,2,12,11,10,9,22}, {5,6,7,8,17,18,19,20,23} /* nodes */
- };
-
- /* pyramid */
- static int pyramid_table[5][8] = {
- /* 1 2 3 side */
- {1,2,5,0,6,11,10,0}, {2,3,5,0,7,12,11,0}, {3,4,5,0,8,13,12,0}, /* nodes */
- /* 4 5 side */
- {1,5,4,0,10,13,9,0}, {1,4,3,2,9,8,7,6} /* nodes */
- };
-
-
- char errmsg[MAX_ERR_LENGTH];
-
- exerrval = 0; /* clear error code */
-
- cdum = 0; /* initialize even though it is not used */
-
-/* first check if any side sets are specified */
-/* inquire how many side sets have been stored */
-
- if ((ex_inquire(exoid, EX_INQ_SIDE_SETS, &num_side_sets, &fdum, cdum)) == -1)
- {
- sprintf(errmsg,
- "Error: failed to get number of side sets in file id %d",exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- return(EX_FATAL);
- }
-
- if (num_side_sets == 0)
- {
- sprintf(errmsg,
- "Warning: no side sets defined in file id %d",exoid);
- ex_err("ex_get_side_set_node_list",errmsg,EX_WARN);
- return(EX_WARN);
- }
-
-/* Lookup index of side set id in VAR_SS_IDS array */
-
- ex_id_lkup(exoid,EX_SIDE_SET,side_set_id);
- if (exerrval != 0)
- {
- if (exerrval == EX_NULLENTITY)
- {
- sprintf(errmsg,
- "Warning: side set %d is NULL in file id %d",
- side_set_id,exoid);
- ex_err("ex_get_side_set_node_list",errmsg,EX_MSG);
- return (EX_WARN);
- }
- else
- {
-
- sprintf(errmsg,
- "Error: failed to locate side set id %d in VAR_SS_IDS array in file id %d",
- side_set_id,exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- return (EX_FATAL);
- }
- }
-
- if ((ex_inquire(exoid, EX_INQ_ELEM_BLK, &num_elem_blks, &fdum, cdum)) == -1)
- {
- sprintf(errmsg,
- "Error: failed to get number of element blocks in file id %d",exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- return(EX_FATAL);
- }
-
- if ((ex_inquire(exoid, EX_INQ_ELEM, &tot_num_elem, &fdum, cdum)) == -1)
- {
- sprintf(errmsg,
- "Error: failed to get total number of elements in file id %d",exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- return(EX_FATAL);
- }
-
-/* get the dimensionality of the coordinates; this is necessary to
- distinguish between 2d TRIs and 3d TRIs */
-
- if ((ex_inquire(exoid, EX_INQ_DIM, &ndim, &fdum, cdum)) == -1)
- {
- sprintf(errmsg,
- "Error: failed to get dimensionality in file id %d",exoid);
- ex_err("ex_cvt_nodes_to_sides",errmsg,exerrval);
- return(EX_FATAL);
- }
-
- /* First determine the # of elements in the side set*/
- if ((ex_get_side_set_param(exoid,side_set_id,&tot_num_ss_elem,&num_df)) == -1)
- {
- sprintf(errmsg,
- "Error: failed to get number of elements in side set %d in file id %d",
- side_set_id, exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- return(EX_FATAL);
- }
-
- /* Allocate space for the side set element list */
- if (!(side_set_elem_list=malloc(tot_num_ss_elem*sizeof(int))))
- {
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for side set element list for file id %d",
- exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* Allocate space for the side set side list */
- if (!(side_set_side_list=malloc(tot_num_ss_elem*sizeof(int))))
- {
- free(side_set_elem_list);
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for side set side list for file id %d",
- exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- if (ex_get_side_set(exoid, side_set_id,
- side_set_elem_list, side_set_side_list) == -1)
- {
- free(side_set_elem_list);
- free(side_set_side_list);
- sprintf(errmsg,
- "Error: failed to get side set %d in file id %d",
- side_set_id, exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* Allocate space for the ss element index array */
- if (!(ss_elem_ndx= malloc(tot_num_ss_elem*sizeof(int))))
- {
- free(side_set_elem_list);
- free(side_set_side_list);
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for side set elem sort array for file id %d",
- exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* Sort side set element list into index array - non-destructive */
- for (i=0;i<tot_num_ss_elem;i++)
- ss_elem_ndx[i] = i; /* init index array to current position */
-
- ex_iqsort(side_set_elem_list, ss_elem_ndx,tot_num_ss_elem);
-
-
- /* Allocate space for the element block ids */
- if (!(elem_blk_ids= malloc(num_elem_blks*sizeof(int))))
- {
- exerrval = EX_MEMFAIL;
- free(ss_elem_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- sprintf(errmsg,
- "Error: failed to allocate space for element block ids for file id %d",
- exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- if (ex_get_elem_blk_ids(exoid, elem_blk_ids) == -1)
- {
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- sprintf(errmsg,
- "Error: failed to get element block ids in file id %d",
- exoid);
- ex_err("ex_get_side_set_node_list",errmsg,EX_MSG);
- return(EX_FATAL);
- }
-
- /* Allocate space for the element block params */
- if (!(elem_blk_parms= malloc(num_elem_blks*sizeof(struct elem_blk_parm))))
- {
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for element block params for file id %d",
- exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- elem_ctr = 0;
- for (i=0; i<num_elem_blks; i++)
- {
- /* read in an element block parameter */
- if ((ex_get_elem_block (exoid,
- elem_blk_ids[i],
- elem_type,
- &num_elem_in_blk,
- &num_nodes_per_elem,
- &num_attr)) == -1)
- {
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- sprintf(errmsg,
- "Error: failed to get element block %d parameters in file id %d",
- elem_blk_ids[i], exoid);
- ex_err("ex_get_side_set_node_list",errmsg,EX_MSG);
- return(EX_FATAL);
- }
-
- elem_blk_parms[i].num_elem_in_blk = num_elem_in_blk;
- elem_blk_parms[i].num_nodes_per_elem = num_nodes_per_elem;
- elem_blk_parms[i].num_attr = num_attr;
-
- for (m=0; m < strlen(elem_type); m++)
- elem_blk_parms[i].elem_type[m] = toupper(elem_type[m]);
- elem_blk_parms[i].elem_type[m] = EX_EL_NULL_ELEMENT;
-
- if (strncmp(elem_blk_parms[i].elem_type,"CIRCLE",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_CIRCLE;
- /* set side set node stride */
- elem_blk_parms[i].num_nodes_per_side[0] = 1;
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"SPHERE",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_SPHERE;
- /* set side set node stride */
- elem_blk_parms[i].num_nodes_per_side[0] = 1;
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"QUAD",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_QUAD;
- /* determine side set node stride */
- if (elem_blk_parms[i].num_nodes_per_elem == 4)
- elem_blk_parms[i].num_nodes_per_side[0] = 2;
- else if (elem_blk_parms[i].num_nodes_per_elem == 5)
- elem_blk_parms[i].num_nodes_per_side[0] = 2;
- else
- elem_blk_parms[i].num_nodes_per_side[0] = 3;
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"TRIANGLE",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_TRIANGLE;
- /* set default side set node stride */
- if (ndim == 2) /* 2d TRIs */
- {
- if (elem_blk_parms[i].num_nodes_per_elem == 3)
- elem_blk_parms[i].num_nodes_per_side[0] = 2;
- else
- elem_blk_parms[i].num_nodes_per_side[0] = 3;
- }
- else if (ndim == 3) /* 3d TRIs */
- {
- if (elem_blk_parms[i].num_nodes_per_elem == 3)
- elem_blk_parms[i].num_nodes_per_side[0] = 3;
- else
- elem_blk_parms[i].num_nodes_per_side[0] = 6;
- }
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"SHELL",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_SHELL;
- /* determine side set node stride */
- if (elem_blk_parms[i].num_nodes_per_elem == 2) /* KLUDGE for 2D Shells*/
- elem_blk_parms[i].num_nodes_per_side[0] = 2;
- else if (elem_blk_parms[i].num_nodes_per_elem == 4)
- elem_blk_parms[i].num_nodes_per_side[0] = 4;
- else
- elem_blk_parms[i].num_nodes_per_side[0] = 8;
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"HEX",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_HEX;
- /* determine side set node stride */
- if (elem_blk_parms[i].num_nodes_per_elem == 8) /* 8-node bricks */
- elem_blk_parms[i].num_nodes_per_side[0] = 4;
- else if (elem_blk_parms[i].num_nodes_per_elem == 9) /* 9-node bricks */
- elem_blk_parms[i].num_nodes_per_side[0] = 4;
- else if (elem_blk_parms[i].num_nodes_per_elem == 12) /* HEXSHELLS */
- elem_blk_parms[i].num_nodes_per_side[0] = 4;
- else if (elem_blk_parms[i].num_nodes_per_elem == 27) /* 27-node bricks */
- elem_blk_parms[i].num_nodes_per_side[0] = 9;
- else
- elem_blk_parms[i].num_nodes_per_side[0] = 8;
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"TETRA",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_TETRA;
- /* determine side set node stride */
- if (elem_blk_parms[i].num_nodes_per_elem == 4)
- elem_blk_parms[i].num_nodes_per_side[0] = 3;
- else if (elem_blk_parms[i].num_nodes_per_elem == 8)
- elem_blk_parms[i].num_nodes_per_side[0] = 4;
- else
- elem_blk_parms[i].num_nodes_per_side[0] = 6;
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"WEDGE",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_WEDGE;
- /* determine side set node stride */
- if (elem_blk_parms[i].num_nodes_per_elem == 6)
- elem_blk_parms[i].num_nodes_per_side[0] = 4;
- else
- elem_blk_parms[i].num_nodes_per_side[0] = 8;
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"PYRAMID",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_PYRAMID;
- /* determine side set node stride */
- if (elem_blk_parms[i].num_nodes_per_elem == 5)
- elem_blk_parms[i].num_nodes_per_side[0] = 4;
- else
- elem_blk_parms[i].num_nodes_per_side[0] = 8;
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"BEAM",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_BEAM;
- /* determine side set node stride */
- if (elem_blk_parms[i].num_nodes_per_elem == 2)
- elem_blk_parms[i].num_nodes_per_side[0] = 2;
- else
- elem_blk_parms[i].num_nodes_per_side[0] = 3;
- }
- else if ( (strncmp(elem_blk_parms[i].elem_type,"TRUSS",3) == 0) ||
- (strncmp(elem_blk_parms[i].elem_type,"BAR",3) == 0) ||
- (strncmp(elem_blk_parms[i].elem_type,"EDGE",3) == 0) )
- {
- elem_blk_parms[i].elem_type_val = EX_EL_TRUSS;
- /* determine side set node stride */
- if (elem_blk_parms[i].num_nodes_per_elem == 2)
- elem_blk_parms[i].num_nodes_per_side[0] = 2;
- else
- elem_blk_parms[i].num_nodes_per_side[0] = 3;
- }
- else if (strncmp(elem_blk_parms[i].elem_type,"NULL",3) == 0)
- {
- elem_blk_parms[i].elem_type_val = EX_EL_NULL_ELEMENT;
- elem_blk_parms[i].num_nodes_per_side[0] = 0;
- elem_blk_parms[i].num_elem_in_blk = 0;
- }
- else
- { /* unsupported element type; no problem if no sides specified for
- this element block */
- elem_blk_parms[i].elem_type_val = EX_EL_UNK;
- elem_blk_parms[i].num_nodes_per_side[0] = 0;
- }
- elem_blk_parms[i].elem_blk_id = elem_blk_ids[i]; /* save id */
- elem_ctr += elem_blk_parms[i].num_elem_in_blk;
- elem_blk_parms[i].elem_ctr = elem_ctr; /* save elem number max */
- }
-
-
- /* Allocate space for the ss element to element block parameter index array */
- if (!(ss_parm_ndx=malloc(tot_num_ss_elem*sizeof(int))))
- {
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for side set elem parms index for file id %d",
- exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- return (EX_FATAL);
- }
-
-
- /* Allocate space for the ss element to node list index array */
- if (!(ss_elem_node_ndx=malloc(tot_num_ss_elem*sizeof(int))))
- {
- free(ss_parm_ndx);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for side set elem to node index for file id %d",
- exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
-
- return (EX_FATAL);
- }
-
-/* Build side set element to node list index and side set element
- parameter index.
-*/
- node_ctr = 0;
- for (i=0;i<tot_num_ss_elem;i++) {
- for (j=0; j<num_elem_blks; j++) {
- if (elem_blk_parms[j].elem_type_val != EX_EL_NULL_ELEMENT)
- if (side_set_elem_list[i] <= elem_blk_parms[j].elem_ctr)
- break;
- }
-
- if (j >= num_elem_blks) {
- exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "Error: Invalid element number %d found in side set %d in file %d",
- side_set_elem_list[i], side_set_id, exoid);
- free(ss_parm_ndx);
- free(ss_elem_node_ndx);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- ex_err("ex_get_side_set_node_list",errmsg,EX_MSG);
- return (EX_FATAL);
- }
-
- ss_parm_ndx[i] = j; /* assign parameter block index */
- ss_elem_node_ndx[i] = node_ctr; /* assign node list index */
-
- /* Update node_ctr (which points to next node in chain */
-
- /* WEDGEs with 3 node sides (side 4 or 5) are special cases */
- if (elem_blk_parms[j].elem_type_val == EX_EL_WEDGE &&
- (side_set_side_list[i] == 4 || side_set_side_list[i] == 5))
- {
- if (elem_blk_parms[j].num_nodes_per_elem == 6)
- node_ctr += 3; /* 3 node side */
- else
- node_ctr += 6; /* 6 node side */
- }
- /* PYRAMIDSs with 3 node sides (sides 1,2,3,4) are also special */
- else if (elem_blk_parms[j].elem_type_val == EX_EL_PYRAMID &&
- (side_set_side_list[i] < 5))
- {
- if (elem_blk_parms[j].num_nodes_per_elem == 5)
- node_ctr += 3; /* 3 node side */
- else
- node_ctr += 6; /* 6 node side */
- }
- /* side numbers 3,4,5,6 for SHELLs are also special */
- else if (elem_blk_parms[j].elem_type_val == EX_EL_SHELL &&
- (side_set_side_list[i] > 2 ))
- {
- if (elem_blk_parms[j].num_nodes_per_elem == 4)
- node_ctr += 2; /* 2 node side */
- else
- node_ctr += 3; /* 3 node side */
- }
- /* side numbers 3,4,5 for 3d TRIs are also special */
- else if (elem_blk_parms[j].elem_type_val == EX_EL_TRIANGLE &&
- ndim == 3 &&
- side_set_side_list[i] > 2 )
- {
- if (elem_blk_parms[j].num_nodes_per_elem == 3) /* 3-node TRI */
- node_ctr += 2; /* 2 node side */
- else /* 6-node TRI */
- node_ctr += 3; /* 3 node side */
- }
- else /* all other element types */
- node_ctr += elem_blk_parms[j].num_nodes_per_side[0];
- }
-
- /* All setup, ready to go ... */
-
- elem_ctr=0;
-
- for (j=0; j < tot_num_ss_elem; j++) {
-
- if (side_set_elem_list[ss_elem_ndx[j]] > elem_ctr) {
- /* release connectivity array space and get next one */
- if (elem_ctr > 0) {
- free(connect);
- }
-
- /* Allocate space for the connectivity array for new element block */
- if (!(connect=malloc(elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].num_elem_in_blk*
- elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].num_nodes_per_elem*
- (int)sizeof(int))))
- {
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(ss_elem_node_ndx);
- free(ss_parm_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- exerrval = EX_MEMFAIL;
- sprintf(errmsg,
- "Error: failed to allocate space for connectivity array for file id %d",
- exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* get connectivity array */
- if (ex_get_elem_conn(exoid,
- elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].elem_blk_id,
- connect) == -1)
- {
- free(connect);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(ss_elem_node_ndx);
- free(ss_parm_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- sprintf(errmsg,
- "Error: failed to allocate space for connectivity array for file id %d",
- exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- return (EX_FATAL);
- }
- elem_ctr = elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].elem_ctr;
- }
- /* For each side in side set, use the appropriate lookup table to
- determine the nodes from the connect array. */
-
- elem_num = side_set_elem_list[ss_elem_ndx[j]]-1;/* element number 0-based*/
- /* calculate the relative element number position in it's block*/
-
- elem_num_pos = elem_num -
- (elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].elem_ctr -
- elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].num_elem_in_blk);
-
- /* calculate the beginning of the node list for this element by
- using the ss_elem_node_ndx index into the side_sets_node_index
- and adding the element number position * number of nodes per elem */
-
- num_nodes_per_elem = elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].num_nodes_per_elem;
- node_pos = ss_elem_node_ndx[ss_elem_ndx[j]];
- connect_offset = num_nodes_per_elem*elem_num_pos;
- side_num = side_set_side_list[ss_elem_ndx[j]]-1;
-
- switch (elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].elem_type_val)
- {
- case EX_EL_CIRCLE:
- case EX_EL_SPHERE:
- { /* Note: no side-node lookup table is used for this simple case */
- side_set_node_list[node_pos] = connect[connect_offset];
- side_set_node_cnt_list[ss_elem_ndx[j]] = 1; /* 1 node object */
- break;
- }
- case EX_EL_TRUSS:
- case EX_EL_BEAM:
- { /* Note: no side-node lookup table is used for this simple case */
- side_set_node_list[node_pos] = connect[connect_offset];
- side_set_node_list[node_pos+1] = connect[connect_offset+1];
- side_set_node_cnt_list[ss_elem_ndx[j]] = 2; /* 2 node object */
- if (num_nodes_per_elem > 2)
- {
- side_set_node_cnt_list[ss_elem_ndx[j]] = 3; /* 3 node object */
- side_set_node_list[node_pos+2] = connect[connect_offset+2];
- }
- break;
- }
- case EX_EL_TRIANGLE:
- {
- if (side_num+1 < 1 || side_num+1 > 5) /* side number range check */
- {
- exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "Error: Invalid triangle edge number %d in file id %d",
- side_num+1, exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- free(connect);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(ss_elem_node_ndx);
- free(ss_parm_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- return(EX_FATAL);
- }
-
- if (ndim == 2) /* 2d TRIs */
- {
- side_set_node_list[node_pos] =
- connect[connect_offset+tri_table[side_num][0]-1];
- side_set_node_list[node_pos+1] =
- connect[connect_offset+tri_table[side_num][1]-1];
- side_set_node_cnt_list[ss_elem_ndx[j]] = 2; /* 2 node object */
- if (num_nodes_per_elem > 3) /* 6-node TRI */
- {
- side_set_node_cnt_list[ss_elem_ndx[j]] = 3; /* 3 node object */
- side_set_node_list[node_pos+2] =
- connect[connect_offset+tri_table[side_num][2]-1];
- }
- }
- else if (ndim == 3) /* 3d TRIs */
- {
- side_set_node_list[node_pos] =
- connect[connect_offset+tri3_table[side_num][0]-1];
- side_set_node_list[node_pos+1] =
- connect[connect_offset+tri3_table[side_num][1]-1];
- side_set_node_cnt_list[ss_elem_ndx[j]] = 2; /* 2 node object */
- if (side_num+1 <= 2) /* 3- or 6-node face */
- {
- if (num_nodes_per_elem == 3) /* 3-node face */
- {
- side_set_node_cnt_list[ss_elem_ndx[j]] = 3; /* 3 node object */
- side_set_node_list[node_pos+2] =
- connect[connect_offset+tri3_table[side_num][2]-1];
- }
- else /* 6-node face */
- {
- side_set_node_cnt_list[ss_elem_ndx[j]] = 6; /* 6 node object */
- side_set_node_list[node_pos+2] =
- connect[connect_offset+tri3_table[side_num][2]-1];
- side_set_node_list[node_pos+3] =
- connect[connect_offset+tri3_table[side_num][3]-1];
- side_set_node_list[node_pos+4] =
- connect[connect_offset+tri3_table[side_num][4]-1];
- side_set_node_list[node_pos+5] =
- connect[connect_offset+tri3_table[side_num][5]-1];
- }
- }
- else /* 2- or 3-node edge */
- {
- if (num_nodes_per_elem > 3) /* 3-node edge */
- {
- side_set_node_cnt_list[ss_elem_ndx[j]] = 3; /* 3 node object */
- side_set_node_list[node_pos+2] =
- connect[connect_offset+tri3_table[side_num][2]-1];
- }
- }
- }
- break;
- }
- case EX_EL_QUAD:
- {
- if (side_num+1 < 1 || side_num+1 > 4) /* side number range check */
- {
- exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "Error: Invalid quad edge number %d in file id %d",
- side_num+1, exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- free(connect);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(ss_elem_node_ndx);
- free(ss_parm_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- return(EX_FATAL);
- }
-
- side_set_node_list[node_pos] =
- connect[connect_offset+quad_table[side_num][0]-1];
- side_set_node_list[node_pos+1] =
- connect[connect_offset+quad_table[side_num][1]-1];
- side_set_node_cnt_list[ss_elem_ndx[j]] = 2; /* 2 node object */
- if (num_nodes_per_elem > 5)
- {
- side_set_node_cnt_list[ss_elem_ndx[j]] = 3; /* 3 node object */
- side_set_node_list[node_pos+2] =
- connect[connect_offset+quad_table[side_num][2]-1];
- }
- break;
- }
- case EX_EL_SHELL:
- {
- if (side_num+1 < 1 || side_num+1 > 6) /* side number range check */
- {
- exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "Error: Invalid shell face number %d in file id %d",
- side_num+1, exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- free(connect);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(ss_elem_node_ndx);
- free(ss_parm_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- return(EX_FATAL);
- }
-
- side_set_node_list[node_pos] =
- connect[connect_offset+shell_table[side_num][0]-1];
- side_set_node_list[node_pos+1] =
- connect[connect_offset+shell_table[side_num][1]-1];
- side_set_node_cnt_list[ss_elem_ndx[j]] = 2; /* 2 node object */
- if (num_nodes_per_elem > 2) /*** KLUDGE for 2D shells ***/
- {
- if (side_num+1 <= 2) /* 4-node face */
- {
- side_set_node_cnt_list[ss_elem_ndx[j]] = 4; /* 4 node object */
- side_set_node_list[node_pos+2] =
- connect[connect_offset+shell_table[side_num][2]-1];
- side_set_node_list[node_pos+3] =
- connect[connect_offset+shell_table[side_num][3]-1];
- }
- }
- if (num_nodes_per_elem == 8)
- {
- if (side_num+1 <= 2) /* 8-node face */
- {
- side_set_node_cnt_list[ss_elem_ndx[j]] = 8; /* 8 node object */
- side_set_node_list[node_pos+4] =
- connect[connect_offset+shell_table[side_num][4]-1];
- side_set_node_list[node_pos+5] =
- connect[connect_offset+shell_table[side_num][5]-1];
- side_set_node_list[node_pos+6] =
- connect[connect_offset+shell_table[side_num][6]-1];
- side_set_node_list[node_pos+7] =
- connect[connect_offset+shell_table[side_num][7]-1];
- }
- else
- {
- side_set_node_cnt_list[ss_elem_ndx[j]] = 3; /* 3 node edge */
- side_set_node_list[node_pos+2] =
- connect[connect_offset+shell_table[side_num][2]-1];
- }
- }
- break;
- }
- case EX_EL_TETRA:
- {
- if (side_num+1 < 1 || side_num+1 > 4) /* side number range check */
- {
- exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "Error: Invalid tetra face number %d in file id %d",
- side_num+1, exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- free(connect);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(ss_elem_node_ndx);
- free(ss_parm_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- return(EX_FATAL);
- }
-
- side_set_node_list[node_pos] =
- connect[connect_offset+tetra_table[side_num][0]-1];
- side_set_node_list[node_pos+1] =
- connect[connect_offset+tetra_table[side_num][1]-1];
- side_set_node_list[node_pos+2] =
- connect[connect_offset+tetra_table[side_num][2]-1];
- side_set_node_cnt_list[ss_elem_ndx[j]] = 3; /* 3 node object */
- if (num_nodes_per_elem == 8)
- {
- side_set_node_cnt_list[ss_elem_ndx[j]] = 4; /* 4 node object */
- side_set_node_list[node_pos+3] =
- connect[connect_offset+tetra_table[side_num][3]-1];
- }
- else if (num_nodes_per_elem > 8)
- {
- side_set_node_cnt_list[ss_elem_ndx[j]] = 6; /* 6 node object */
- side_set_node_list[node_pos+3] =
- connect[connect_offset+tetra_table[side_num][3]-1];
- side_set_node_list[node_pos+4] =
- connect[connect_offset+tetra_table[side_num][4]-1];
- side_set_node_list[node_pos+5] =
- connect[connect_offset+tetra_table[side_num][5]-1];
- }
- break;
- }
- case EX_EL_WEDGE:
- {
- if (side_num+1 < 1 || side_num+1 > 5) /* side number range check */
- {
- exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "Error: Invalid wedge face number %d in file id %d",
- side_num+1, exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- free(connect);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(ss_elem_node_ndx);
- free(ss_parm_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- return(EX_FATAL);
- }
-
- side_set_node_list[node_pos++] =
- connect[connect_offset+wedge_table[side_num][0]-1];
- side_set_node_list[node_pos++] =
- connect[connect_offset+wedge_table[side_num][1]-1];
- side_set_node_list[node_pos++] =
- connect[connect_offset+wedge_table[side_num][2]-1];
-
- if (wedge_table[side_num][3] == 0) { /* degenerate side? */
- side_set_node_cnt_list[ss_elem_ndx[j]] = 3; /* 3 node side */
- }
- else
- {
- side_set_node_list[node_pos++] =
- connect[connect_offset+wedge_table[side_num][3]-1];
- side_set_node_cnt_list[ss_elem_ndx[j]] = 4; /* 4 node side */
- }
-
-
- if (num_nodes_per_elem > 6)
- {
- side_set_node_cnt_list[ss_elem_ndx[j]] = 8; /* 8 node object */
- side_set_node_list[node_pos++] =
- connect[connect_offset+wedge_table[side_num][4]-1];
- side_set_node_list[node_pos++] =
- connect[connect_offset+wedge_table[side_num][5]-1];
- side_set_node_list[node_pos++] =
- connect[connect_offset+wedge_table[side_num][6]-1];
-
- if (wedge_table[side_num][7] == 0) /* degenerate side? */
- side_set_node_cnt_list[ss_elem_ndx[j]] = 6; /* 6 node side */
- else
- {
- side_set_node_list[node_pos++] =
- connect[connect_offset+wedge_table[side_num][7]-1];
- side_set_node_cnt_list[ss_elem_ndx[j]] = 8; /* 8 node side */
- }
- }
- break;
- }
- case EX_EL_PYRAMID:
- {
- if (side_num+1 < 1 || side_num+1 > 5) /* side number range check */
- {
- exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "Error: Invalid pyramid face number %d in file id %d",
- side_num+1, exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- free(connect);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(ss_elem_node_ndx);
- free(ss_parm_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- return(EX_FATAL);
- }
-
- side_set_node_list[node_pos++] =
- connect[connect_offset+pyramid_table[side_num][0]-1];
- side_set_node_list[node_pos++] =
- connect[connect_offset+pyramid_table[side_num][1]-1];
- side_set_node_list[node_pos++] =
- connect[connect_offset+pyramid_table[side_num][2]-1];
-
- if (pyramid_table[side_num][3] == 0) { /* degenerate side? */
- side_set_node_cnt_list[ss_elem_ndx[j]] = 3; /* 3 node side */
- }
- else
- {
- side_set_node_list[node_pos++] =
- connect[connect_offset+pyramid_table[side_num][3]-1];
- side_set_node_cnt_list[ss_elem_ndx[j]] = 4; /* 4 node side */
- }
-
-
- if (num_nodes_per_elem > 5)
- {
- side_set_node_cnt_list[ss_elem_ndx[j]] = 8; /* 8 node object */
- side_set_node_list[node_pos++] =
- connect[connect_offset+pyramid_table[side_num][4]-1];
- side_set_node_list[node_pos++] =
- connect[connect_offset+pyramid_table[side_num][5]-1];
- side_set_node_list[node_pos++] =
- connect[connect_offset+pyramid_table[side_num][6]-1];
-
- if (pyramid_table[side_num][7] == 0) /* degenerate side? */
- side_set_node_cnt_list[ss_elem_ndx[j]] = 6; /* 6 node side */
- else
- {
- side_set_node_list[node_pos++] =
- connect[connect_offset+pyramid_table[side_num][7]-1];
- side_set_node_cnt_list[ss_elem_ndx[j]] = 8; /* 8 node side */
- }
- }
- break;
- }
- case EX_EL_HEX:
- {
- if (side_num+1 < 1 || side_num+1 > 6) /* side number range check */
- {
- exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "Error: Invalid hex face number %d in file id %d",
- side_num+1, exoid);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- free(connect);
- free(elem_blk_parms);
- free(elem_blk_ids);
- free(ss_elem_ndx);
- free(ss_elem_node_ndx);
- free(ss_parm_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
- return(EX_FATAL);
- }
-
- side_set_node_list[node_pos] =
- connect[connect_offset+hex_table[side_num][0]-1];
- side_set_node_list[node_pos+1] =
- connect[connect_offset+hex_table[side_num][1]-1];
- side_set_node_list[node_pos+2] =
- connect[connect_offset+hex_table[side_num][2]-1];
- side_set_node_list[node_pos+3] =
- connect[connect_offset+hex_table[side_num][3]-1];
- side_set_node_cnt_list[ss_elem_ndx[j]] = 4; /* 4 node object */
- if (num_nodes_per_elem > 12) /* more nodes than HEXSHELL */
- {
- side_set_node_cnt_list[ss_elem_ndx[j]] = 8; /* 8 node object */
- side_set_node_list[node_pos+4] =
- connect[connect_offset+hex_table[side_num][4]-1];
- side_set_node_list[node_pos+5] =
- connect[connect_offset+hex_table[side_num][5]-1];
- side_set_node_list[node_pos+6] =
- connect[connect_offset+hex_table[side_num][6]-1];
- side_set_node_list[node_pos+7] =
- connect[connect_offset+hex_table[side_num][7]-1];
- }
- if (num_nodes_per_elem == 27) /* 27-node brick */
- {
- side_set_node_cnt_list[ss_elem_ndx[j]] = 9; /* 9 node object */
- side_set_node_list[node_pos+8] =
- connect[connect_offset+hex_table[side_num][8]-1];
- }
- break;
- }
- default:
- {
- exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "Error: %s is an unsupported element type",
- elem_blk_parms[ss_parm_ndx[ss_elem_ndx[j]]].elem_type);
- ex_err("ex_get_side_set_node_list",errmsg,exerrval);
- return(EX_FATAL);
- }
- }
- }
-
-
- /* All done: release connectivity array space, element block ids array,
- element block parameters array, and side set element index array */
- free(connect);
- free(ss_parm_ndx);
- free(elem_blk_ids);
- free(elem_blk_parms);
- free(ss_elem_ndx);
- free(ss_elem_node_ndx);
- free(side_set_side_list);
- free(side_set_elem_list);
-
- return(EX_NOERR);
-}
diff --git a/exodus/cbind/src/exgvid.c b/exodus/cbind/src/exgvid.c
deleted file mode 100644
index 64ce4ae..0000000
--- a/exodus/cbind/src/exgvid.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*****************************************************************************
-*
-* exgvid - ex_get_varid
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-*
-* exit conditions -
-* int* varid variable id array
-*
-* revision history -
-*
-*
-*****************************************************************************/
-
-#include <stdlib.h>
-#include "exodusII.h"
-#include "exodusII_int.h"
-
-/*!
- * reads the EXODUS II variable varids from the database
- */
-
-int ex_get_varid (int exoid,
- ex_entity_type obj_type,
- int *varid_arr)
-{
- int status1, status2;
- int varid;
- size_t i, j;
- size_t num_entity = 0;
- size_t num_var = 0;
- char errmsg[MAX_ERR_LENGTH];
- const char* routine = "ex_get_varid";
-
- /*
- * The ent_type and the var_name are used to build the netcdf
- * variables name. Normally this is done via a macro defined in
- * exodusII_int.h
- */
- const char* ent_type = NULL;
- const char* var_name = NULL;
-
- exerrval = 0; /* clear error code */
-
- if (obj_type == EX_NODAL){
- /* Handle nodal variables in a node-specific manner */
- return ex_get_nodal_varid(exoid, varid_arr);
- }
- else if (obj_type == EX_ELEM_BLOCK) {
- status1 = ex_get_dimension(exoid, DIM_NUM_ELE_VAR, "element variables", &num_var, &varid, routine);
- var_name = "vals_elem_var";
- ent_type = "eb";
- }
- else if (obj_type == EX_NODE_SET) {
- status1 = ex_get_dimension(exoid, DIM_NUM_NSET_VAR, "nodeset variables", &num_var, &varid, routine);
- var_name = "vals_nset_var";
- ent_type = "ns";
- }
- else if (obj_type == EX_SIDE_SET) {
- status1 = ex_get_dimension(exoid, DIM_NUM_SSET_VAR, "sideset variables", &num_var, &varid, routine);
- var_name = "vals_sset_var";
- ent_type = "ss";
- }
- else if (obj_type == EX_EDGE_BLOCK) {
- status1 = ex_get_dimension(exoid, DIM_NUM_EDG_VAR, "edge variables", &num_var, &varid, routine);
- var_name = "vals_edge_var";
- ent_type = "eb";
- }
- else if (obj_type == EX_EDGE_SET) {
- status1 = ex_get_dimension(exoid, DIM_NUM_ESET_VAR, "edgeset variables", &num_var, &varid, routine);
- var_name = "vals_eset_var";
- ent_type = "es";
- }
- else if (obj_type == EX_FACE_BLOCK) {
- status1 = ex_get_dimension(exoid, DIM_NUM_FAC_VAR, "face variables", &num_var, &varid, routine);
- var_name = "vals_face_var";
- ent_type = "fb";
- }
- else if (obj_type == EX_FACE_SET) {
- status1 = ex_get_dimension(exoid, DIM_NUM_FSET_VAR, "faceset variables", &num_var, &varid, routine);
- var_name = "vals_fset_var";
- ent_type = "fs";
- }
- else if (obj_type == EX_ELEM_SET) {
- status1 = ex_get_dimension(exoid, DIM_NUM_ELSET_VAR, "elementset variables", &num_var, &varid, routine);
- var_name = "vals_elset_var";
- ent_type = "es";
- }
- else { /* invalid variable type */
- exerrval = EX_BADPARAM;
- sprintf(errmsg,
- "Error: Invalid object type %d specified in file id %d",
- obj_type, exoid);
- ex_err("ex_get_varid",errmsg,exerrval);
- return (EX_WARN);
- }
-
- status2 = ex_get_dimension(exoid, ex_dim_num_objects(obj_type),
- ex_name_of_object(obj_type), &num_entity, &varid, routine);
- if (status2 != NC_NOERR || status1 != NC_NOERR)
- return(EX_FATAL);
-
- if (num_entity == 0 || num_var == 0)
- return(EX_WARN);
-
- for (j=0; j<num_entity; j++) {
- for (i=0; i<num_var; i++) {
- /* NOTE: names are 1-based */
- if (nc_inq_varid(exoid, ex_catstr2(var_name, i+1, ent_type, j+1), &varid) == NC_NOERR)
- /* variable exists; put varid in the varid_arr table */
- varid_arr[j*num_var+i] = varid;
- else
- /* variable doesn't exist; put 0 in the table */
- varid_arr[j*num_var+i] = 0;
- }
- }
- return (EX_NOERR);
-}
-
diff --git a/exodus/cbind/src/exgvv.c b/exodus/cbind/src/exgvv.c
deleted file mode 100644
index 1963e60..0000000
--- a/exodus/cbind/src/exgvv.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*****************************************************************************
-*
-* exgev - ex_get_varid_var
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-* int time_step time step number
-* int varid id of variable on exodus database
-* int num_entity number of entities for this variable
-*
-*
-* exit conditions -
-* float* var_vals array of variable values
-*
-*
-* revision history -
-*
-*
-*****************************************************************************/
-
-#include "exodusII.h"
-#include "exodusII_int.h"
-
-/*!
- * reads the values of a single variable at one time step in the
- * database; assume the first time index is 1. Access based on the
- * passed in 'varid'
- *
- * NOTE: If used for nodal variables, it must be an ex_large_model == 1
- */
-
-int ex_get_varid_var(int exoid,
- int time_step,
- int varid,
- int num_entity,
- void *var_vals)
-{
- int status;
- size_t start[2], count[2];
- char errmsg[MAX_ERR_LENGTH];
-
- exerrval = 0; /* clear error code */
-
- /* read values of variable */
-
- start[0] = --time_step;
- start[1] = 0;
-
- count[0] = 1;
- count[1] = num_entity;
-
- if (ex_comp_ws(exoid) == 4) {
- status = nc_get_vara_float(exoid, varid, start, count, var_vals);
- } else {
- status = nc_get_vara_double(exoid, varid, start, count, var_vals);
- }
-
- if (status != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get variable with variable id %d in file id %d",
- varid,exoid);/*this msg needs to be improved*/
- ex_err("ex_get_varid_var",errmsg,exerrval);
- return (EX_FATAL);
- }
- return (EX_NOERR);
-}
diff --git a/exodus/cbind/src/expmp.c b/exodus/cbind/src/expmp.c
deleted file mode 100644
index 7c6d51b..0000000
--- a/exodus/cbind/src/expmp.c
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*****************************************************************************
-*
-* expmp - ex_put_map_param
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-* int num_node_maps number of node maps
-* int num_elem_maps number of element maps
-*
-* exit conditions -
-*
-*
-*****************************************************************************/
-
-#include "exodusII.h"
-#include "exodusII_int.h"
-#include <assert.h>
-#include <stdlib.h>
-
-/*!
- * defines the number of node and element maps. It is more efficient
- * to define both of these at the same time; however, they can be
- * defined in separate calls by setting only one of the counts to a
- * non-zero value. It is an error to redefine the number of node or
- * element maps.
- * \param exoid exodus file id
- * \param num_node_maps number of node maps
- * \param num_elem_maps number of element maps
- */
-
-int ex_put_map_param (int exoid,
- int num_node_maps,
- int num_elem_maps)
-{
- int dim[2], dimid, strdim, varid, status;
- int var_nm_id, var_em_id;
- int i;
- char errmsg[MAX_ERR_LENGTH];
-
- exerrval = 0; /* clear error code */
-
- /* return if these have been defined before */
- if ( (num_node_maps > 0 && ((nc_inq_dimid (exoid, DIM_NUM_NM, &dimid)) == NC_NOERR)) ||
- (num_elem_maps > 0 && ((nc_inq_dimid (exoid, DIM_NUM_EM, &dimid)) == NC_NOERR)) )
- {
- exerrval = EX_MSG;
- sprintf(errmsg,
- "Error: number of maps already defined for file id %d",exoid);
- ex_err("ex_put_map_param",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- if ( (num_node_maps > 0) || (num_elem_maps > 0) ) {
-
- /* inquire previously defined dimensions */
- if ((status = nc_inq_dimid (exoid, DIM_STR_NAME, &strdim)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get string length in file id %d",exoid);
- ex_err("ex_put_map_param",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* put file into define mode */
- if ((status = nc_redef (exoid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to put file id %d into define mode", exoid);
- ex_err("ex_put_map_param",errmsg,exerrval);
- return (EX_FATAL);
- }
-
-
- /* node maps: */
- if (num_node_maps > 0) {
-
- if ((status = nc_def_dim(exoid, DIM_NUM_NM, num_node_maps, &dimid)) != NC_NOERR)
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to define number of node maps in file id %d",exoid);
- ex_err("ex_put_map_param",errmsg,exerrval);
- goto error_ret; /* exit define mode and return */
- }
-
- /* node maps id array: */
- dim[0] = dimid;
- if ((status = nc_def_var(exoid, VAR_NM_PROP(1), NC_INT, 1, dim, &var_nm_id)) != NC_NOERR)
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to create node maps property array in file id %d",
- exoid);
- ex_err("ex_put_map_param",errmsg,exerrval);
- goto error_ret; /* exit define mode and return */
- }
-
- /* store property name as attribute of property array variable */
- if ((status=nc_put_att_text(exoid, var_nm_id, ATT_PROP_NAME, 3, "ID")) != NC_NOERR)
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to store node map property name %s in file id %d",
- "ID",exoid);
- ex_err("ex_put_map_param",errmsg,exerrval);
- goto error_ret; /* exit define mode and return */
- }
-
- /* Node map names... */
- dim[0] = dimid;
- dim[1] = strdim;
-
- if (nc_def_var(exoid, VAR_NAME_NM, NC_CHAR, 2, dim, &varid) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to define node map name array in file id %d",exoid);
- ex_err("ex_put_map_param",errmsg,exerrval);
- goto error_ret; /* exit define mode and return */
- }
-
- /* determine number of nodes */
- if ((status = nc_inq_dimid (exoid, DIM_NUM_NODES, &dimid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: couldn't determine number of nodes in file id %d",
- exoid);
- ex_err("ex_put_node_map",errmsg,exerrval);
- goto error_ret; /* exit define mode and return */
- }
-
- dim[0] = dimid;
-
- /* create variable array in which to store the node maps */
- for (i=0; i < num_node_maps; i++) {
- if ((status = nc_def_var(exoid,VAR_NODE_MAP(i+1),NC_INT,1,dim,&varid)) != NC_NOERR) {
- if (status == NC_ENAMEINUSE) {
- exerrval = status;
- sprintf(errmsg,
- "Error: node map %d already defined in file id %d",
- i,exoid);
- ex_err("ex_put_node_map",errmsg,exerrval);
- } else {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to create node map %d in file id %d",
- i,exoid);
- ex_err("ex_put_node_map",errmsg,exerrval);
- }
- goto error_ret; /* exit define mode and return */
- }
- }
- }
-
- /* element maps: */
- if (num_elem_maps > 0) {
- if ((status = nc_def_dim (exoid, DIM_NUM_EM, num_elem_maps,&dimid)) != NC_NOERR)
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to define number of element maps in file id %d",
- exoid);
- ex_err("ex_put_map_param",errmsg,exerrval);
- goto error_ret; /* exit define mode and return */
- }
-
- /* element maps id array: */
- dim[0] = dimid;
- if ((status = nc_def_var(exoid, VAR_EM_PROP(1), NC_INT, 1, dim, &var_em_id)) != NC_NOERR)
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to create element maps property array in file id %d",
- exoid);
- ex_err("ex_put_map_param",errmsg,exerrval);
- goto error_ret; /* exit define mode and return */
- }
-
- /* store property name as attribute of property array variable */
- if ((status=nc_put_att_text(exoid, var_em_id, ATT_PROP_NAME, 3, "ID")) != NC_NOERR)
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to store element map property name %s in file id %d",
- "ID",exoid);
- ex_err("ex_put_map_param",errmsg,exerrval);
- goto error_ret; /* exit define mode and return */
- }
-
- /* Element map names... */
- dim[0] = dimid;
- dim[1] = strdim;
-
- if ((status = nc_def_var(exoid, VAR_NAME_EM, NC_CHAR, 2, dim, &varid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to define element map name array in file id %d",exoid);
- ex_err("ex_put_map_param",errmsg,exerrval);
- goto error_ret; /* exit define mode and return */
- }
-
- /* determine number of elements */
- if ((status = nc_inq_dimid(exoid, DIM_NUM_ELEM, &dimid)) != NC_NOERR)
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: couldn't determine number of elements in file id %d",
- exoid);
- ex_err("ex_put_elem_map",errmsg,exerrval);
- goto error_ret; /* exit define mode and return */
- }
-
- /* create variable array in which to store the element maps */
- dim[0] = dimid;
- for (i = 0; i < num_elem_maps; i++) {
- if ((status = nc_def_var(exoid,VAR_ELEM_MAP(i+1),NC_INT,1,dim, &varid)) != NC_NOERR)
- {
- if (status == NC_ENAMEINUSE)
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: element map %d already defined in file id %d",
- i,exoid);
- ex_err("ex_put_elem_map",errmsg,exerrval);
- }
- else
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to create element map %d in file id %d",
- i,exoid);
- ex_err("ex_put_elem_map",errmsg,exerrval);
- }
- goto error_ret; /* exit define mode and return */
- }
- }
- }
-
- /* leave define mode */
- if ((status = nc_enddef (exoid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to complete variable definitions in file id %d",exoid);
- ex_err("ex_put_map_param",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* Fill the id arrays with EX_INVALID_ID */
- {
- int maxset = num_node_maps > num_elem_maps ? num_node_maps : num_elem_maps;
- int *invalid_ids = malloc(maxset*sizeof(int));
- for (i=0; i < maxset; i++) {
- invalid_ids[i] = EX_INVALID_ID;
- }
- if (num_node_maps > 0) {
- status = nc_put_var_int(exoid, var_nm_id, invalid_ids);
- assert(status == NC_NOERR);
- }
- if (num_elem_maps > 0) {
- status = nc_put_var_int(exoid, var_em_id, invalid_ids);
- assert(status == NC_NOERR);
- }
- free(invalid_ids);
- }
- }
-
- return (EX_NOERR);
-
- /* Fatal error: exit definition mode and return */
- error_ret:
- if (nc_enddef (exoid) != NC_NOERR) /* exit define mode */
- {
- sprintf(errmsg,
- "Error: failed to complete definition for file id %d",
- exoid);
- ex_err("ex_put_map_param",errmsg,exerrval);
- }
- return (EX_FATAL);
-}
diff --git a/exodus/cbind/src/expnmap.c b/exodus/cbind/src/expnmap.c
deleted file mode 100644
index 737c1e9..0000000
--- a/exodus/cbind/src/expnmap.c
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
- * Copyright (c) 2006 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*****************************************************************************
-*
-* expem - ex_put_num_map
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-* int map_type type of map (node,edge,face,elem)
-* int map_id id to associate with new map
-* int *map_data map set value array
-*
-* exit conditions -
-*
-* revision history -
-*
-*****************************************************************************/
-
-#include "exodusII.h"
-#include "exodusII_int.h"
-#include <stdlib.h> /* for free() */
-
-/*!
- * writes a map; this is a vector of integers of the same length as the
- * number of entries in the source object (nodes, edges, faces, or elements
- * in the file).
- * \param exoid exodus file id
- * \param map_type type of map (node,edge,face,elem)
- * \param map_id id to associate with new map
- * \param map map set value array
- */
-
-int ex_put_num_map ( int exoid,
- ex_entity_type map_type,
- int map_id,
- const int *map )
-{
- int dimid, varid;
- size_t start[1];
- int ldum;
- int num_maps;
- size_t num_entries;
- int cur_num_maps;
- char errmsg[MAX_ERR_LENGTH];
- const char* dnumentries;
- const char* dnummaps;
- const char* vmapids;
- const char* vmap;
- int status;
-
- exerrval = 0; /* clear error code */
-
- switch ( map_type ) {
- case EX_NODE_MAP:
- dnumentries = DIM_NUM_NODES;
- dnummaps = DIM_NUM_NM;
- vmapids = VAR_NM_PROP(1);
- break;
- case EX_EDGE_MAP:
- dnumentries = DIM_NUM_EDGE;
- dnummaps = DIM_NUM_EDM;
- vmapids = VAR_EDM_PROP(1);
- break;
- case EX_FACE_MAP:
- dnumentries = DIM_NUM_FACE;
- dnummaps = DIM_NUM_FAM;
- vmapids = VAR_FAM_PROP(1);
- break;
- case EX_ELEM_MAP:
- dnumentries = DIM_NUM_ELEM;
- dnummaps = DIM_NUM_EM;
- vmapids = VAR_EM_PROP(1);
- break;
- default:
- exerrval = EX_BADPARAM;
- sprintf( errmsg,
- "Error: Bad map type (%d) specified for file id %d",
- map_type, exoid );
- ex_err( "ex_put_num_map", errmsg, exerrval );
- return (EX_FATAL);
- }
-
- /* Make sure the file contains entries */
- if (nc_inq_dimid (exoid, dnumentries, &dimid) != NC_NOERR )
- {
- return (EX_NOERR);
- }
-
- /* first check if any maps are specified */
- if ((status = nc_inq_dimid (exoid, dnummaps, &dimid)) != NC_NOERR )
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: no %ss specified in file id %d",
- ex_name_of_object(map_type),exoid);
- ex_err("ex_put_num_map",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* Check for duplicate map id entry */
- ex_id_lkup(exoid,map_type,map_id);
- if (exerrval != EX_LOOKUPFAIL) /* found the map id */
- {
- sprintf(errmsg,
- "Error: %s %d already defined in file id %d",
- ex_name_of_object(map_type),map_id,exoid);
- ex_err("ex_put_num_map",errmsg,exerrval);
- return(EX_FATAL);
- }
-
- /* Get number of maps initialized for this file */
- if ((status = nc_inq_dimlen(exoid,dimid,&num_entries)) != NC_NOERR)
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get number of %ss in file id %d",
- ex_name_of_object(map_type),exoid);
- ex_err("ex_put_num_map",errmsg,exerrval);
- return (EX_FATAL);
- }
- num_maps = num_entries;
-
- /* Keep track of the total number of maps defined using a counter stored
- in a linked list keyed by exoid.
- NOTE: ex_get_file_item is used to find the number of maps
- for a specific file and returns that value.
- */
- cur_num_maps = ex_get_file_item(exoid, ex_get_counter_list(map_type));
- if (cur_num_maps >= num_maps) {
- exerrval = EX_FATAL;
- sprintf(errmsg,
- "Error: exceeded number of %ss (%d) specified in file id %d",
- ex_name_of_object(map_type),num_maps,exoid);
- ex_err("ex_put_num_map",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* NOTE: ex_inc_file_item is used to find the number of maps
- for a specific file and returns that value incremented. */
- cur_num_maps = ex_inc_file_item(exoid, ex_get_counter_list(map_type));
-
- /* write out information to previously defined variable */
-
- /* first get id of variable */
- if ((status = nc_inq_varid (exoid, vmapids, &varid)) == -1)
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate %s ids in file id %d",
- ex_name_of_object(map_type),exoid);
- ex_err("ex_put_num_map",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* then, write out map id */
- start[0] = cur_num_maps;
-
- ldum = (int)map_id;
- if ((status = nc_put_var1_int(exoid, varid, start, &ldum)) != NC_NOERR)
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to store %s id %d in file id %d",
- ex_name_of_object(map_type),map_id,exoid);
- ex_err("ex_put_num_map",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- switch ( map_type ) {
- case EX_NODE_MAP:
- vmap = VAR_NODE_MAP(cur_num_maps+1);
- break;
- case EX_EDGE_MAP:
- vmap = VAR_EDGE_MAP(cur_num_maps+1);
- break;
- case EX_FACE_MAP:
- vmap = VAR_FACE_MAP(cur_num_maps+1);
- break;
- case EX_ELEM_MAP:
- vmap = VAR_ELEM_MAP(cur_num_maps+1);
- break;
- default:
- exerrval = 1005;
- sprintf(errmsg,
- "Internal Error: unrecognized map type in switch: %d in file id %d",
- map_type,exoid);
- ex_err("ex_putt_n_one_attr",errmsg,EX_MSG);
- return (EX_FATAL);
- }
-
- /* locate variable array in which to store the map */
- if ((status = nc_inq_varid(exoid,vmap,&varid)) != NC_NOERR)
- {
- int dims[2];
-
- /* determine number of entries */
- if ((status = nc_inq_dimid (exoid, dnumentries, &dimid)) == -1 )
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: couldn't determine number of %s entries in file id %d",
- ex_name_of_object(map_type),exoid);
- ex_err("ex_put_num_map",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- status = 0;
-
- if ((status = nc_redef( exoid )) != NC_NOERR ) {
- exerrval = status;
- sprintf(errmsg, "Error: failed to place file id %d into define mode", exoid);
- ex_err("ex_put_num_map",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- dims[0] = dimid;
- if ((status = nc_def_var( exoid, vmap, NC_INT, 1, dims, &varid )) == -1 ) {
- exerrval = status;
- sprintf(errmsg, "Error: failed to define map %s in file id %d", vmap, exoid);
- ex_err("ex_put_num_map",errmsg,exerrval);
- }
-
- if ((status = nc_enddef(exoid)) != NC_NOERR ) { /* exit define mode */
- sprintf( errmsg, "Error: failed to complete definition for file id %d", exoid );
- ex_err( "ex_put_num_map", errmsg, exerrval );
- varid = -1; /* force early exit */
- }
-
- if ( varid == -1 ) /* we couldn't define variable and have prepared error message. */
- return (EX_FATAL);
- }
-
- /* write out the map */
- if ((status = nc_put_var_int(exoid, varid, map)) != NC_NOERR)
- {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to store %s in file id %d",
- ex_name_of_object(map_type),exoid);
- ex_err("ex_put_num_map",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- return (EX_NOERR);
-}
diff --git a/exodus/cbind/src/expnvv.c b/exodus/cbind/src/expnvv.c
deleted file mode 100644
index c0ad711..0000000
--- a/exodus/cbind/src/expnvv.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*****************************************************************************
-*
-* expnv - ex_put_nodal_varid_var
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-* int time_step whole time step number
-* int nodeal_var_index index of desired nodal variable
-* int num_nodes number of nodal points
-* int varid id of variable on exodus database
-* float* nodal_var_vals array of nodal variable values
-*
-* exit conditions -
-*
-* revision history -
-*
-*
-*****************************************************************************/
-
-#include "exodusII.h"
-#include "exodusII_int.h"
-
-/*!
- * writes the values of a single nodal variable for a single time step to
- * the database; assume the first time step and nodal variable index
- * is 1
- * \param exoid exodus file id
- * \param time_step whole time step number
- * \param nodal_var_index index of desired nodal variable
- * \param num_nodes number of nodal points
- * \param varid id of variable on exodus database
- * \param nodal_var_vals array of nodal variable values
- */
-
-int ex_put_nodal_varid_var(int exoid,
- int time_step,
- int nodal_var_index,
- int num_nodes,
- int varid,
- const void *nodal_var_vals)
-{
- int status;
- size_t start[3], count[3];
- char errmsg[MAX_ERR_LENGTH];
-
- exerrval = 0; /* clear error code */
-
- if (ex_large_model(exoid) == 0) {
- start[0] = --time_step;
- start[1] = --nodal_var_index;
- start[2] = 0;
-
- count[0] = 1;
- count[1] = 1;
- count[2] = num_nodes;
- } else {
- start[0] = --time_step;
- start[1] = 0;
-
- count[0] = 1;
- count[1] = num_nodes;
- }
-
- if (ex_comp_ws(exoid) == 4) {
- status = nc_put_vara_float(exoid, varid, start, count, nodal_var_vals);
- } else {
- status = nc_put_vara_double(exoid, varid, start, count, nodal_var_vals);
- }
-
- if (status != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to store nodal variables in file id %d",
- exoid);
- ex_err("ex_put_nodal_varid_var",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- return (EX_NOERR);
-}
diff --git a/exodus/cbind/src/exppem.c b/exodus/cbind/src/exppem.c
deleted file mode 100644
index 302bf57..0000000
--- a/exodus/cbind/src/exppem.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*****************************************************************************
-*
-* exppem - ex_put_partial_elem_map
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-* int map_id element map id
-* int ent_start first entry in map
-* int ent_count number of entries in map
-* int *elem_map element map
-*
-* exit conditions -
-*
-* revision history -
-*
-*
-*****************************************************************************/
-
-#include "exodusII.h"
-#include "exodusII_int.h"
-#include <stdlib.h> /* for free() */
-
-/*!
- * writes an element map; this is a vector of integers of length number
- * of elements
- */
-int ex_put_partial_elem_map (int exoid,
- int map_id,
- int ent_start,
- int ent_count,
- const int *elem_map)
-{
- int status;
- int dimid, varid, map_ndx, map_exists;
- size_t start[1];
- size_t num_elem_maps, num_elem, count[1];
- int cur_num_elem_maps;
- char errmsg[MAX_ERR_LENGTH];
-
- exerrval = 0; /* clear error code */
- map_exists = 0;
-
- /* Make sure the file contains elements */
- if (nc_inq_dimid (exoid, DIM_NUM_ELEM, &dimid) != NC_NOERR ) {
- return (EX_NOERR);
- }
-
- /* first check if any element maps are specified */
- if ((status = nc_inq_dimid(exoid, DIM_NUM_EM, &dimid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: no element maps specified in file id %d",
- exoid);
- ex_err("ex_put_partial_elem_map",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* Check for duplicate element map id entry */
- map_ndx = ex_id_lkup(exoid,EX_ELEM_MAP,map_id);
- if (exerrval == EX_LOOKUPFAIL) { /* did not find the element map id */
- map_exists = 0; /* Map is being defined */
- map_ndx = -1;
- } else {
- map_exists = 1; /* A portion of this map has already been written */
- }
-
- if (!map_exists) {
- /* Get number of element maps initialized for this file */
- if ((status = nc_inq_dimlen(exoid,dimid,&num_elem_maps)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get number of element maps in file id %d",
- exoid);
- ex_err("ex_put_partial_elem_map",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* Keep track of the total number of element maps defined using a
- counter stored in a linked list keyed by exoid. NOTE:
- ex_get_file_item is used to find the number of element maps for a
- specific file and returns that value.
- */
- cur_num_elem_maps = ex_get_file_item(exoid, ex_get_counter_list(EX_ELEM_MAP));
- if (cur_num_elem_maps >= (int)num_elem_maps) {
- exerrval = EX_FATAL;
- sprintf(errmsg,
- "Error: exceeded number of element maps (%ld) specified in file id %d",
- (long)num_elem_maps,exoid);
- ex_err("ex_put_partial_elem_map",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* NOTE: ex_inc_file_item is used to find the number of element maps
- for a specific file and returns that value incremented. */
- cur_num_elem_maps = ex_inc_file_item(exoid, ex_get_counter_list(EX_ELEM_MAP));
- } else {
- cur_num_elem_maps = map_ndx-1;
- }
-
- /* determine number of elements */
- if ((status = nc_inq_dimid(exoid, DIM_NUM_ELEM, &dimid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: couldn't determine number of elements in file id %d",
- exoid);
- ex_err("ex_put_partial_elem_map",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- if ((status = nc_inq_dimlen(exoid, dimid, &num_elem)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get number of elements in file id %d",
- exoid);
- ex_err("ex_put_partial_elem_map",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* Check input parameters for a valid range of numbers */
- if (ent_start <= 0 || ent_start > (int)num_elem) {
- exerrval = EX_FATAL;
- sprintf(errmsg,
- "Error: start count is invalid in file id %d",
- exoid);
- ex_err("ex_put_partial_elem_map",errmsg,exerrval);
- return (EX_FATAL);
- }
- if (ent_count < 0) {
- exerrval = EX_FATAL;
- sprintf(errmsg,
- "Error: Invalid count value in file id %d",
- exoid);
- ex_err("ex_put_partial_elem_map",errmsg,exerrval);
- return (EX_FATAL);
- }
- if (ent_start+ent_count-1 > (int)num_elem) {
- exerrval = EX_FATAL;
- sprintf(errmsg,
- "Error: start+count-1 is larger than element count in file id %d",
- exoid);
- ex_err("ex_put_partial_elem_map",errmsg,exerrval);
- return (EX_FATAL);
- }
-
-
- /* write out information to previously defined variable */
-
- /* first get id of variable */
- if ((status = nc_inq_varid(exoid, VAR_EM_PROP(1), &varid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate element map ids in file id %d",
- exoid);
- ex_err("ex_put_partial_elem_map",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* then, write out element map id */
- if (!map_exists) {
- start[0] = cur_num_elem_maps;
-
- if ((status = nc_put_var1_int(exoid, varid, start, &map_id)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to store element map id %d in file id %d",
- map_id,exoid);
- ex_err("ex_put_partial_elem_map",errmsg,exerrval);
- return (EX_FATAL);
- }
- }
-
- /* locate variable array in which to store the element map */
- if ((status = nc_inq_varid(exoid,VAR_ELEM_MAP(cur_num_elem_maps+1),
- &varid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate element map %d in file id %d",
- map_id,exoid);
- ex_err("ex_put_partial_elem_map",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* write out the element map */
- start[0] = ent_start-1;
- count[0] = ent_count;
-
- status = nc_put_vara_int(exoid, varid, start, count, elem_map);
-
- if (status != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to store element map in file id %d",
- exoid);
- ex_err("ex_put_partial_elem_map",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- return (EX_NOERR);
-}
diff --git a/exodus/cbind/src/expsetp.c b/exodus/cbind/src/expsetp.c
deleted file mode 100644
index 2e5faa9..0000000
--- a/exodus/cbind/src/expsetp.c
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*****************************************************************************
-*
-* expsetp - ex_put_set_param
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-* int set_type the type of set
-* int set_id set id
-* int num_entries_in_set number of entries in the set
-* int num_dist_fact_in_set number of distribution factors in the
-* set
-*
-* exit conditions -
-*
-* revision history -
-*
-*
-*****************************************************************************/
-
-#include "exodusII.h"
-#include "exodusII_int.h"
-
-/*!
- * writes the set id and the number of entries which describe a single set
- * \param exoid exodus file id
- * \param set_type the type of set
- * \param set_id set id
- * \param num_entries_in_set number of entries in the set
- * \param num_dist_fact_in_set number of distribution factors in the set
- */
-
-int ex_put_set_param (int exoid,
- ex_entity_type set_type,
- int set_id,
- int num_entries_in_set,
- int num_dist_fact_in_set)
-{
- int status;
- size_t temp;
- int dimid, varid, set_id_ndx, dims[1];
- size_t start[1];
- int num_sets;
- int ldum;
- int cur_num_sets, set_stat;
- char errmsg[MAX_ERR_LENGTH];
- char* dimptr = NULL;
- char* idsptr = NULL;
- char* statptr = NULL;
- char* numentryptr = NULL;
- char* numdfptr = NULL;
- char* factptr = NULL;
- char* entryptr = NULL;
- char* extraptr = NULL;
-
- exerrval = 0; /* clear error code */
-
- /* setup pointers based on set_type
- NOTE: there is another block that sets more stuff later ... */
- if (set_type == EX_NODE_SET) {
- dimptr = DIM_NUM_NS;
- idsptr = VAR_NS_IDS;
- statptr = VAR_NS_STAT;
- }
- else if (set_type == EX_EDGE_SET) {
- dimptr = DIM_NUM_ES;
- idsptr = VAR_ES_IDS;
- statptr = VAR_ES_STAT;
- }
- else if (set_type == EX_FACE_SET) {
- dimptr = DIM_NUM_FS;
- idsptr = VAR_FS_IDS;
- statptr = VAR_FS_STAT;
- }
- else if (set_type == EX_SIDE_SET) {
- dimptr = DIM_NUM_SS;
- idsptr = VAR_SS_IDS;
- statptr = VAR_SS_STAT;
- }
- else if (set_type == EX_ELEM_SET) {
- dimptr = DIM_NUM_ELS;
- idsptr = VAR_ELS_IDS;
- statptr = VAR_ELS_STAT;
- }
- else {
- exerrval = EX_FATAL;
- sprintf(errmsg,
- "Error: invalid set type (%d)", set_type);
- ex_err("ex_put_set_param",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* first check if any of that set type is specified */
-
- if ((status = nc_inq_dimid(exoid, dimptr, &dimid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: no %ss specified in file id %d", ex_name_of_object(set_type),
- exoid);
- ex_err("ex_put_set_param",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* Check for duplicate set id entry */
- ex_id_lkup(exoid, set_type, set_id);
- if (exerrval != EX_LOOKUPFAIL) { /* found the side set id */
- sprintf(errmsg,
- "Error: %s %d already defined in file id %d", ex_name_of_object(set_type),
- set_id,exoid);
- ex_err("ex_put_set_param",errmsg,exerrval);
- return(EX_FATAL);
- }
-
- /* Get number of sets specified for this file */
- if ((status = nc_inq_dimlen(exoid,dimid,&temp)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get number of %ss in file id %d",
- ex_name_of_object(set_type), exoid);
- ex_err("ex_put_set_param",errmsg,exerrval);
- return (EX_FATAL);
- }
- num_sets = temp;
-
-
- /* Keep track of the total number of sets defined using a counter stored
- in a linked list keyed by exoid.
- NOTE: ex_get_file_item finds the maximum number of sets defined
- for a specific file and returns that value.
- */
- cur_num_sets=ex_get_file_item(exoid, ex_get_counter_list(set_type));
- if (cur_num_sets >= num_sets) {
- exerrval = EX_FATAL;
- sprintf(errmsg,
- "Error: exceeded number of %ss (%d) defined in file id %d",
- ex_name_of_object(set_type), num_sets,exoid);
- ex_err("ex_put_set_param",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* NOTE: ex_inc_file_item finds the current number of sets defined
- for a specific file and returns that value incremented. */
-
- cur_num_sets=ex_inc_file_item(exoid, ex_get_counter_list(set_type));
- set_id_ndx = cur_num_sets + 1;
-
- /* setup more pointers based on set_type */
- if (set_type == EX_NODE_SET) {
- numentryptr = DIM_NUM_NOD_NS(set_id_ndx);
- entryptr = VAR_NODE_NS(set_id_ndx);
- extraptr = NULL;
- /* note we are using DIM_NUM_NODE_NS instead of DIM_NUM_DF_NS */
- numdfptr = DIM_NUM_NOD_NS(set_id_ndx);
- factptr = VAR_FACT_NS(set_id_ndx);
- }
- else if (set_type == EX_EDGE_SET) {
- numentryptr = DIM_NUM_EDGE_ES(set_id_ndx);
- entryptr = VAR_EDGE_ES(set_id_ndx);
- extraptr = VAR_ORNT_ES(set_id_ndx);
- numdfptr = DIM_NUM_DF_ES(set_id_ndx);
- factptr = VAR_FACT_ES(set_id_ndx);
- }
- else if (set_type == EX_FACE_SET) {
- numentryptr = DIM_NUM_FACE_FS(set_id_ndx);
- entryptr = VAR_FACE_FS(set_id_ndx);
- extraptr = VAR_ORNT_FS(set_id_ndx);
- numdfptr = DIM_NUM_DF_FS(set_id_ndx);
- factptr = VAR_FACT_FS(set_id_ndx);
- }
- else if (set_type == EX_SIDE_SET) {
- numentryptr = DIM_NUM_SIDE_SS(set_id_ndx);
- entryptr = VAR_ELEM_SS(set_id_ndx);
- extraptr = VAR_SIDE_SS(set_id_ndx);
- numdfptr = DIM_NUM_DF_SS(set_id_ndx);
- factptr = VAR_FACT_SS(set_id_ndx);
- }
- if (set_type == EX_ELEM_SET) {
- numentryptr = DIM_NUM_ELE_ELS(set_id_ndx);
- entryptr = VAR_ELEM_ELS(set_id_ndx);
- extraptr = NULL;
- numdfptr = DIM_NUM_DF_ELS(set_id_ndx);
- factptr = VAR_FACT_ELS(set_id_ndx);
- }
-
- /* write out information to previously defined variable */
-
- /* first: get id of set id variable */
- if ((status = nc_inq_varid(exoid, idsptr, &varid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate %s %d in file id %d", ex_name_of_object(set_type),
- set_id, exoid);
- ex_err("ex_put_set_param",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* write out set id */
- start[0] = cur_num_sets;
-
- ldum = (int)set_id;
- if ((status = nc_put_var1_int(exoid, varid, start, &ldum)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to store %s id %d in file id %d", ex_name_of_object(set_type),
- set_id, exoid);
- ex_err("ex_put_set_param",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- if (num_entries_in_set == 0) /* Is this a NULL set? */
- set_stat = 0; /* change set status to NULL */
- else
- set_stat = 1; /* change set status to TRUE */
-
- if ((status = nc_inq_varid(exoid, statptr, &varid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate %s status in file id %d", ex_name_of_object(set_type),
- exoid);
- ex_err("ex_put_set_param",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- ldum = (int)set_stat;
- if ((status = nc_put_var1_int(exoid, varid, start, &ldum)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to store %s %d status to file id %d", ex_name_of_object(set_type),
- set_id, exoid);
- ex_err("ex_put_set_param",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- if (num_entries_in_set == 0) {/* Is this a NULL set? */
- return(EX_NOERR);
- }
-
- /* put netcdf file into define mode */
- if ((status = nc_redef (exoid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to put file id %d into define mode",
- exoid);
- ex_err("ex_put_set_param",errmsg,exerrval);
- return (EX_FATAL);
- }
-
-
- /* define dimensions and variables */
- if ((status = nc_def_dim(exoid, numentryptr,
- num_entries_in_set, &dimid)) != NC_NOERR) {
- exerrval = status;
- if (status == NC_ENAMEINUSE)
- {
- sprintf(errmsg,
- "Error: %s %d size already defined in file id %d",
- ex_name_of_object(set_type), set_id,exoid);
- ex_err("ex_put_set_param",errmsg,exerrval);
- }
- else {
- sprintf(errmsg,
- "Error: failed to define number of entries in %s %d in file id %d",
- ex_name_of_object(set_type), set_id,exoid);
- ex_err("ex_put_set_param",errmsg,exerrval);
- }
- goto error_ret;
- }
-
- /* create variable array in which to store the entry lists */
-
- dims[0] = dimid;
- if ((status = nc_def_var(exoid, entryptr, NC_INT, 1, dims, &varid)) != NC_NOERR) {
- exerrval = status;
- if (status == NC_ENAMEINUSE) {
- sprintf(errmsg,
- "Error: entry list already exists for %s %d in file id %d",
- ex_name_of_object(set_type), set_id,exoid);
- ex_err("ex_put_set_param",errmsg,exerrval);
- } else {
- sprintf(errmsg,
- "Error: failed to create entry list for %s %d in file id %d",
- ex_name_of_object(set_type), set_id,exoid);
- ex_err("ex_put_set_param",errmsg,exerrval);
- }
- goto error_ret; /* exit define mode and return */
- }
-
- if (extraptr) {
- if ((status = nc_def_var(exoid, extraptr, NC_INT, 1, dims, &varid)) != NC_NOERR) {
- exerrval = status;
- if (status == NC_ENAMEINUSE) {
- sprintf(errmsg,
- "Error: extra list already exists for %s %d in file id %d",
- ex_name_of_object(set_type), set_id, exoid);
- ex_err("ex_put_set_param",errmsg,exerrval);
- } else {
- sprintf(errmsg,
- "Error: failed to create extra list for %s %d in file id %d",
- ex_name_of_object(set_type), set_id,exoid);
- ex_err("ex_put_set_param",errmsg,exerrval);
- }
- goto error_ret; /* exit define mode and return */
-
- }
- }
-
- /* Create distribution factors variable if required */
-
- if (num_dist_fact_in_set > 0) {
-
- if (set_type == EX_NODE_SET) {
- /* but num_dist_fact_in_set must equal number of nodes */
- if (num_dist_fact_in_set != num_entries_in_set) {
- exerrval = EX_FATAL;
- sprintf(errmsg,
- "Error: # dist fact (%d) not equal to # nodes (%d) in node set %d file id %d",
- num_dist_fact_in_set, num_entries_in_set, set_id, exoid);
- ex_err("ex_put_set_param",errmsg,exerrval);
- goto error_ret; /* exit define mode and return */
- }
-
- /* resuse dimid from entry lists */
-
- } else {
- if ((status = nc_def_dim(exoid, numdfptr,
- num_dist_fact_in_set, &dimid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to define number of dist factors in %s %d in file id %d",
- ex_name_of_object(set_type), set_id,exoid);
- ex_err("ex_put_set_param",errmsg,exerrval);
- goto error_ret; /* exit define mode and return */
- }
- }
-
- /* create variable array in which to store the set distribution factors
- */
- dims[0] = dimid;
- if ((status = nc_def_var(exoid, factptr, nc_flt_code(exoid), 1, dims, &varid)) != NC_NOERR) {
- exerrval = status;
- if (status == NC_ENAMEINUSE) {
- sprintf(errmsg,
- "Error: dist factors list already exists for %s %d in file id %d",
- ex_name_of_object(set_type), set_id,exoid);
- ex_err("ex_put_set_param",errmsg,exerrval);
- } else {
- sprintf(errmsg,
- "Error: failed to create dist factors list for %s %d in file id %d",
- ex_name_of_object(set_type), set_id,exoid);
- ex_err("ex_put_set_param",errmsg,exerrval);
- }
- goto error_ret; /* exit define mode and return */
- }
- }
-
- /* leave define mode */
- if ((status = nc_enddef (exoid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to complete definition in file id %d", exoid);
- ex_err("ex_put_set_param",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- return (EX_NOERR);
-
- /* Fatal error: exit definition mode and return */
- error_ret:
- if (nc_enddef (exoid) != NC_NOERR) { /* exit define mode */
- sprintf(errmsg,
- "Error: failed to complete definition for file id %d",
- exoid);
- ex_err("ex_put_set_param",errmsg,exerrval);
- }
- return (EX_FATAL);
-}
diff --git a/exodus/cbind/src/expvar.c b/exodus/cbind/src/expvar.c
deleted file mode 100644
index 783a191..0000000
--- a/exodus/cbind/src/expvar.c
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * Copyright (c) 2006 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*****************************************************************************
-*
-* expvar - ex_put_var
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-* int time_step time step number
-* int var_type type (edge block, face block, edge set, ... )
-* int var_index element variable index
-* int obj_id element block id
-* int num_entries_this_obj number of entries in this block/set
-*
-* exit conditions -
-*
-*
-* exit conditions -
-*
-* revision history -
-*
-*
-*****************************************************************************/
-
-#include <stdlib.h>
-#include "exodusII.h"
-#include "exodusII_int.h"
-
-/*!
- * writes the values of a single variable for one block at one time
- * step to the database; assume the first time step and variable index
- * are 1
- * \param exoid exodus file id
- * \param time_step time step number
- * \param var_type type (edge block, face block, edge set, ... )
- * \param var_index element variable index
- * \param obj_id element block id
- * \param num_entries_this_obj number of entries in this block/set
- * \param var_vals the values to be written
- */
-
-int ex_put_var (int exoid,
- int time_step,
- ex_entity_type var_type,
- int var_index,
- int obj_id,
- int num_entries_this_obj,
- const void *var_vals)
-{
- int varid, dimid,time_dim, numobjdim, dims[2], obj_id_ndx;
- size_t num_obj;
- size_t num_obj_var;
- size_t num_entity;
- size_t start[2], count[2];
- int *obj_var_truth_tab;
- int status;
- char errmsg[MAX_ERR_LENGTH];
-
- exerrval = 0; /* clear error code */
-
-#define EX_LOOK_UP_VAR(VOBJID,VVAR,VOBJTAB,DNUMOBJ,DNUMOBJVAR) \
- /* Determine index of obj_id in VOBJID array */ \
- obj_id_ndx = ex_id_lkup(exoid,var_type,obj_id); \
- if (exerrval != 0) \
- { \
- if (exerrval == EX_NULLENTITY) \
- { \
- sprintf(errmsg, \
- "Warning: no variables allowed for NULL block %d in file id %d", \
- obj_id,exoid); \
- ex_err("ex_put_var",errmsg,EX_MSG); \
- return (EX_WARN); \
- } \
- else \
- { \
- sprintf(errmsg, \
- "Error: failed to locate %s id %d in %s array in file id %d", \
- ex_name_of_object(var_type), obj_id, VOBJID, exoid); \
- ex_err("ex_put_var",errmsg,exerrval); \
- return (EX_FATAL); \
- } \
- } \
- \
- if ((status = nc_inq_varid (exoid, VVAR(var_index,obj_id_ndx), &varid)) != NC_NOERR) \
- { \
- if (status == NC_ENOTVAR) /* variable doesn't exist, create it! */ \
- { \
- /* check for the existance of an TNAME variable truth table */ \
- if (nc_inq_varid(exoid, VOBJTAB, &varid) == NC_NOERR) { \
- /* find out number of TNAMEs and TNAME variables */ \
- status = ex_get_dimension(exoid, DNUMOBJ, ex_name_of_object(var_type), &num_obj, &dimid, "ex_put_var"); \
- if (status != NC_NOERR) return status; \
- \
- status = ex_get_dimension(exoid, DNUMOBJVAR, ex_name_of_object(var_type), &num_obj_var, &dimid, "ex_put_var"); \
- if (status != NC_NOERR) return status; \
- \
- if (!(obj_var_truth_tab = malloc(num_obj*num_obj_var*sizeof(int)))) \
- { \
- exerrval = EX_MEMFAIL; \
- sprintf(errmsg, \
- "Error: failed to allocate memory for %s variable truth table in file id %d", \
- ex_name_of_object(var_type), exoid); \
- ex_err("ex_put_var",errmsg,exerrval); \
- return (EX_FATAL); \
- } \
- \
- /* read in the TNAME variable truth table */ \
- if ((status = nc_get_var_int (exoid, varid, obj_var_truth_tab)) != NC_NOERR) \
- { \
- exerrval = status; \
- sprintf(errmsg, \
- "Error: failed to get truth table from file id %d", exoid); \
- ex_err("ex_put_var",errmsg,exerrval); \
- return (EX_FATAL); \
- } \
- \
- if(obj_var_truth_tab[num_obj_var*(obj_id_ndx-1)+var_index-1] \
- == 0L) \
- { \
- free(obj_var_truth_tab); \
- exerrval = EX_BADPARAM; \
- sprintf(errmsg, \
- "Error: Invalid %s variable %d, %s %d in file id %d", \
- ex_name_of_object(var_type), var_index, ex_name_of_object(var_type), obj_id, exoid); \
- ex_err("ex_put_var",errmsg,exerrval); \
- return (EX_FATAL); \
- } \
- free(obj_var_truth_tab); \
- } \
- \
- if ((status = nc_inq_dimid(exoid, DIM_TIME, &time_dim)) != NC_NOERR) { \
- exerrval = status; \
- sprintf(errmsg, \
- "Error: failed to locate time dimension in file id %d", exoid); \
- ex_err("ex_put_var",errmsg,exerrval); \
- goto error_ret; /* exit define mode and return */ \
- } \
- \
- ex_get_dimension(exoid, ex_dim_num_entries_in_object(var_type, obj_id_ndx), \
- ex_name_of_object(var_type), &num_entity, &numobjdim, "ex_put_var"); \
- \
- /* variable doesn't exist so put file into define mode */ \
- if ((status = nc_redef (exoid)) != NC_NOERR) { \
- exerrval = status; \
- sprintf(errmsg, \
- "Error: failed to put file id %d into define mode", exoid); \
- ex_err("ex_put_var",errmsg,exerrval); \
- return (EX_FATAL); \
- } \
- \
- /* define netCDF variable to store TNAME variable values */ \
- dims[0] = time_dim; \
- dims[1] = numobjdim; \
- if ((status = nc_def_var(exoid, VVAR(var_index,obj_id_ndx), \
- nc_flt_code(exoid), 2, dims, &varid)) != NC_NOERR) \
- { \
- exerrval = status; \
- sprintf(errmsg, \
- "Error: failed to define %s variable %d in file id %d", \
- ex_name_of_object(var_type), var_index,exoid); \
- ex_err("ex_put_var",errmsg,exerrval); \
- goto error_ret; \
- } \
- \
- /* leave define mode */ \
- \
- if ((status = nc_enddef (exoid)) != NC_NOERR) \
- { \
- exerrval = status; \
- sprintf(errmsg, \
- "Error: failed to complete %s variable %s definition to file id %d", \
- ex_name_of_object(var_type), VVAR(var_index,obj_id_ndx), exoid); \
- ex_err("ex_put_var",errmsg,exerrval); \
- return (EX_FATAL); \
- } \
- } \
- else \
- { \
- exerrval = status; \
- sprintf(errmsg, \
- "Error: failed to locate %s variable %s in file id %d", \
- ex_name_of_object(var_type), VVAR(var_index,obj_id_ndx),exoid); \
- ex_err("ex_put_var",errmsg,exerrval); \
- return (EX_FATAL); \
- } \
- }
-
- switch (var_type) {
- case EX_GLOBAL:
- if ( num_entries_this_obj <= 0 ) {
- exerrval = EX_MSG;
- sprintf(errmsg,
- "Warning: no global variables specified for file id %d",
- exoid);
- ex_err("ex_put_glob_vars",errmsg,exerrval);
-
- return (EX_WARN);
- }
- /* inquire previously defined variable */
-
- if ((status = nc_inq_varid (exoid, VAR_GLO_VAR, &varid)) != NC_NOERR) {
- if (status == NC_ENOTVAR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: no global variables defined in file id %d",
- exoid);
- ex_err("ex_put_glob_vars",errmsg,exerrval);
- } else {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get global variables parameters in file id %d",
- exoid);
- ex_err("ex_put_glob_vars",errmsg,exerrval);
- }
- return (EX_FATAL);
- }
- break;
- case EX_NODAL:
- return ex_put_nodal_var(exoid, time_step, var_index, num_entries_this_obj, var_vals);
- break;
- case EX_EDGE_BLOCK:
- EX_LOOK_UP_VAR(VAR_ID_ED_BLK,VAR_EDGE_VAR,VAR_EBLK_TAB,DIM_NUM_ED_BLK,DIM_NUM_EDG_VAR);
- break;
- case EX_FACE_BLOCK:
- EX_LOOK_UP_VAR(VAR_ID_FA_BLK,VAR_FACE_VAR,VAR_FBLK_TAB,DIM_NUM_FA_BLK,DIM_NUM_FAC_VAR);
- break;
- case EX_ELEM_BLOCK:
- EX_LOOK_UP_VAR(VAR_ID_EL_BLK,VAR_ELEM_VAR,VAR_ELEM_TAB,DIM_NUM_EL_BLK,DIM_NUM_ELE_VAR);
- break;
- case EX_NODE_SET:
- EX_LOOK_UP_VAR(VAR_NS_IDS,VAR_NS_VAR,VAR_NSET_TAB,DIM_NUM_NS,DIM_NUM_NSET_VAR);
- break;
- case EX_EDGE_SET:
- EX_LOOK_UP_VAR(VAR_ES_IDS,VAR_ES_VAR,VAR_ESET_TAB,DIM_NUM_ES,DIM_NUM_ESET_VAR);
- break;
- case EX_FACE_SET:
- EX_LOOK_UP_VAR(VAR_FS_IDS,VAR_FS_VAR,VAR_FSET_TAB,DIM_NUM_FS,DIM_NUM_FSET_VAR);
- break;
- case EX_SIDE_SET:
- EX_LOOK_UP_VAR(VAR_SS_IDS,VAR_SS_VAR,VAR_SSET_TAB,DIM_NUM_SS,DIM_NUM_SSET_VAR);
- break;
- case EX_ELEM_SET:
- EX_LOOK_UP_VAR(VAR_ELS_IDS,VAR_ELS_VAR,VAR_ELSET_TAB,DIM_NUM_ELS,DIM_NUM_ELSET_VAR);
- break;
- default:
- exerrval = EX_MSG;
- sprintf( errmsg, "Error: invalid variable type (%d) specified for file id %d",
- var_type, exoid );
- ex_err( "ex_put_var", errmsg, exerrval );
- return (EX_FATAL);
- }
- /* store element variable values */
-
- start[0] = --time_step;
- start[1] = 0;
-
- if ( var_type == EX_GLOBAL ) {
- /* global variables may be written
- * - all at once (by setting var_index to 1 and num_entries_this_obj to num_glob, or
- * - one at a time (by setting var_index to the desired index and num_entries_this_obj to 1.
- */
- count[0] = var_index;
- } else {
- count[0] = 1;
- }
- count[1] = num_entries_this_obj;
-
- if (ex_comp_ws(exoid) == 4) {
- status = nc_put_vara_float(exoid, varid, start, count, var_vals);
- } else {
- status = nc_put_vara_double(exoid, varid, start, count, var_vals);
- }
-
- if (status != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to store %s %d variable %d in file id %d",
- ex_name_of_object(var_type), obj_id, var_index,exoid);
- ex_err("ex_put_var",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- return (EX_NOERR);
-
- /* Fatal error: exit definition mode and return */
- error_ret:
- if (nc_enddef (exoid) != NC_NOERR) /* exit define mode */
- {
- sprintf(errmsg,
- "Error: failed to complete definition for file id %d",
- exoid);
- ex_err("ex_put_var",errmsg,exerrval);
- }
- return (EX_FATAL);
-}
diff --git a/exodus/cbind/src/expvv.c b/exodus/cbind/src/expvv.c
deleted file mode 100644
index 52f69f6..0000000
--- a/exodus/cbind/src/expvv.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*****************************************************************************
-*
-* expnv - ex_put_varid_var
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-* int time_step whole time step number
-* int varid id of variable on exodus database
-* int num_entity number of entities for this variable
-* float* var_vals array of nodal variable values
-*
-* exit conditions -
-*
-* revision history -
-*
-*
-*****************************************************************************/
-
-#include "exodusII.h"
-#include "exodusII_int.h"
-
-/*!
- * writes the values of a single variable at one time step in the
- * database; assume the first time index is 1. Access based on the
- * passed in 'varid'
- *
- * NOTE: If used for nodal variables, it must be an ex_large_model == 1
- * \param exoid int exodus file id
- * \param time_step int whole time step number
- * \param varid int id of variable on exodus database
- * \param num_entity int number of entities for this variable
- * \param var_vals float* array of nodal variable values
- */
-
-int ex_put_varid_var(int exoid,
- int time_step,
- int varid,
- int num_entity,
- const void *var_vals)
-{
- size_t start[2], count[2];
- int status;
- char errmsg[MAX_ERR_LENGTH];
-
- exerrval = 0; /* clear error code */
-
- start[0] = --time_step;
- start[1] = 0;
-
- count[0] = 1;
- count[1] = num_entity;
-
- if (ex_comp_ws(exoid) == 4) {
- status = nc_put_vara_float(exoid, varid, start, count, var_vals);
- } else {
- status = nc_put_vara_double(exoid, varid, start, count, var_vals);
- }
-
- if (status != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to store variables with varid %d in file id %d",
- varid, exoid);
- ex_err("ex_put_varid_var",errmsg,exerrval);
- return (EX_FATAL);
- }
- return (EX_NOERR);
-}
diff --git a/exodus/cbind/test/CMakeLists.txt b/exodus/cbind/test/CMakeLists.txt
index 88ce577..5374f7f 100644
--- a/exodus/cbind/test/CMakeLists.txt
+++ b/exodus/cbind/test/CMakeLists.txt
@@ -53,16 +53,15 @@ SET( cbind_OLDTESTS
testrd_nc
testwt-zeroe
testwt-zeron
- testrdv
testwt-one-attrib
testwt-partial
- testrd-partial
testrd-nsided
testwt-nsided
testrd-nfaced
testwt-nfaced
create_mesh
rd_wt_mesh
+ test_nemesis
testwt-long-name
testrd-long-name)
diff --git a/exodus/cbind/test/CreateEdgeFace.c b/exodus/cbind/test/CreateEdgeFace.c
index 3930008..06a34da 100644
--- a/exodus/cbind/test/CreateEdgeFace.c
+++ b/exodus/cbind/test/CreateEdgeFace.c
@@ -265,7 +265,7 @@ int cCreateEdgeFace( int argc, char* argv[] )
int exoid;
int appWordSize = 8;
int diskWordSize = 8;
- int concatBlocks = ex_have_arg( argc, argv, "-pcab" );
+ /* int concatBlocks = ex_have_arg( argc, argv, "-pcab" ); */
int concatSets = ex_have_arg( argc, argv, "-pcset" );
int concatResult = ex_have_arg( argc, argv, "-pvpax" );
double t;
@@ -291,76 +291,60 @@ int cCreateEdgeFace( int argc, char* argv[] )
1, /* num_elem_map */
};
- ex_block_params blockParams;
+ ex_block edgeBlocks[1];
+ ex_block faceBlocks[3];
+ ex_block elemBlocks[2];
+
ex_var_params varParams;
- blockParams.edge_blk_id = (int*)malloc(1 * sizeof(int));
- blockParams.num_edge_this_blk = (int*)malloc(1 * sizeof(int));
- blockParams.num_nodes_per_edge = (int*)malloc(1 * sizeof(int));
- blockParams.num_attr_edge = (int*)malloc(1 * sizeof(int));
- blockParams.face_blk_id = (int*)malloc(3 * sizeof(int));
- blockParams.num_face_this_blk = (int*)malloc(3 * sizeof(int));
- blockParams.num_nodes_per_face = (int*)malloc(3 * sizeof(int));
- blockParams.num_attr_face = (int*)malloc(3 * sizeof(int));
- blockParams.elem_blk_id = (int*)malloc(2 * sizeof(int));
- blockParams.num_elem_this_blk = (int*)malloc(2 * sizeof(int));
- blockParams.num_nodes_per_elem = (int*)malloc(2 * sizeof(int));
- blockParams.num_edges_per_elem = (int*)malloc(2 * sizeof(int));
- blockParams.num_faces_per_elem = (int*)malloc(2 * sizeof(int));
- blockParams.num_attr_elem = (int*)malloc(2 * sizeof(int));
-
- blockParams.edge_type = (char**)malloc(1 * sizeof(char*));
- blockParams.edge_type[0] = (char*)malloc((MAX_STR_LENGTH+1) * sizeof(char));
- blockParams.face_type = (char**)malloc(3 * sizeof(char*));
- blockParams.face_type[0] = (char*)malloc((MAX_STR_LENGTH+1) * sizeof(char));
- blockParams.face_type[1] = (char*)malloc((MAX_STR_LENGTH+1) * sizeof(char));
- blockParams.face_type[2] = (char*)malloc((MAX_STR_LENGTH+1) * sizeof(char));
- blockParams.elem_type = (char**)malloc(2 * sizeof(char*));
- blockParams.elem_type[0] = (char*)malloc((MAX_STR_LENGTH+1) * sizeof(char));
- blockParams.elem_type[1] = (char*)malloc((MAX_STR_LENGTH+1) * sizeof(char));
-
- blockParams.edge_blk_id[0] = 100;
- blockParams.num_edge_this_blk[0] = 20;
- blockParams.num_nodes_per_edge[0] = 2;
- blockParams.num_attr_edge[0] = 1;
-
- blockParams.face_blk_id[0] = 500;
- blockParams.face_blk_id[1] = 600;
- blockParams.face_blk_id[2] = 700;
- blockParams.num_face_this_blk[0] = 2;
- blockParams.num_face_this_blk[1] = 1;
- blockParams.num_face_this_blk[2] = 8;
- blockParams.num_nodes_per_face[0] = 4;
- blockParams.num_nodes_per_face[1] = 4;
- blockParams.num_nodes_per_face[2] = 4;
- blockParams.num_attr_face[0] = 1;
- blockParams.num_attr_face[1] = 1;
- blockParams.num_attr_face[2] = 1;
-
- blockParams.elem_blk_id[0] = 200;
- blockParams.elem_blk_id[1] = 201;
- blockParams.num_elem_this_blk[0] = 2;
- blockParams.num_elem_this_blk[1] = 1;
- blockParams.num_nodes_per_elem[0] = 8;
- blockParams.num_nodes_per_elem[1] = 4;
- blockParams.num_edges_per_elem[0] = 12;
- blockParams.num_edges_per_elem[1] = 0;
- blockParams.num_faces_per_elem[0] = 6;
- blockParams.num_faces_per_elem[1] = 0;
- blockParams.num_attr_elem[0] = 2;
- blockParams.num_attr_elem[1] = 0;
-
- blockParams.define_maps = 0;
-
- strcpy(blockParams.edge_type[0], "EDGE2");
-
- strcpy(blockParams.face_type[0], "QUAD4");
- strcpy(blockParams.face_type[1], "QUAD4");
- strcpy(blockParams.face_type[2], "QUAD4");
-
- strcpy(blockParams.elem_type[0], "HEX8");
- strcpy(blockParams.elem_type[1], "TET4");
+ ex_opts (EX_VERBOSE | EX_ABORT );
+ edgeBlocks[0].type = EX_EDGE_BLOCK;
+ edgeBlocks[0].id = 100;
+ edgeBlocks[0].num_entry = 20;
+ edgeBlocks[0].num_nodes_per_entry = 2;
+ edgeBlocks[0].num_attribute = 1;
+ strcpy(edgeBlocks[0].topology, "EDGE2");
+
+ faceBlocks[0].type = EX_FACE_BLOCK;
+ faceBlocks[0].id = 500;
+ faceBlocks[0].num_entry = 2;
+ faceBlocks[0].num_nodes_per_entry = 4;
+ faceBlocks[0].num_attribute = 1;
+ strcpy(faceBlocks[0].topology, "QUAD4");
+
+ faceBlocks[1].type = EX_FACE_BLOCK;
+ faceBlocks[1].id = 600;
+ faceBlocks[1].num_entry = 1;
+ faceBlocks[1].num_nodes_per_entry = 4;
+ faceBlocks[1].num_attribute = 1;
+ strcpy(faceBlocks[1].topology, "QUAD4");
+
+ faceBlocks[2].type = EX_FACE_BLOCK;
+ faceBlocks[2].id = 700;
+ faceBlocks[2].num_entry = 8;
+ faceBlocks[2].num_nodes_per_entry = 4;
+ faceBlocks[2].num_attribute = 1;
+ strcpy(faceBlocks[2].topology, "QUAD4");
+
+ elemBlocks[0].type = EX_ELEM_BLOCK;
+ elemBlocks[0].id = 200;
+ elemBlocks[0].num_entry = 2;
+ elemBlocks[0].num_nodes_per_entry = 8;
+ elemBlocks[0].num_edges_per_entry = 12;
+ elemBlocks[0].num_faces_per_entry = 6;
+ elemBlocks[0].num_attribute = 2;
+ strcpy(elemBlocks[0].topology, "HEX8");
+
+ elemBlocks[1].type = EX_ELEM_BLOCK;
+ elemBlocks[1].id = 201;
+ elemBlocks[1].num_entry = 1;
+ elemBlocks[1].num_nodes_per_entry = 4;
+ elemBlocks[1].num_edges_per_entry = 0;
+ elemBlocks[1].num_faces_per_entry = 0;
+ elemBlocks[1].num_attribute = 0;
+ strcpy(elemBlocks[1].topology, "TET4");
+
varParams.edge_var_tab = (int*)malloc(2 * sizeof(int));
varParams.face_var_tab = (int*)malloc(3 * sizeof(int));
varParams.elem_var_tab = (int*)malloc(2 * sizeof(int));
@@ -396,31 +380,19 @@ int cCreateEdgeFace( int argc, char* argv[] )
return 1;
}
- /* *** NEW API *** */
EXCHECK( ex_put_init_ext( exoid, &modelParams ),
"Unable to initialize database.\n" );
- /* *** NEW API *** */
- if ( concatBlocks ) {
- EXCHECK( ex_put_concat_all_blocks( exoid, &blockParams ),
- "Unable to initialize block params.\n" );
- } else {
+ {
int blk;
for ( blk = 0; blk < modelParams.num_edge_blk; ++blk ) {
- EXCHECK( ex_put_block( exoid, EX_EDGE_BLOCK, blockParams.edge_blk_id[blk], blockParams.edge_type[blk],
- blockParams.num_edge_this_blk[blk], blockParams.num_nodes_per_edge[blk], 0, 0,
- blockParams.num_attr_edge[blk] ), "Unable to write edge block" );
+ EXCHECK( ex_put_block_param( exoid, edgeBlocks[blk]), "Unable to write edge block" );
}
for ( blk = 0; blk < modelParams.num_face_blk; ++blk ) {
- EXCHECK( ex_put_block( exoid, EX_FACE_BLOCK, blockParams.face_blk_id[blk], blockParams.face_type[blk],
- blockParams.num_face_this_blk[blk], blockParams.num_nodes_per_face[blk], 0, 0,
- blockParams.num_attr_face[blk] ), "Unable to write face block" );
+ EXCHECK( ex_put_block_param( exoid, faceBlocks[blk]), "Unable to write face block" );
}
for ( blk = 0; blk < modelParams.num_elem_blk; ++blk ) {
- EXCHECK( ex_put_block( exoid, EX_ELEM_BLOCK, blockParams.elem_blk_id[blk], blockParams.elem_type[blk],
- blockParams.num_elem_this_blk[blk], blockParams.num_nodes_per_elem[blk],
- blockParams.num_edges_per_elem[blk], blockParams.num_faces_per_elem[blk],
- blockParams.num_attr_elem[blk] ), "Unable to write elem block" );
+ EXCHECK( ex_put_block_param( exoid, elemBlocks[blk]), "Unable to write elem block" );
}
}
@@ -432,23 +404,23 @@ int cCreateEdgeFace( int argc, char* argv[] )
/* =============== Connectivity ================== */
/* *** NEW API *** */
- EXCHECK( ex_put_conn( exoid, EX_EDGE_BLOCK, blockParams.edge_blk_id[0], ebconn1, 0, 0 ),
+ EXCHECK( ex_put_conn( exoid, EX_EDGE_BLOCK, edgeBlocks[0].id, ebconn1, 0, 0 ),
"Unable to write edge block connectivity.\n" );
/* *** NEW API *** */
- EXCHECK( ex_put_conn( exoid, EX_FACE_BLOCK, blockParams.face_blk_id[0], fbconn1, 0, 0 ),
+ EXCHECK( ex_put_conn( exoid, EX_FACE_BLOCK, faceBlocks[0].id, fbconn1, 0, 0 ),
"Unable to write face block 1 connectivity.\n" );
- EXCHECK( ex_put_conn( exoid, EX_FACE_BLOCK, blockParams.face_blk_id[1], fbconn2, 0, 0 ),
+ EXCHECK( ex_put_conn( exoid, EX_FACE_BLOCK, faceBlocks[1].id, fbconn2, 0, 0 ),
"Unable to write face block 2 connectivity.\n" );
- EXCHECK( ex_put_conn( exoid, EX_FACE_BLOCK, blockParams.face_blk_id[2], fbconn3, 0, 0 ),
+ EXCHECK( ex_put_conn( exoid, EX_FACE_BLOCK, faceBlocks[2].id, fbconn3, 0, 0 ),
"Unable to write face block 3 connectivity.\n" );
/* *** NEW API *** */
- EXCHECK( ex_put_conn( exoid, EX_ELEM_BLOCK, blockParams.elem_blk_id[0], conn1, econn1, fconn1 ),
+ EXCHECK( ex_put_conn( exoid, EX_ELEM_BLOCK, elemBlocks[0].id, conn1, econn1, fconn1 ),
"Unable to write elem block 1 connectivity.\n" );
/* *** NEW API *** */
- EXCHECK( ex_put_conn( exoid, EX_ELEM_BLOCK, blockParams.elem_blk_id[1], conn2, 0, 0 ),
+ EXCHECK( ex_put_conn( exoid, EX_ELEM_BLOCK, elemBlocks[1].id, conn2, 0, 0 ),
"Unable to write elem block 2 connectivity.\n" );
/* *** NEW API *** */
@@ -471,36 +443,36 @@ int cCreateEdgeFace( int argc, char* argv[] )
/* =============== Attribute names ================ */
/* *** NEW API *** */
- EXCHECK( ex_put_attr_names( exoid, EX_EDGE_BLOCK, blockParams.edge_blk_id[0], (char**)edge_attr_names1 ),
+ EXCHECK( ex_put_attr_names( exoid, EX_EDGE_BLOCK, edgeBlocks[0].id, (char**)edge_attr_names1 ),
"Unable to write edge block 1 attribute names.\n" );
/* *** NEW API *** */
- EXCHECK( ex_put_attr_names( exoid, EX_FACE_BLOCK, blockParams.face_blk_id[0], (char**)face_attr_names1 ),
+ EXCHECK( ex_put_attr_names( exoid, EX_FACE_BLOCK, faceBlocks[0].id, (char**)face_attr_names1 ),
"Unable to write face block 1 attribute names.\n" );
- EXCHECK( ex_put_attr_names( exoid, EX_FACE_BLOCK, blockParams.face_blk_id[1], (char**)face_attr_names2 ),
+ EXCHECK( ex_put_attr_names( exoid, EX_FACE_BLOCK, faceBlocks[1].id, (char**)face_attr_names2 ),
"Unable to write face block 1 attribute names.\n" );
- EXCHECK( ex_put_attr_names( exoid, EX_FACE_BLOCK, blockParams.face_blk_id[2], (char**)face_attr_names3 ),
+ EXCHECK( ex_put_attr_names( exoid, EX_FACE_BLOCK, faceBlocks[2].id, (char**)face_attr_names3 ),
"Unable to write face block 1 attribute names.\n" );
/* *** NEW API *** */
- EXCHECK( ex_put_attr_names( exoid, EX_ELEM_BLOCK, blockParams.elem_blk_id[0], (char**)elem_attr_names1 ),
+ EXCHECK( ex_put_attr_names( exoid, EX_ELEM_BLOCK, elemBlocks[0].id, (char**)elem_attr_names1 ),
"Unable to write elem block 1 attribute names.\n" );
/* =============== Attribute values =============== */
/* *** NEW API *** */
- EXCHECK( ex_put_attr( exoid, EX_EDGE_BLOCK, blockParams.edge_blk_id[0], edge_attr_values1 ),
+ EXCHECK( ex_put_attr( exoid, EX_EDGE_BLOCK, edgeBlocks[0].id, edge_attr_values1 ),
"Unable to write edge block 1 attribute values.\n" );
/* *** NEW API *** */
- EXCHECK( ex_put_attr( exoid, EX_FACE_BLOCK, blockParams.face_blk_id[0], face_attr_values1 ),
+ EXCHECK( ex_put_attr( exoid, EX_FACE_BLOCK, faceBlocks[0].id, face_attr_values1 ),
"Unable to write face block 1 attribute values.\n" );
- EXCHECK( ex_put_attr( exoid, EX_FACE_BLOCK, blockParams.face_blk_id[1], face_attr_values2 ),
+ EXCHECK( ex_put_attr( exoid, EX_FACE_BLOCK, faceBlocks[1].id, face_attr_values2 ),
"Unable to write face block 1 attribute values.\n" );
- EXCHECK( ex_put_attr( exoid, EX_FACE_BLOCK, blockParams.face_blk_id[2], face_attr_values3 ),
+ EXCHECK( ex_put_attr( exoid, EX_FACE_BLOCK, faceBlocks[2].id, face_attr_values3 ),
"Unable to write face block 1 attribute values.\n" );
/* *** NEW API *** */
- EXCHECK( ex_put_attr( exoid, EX_ELEM_BLOCK, blockParams.elem_blk_id[0], elem_attr_values1 ),
+ EXCHECK( ex_put_attr( exoid, EX_ELEM_BLOCK, elemBlocks[0].id, elem_attr_values1 ),
"Unable to write elem block 1 attribute values.\n" );
/* =============== Set parameters ================= */
@@ -511,112 +483,72 @@ int cCreateEdgeFace( int argc, char* argv[] )
EXCHECK( ex_put_names( exoid, EX_SIDE_SET, (char**)sset_names ), "Unable to write side set names.\n" );
EXCHECK( ex_put_names( exoid, EX_ELEM_SET, (char**)elset_names ), "Unable to write element set names.\n" );
- if ( concatSets ) {
- ex_set_specs setParams;
-
- setParams.sets_ids = (int*)malloc(2*sizeof(int));
- setParams.num_entries_per_set = (int*)malloc(2*sizeof(int));
- setParams.num_dist_per_set = (int*)malloc(2*sizeof(int));
- setParams.sets_entry_index = (int*)malloc(2*sizeof(int));
- setParams.sets_dist_index = (int*)malloc(2*sizeof(int));
- setParams.sets_entry_list = (int*)malloc(6*sizeof(int));
- setParams.sets_extra_list = (int*)malloc(6*sizeof(int));
- setParams.sets_dist_fact = (double*)malloc(6*sizeof(double));
-
- setParams.sets_ids[0] = 1000;
- setParams.num_entries_per_set[0] = 3;
- setParams.num_dist_per_set[0] = 0;
- setParams.sets_entry_index[0] = 0;
- setParams.sets_dist_index[0] = 0;
- setParams.sets_entry_list[0] = nset_nodes[0];
- setParams.sets_entry_list[1] = nset_nodes[1];
- setParams.sets_entry_list[2] = nset_nodes[2];
-
- EXCHECK( ex_put_concat_sets( exoid, EX_NODE_SET, &setParams ), "Unable to write node sets.\n" );
-
- setParams.sets_ids[0] = 1200;
- setParams.num_entries_per_set[0] = 6;
- setParams.num_dist_per_set[0] = 6;
- setParams.sets_entry_index[0] = 0;
- setParams.sets_dist_index[0] = 0;
- setParams.sets_entry_list[0] = eset_edges[0];
- setParams.sets_entry_list[1] = eset_edges[1];
- setParams.sets_entry_list[2] = eset_edges[2];
- setParams.sets_entry_list[3] = eset_edges[3];
- setParams.sets_entry_list[4] = eset_edges[4];
- setParams.sets_entry_list[5] = eset_edges[5];
-
- setParams.sets_extra_list[0] = eset_orient[0];
- setParams.sets_extra_list[1] = eset_orient[1];
- setParams.sets_extra_list[2] = eset_orient[2];
- setParams.sets_extra_list[3] = eset_orient[3];
- setParams.sets_extra_list[4] = eset_orient[4];
- setParams.sets_extra_list[5] = eset_orient[5];
-
- memcpy(setParams.sets_dist_fact, eset_df, sizeof(eset_df)/sizeof(eset_df[0]));
-
- EXCHECK( ex_put_concat_sets( exoid, EX_EDGE_SET, &setParams ), "Unable to write edge sets.\n" );
-
- setParams.sets_ids[0] = 1400;
- setParams.num_entries_per_set[0] = 2;
- setParams.num_dist_per_set[0] = 0;
- setParams.sets_entry_index[0] = 0;
- setParams.sets_dist_index[0] = 0;
- setParams.sets_entry_list[0] = fset_faces[0];
- setParams.sets_entry_list[1] = fset_faces[1];
-
- setParams.sets_extra_list[0] = fset_orient[0];
- setParams.sets_extra_list[1] = fset_orient[1];
-
- EXCHECK( ex_put_concat_sets( exoid, EX_FACE_SET, &setParams ), "Unable to write face sets.\n" );
-
- setParams.sets_ids[0] = 1400;
- setParams.num_entries_per_set[0] = 5;
- setParams.num_dist_per_set[0] = 0;
- setParams.sets_entry_index[0] = 0;
- setParams.sets_dist_index[0] = 0;
- memcpy(setParams.sets_entry_list, sset_elems, sizeof(sset_elems)/sizeof(sset_elems[0]));
- memcpy(setParams.sets_extra_list, sset_sides, sizeof(sset_sides)/sizeof(sset_sides[0]));
-
- EXCHECK( ex_put_concat_sets( exoid, EX_SIDE_SET, &setParams ), "Unable to write side sets.\n" );
-
- setParams.sets_ids[0] = 1800;
- setParams.sets_ids[1] = 1900;
- setParams.num_entries_per_set[0] = 1;
- setParams.num_entries_per_set[1] = 1;
- setParams.num_dist_per_set[0] = 0;
- setParams.num_dist_per_set[1] = 0;
- setParams.sets_entry_index[0] = 0;
- setParams.sets_entry_index[1] = 1;
- setParams.sets_dist_index[0] = 0;
- setParams.sets_dist_index[1] = 0;
- memcpy(setParams.sets_entry_list, elset_elems, sizeof(elset_elems)/sizeof(elset_elems[0]));
-
- EXCHECK( ex_put_concat_sets( exoid, EX_ELEM_SET, &setParams ), "Unable to write element sets.\n" );
-
- } else {
- /* *** NEW API *** */
- EXCHECK( ex_put_set_param( exoid, EX_NODE_SET, 1000, 3, 0 ), "Unable to write node set params.\n" );
- EXCHECK( ex_put_set( exoid, EX_NODE_SET, 1000, nset_nodes, 0 ), "Unable to write node set.\n" );
-
- /* *** NEW API *** */
- EXCHECK( ex_put_set_param( exoid, EX_EDGE_SET, 1200, 6, 6 ), "Unable to write edge set params.\n" );
- EXCHECK( ex_put_set( exoid, EX_EDGE_SET, 1200, eset_edges, eset_orient ), "Unable to write edge set.\n" );
- EXCHECK( ex_put_set_dist_fact( exoid, EX_EDGE_SET, 1200, eset_df ), "Unable to write edge set dist factors.\n" );
-
- /* *** NEW API *** */
- EXCHECK( ex_put_set_param( exoid, EX_FACE_SET, 1400, 2, 0 ), "Unable to write face set params.\n" );
- EXCHECK( ex_put_set( exoid, EX_FACE_SET, 1400, fset_faces, fset_orient ), "Unable to write face set.\n" );
-
- /* *** NEW API *** */
- EXCHECK( ex_put_set_param( exoid, EX_SIDE_SET, 1600, 5, 0 ), "Unable to write side set params.\n" );
- EXCHECK( ex_put_set( exoid, EX_SIDE_SET, 1600, sset_elems, sset_sides ), "Unable to write side set.\n" );
-
- /* *** NEW API *** */
- EXCHECK( ex_put_set_param( exoid, EX_ELEM_SET, 1800, 1, 0 ), "Unable to write element set 1 params.\n" );
- EXCHECK( ex_put_set( exoid, EX_ELEM_SET, 1800, elset_elems + 0, 0 ), "Unable to write element set 1.\n" );
- EXCHECK( ex_put_set_param( exoid, EX_ELEM_SET, 1900, 1, 0 ), "Unable to write element set 2 params.\n" );
- EXCHECK( ex_put_set( exoid, EX_ELEM_SET, 1900, elset_elems + 1, 0 ), "Unable to write element set 2.\n" );
+ {
+ ex_set allSets[1+1+1+1+2];
+
+ ex_set *nodeSets = &allSets[0];
+ ex_set *edgeSets = &allSets[1];
+ ex_set *faceSets = &allSets[2];
+ ex_set *sideSets = &allSets[3];
+ ex_set *elemSets = &allSets[4];
+
+ nodeSets[0].type = EX_NODE_SET;
+ nodeSets[0].id = 1000;
+ nodeSets[0].num_entry = 3;
+ nodeSets[0].num_distribution_factor = 0;
+ nodeSets[0].entry_list = nset_nodes;
+ nodeSets[0].extra_list = NULL;
+ nodeSets[0].distribution_factor_list = NULL;
+
+ edgeSets[0].type = EX_EDGE_SET;
+ edgeSets[0].id = 1200;
+ edgeSets[0].num_entry = 6;
+ edgeSets[0].num_distribution_factor = 6;
+ edgeSets[0].entry_list = eset_edges;
+ edgeSets[0].extra_list = eset_orient;
+ edgeSets[0].distribution_factor_list = eset_df;
+
+ faceSets[0].type = EX_FACE_SET;
+ faceSets[0].id = 1400;
+ faceSets[0].num_entry = 2;
+ faceSets[0].num_distribution_factor = 0;
+ faceSets[0].entry_list = fset_faces;
+ faceSets[0].extra_list = fset_orient;
+ faceSets[0].distribution_factor_list = NULL;
+
+ sideSets[0].type = EX_SIDE_SET;
+ sideSets[0].id = 1400;
+ sideSets[0].num_entry = 5;
+ sideSets[0].num_distribution_factor = 0;
+ sideSets[0].entry_list = sset_elems;
+ sideSets[0].extra_list = sset_sides;
+ sideSets[0].distribution_factor_list = NULL;
+
+ elemSets[0].type = EX_ELEM_SET;
+ elemSets[0].id = 1800;
+ elemSets[0].num_entry = 1;
+ elemSets[0].num_distribution_factor = 0;
+ elemSets[0].entry_list = &elset_elems[0];
+ elemSets[0].extra_list = NULL;
+ elemSets[0].distribution_factor_list = NULL;
+
+ elemSets[1].type = EX_ELEM_SET;
+ elemSets[1].id = 1900;
+ elemSets[1].num_entry = 1;
+ elemSets[1].num_distribution_factor = 0;
+ elemSets[1].entry_list = &elset_elems[1];
+ elemSets[1].extra_list = NULL;
+ elemSets[1].distribution_factor_list = NULL;
+
+ if ( concatSets ) {
+ EXCHECK( ex_put_sets(exoid, 1+2+1+1+1, allSets), "Unable to output concatenated sets.\n" );
+ } else {
+ EXCHECK( ex_put_sets( exoid, 1, nodeSets), "Unable to write node sets.\n" );
+ EXCHECK( ex_put_sets( exoid, 1, edgeSets), "Unable to write edge sets.\n" );
+ EXCHECK( ex_put_sets( exoid, 1, faceSets), "Unable to write face sets.\n" );
+ EXCHECK( ex_put_sets( exoid, 1, sideSets), "Unable to write side sets.\n" );
+ EXCHECK( ex_put_sets( exoid, 2, elemSets), "Unable to write element sets.\n" );
+ }
}
/* =============== Result variable params ========= */
diff --git a/exodus/cbind/test/Imakefile b/exodus/cbind/test/Imakefile
index 95f0895..03a51d1 100644
--- a/exodus/cbind/test/Imakefile
+++ b/exodus/cbind/test/Imakefile
@@ -42,23 +42,26 @@ LIBS = $(LOCALEXO) -L$(USRLIBDIR) $(NETCDF) $(EXTRANETCDFLIB)
PROGS = testwt testwtd testrd testrd1 testrdd testwt1 testwt2 testwtm \
testwt_ss testwt_nossnsdf testrd_ss testrdwt testcp testcpd testcp_nl \
testcp_ln testwt_clb testwt_nc testrd_nc testwt-zeroe testwt-zeron \
- testrdv testwt-one-attrib create_mesh rd_wt_mesh \
- testrd-partial testwt-partial testwt-nsided testrd-nsided testwt-nfaced \
- testrd-nfaced testwt-long-name testrd-long-name
-
+ testwt-one-attrib create_mesh rd_wt_mesh \
+ testwt-partial testwt-nsided testrd-nsided testwt-nfaced \
+ testrd-nfaced testwt-long-name testrd-long-name \
+ oned twod MakeTestData test_nemesis
#if 0
CreateEdgeFace ReadEdgeFace
#endif
all:: check
+NormalProgramTarget(oned, oned.o, $(LOCALEXO), /**/, $(LIBS))
+NormalProgramTarget(twod, twod.o, $(LOCALEXO), /**/, $(LIBS))
+NormalProgramTarget(MakeTestData,MakeTestData.o, $(LOCALEXO), /**/, $(LIBS))
+
NormalProgramTarget(testwt, testwt.o, $(LOCALEXO), /**/, $(LIBS))
NormalProgramTarget(testwt_clb,testwt_clb.o,$(LOCALEXO), /**/, $(LIBS))
NormalProgramTarget(testwtd, testwtd.o, $(LOCALEXO), /**/, $(LIBS))
NormalProgramTarget(testrd, testrd.o, $(LOCALEXO), /**/, $(LIBS))
NormalProgramTarget(testrd1, testrd1.o, $(LOCALEXO), /**/, $(LIBS))
NormalProgramTarget(testrdd, testrdd.o, $(LOCALEXO), /**/, $(LIBS))
-NormalProgramTarget(testrdv, testrdv.o, $(LOCALEXO), /**/, $(LIBS))
NormalProgramTarget(testwt1, testwt1.o, $(LOCALEXO), /**/, $(LIBS))
NormalProgramTarget(testwt2, testwt2.o, $(LOCALEXO), /**/, $(LIBS))
NormalProgramTarget(testwtm, testwtm.o, $(LOCALEXO), /**/, $(LIBS))
@@ -80,7 +83,6 @@ NormalProgramTarget(testwt-zeroe, testwt-zeroe.o, $(LOCALEXO), /**/, $(LIBS))
NormalProgramTarget(testwt-zeron, testwt-zeron.o, $(LOCALEXO), /**/, $(LIBS))
NormalProgramTarget(testwt-one-attrib, testwt-one-attrib.o, $(LOCALEXO), /**/, $(LIBS))
NormalProgramTarget(testwt-partial, testwt-partial.o, $(LOCALEXO), /**/, $(LIBS))
-NormalProgramTarget(testrd-partial, testrd-partial.o, $(LOCALEXO), /**/, $(LIBS))
NormalProgramTarget(testwt-nsided, testwt-nsided.o, $(LOCALEXO), /**/, $(LIBS))
NormalProgramTarget(testrd-nsided, testrd-nsided.o, $(LOCALEXO), /**/, $(LIBS))
NormalProgramTarget(testwt-nfaced, testwt-nfaced.o, $(LOCALEXO), /**/, $(LIBS))
@@ -92,6 +94,8 @@ NormalProgramTarget(rd_wt_mesh, rd_wt_mesh.o, $(LOCALEXO), /**/, $(LIBS))
NormalProgramTarget(CreateEdgeFace, CreateEdgeFace.o, $(LOCALEXO), /**/, $(LIBS))
NormalProgramTarget(ReadEdgeFace, ReadEdgeFace.o, $(LOCALEXO), /**/, $(LIBS))
+NormalProgramTarget(test_nemesis, test_nemesis.o, $(LOCALEXO), /**/, $(LIBS))
+
testall: testall.in1 $(CONFIGDIR)/$(MACROFILE)
rm -f testall
$(ETCDIR)/MsubCmd +R"@<" -R">@" testall.in1 >testall
diff --git a/exodus/cbind/test/MakeTestData.c b/exodus/cbind/test/MakeTestData.c
new file mode 100644
index 0000000..98d046b
--- /dev/null
+++ b/exodus/cbind/test/MakeTestData.c
@@ -0,0 +1,929 @@
+#include "exodusII.h"
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#if 1
+int mymode = EX_MAPS_INT64_DB|EX_MAPS_INT64_API|EX_BULK_INT64_DB|EX_BULK_INT64_API|EX_IDS_INT64_API|EX_IDS_INT64_DB;
+typedef int64_t INT;
+#else
+int mymode = 0;
+typedef int INT;
+#endif
+
+#define EX_TEST_FILENAME "ExodusTestData.e"
+
+/* ================ Coordinate Frames ================ */
+int cf_ids[2] = {20, 13};
+double pt_coords[9*2] = {1,0,0, 1,0,1, 2,0,0,
+ 0,0,0, 1,0,0, 0,1,0};
+char tags[2]={'r', 'c'};
+
+/* ======== Coordinates and connectivity ========= */
+double coordsX[] = {
+ 0., 0., 0., 0.,
+ 3., 3., 3., 3.,
+ -3., -3., -3., -3.
+};
+
+double coordsY[] = {
+ -1., 1., 1., -1.,
+ -3., 3., 3., -3.,
+ -3., 3., 3., -3.
+};
+
+double coordsZ[] = {
+ -1., -1., 1., 1.,
+ -3., -3., 3., 3.,
+ -3., -3., 3., 3.
+};
+
+const char* coordsNames[] = { "X", "Y", "Z" };
+
+INT conn1[] = {
+ 1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 1, 2, 3, 4
+};
+
+INT conn2[] = { 1, 2, 3, 5 };
+
+INT conn3[] = { 12, 11, 10, 9 };
+
+INT conn4[] = {1, 3, 5, 7, 9, 11}; /* Sphere */
+
+INT conn5[] = {12, 8, 11, 7, 10, 6, 9, 5}; /* Beam */
+
+INT econn1[] = {
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
+ 13, 14, 15, 16, 1, 2, 3, 4, 17, 18, 19, 20
+};
+
+INT fconn1[] = {
+ 4, 5, 7, 6, 3, 2,
+ 8, 9, 11, 10, 1, 3
+};
+
+INT ebconn1[] = {
+ 1, 2,
+ 2, 3,
+ 3, 4,
+ 4, 1,
+ 5, 6,
+ 6, 7,
+ 7, 8,
+ 8, 5,
+ 1, 5,
+ 2, 6,
+ 4, 8,
+ 3, 7,
+ 9, 10,
+ 10, 11,
+ 11, 12,
+ 12, 9,
+ 9, 1,
+ 10, 2,
+ 12, 4,
+ 11, 3
+};
+
+INT fbconn1[] = {
+ 12, 11, 10, 9,
+ 5, 6, 7, 8
+};
+
+INT fbconn2[] = {
+ 1, 2, 3, 4
+};
+
+INT fbconn3[] = {
+ 1, 5, 6, 2,
+ 3, 7, 8, 4,
+ 2, 6, 7, 3,
+ 4, 8, 5, 1, 9, 1, 2, 10,
+ 11, 3, 4, 12,
+ 10, 2, 3, 11,
+ 12, 4, 1, 9
+};
+
+INT nmap1[] = {
+ 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
+};
+
+INT nmap2[] = {
+ 120, 110, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10
+};
+
+INT edmap1[] = {
+ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20
+};
+
+
+INT famap1[] = {
+ 2, 1, 4, 3, 6, 5, 7, 8, 9, 10, 11
+};
+
+INT emap1[] = {
+ 10, 20, 30, 44, 91,92,93,94,95,96, 88, 87, 86, 85
+};
+
+const char* eblk_names[] = {
+ "Eli_WALLACH",
+ "Angelo_NOVI",
+ "A_Shell",
+ "Some_Sphere_Elements",
+ "Reinforcement"
+};
+
+const char* edblk_names[] = { "Aldo_GIUFFRE" };
+const char* fablk_names[] = {
+ "Livio_LORENZON",
+ "Claudio_SCARCHILLI",
+ "John_BARTHA"
+};
+
+const char* nmap_names[] = { "Luigi_PISTILLI" };
+const char* edmap_names[] = { "Antonio_CASALE" };
+const char* famap_names[] = { "Sandro_SCARCHILLI" };
+const char* emap_names[] = { "Benito_STEFANELLI" };
+
+/* ======== Sets ========= */
+INT nset_nodes[] = {
+ 5, 6, 9
+};
+
+INT eset_edges[] = {
+ 1, 2, 4, 15, 19, 20
+};
+
+INT eset_orient[] = {
+ +1, +1, +1, +1, +1, -1
+};
+
+double eset_df[] = {
+ 2., 2., 0.5, 0.5, 1., 1.
+};
+
+INT fset_faces[] = {
+ 3, 9
+};
+
+INT fset_orient[] = {
+ +1, -1
+};
+
+INT sset_elems[] = {
+ 1, 1, 1, 2, 2
+};
+
+INT sset_sides[] = {
+ 1, 3, 5, 2, 4
+};
+
+INT sset1_elems[] = {
+ 4, 4, 4
+};
+
+INT sset1_sides[] = {
+ 1, 3, 5
+};
+
+INT elset_elems[] = {
+ 1,
+ 2
+};
+
+const char* elset_names[] = {
+ "Clint_EASTWOOD",
+ "Lee_VAN_CLEEF"
+};
+
+const char* nset_names[] = { "Ennio_MORRICONE" };
+const char* eset_names[] = { "Rada_RASSIMOV" };
+const char* fset_names[] = { "Enzo_PETITO" };
+const char* sset_names[] = { "Luciano_VINCENZONI", "A_Very_Long_Name_That_Tests_Capability_for_Long_Names" };
+
+/* ======== Attributes ========= */
+const char* node_attr_names[] = {"Influence_Diameter"};
+const char* edge_attr_names1[] = {"Sergio_LEONE"};
+
+const char* face_attr_names1[] = {"GOOD"};
+const char* face_attr_names2[] = {"BAD"};
+const char* face_attr_names3[] = {"UGLY"};
+
+const char* elem_attr_names1[] = {
+ "SPAGHETTI",
+ "WESTERN"
+};
+
+const char* elem_attr_names3[] = {
+ "Thickness"
+};
+
+const char* elem_attr_names4[] = {
+ "Radius", "Volume"
+};
+
+const char* elem_attr_names5[] = {
+ "Area", "I_1", "I_2", "J", "V_x", "V_y", "V_z"
+};
+
+const char* elem_var_names[] = {"my_stress_xx_1",
+ "my_stress_yy_1",
+ "my_stress_zz_1",
+ "my_stress_xy_1",
+ "my_stress_yz_1",
+ "my_stress_zx_1",
+ "my_stress_xx_2",
+ "my_stress_yy_2",
+ "my_stress_zz_2",
+ "my_stress_xy_2",
+ "my_stress_yz_2",
+ "my_stress_zx_2",
+ "von_mises_which_is_calculated_the_standard_way_from_stress",
+ "tension"
+};
+
+const char* nset_var_names[] = {"var_name.xx",
+ "var_name.yy",
+ "var_name.zz",
+ "var_name.xy",
+ "var_name.yz",
+ "var_name.zx"};
+
+const char* sset_var_names[] = {"stressxx",
+ "stressyy",
+ "stresszz",
+ "stressxy",
+ "stressyz",
+ "stresszx"};
+
+double edge_attr_values1[] = {
+ 1., 2., 3., 5., 7., 11., 13., 17., 19., 23.,
+ 29., 31., 37., 41., 43., 47., 53., 59., 61., 67.
+};
+
+double node_attr_values[] = { 12., 11., 10., 9., 8., 7., 6., 5., 4., 3., 2., 1.};
+
+double face_attr_values1[] = {
+ 71., 73.
+};
+
+double face_attr_values2[] = {
+ 79.
+};
+
+double face_attr_values3[] = {
+ 83., 89., 97., 101., 103., 107., 109., 113.
+};
+
+double elem_attr_values1[] = {
+ 127., 101.,
+ 137., 139.
+};
+
+double elem_attr_values4[] = {
+ .10, 0.0,
+ .11, 0.0,
+ .12, 0.0,
+ .13, 0.0,
+ .14, 0.0,
+ .15, 0.0
+};
+
+double elem_attr_values5[] = { /* 4 elements, 7 attributes/element */
+ 1.0, 10.0, 11.0, 12.0, 0.0, 0.0, 1.0,
+ 1.1, 10.1, 11.1, 12.1, 1.0, 0.0, 0.0,
+ 1.2, 10.2, 11.2, 12.2, 0.0, 1.0, 0.0,
+ 1.3, 10.3, 11.3, 12.3, 1.0, 1.0, 1.0
+};
+
+/* ======== Results variables ========= */
+/* (2 time steps) */
+
+double vals_glo_var[2][3] = {
+ { 36., 37., 38.},
+ { 42., 43., 44.}
+};
+
+double vals_nod_var[2][12] = {
+ { 0.1, 0.8, 0.0, 0.4, 0.3, 0.9, 0.8, 0.5, 0.3, 0.7, 0.4, 0.6 },
+ { 0.7, 0.5, 0.3, 0.5, 0.2, 0.7, 0.9, 0.8, 0.0, 0.2, 0.3, 0.5 }
+} ;
+
+
+double vals_edge_var1eb1[2][20] = {
+ { 20., 19., 18., 17., 16., 15., 14., 13., 12., 11., 10., 9., 8., 7., 6., 5., 4., 3., 2., 1. },
+ { 21., 20., 19., 18., 17., 16., 15., 14., 13., 12., 11., 10., 9., 8., 7., 6., 5., 4., 3., 2. }
+};
+
+double vals_edge_var2eb1[2][20] = {
+ { 1., 1., 0., 0., 1., 1., 2., 0., 2., 0., 1., 1., 1., 1., 0., 0., 2., 2., 2., 2. },
+ { 1., 1., 0., 0., 1., 1., 2., 0., 2., 0., 1., 1., 1., 1., 0., 0., 2., 2., 2., 2. }
+};
+
+double vals_face_var1fb1[2][2] = {
+ { 0, 1 },
+ { 2, 0 }
+};
+
+double vals_face_var1fb3[2][8] = {
+ { 1, 0, 2, 0, 3, 0, 4, 0 },
+ { 0, 1, 0, 2, 0, 3, 0, 4 }
+};
+
+double vals_elem_var[2][2*6*2] = {
+ { 8.0, 8.0, 8.1, 8.1, 8.2, 8.2, 8.3, 8.3, 8.4, 8.4, 8.5, 8.5, 18.0, 18.0, 18.1, 18.1, 18.2, 18.2, 18.3, 18.3, 18.4, 18.4, 18.5, 18.5 },
+ { -7.0, -7.0, -7.1, -7.1, -7.2, -7.2, -7.3, -7.3, -7.4, -7.4, -7.5, -7.5, -7.0, -17.0, -17.1, -17.1, -17.2, -17.2, -17.3, -17.3, -17.4, -17.4, -17.5, -17.5 }
+};
+
+double vals_elem_var1[2][1] = {
+ { 88.8 },
+ { 99.9 }
+};
+
+double vals_tension[2][4] = {
+ { 1000., 2000., 3000., 4000. },
+ { 2000., 4000., 6000., 8000. }
+};
+
+/* 2 time planes, 6 elements, 3 variables */
+double vals_elem_var2[2][6*3] = {
+ { 1.01, 1.02, 1.03, 2.01, 2.02, 2.03, 3.01, 3.02, 3.03, 4.01, 4.02, 4.03, 5.01, 5.02, 5.03, 6.01, 6.02, 6.03 },
+ {11.01,11.02,11.03,12.01,12.02,12.03,13.01,13.02,13.03,14.01,14.02,14.03,15.01,15.02,15.03,16.01,16.02,16.03 }
+};
+
+double vals_nset_var[2][3*6] = {
+ { 8.0, 8.1, 8.2,
+ 7.0, 7.1, 7.2,
+ 6.0, 6.1, 6.2,
+ 5.0, 5.1, 5.2,
+ 4.0, 4.1, 4.2,
+ 3.0, 3.1, 3.2},
+ { -8.0, -8.1, -8.2,
+ -7.0, -7.1, -7.2,
+ -6.0, -6.1, -6.2,
+ -5.0, -5.1, -5.2,
+ -4.0, -4.1, -4.2,
+ -3.0, -3.1, -3.2},
+};
+
+double vals_sset_var[2][5*6] = {
+ { 18.0, 18.1, 18.2, 18.3, 18.4,
+ 17.0, 17.1, 17.2, 17.3, 17.4,
+ 16.0, 16.1, 16.2, 16.3, 16.4,
+ 15.0, 15.1, 15.2, 15.3, 15.4,
+ 14.0, 14.1, 14.2, 14.3, 14.4,
+ 13.0, 13.1, 13.2, 13.3, 13.4},
+ { -18.0, -18.1, -18.2, -18.3, -18.4,
+ -17.0, -17.1, -17.2, -17.3, -17.4,
+ -16.0, -16.1, -16.2, -16.3, -16.4,
+ -15.0, -15.1, -15.2, -15.3, -15.4,
+ -14.0, -14.1, -14.2, -14.3, -14.4,
+ -13.0, -13.1, -13.2, -13.3, -13.4},
+};
+
+double vals_fset_var1fs1[2][2] = {
+ { 1., 3. },
+ { 9., 27. }
+};
+
+#define EXCHECK(funcall,errmsg)\
+ if ( (funcall) < 0 ) \
+ { \
+ fprintf( stderr, errmsg ); \
+ return 1; \
+ }
+
+int ex_have_arg( int argc, char* argv[], const char* aname )
+{
+ int i;
+ for ( i = 0; i < argc; ++i )
+ if ( ! strcmp( argv[i], aname ) )
+ return 1;
+ return 0;
+}
+
+int cCreateEdgeFace( int argc, char* argv[] )
+{
+ int exoid;
+ int appWordSize = 8;
+ int diskWordSize = 8;
+ int concatBlocks = ex_have_arg( argc, argv, "-pcab" );
+ int concatSets = ex_have_arg( argc, argv, "-pcset" );
+ int concatResult = ex_have_arg( argc, argv, "-pvpax" );
+ double t;
+ int i;
+
+ ex_opts(EX_VERBOSE);
+
+ ex_init_params modelParams = {
+ "CreateEdgeFace Test", /* title */
+ 3, /* num_dim */
+ 12, /* num_nodes */
+ 20, /* num_edge */
+ 1, /* num_edge_blk */
+ 11, /* num_face */
+ 3, /* num_face_blk */
+ 14, /* num_elem */
+ 5, /* num_elem_blk */
+ 1, /* num_node_sets */
+ 1, /* num_edge_sets */
+ 1, /* num_face_sets */
+ 2, /* num_side_sets */
+ 2, /* num_elem_sets */
+ 1, /* num_node_map */
+ 1, /* num_edge_map */
+ 1, /* num_face_map */
+ 1, /* num_elem_map */
+ };
+
+ ex_block_params blockParams;
+ ex_var_params varParams;
+
+ blockParams.edge_blk_id = (int*)malloc(1 * sizeof(INT));
+ blockParams.num_edge_this_blk = (int*)malloc(1 * sizeof(int));
+ blockParams.num_nodes_per_edge = (int*)malloc(1 * sizeof(int));
+ blockParams.num_attr_edge = (int*)malloc(1 * sizeof(int));
+ blockParams.face_blk_id = (int*)malloc(3 * sizeof(INT));
+ blockParams.num_face_this_blk = (int*)malloc(3 * sizeof(int));
+ blockParams.num_nodes_per_face = (int*)malloc(3 * sizeof(int));
+ blockParams.num_attr_face = (int*)malloc(3 * sizeof(int));
+ blockParams.elem_blk_id = (int*)malloc(5 * sizeof(INT));
+ blockParams.num_elem_this_blk = (int*)malloc(5 * sizeof(int));
+ blockParams.num_nodes_per_elem = (int*)malloc(5 * sizeof(int));
+ blockParams.num_edges_per_elem = (int*)malloc(5 * sizeof(int));
+ blockParams.num_faces_per_elem = (int*)malloc(5 * sizeof(int));
+ blockParams.num_attr_elem = (int*)malloc(5 * sizeof(int));
+
+ blockParams.edge_type = (char**)malloc(1 * sizeof(char*));
+ blockParams.edge_type[0] = (char*)malloc((MAX_STR_LENGTH+1) * sizeof(char));
+ blockParams.face_type = (char**)malloc(3 * sizeof(char*));
+ blockParams.face_type[0] = (char*)malloc((MAX_STR_LENGTH+1) * sizeof(char));
+ blockParams.face_type[1] = (char*)malloc((MAX_STR_LENGTH+1) * sizeof(char));
+ blockParams.face_type[2] = (char*)malloc((MAX_STR_LENGTH+1) * sizeof(char));
+ blockParams.elem_type = (char**)malloc(5 * sizeof(char*));
+ blockParams.elem_type[0] = (char*)malloc((MAX_STR_LENGTH+1) * sizeof(char));
+ blockParams.elem_type[1] = (char*)malloc((MAX_STR_LENGTH+1) * sizeof(char));
+ blockParams.elem_type[2] = (char*)malloc((MAX_STR_LENGTH+1) * sizeof(char));
+ blockParams.elem_type[3] = (char*)malloc((MAX_STR_LENGTH+1) * sizeof(char));
+ blockParams.elem_type[4] = (char*)malloc((MAX_STR_LENGTH+1) * sizeof(char));
+
+ ((INT*)blockParams.edge_blk_id)[0] = 100;
+ blockParams.num_edge_this_blk[0] = 20;
+ blockParams.num_nodes_per_edge[0] = 2;
+ blockParams.num_attr_edge[0] = 1;
+
+ ((INT*)blockParams.face_blk_id)[0] = 500;
+ ((INT*)blockParams.face_blk_id)[1] = 600;
+ ((INT*)blockParams.face_blk_id)[2] = 700;
+ blockParams.num_face_this_blk[0] = 2;
+ blockParams.num_face_this_blk[1] = 1;
+ blockParams.num_face_this_blk[2] = 8;
+ blockParams.num_nodes_per_face[0] = 4;
+ blockParams.num_nodes_per_face[1] = 4;
+ blockParams.num_nodes_per_face[2] = 4;
+ blockParams.num_attr_face[0] = 1;
+ blockParams.num_attr_face[1] = 1;
+ blockParams.num_attr_face[2] = 1;
+
+ ((INT*)blockParams.elem_blk_id)[0] = 200;
+ ((INT*)blockParams.elem_blk_id)[1] = 201;
+ ((INT*)blockParams.elem_blk_id)[2] = 100;
+ ((INT*)blockParams.elem_blk_id)[3] = 500;
+ ((INT*)blockParams.elem_blk_id)[4] = 2147483647;
+
+ blockParams.num_elem_this_blk[0] = 2;
+ blockParams.num_elem_this_blk[1] = 1;
+ blockParams.num_elem_this_blk[2] = 1;
+ blockParams.num_elem_this_blk[3] = 6;
+ blockParams.num_elem_this_blk[4] = 4;
+
+ blockParams.num_nodes_per_elem[0] = 8;
+ blockParams.num_nodes_per_elem[1] = 4;
+ blockParams.num_nodes_per_elem[2] = 4;
+ blockParams.num_nodes_per_elem[3] = 1;
+ blockParams.num_nodes_per_elem[4] = 2;
+
+ blockParams.num_edges_per_elem[0] = 12;
+ blockParams.num_edges_per_elem[1] = 0;
+ blockParams.num_edges_per_elem[2] = 0;
+ blockParams.num_edges_per_elem[3] = 0;
+ blockParams.num_edges_per_elem[4] = 0;
+
+ blockParams.num_faces_per_elem[0] = 6;
+ blockParams.num_faces_per_elem[1] = 0;
+ blockParams.num_faces_per_elem[2] = 0;
+ blockParams.num_faces_per_elem[3] = 0;
+ blockParams.num_faces_per_elem[4] = 0;
+
+ blockParams.num_attr_elem[0] = 2;
+ blockParams.num_attr_elem[1] = 0;
+ blockParams.num_attr_elem[2] = 1;
+ blockParams.num_attr_elem[3] = 2;
+ blockParams.num_attr_elem[4] = 7;
+
+ blockParams.define_maps = 0;
+
+ strcpy(blockParams.edge_type[0], "EDGE2");
+
+ strcpy(blockParams.face_type[0], "QUAD4");
+ strcpy(blockParams.face_type[1], "QUAD4");
+ strcpy(blockParams.face_type[2], "QUAD4");
+
+ strcpy(blockParams.elem_type[0], "HEX8");
+ strcpy(blockParams.elem_type[1], "TET4");
+ strcpy(blockParams.elem_type[2], "SHELL");
+ strcpy(blockParams.elem_type[3], "SPHERE");
+ strcpy(blockParams.elem_type[4], "beam");
+
+ varParams.edge_var_tab = (int*)malloc(2 * sizeof(int));
+ varParams.face_var_tab = (int*)malloc(3 * sizeof(int));
+ varParams.elem_var_tab = (int*)0;
+ varParams.nset_var_tab = (int*)0;
+ varParams.eset_var_tab = (int*)0;
+ varParams.fset_var_tab = (int*)malloc(1 * sizeof(int));
+ varParams.sset_var_tab = (int*)0;
+ varParams.elset_var_tab = (int*)0;
+
+ varParams.num_glob = 2;
+ varParams.num_node = 1;
+ varParams.num_edge = 2;
+ varParams.edge_var_tab[0] = 1;
+ varParams.edge_var_tab[1] = 1;
+ varParams.num_face = 1;
+ varParams.face_var_tab[0] = 1;
+ varParams.face_var_tab[1] = 1;
+ varParams.face_var_tab[2] = 1;
+ varParams.num_elem = 1;
+ varParams.num_nset = 0;
+ varParams.num_eset = 0;;
+ varParams.num_fset = 1;
+ varParams.fset_var_tab[0] = 1;
+ varParams.num_sset = 0;
+ varParams.num_elset = 0;
+
+ exoid = ex_create( EX_TEST_FILENAME, EX_CLOBBER|mymode, &appWordSize, &diskWordSize );
+ if ( exoid <= 0 )
+ {
+ fprintf( stderr, "Unable to open \"%s\" for writing.\n", EX_TEST_FILENAME );
+ return 1;
+ }
+
+ ex_set_max_name_length(exoid, 80);
+
+ EXCHECK( ex_put_init_ext( exoid, &modelParams ),
+ "Unable to initialize database.\n" );
+
+ /* Add a coordinate frame just to give test coverage... */
+ EXCHECK( ex_put_coordinate_frames(exoid, 2, cf_ids, pt_coords, tags),
+ "Unable to output coordinate frame.\n");
+
+ if ( concatBlocks ) {
+ EXCHECK( ex_put_concat_all_blocks( exoid, &blockParams ),
+ "Unable to initialize block params.\n" );
+ } else {
+ int blk;
+ for ( blk = 0; blk < modelParams.num_edge_blk; ++blk ) {
+ EXCHECK( ex_put_block( exoid, EX_EDGE_BLOCK, ((INT*)blockParams.edge_blk_id)[blk], blockParams.edge_type[blk],
+ blockParams.num_edge_this_blk[blk], blockParams.num_nodes_per_edge[blk], 0, 0,
+ blockParams.num_attr_edge[blk] ), "Unable to write edge block" );
+ }
+ for ( blk = 0; blk < modelParams.num_face_blk; ++blk ) {
+ EXCHECK( ex_put_block( exoid, EX_FACE_BLOCK, ((INT*)blockParams.face_blk_id)[blk], blockParams.face_type[blk],
+ blockParams.num_face_this_blk[blk], blockParams.num_nodes_per_face[blk], 0, 0,
+ blockParams.num_attr_face[blk] ), "Unable to write face block" );
+ }
+ for ( blk = 0; blk < modelParams.num_elem_blk; ++blk ) {
+ EXCHECK( ex_put_block( exoid, EX_ELEM_BLOCK, ((INT*)blockParams.elem_blk_id)[blk], blockParams.elem_type[blk],
+ blockParams.num_elem_this_blk[blk], blockParams.num_nodes_per_elem[blk],
+ blockParams.num_edges_per_elem[blk], blockParams.num_faces_per_elem[blk],
+ blockParams.num_attr_elem[blk] ), "Unable to write elem block" );
+ }
+ }
+
+ EXCHECK( ex_put_attr_param(exoid, EX_NODAL, 0, 1),
+ "Unable to put nodal attributes.\n" );
+
+ EXCHECK( ex_put_coord( exoid, (void*)coordsX, (void*)coordsY, (void*)coordsZ ),
+ "Unable to write coordinates.\n" );
+
+ EXCHECK( ex_put_coord_names( exoid, (char**)coordsNames ),
+ "Unable to write coordinate names.\n" );
+
+ /* =============== Connectivity ================== */
+ EXCHECK( ex_put_conn( exoid, EX_EDGE_BLOCK, ((INT*)blockParams.edge_blk_id)[0], ebconn1, 0, 0 ),
+ "Unable to write edge block connectivity.\n" );
+
+ EXCHECK( ex_put_conn( exoid, EX_FACE_BLOCK, ((INT*)blockParams.face_blk_id)[0], fbconn1, 0, 0 ),
+ "Unable to write face block 1 connectivity.\n" );
+ EXCHECK( ex_put_conn( exoid, EX_FACE_BLOCK, ((INT*)blockParams.face_blk_id)[1], fbconn2, 0, 0 ),
+ "Unable to write face block 2 connectivity.\n" );
+ EXCHECK( ex_put_conn( exoid, EX_FACE_BLOCK, ((INT*)blockParams.face_blk_id)[2], fbconn3, 0, 0 ),
+ "Unable to write face block 3 connectivity.\n" );
+
+ EXCHECK( ex_put_conn( exoid, EX_ELEM_BLOCK, ((INT*)blockParams.elem_blk_id)[0], conn1, econn1, fconn1 ),
+ "Unable to write elem block 1 connectivity.\n" );
+ EXCHECK( ex_put_conn( exoid, EX_ELEM_BLOCK, ((INT*)blockParams.elem_blk_id)[1], conn2, 0, 0 ),
+ "Unable to write elem block 2 connectivity.\n" );
+ EXCHECK( ex_put_conn( exoid, EX_ELEM_BLOCK, ((INT*)blockParams.elem_blk_id)[2], conn3, 0, 0 ),
+ "Unable to write elem block 3 connectivity.\n" );
+ EXCHECK( ex_put_conn( exoid, EX_ELEM_BLOCK, ((INT*)blockParams.elem_blk_id)[3], conn4, 0, 0 ),
+ "Unable to write elem block 4 connectivity.\n" );
+ EXCHECK( ex_put_conn( exoid, EX_ELEM_BLOCK, ((INT*)blockParams.elem_blk_id)[4], conn5, 0, 0 ),
+ "Unable to write elem block 5 connectivity.\n" );
+
+ EXCHECK( ex_put_names( exoid, EX_EDGE_BLOCK, (char**)edblk_names ), "Unable to write edge block names.\n" );
+ EXCHECK( ex_put_names( exoid, EX_FACE_BLOCK, (char**)fablk_names ), "Unable to write face block names.\n" );
+ EXCHECK( ex_put_names( exoid, EX_ELEM_BLOCK, (char**) eblk_names ), "Unable to write element block names.\n" );
+
+ /* =============== Number Maps ================== */
+ EXCHECK( ex_put_num_map( exoid, EX_NODE_MAP, 300, nmap1 ), "Unable to write node map.\n" );
+ EXCHECK( ex_put_num_map( exoid, EX_EDGE_MAP, 800, edmap1 ), "Unable to write edge map.\n" );
+ EXCHECK( ex_put_num_map( exoid, EX_FACE_MAP, 900, famap1 ), "Unable to write face map.\n" );
+ EXCHECK( ex_put_num_map( exoid, EX_ELEM_MAP, 400, emap1 ), "Unable to write element map.\n" );
+
+ EXCHECK( ex_put_names( exoid, EX_NODE_MAP, (char**) nmap_names ), "Unable to write node map names.\n" );
+ EXCHECK( ex_put_names( exoid, EX_EDGE_MAP, (char**)edmap_names ), "Unable to write edge map names.\n" );
+ EXCHECK( ex_put_names( exoid, EX_FACE_MAP, (char**)famap_names ), "Unable to write face map names.\n" );
+ EXCHECK( ex_put_names( exoid, EX_ELEM_MAP, (char**) emap_names ), "Unable to write element map names.\n" );
+
+ /* =============== Id Maps ================== */
+ EXCHECK( ex_put_id_map( exoid, EX_NODE_MAP, nmap2 ), "Unable to write node id map.\n" );
+ EXCHECK( ex_put_id_map( exoid, EX_EDGE_MAP, edmap1 ), "Unable to write edge id map.\n" );
+ EXCHECK( ex_put_id_map( exoid, EX_FACE_MAP, famap1 ), "Unable to write face id map.\n" );
+ EXCHECK( ex_put_id_map( exoid, EX_ELEM_MAP, emap1 ), "Unable to write element id map.\n" );
+
+ /* =============== Attribute names ================ */
+ EXCHECK( ex_put_attr_names( exoid, EX_EDGE_BLOCK, ((INT*)blockParams.edge_blk_id)[0], (char**)edge_attr_names1 ),
+ "Unable to write edge block 1 attribute names.\n" );
+
+ EXCHECK( ex_put_attr_names( exoid, EX_NODAL, 0, (char**)node_attr_names),
+ "Unable to write nodal attribute names.\n" );
+
+ EXCHECK( ex_put_attr_names( exoid, EX_FACE_BLOCK, ((INT*)blockParams.face_blk_id)[0], (char**)face_attr_names1 ),
+ "Unable to write face block 1 attribute names.\n" );
+ EXCHECK( ex_put_attr_names( exoid, EX_FACE_BLOCK, ((INT*)blockParams.face_blk_id)[1], (char**)face_attr_names2 ),
+ "Unable to write face block 1 attribute names.\n" );
+ EXCHECK( ex_put_attr_names( exoid, EX_FACE_BLOCK, ((INT*)blockParams.face_blk_id)[2], (char**)face_attr_names3 ),
+ "Unable to write face block 1 attribute names.\n" );
+
+ EXCHECK( ex_put_attr_names( exoid, EX_ELEM_BLOCK, ((INT*)blockParams.elem_blk_id)[0], (char**)elem_attr_names1 ),
+ "Unable to write elem block 1 attribute names.\n" );
+ EXCHECK( ex_put_attr_names( exoid, EX_ELEM_BLOCK, ((INT*)blockParams.elem_blk_id)[2], (char**)elem_attr_names3 ),
+ "Unable to write elem block 3 attribute names.\n" );
+ EXCHECK( ex_put_attr_names( exoid, EX_ELEM_BLOCK, ((INT*)blockParams.elem_blk_id)[3], (char**)elem_attr_names4 ),
+ "Unable to write elem block 4 attribute names.\n" );
+ EXCHECK( ex_put_attr_names( exoid, EX_ELEM_BLOCK, ((INT*)blockParams.elem_blk_id)[4], (char**)elem_attr_names5 ),
+ "Unable to write elem block 5 attribute names.\n" );
+
+ /* =============== Attribute values =============== */
+ EXCHECK( ex_put_attr( exoid, EX_EDGE_BLOCK, ((INT*)blockParams.edge_blk_id)[0], edge_attr_values1 ),
+ "Unable to write edge block 1 attribute values.\n" );
+ EXCHECK( ex_put_attr( exoid, EX_NODAL, 0, node_attr_values ),
+ "Unable to write node attribute values.\n" );
+
+ EXCHECK( ex_put_attr( exoid, EX_FACE_BLOCK, ((INT*)blockParams.face_blk_id)[0], face_attr_values1 ),
+ "Unable to write face block 1 attribute values.\n" );
+ EXCHECK( ex_put_attr( exoid, EX_FACE_BLOCK, ((INT*)blockParams.face_blk_id)[1], face_attr_values2 ),
+ "Unable to write face block 1 attribute values.\n" );
+ EXCHECK( ex_put_attr( exoid, EX_FACE_BLOCK, ((INT*)blockParams.face_blk_id)[2], face_attr_values3 ),
+ "Unable to write face block 1 attribute values.\n" );
+
+ EXCHECK( ex_put_attr( exoid, EX_ELEM_BLOCK, ((INT*)blockParams.elem_blk_id)[0], elem_attr_values1 ),
+ "Unable to write elem block 1 attribute values.\n" );
+ EXCHECK( ex_put_attr( exoid, EX_ELEM_BLOCK, ((INT*)blockParams.elem_blk_id)[2], elem_attr_values1 ),
+ "Unable to write elem block 3 attribute values.\n" );
+
+ for (i=0; i < 6; i++) {
+ elem_attr_values4[2*i+1] = 4.0 / 3.0 * 3.14 * elem_attr_values4[2*i] * elem_attr_values4[2*i] * elem_attr_values4[2*i];
+ }
+ EXCHECK( ex_put_attr( exoid, EX_ELEM_BLOCK, ((INT*)blockParams.elem_blk_id)[3], elem_attr_values4 ),
+ "Unable to write elem block 3 attribute values.\n" );
+ EXCHECK( ex_put_attr( exoid, EX_ELEM_BLOCK, ((INT*)blockParams.elem_blk_id)[4], elem_attr_values5 ),
+ "Unable to write elem block 4 attribute values.\n" );
+
+ /* =============== Set parameters ================= */
+ /* *** NEW API *** */
+ EXCHECK( ex_put_names( exoid, EX_NODE_SET, (char**)nset_names ), "Unable to write node set names.\n" );
+ EXCHECK( ex_put_names( exoid, EX_EDGE_SET, (char**)eset_names ), "Unable to write edge set names.\n" );
+ EXCHECK( ex_put_names( exoid, EX_FACE_SET, (char**)fset_names ), "Unable to write face set names.\n" );
+ EXCHECK( ex_put_names( exoid, EX_SIDE_SET, (char**)sset_names ), "Unable to write side set names.\n" );
+ EXCHECK( ex_put_names( exoid, EX_ELEM_SET, (char**)elset_names ), "Unable to write element set names.\n" );
+
+ if ( concatSets ) {
+ ex_set_specs setParams;
+
+ setParams.sets_ids = (int*)malloc(2*sizeof(INT));
+ setParams.num_entries_per_set = (int*)malloc(2*sizeof(int));
+ setParams.num_dist_per_set = (int*)malloc(2*sizeof(int));
+ setParams.sets_entry_index = (int*)malloc(2*sizeof(int));
+ setParams.sets_dist_index = (int*)malloc(2*sizeof(int));
+ setParams.sets_entry_list = (INT*)malloc(6*sizeof(INT));
+ setParams.sets_extra_list = (INT*)malloc(6*sizeof(INT));
+ setParams.sets_dist_fact = (double*)malloc(6*sizeof(double));
+
+ ((INT*)setParams.sets_ids)[0] = 1000;
+ ((INT*)setParams.num_entries_per_set)[0] = 3;
+ ((INT*)setParams.num_dist_per_set)[0] = 0;
+ ((INT*)setParams.sets_entry_index)[0] = 0;
+ ((INT*)setParams.sets_dist_index)[0] = 0;
+
+ {
+ INT* entry_list = setParams.sets_entry_list;
+ entry_list[0] = nset_nodes[0];
+ entry_list[1] = nset_nodes[1];
+ entry_list[2] = nset_nodes[2];
+ }
+
+ EXCHECK( ex_put_concat_sets( exoid, EX_NODE_SET, &setParams ), "Unable to write node sets.\n" );
+
+ ((INT*)setParams.sets_ids)[0] = 1200;
+ ((INT*)setParams.num_entries_per_set)[0] = 6;
+ ((INT*)setParams.num_dist_per_set)[0] = 6;
+ ((INT*)setParams.sets_entry_index)[0] = 0;
+ ((INT*)setParams.sets_dist_index)[0] = 0;
+
+ {
+ INT* entry_list = setParams.sets_entry_list;
+ INT* extra_list = setParams.sets_extra_list;
+
+ entry_list[0] = eset_edges[0];
+ entry_list[1] = eset_edges[1];
+ entry_list[2] = eset_edges[2];
+ entry_list[3] = eset_edges[3];
+ entry_list[4] = eset_edges[4];
+ entry_list[5] = eset_edges[5];
+
+ extra_list[0] = eset_orient[0];
+ extra_list[1] = eset_orient[1];
+ extra_list[2] = eset_orient[2];
+ extra_list[3] = eset_orient[3];
+ extra_list[4] = eset_orient[4];
+ extra_list[5] = eset_orient[5];
+ }
+
+ memcpy(setParams.sets_dist_fact, eset_df, sizeof(eset_df)/sizeof(eset_df[0]));
+
+ EXCHECK( ex_put_concat_sets( exoid, EX_EDGE_SET, &setParams ), "Unable to write edge sets.\n" );
+
+ ((INT*)setParams.sets_ids)[0] = 1400;
+ ((INT*)setParams.num_entries_per_set)[0] = 2;
+ ((INT*)setParams.num_dist_per_set)[0] = 0;
+ ((INT*)setParams.sets_entry_index)[0] = 0;
+ ((INT*)setParams.sets_dist_index)[0] = 0;
+ {
+ INT *entry_list = setParams.sets_entry_list;
+ INT *extra_list = setParams.sets_extra_list;
+
+ entry_list[0] = fset_faces[0];
+ entry_list[1] = fset_faces[1];
+
+ extra_list[0] = fset_orient[0];
+ extra_list[1] = fset_orient[1];
+ }
+
+ EXCHECK( ex_put_concat_sets( exoid, EX_FACE_SET, &setParams ), "Unable to write face sets.\n" );
+
+ ((INT*)setParams.sets_ids)[0] = 1400;
+ ((INT*)setParams.sets_ids)[1] = 1441;
+ ((INT*)setParams.num_entries_per_set)[0] = 5;
+ ((INT*)setParams.num_entries_per_set)[1] = 3;
+ ((INT*)setParams.num_dist_per_set)[0] = 0;
+ ((INT*)setParams.num_dist_per_set)[1] = 0;
+ ((INT*)setParams.sets_entry_index)[0] = 0;
+ ((INT*)setParams.sets_entry_index)[5] = 0;
+ ((INT*)setParams.sets_dist_index)[0] = 0;
+ memcpy(setParams.sets_entry_list, sset_elems, sizeof(sset_elems)/sizeof(sset_elems[0]));
+ memcpy(setParams.sets_extra_list, sset_sides, sizeof(sset_sides)/sizeof(sset_sides[0]));
+
+ EXCHECK( ex_put_concat_sets( exoid, EX_SIDE_SET, &setParams ), "Unable to write side sets.\n" );
+
+ ((INT*)setParams.sets_ids)[0] = 1800;
+ ((INT*)setParams.sets_ids)[1] = 1900;
+ ((INT*)setParams.num_entries_per_set)[0] = 1;
+ ((INT*)setParams.num_entries_per_set)[1] = 1;
+ ((INT*)setParams.num_dist_per_set)[0] = 0;
+ ((INT*)setParams.num_dist_per_set)[1] = 0;
+ ((INT*)setParams.sets_entry_index)[0] = 0;
+ ((INT*)setParams.sets_entry_index)[1] = 1;
+ ((INT*)setParams.sets_dist_index)[0] = 0;
+ ((INT*)setParams.sets_dist_index)[1] = 0;
+ memcpy(setParams.sets_entry_list, elset_elems, sizeof(elset_elems)/sizeof(elset_elems[0]));
+
+ EXCHECK( ex_put_concat_sets( exoid, EX_ELEM_SET, &setParams ), "Unable to write element sets.\n" );
+
+ } else {
+ EXCHECK( ex_put_set_param( exoid, EX_NODE_SET, 1000, 3, 0 ), "Unable to write node set params.\n" );
+ EXCHECK( ex_put_set( exoid, EX_NODE_SET, 1000, nset_nodes, 0 ), "Unable to write node set.\n" );
+
+ EXCHECK( ex_put_set_param( exoid, EX_EDGE_SET, 1200, 6, 6 ), "Unable to write edge set params.\n" );
+ EXCHECK( ex_put_set( exoid, EX_EDGE_SET, 1200, eset_edges, eset_orient ), "Unable to write edge set.\n" );
+ EXCHECK( ex_put_set_dist_fact( exoid, EX_EDGE_SET, 1200, eset_df ), "Unable to write edge set dist factors.\n" );
+
+ EXCHECK( ex_put_set_param( exoid, EX_FACE_SET, 1400, 2, 0 ), "Unable to write face set params.\n" );
+ EXCHECK( ex_put_set( exoid, EX_FACE_SET, 1400, fset_faces, fset_orient ), "Unable to write face set.\n" );
+
+ EXCHECK( ex_put_set_param( exoid, EX_SIDE_SET, 1600, 5, 0 ), "Unable to write side set params.\n" );
+ EXCHECK( ex_put_set( exoid, EX_SIDE_SET, 1600, sset_elems, sset_sides ), "Unable to write side set.\n" );
+
+ EXCHECK( ex_put_set_param( exoid, EX_SIDE_SET, 1661, 3, 0 ), "Unable to write side set params.\n" );
+ EXCHECK( ex_put_set( exoid, EX_SIDE_SET, 1661, sset1_elems, sset1_sides ), "Unable to write side set.\n" );
+
+ EXCHECK( ex_put_set_param( exoid, EX_ELEM_SET, 1800, 1, 0 ), "Unable to write element set 1 params.\n" );
+ EXCHECK( ex_put_set( exoid, EX_ELEM_SET, 1800, elset_elems + 0, 0 ), "Unable to write element set 1.\n" );
+ EXCHECK( ex_put_set_param( exoid, EX_ELEM_SET, 1900, 1, 0 ), "Unable to write element set 2 params.\n" );
+ EXCHECK( ex_put_set( exoid, EX_ELEM_SET, 1900, elset_elems + 1, 0 ), "Unable to write element set 2.\n" );
+ }
+
+ /* =============== Result variable params ========= */
+ if ( concatResult ) {
+ EXCHECK( ex_put_all_var_param_ext( exoid, &varParams ),
+ "Unable to write result variable parameter information.\n" );
+ } else {
+ EXCHECK( ex_put_variable_param( exoid, EX_GLOBAL, 3 ),
+ "Unable to write global result variable parameters.\n" );
+ EXCHECK( ex_put_variable_param( exoid, EX_NODAL, 1 ),
+ "Unable to write nodal result variable parameters.\n" );
+ EXCHECK( ex_put_variable_param( exoid, EX_ELEM_BLOCK, 14 ),
+ "Unable to write element result variable parameters.\n" );
+ EXCHECK( ex_put_variable_param( exoid, EX_EDGE_BLOCK, 2 ),
+ "Unable to write edge result variable parameters.\n" );
+ EXCHECK( ex_put_variable_param( exoid, EX_FACE_BLOCK, 1 ),
+ "Unable to write face result variable parameters.\n" );
+ EXCHECK( ex_put_variable_param( exoid, EX_FACE_SET, 1 ),
+ "Unable to write faceset result variable parameters.\n" );
+ EXCHECK( ex_put_variable_param( exoid, EX_SIDE_SET, 6 ),
+ "Unable to write sideset result variable parameters.\n" );
+ EXCHECK( ex_put_variable_param( exoid, EX_NODE_SET, 6 ),
+ "Unable to write nodeset result variable parameters.\n" );
+ }
+
+ /* =============== Result variable names ========== */
+ /* *** NEW API *** */
+ EXCHECK( ex_put_variable_name( exoid, EX_GLOBAL, 1, "A_vector_X" ), "Unable to write variable name.\n" );
+ EXCHECK( ex_put_variable_name( exoid, EX_GLOBAL, 2, "A_vector_Y" ), "Unable to write variable name.\n" );
+ EXCHECK( ex_put_variable_name( exoid, EX_GLOBAL, 3, "A_vector_Z" ), "Unable to write variable name.\n" );
+ EXCHECK( ex_put_variable_name( exoid, EX_NODAL, 1, "RHO" ), "Unable to write variable name.\n" );
+ EXCHECK( ex_put_variable_name( exoid, EX_EDGE_BLOCK, 1, "GAMMA1" ), "Unable to write variable name.\n" );
+ EXCHECK( ex_put_variable_name( exoid, EX_EDGE_BLOCK, 2, "GAMMA2" ), "Unable to write variable name.\n" );
+ EXCHECK( ex_put_variable_name( exoid, EX_FACE_BLOCK, 1, "PHI" ), "Unable to write variable name.\n" );
+ EXCHECK( ex_put_variable_names( exoid, EX_ELEM_BLOCK, 14, (char**)elem_var_names), "Unable to write variable name.\n" );
+ EXCHECK( ex_put_variable_names( exoid, EX_SIDE_SET, 6, (char**)sset_var_names), "Unable to write variable name.\n" );
+ EXCHECK( ex_put_variable_names( exoid, EX_NODE_SET, 6, (char**)nset_var_names), "Unable to write variable name.\n" );
+ EXCHECK( ex_put_variable_name( exoid, EX_FACE_SET, 1, "PHI0" ), "Unable to write variable name.\n" );
+
+ /* =============== Result variable values ========= */
+ t = 1.;
+ /* *** NEW API *** */
+ EXCHECK( ex_put_time( exoid, 1, &t ), "Unable to write time value.\n" );
+ EXCHECK( ex_put_var( exoid, 1, EX_GLOBAL, 1, 0/*N/A*/, 2, vals_glo_var[0] ), "Unable to write global var 1.\n" );
+ EXCHECK( ex_put_var( exoid, 1, EX_EDGE_BLOCK, 1, 100, 20, vals_edge_var1eb1[0] ), "Unable to write edge block 1 var 1.\n" );
+ EXCHECK( ex_put_var( exoid, 1, EX_EDGE_BLOCK, 2, 100, 20, vals_edge_var2eb1[0] ), "Unable to write edge block 1 var 2.\n" );
+ EXCHECK( ex_put_var( exoid, 1, EX_FACE_BLOCK, 1, 500, 2, vals_face_var1fb1[0] ), "Unable to write face block 1 var 1.\n" );
+ EXCHECK( ex_put_var( exoid, 1, EX_FACE_BLOCK, 1, 700, 8, vals_face_var1fb3[0] ), "Unable to write face block 3 var 1.\n" );
+
+ EXCHECK( ex_put_var( exoid, 1, EX_ELEM_BLOCK, 13, 201, 1, &vals_elem_var1[0] ), "Unable to write elem block 1 var 1.\n" );
+ EXCHECK( ex_put_var( exoid, 1, EX_ELEM_BLOCK, 14, 2147483647, 4, &vals_tension[0] ), "Unable to write elem block 1 var 1.\n" );
+ for(i=0; i < 6; i++){
+ /* There are 2 elements in the block and 12 variables (a composite tensor x 2) */
+ EXCHECK( ex_put_var( exoid, 1, EX_ELEM_BLOCK, i+1, 200, 2, &vals_elem_var[0][2*i] ), "Unable to write elem block 1 var 1.\n" );
+ EXCHECK( ex_put_var( exoid, 1, EX_ELEM_BLOCK, i+7, 200, 2, &vals_elem_var[0][12+2*i] ), "Unable to write elem block 1 var 1.\n" );
+ EXCHECK( ex_put_var( exoid, 1, EX_NODE_SET, i+1, 1000, 3, &vals_nset_var[0][3*i] ), "Unable to write elem block 1 var 1.\n" );
+ EXCHECK( ex_put_var( exoid, 1, EX_SIDE_SET, i+1, 1600, 5, &vals_sset_var[0][5*i] ), "Unable to write elem block 1 var 1.\n" );
+ }
+
+ EXCHECK( ex_put_var( exoid, 1, EX_FACE_SET, 1, 1400, 2, vals_fset_var1fs1[0] ), "Unable to write face set 1 var 1.\n" );
+
+ t = 2.;
+ EXCHECK( ex_put_time( exoid, 2, &t ), "Unable to write time value.\n" );
+ EXCHECK( ex_put_var( exoid, 2, EX_GLOBAL, 1, 0/*N/A*/, 2, vals_glo_var[1] ), "Unable to write global var 1.\n" );
+ EXCHECK( ex_put_var( exoid, 2, EX_EDGE_BLOCK, 1, 100, 20, vals_edge_var1eb1[1] ), "Unable to write edge block 1 var 1.\n" );
+ EXCHECK( ex_put_var( exoid, 2, EX_EDGE_BLOCK, 2, 100, 20, vals_edge_var2eb1[1] ), "Unable to write edge block 1 var 2.\n" );
+ EXCHECK( ex_put_var( exoid, 2, EX_FACE_BLOCK, 1, 500, 2, vals_face_var1fb1[1] ), "Unable to write face block 1 var 1.\n" );
+ EXCHECK( ex_put_var( exoid, 2, EX_FACE_BLOCK, 1, 700, 8, vals_face_var1fb3[1] ), "Unable to write face block 3 var 1.\n" );
+
+ EXCHECK( ex_put_var( exoid, 2, EX_ELEM_BLOCK, 13, 201, 1, &vals_elem_var1[1] ), "Unable to write elem block 1 var 1.\n" );
+ EXCHECK( ex_put_var( exoid, 2, EX_ELEM_BLOCK, 14, 2147483647, 4, &vals_tension[1] ), "Unable to write elem block 1 var 1.\n" );
+ for(i=0; i < 6; i++){
+ EXCHECK( ex_put_var( exoid, 2, EX_ELEM_BLOCK, i+1, 200, 2, &vals_elem_var[1][2*i] ), "Unable to write elem block 1 var 1.\n" );
+ EXCHECK( ex_put_var( exoid, 2, EX_ELEM_BLOCK, i+7, 200, 2, &vals_elem_var[1][12+2*i] ), "Unable to write elem block 1 var 1.\n" );
+ EXCHECK( ex_put_var( exoid, 2, EX_NODE_SET, i+1, 1000, 3, &vals_nset_var[1][3*i] ), "Unable to write elem block 1 var 1.\n" );
+ EXCHECK( ex_put_var( exoid, 2, EX_SIDE_SET, i+1, 1600, 5, &vals_sset_var[1][5*i] ), "Unable to write elem block 1 var 1.\n" );
+ }
+ EXCHECK( ex_put_var( exoid, 2, EX_FACE_SET, 1, 1400, 2, vals_fset_var1fs1[1] ), "Unable to write face set 1 var 1.\n" );
+
+ EXCHECK( ex_put_nodal_var( exoid, 1, 1, 12, vals_nod_var[0] ), "Unable to write nodal var 1.\n" );
+ EXCHECK( ex_put_nodal_var( exoid, 2, 1, 12, vals_nod_var[1] ), "Unable to write nodal var 1.\n" );
+
+ EXCHECK( ex_close( exoid ),
+ "Unable to close database.\n" );
+
+ return 0;
+}
+
+#if !defined(USING_CMAKE)
+int main( int argc, char* argv[] )
+{
+ return cCreateEdgeFace(argc, argv);
+}
+#endif
diff --git a/exodus/cbind/test/Makefile.standalone b/exodus/cbind/test/Makefile.standalone
index 27e80e2..5c13e11 100644
--- a/exodus/cbind/test/Makefile.standalone
+++ b/exodus/cbind/test/Makefile.standalone
@@ -31,128 +31,129 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
-EXOIITEST = -L../.. -lexodus
+NETCDF = /Users/gdsjaar/src/seacas-nopar
+LDFLAGS = -L$(NETCDF)/lib -lnetcdf -lhdf5_hl -lhdf5 -lm -lz
+CFLAGS = -I../include -I$(NETCDF)/include
LOCALEXO = ../../libexodus.a
-LIBS = $(EXOIITEST) $(NETCDF_LIB) -lm
+NCDUMP = $(NETCDF)/bin/ncdump
PROGS = testwt testwtd testrd testrd1 testrdd testwt1 testwt2 testwtm \
- testwt_ss testwt_nossnsdf testrd_ss testrdwt testcp testcpd testcp_nl \
- testcp_ln testwt_clb testwt_nc testrd_nc testwt-zeroe testwt-zeron \
- testrdv testwt-one-attrib create_mesh rd_wt_mesh \
- testrd-partial testwt-partial testwt-nsided testrd-nsided testwt-nfaced \
- testrd-nfaced testwt-long-name testrd-long-name
+ testwt_ss testwt_nossnsdf testrd_ss testrdwt testcp testcpd \
+ testwt_clb testwt_nc testrd_nc testwt-zeroe testwt-zeron \
+ testwt-one-attrib create_mesh rd_wt_mesh testcef test_nemesis \
+ testref testwt-nsided testrd-nsided testwt-nfaced testrd-nfaced \
+ testwt-long-name testrd-long-name testcp_nl testcp_ln
all:: check
+testcp_ln : testcp_ln.o $(LOCALEXO)
+ $(RM) $@
+ $(CC) -o $@ $(LDOPTIONS) testcp_ln.o $(LOCALEXO) $(LDFLAGS)
+
+testcp_nl : testcp_nl.o $(LOCALEXO)
+ $(RM) $@
+ $(CC) $(CFLAGS) -o $@ testcp_nl.o $(LOCALEXO) $(LDFLAGS)
+
+testcp_ln : testcp_ln.o $(LOCALEXO)
+ $(RM) $@
+ $(CC) $(CFLAGS) -o $@ testcp_ln.o $(LOCALEXO) $(LDFLAGS)
+
testwt: testwt.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testwt.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testwt.o $(LOCALEXO) $(LDFLAGS)
testwt_clb: testwt_clb.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testwt_clb.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testwt_clb.o $(LOCALEXO) $(LDFLAGS)
testwtd: testwtd.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testwtd.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testwtd.o $(LOCALEXO) $(LDFLAGS)
testrd: testrd.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testrd.o $(LDFLAGS) $(LIBS)
-
-testrdv: testrdv.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testrdv.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testrd.o $(LOCALEXO) $(LDFLAGS)
testrd1: testrd1.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testrd1.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testrd1.o $(LOCALEXO) $(LDFLAGS)
testrdd: testrdd.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testrdd.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testrdd.o $(LOCALEXO) $(LDFLAGS)
testwt1: testwt1.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testwt1.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testwt1.o $(LOCALEXO) $(LDFLAGS)
testwt2: testwt2.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testwt2.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testwt2.o $(LOCALEXO) $(LDFLAGS)
testwtm: testwtm.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testwtm.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testwtm.o $(LOCALEXO) $(LDFLAGS)
testwt_ss: testwt_ss.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testwt_ss.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testwt_ss.o $(LOCALEXO) $(LDFLAGS)
testwt_nossnsdf: testwt_nossnsdf.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testwt_nossnsdf.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testwt_nossnsdf.o $(LOCALEXO) $(LDFLAGS)
testrd_ss: testrd_ss.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testrd_ss.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testrd_ss.o $(LOCALEXO) $(LDFLAGS)
testrdwt: testrdwt.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testrdwt.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testrdwt.o $(LOCALEXO) $(LDFLAGS)
testcp: testcp.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testcp.o $(LDFLAGS) $(LIBS)
-
-testcp_nl: testcp_nl.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testcp_nl.o $(LDFLAGS) $(LIBS)
-
-testcp_ln: testcp_ln.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testcp_ln.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testcp.o $(LOCALEXO) $(LDFLAGS)
testcpd: testcpd.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testcpd.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testcpd.o $(LOCALEXO) $(LDFLAGS)
testwt_nc: testwt_nc.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testwt_nc.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testwt_nc.o $(LOCALEXO) $(LDFLAGS)
testrd_nc: testrd_nc.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testrd_nc.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testrd_nc.o $(LOCALEXO) $(LDFLAGS)
testwt-zeroe: testwt-zeroe.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testwt-zeroe.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testwt-zeroe.o $(LOCALEXO) $(LDFLAGS)
testwt-zeron: testwt-zeron.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testwt-zeron.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testwt-zeron.o $(LOCALEXO) $(LDFLAGS)
testwt-one-attrib: testwt-one-attrib.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testwt-one-attrib.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testwt-one-attrib.o $(LOCALEXO) $(LDFLAGS)
testwt-nsided: testwt-nsided.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testwt-nsided.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testwt-nsided.o $(LOCALEXO) $(LDFLAGS)
testrd-nsided: testrd-nsided.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testrd-nsided.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testrd-nsided.o $(LOCALEXO) $(LDFLAGS)
testwt-nfaced: testwt-nfaced.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testwt-nfaced.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testwt-nfaced.o $(LOCALEXO) $(LDFLAGS)
testrd-nfaced: testrd-nfaced.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testrd-nfaced.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ testrd-nfaced.o $(LOCALEXO) $(LDFLAGS)
+
+testrd-long-name: testrd-long-name.o $(LOCALEXO)
+ $(CC) $(CFLAGS) -o $@ testrd-long-name.o $(LOCALEXO) $(LDFLAGS)
+
+testwt-long-name: testwt-long-name.o $(LOCALEXO)
+ $(CC) $(CFLAGS) -o $@ testwt-long-name.o $(LOCALEXO) $(LDFLAGS)
create_mesh: create_mesh.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ create_mesh.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ create_mesh.o $(LOCALEXO) $(LDFLAGS)
+
+test_nemesis: test_nemesis.o $(LOCALEXO)
+ $(CC) $(CFLAGS) -o $@ test_nemesis.o $(LOCALEXO) $(LDFLAGS)
rd_wt_mesh: rd_wt_mesh.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ rd_wt_mesh.o $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -o $@ rd_wt_mesh.o $(LOCALEXO) $(LDFLAGS)
testcef: CreateEdgeFace.c $(LOCALEXO)
- $(CC) $(CFLAGS) -DCreateEdgeFace=main -o $@ CreateEdgeFace.c $(LDFLAGS) $(LIBS)
+ $(CC) $(CFLAGS) -DCreateEdgeFace=main -o $@ CreateEdgeFace.c $(LOCALEXO) $(LDFLAGS)
testref: ReadEdgeFace.c $(LOCALEXO)
- $(CC) $(CFLAGS) -DReadEdgeFace=main -o $@ ReadEdgeFace.c $(LDFLAGS) $(LIBS)
-
-testwt-long-name: testwt-long-name.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testwt-long-name.o $(LDFLAGS) $(LIBS)
-
-testrd-long-name: testrd-long-name.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testrd-long-name.o $(LDFLAGS) $(LIBS)
-
-testrd-partial: testrd-partial.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testrd-partial.o $(LDFLAGS) $(LIBS)
-
-testwt-partial: testwt-partial.o $(LOCALEXO)
- $(CC) $(CFLAGS) -o $@ testwt-partial.o $(LDFLAGS) $(LIBS)
-
+ $(CC) $(CFLAGS) -DReadEdgeFace=main -o $@ ReadEdgeFace.c $(LOCALEXO) $(LDFLAGS)
test: check
check: $(PROGS)
- csh ./testall
+ csh ./testall.standalone $(NCDUMP)
clean::
rm -f *.res $(PROGS)
@@ -170,7 +171,7 @@ clean::
.SUFFIXES: .c
.c.o:
- $(CC) -c $(CFLAGS) $*.c
+ $(CC) -c $(INCLUDES) $(CFLAGS) $*.c
# ----------------------------------------------------------------------
# dependencies generated by makedepend or sfmakedepend
diff --git a/exodus/cbind/test/ReadEdgeFace.c b/exodus/cbind/test/ReadEdgeFace.c
index 44d9c2f..0818cad 100644
--- a/exodus/cbind/test/ReadEdgeFace.c
+++ b/exodus/cbind/test/ReadEdgeFace.c
@@ -1,6 +1,7 @@
#include "exodusII.h"
#include <stdio.h>
#include <stdlib.h> /* for malloc(), free() */
+#include <inttypes.h>
#define EX_TEST_FILENAME "edgeFace.exo"
@@ -131,23 +132,23 @@ int cReadEdgeFace( int argc, char* argv[] )
fprintf( stdout,
"Title: <%s>\n"
- "Dimension: %d\n"
- "Nodes: %d\n"
- "Edges: %d\n"
- "Faces: %d\n"
- "Elements: %d\n"
- "Edge Blocks: %d\n"
- "Face Blocks: %d\n"
- "Element Blocks: %d\n"
- "Node Sets: %d\n"
- "Edge Sets: %d\n"
- "Face Sets: %d\n"
- "Side Sets: %d\n"
- "Element Sets: %d\n"
- "Node Maps: %d\n"
- "Edge Maps: %d\n"
- "Face Maps: %d\n"
- "Element Maps: %d\n",
+ "Dimension: %"PRId64"\n"
+ "Nodes: %"PRId64"\n"
+ "Edges: %"PRId64"\n"
+ "Faces: %"PRId64"\n"
+ "Elements: %"PRId64"\n"
+ "Edge Blocks: %"PRId64"\n"
+ "Face Blocks: %"PRId64"\n"
+ "Element Blocks: %"PRId64"\n"
+ "Node Sets: %"PRId64"\n"
+ "Edge Sets: %"PRId64"\n"
+ "Face Sets: %"PRId64"\n"
+ "Side Sets: %"PRId64"\n"
+ "Element Sets: %"PRId64"\n"
+ "Node Maps: %"PRId64"\n"
+ "Edge Maps: %"PRId64"\n"
+ "Face Maps: %"PRId64"\n"
+ "Element Maps: %"PRId64"\n",
modelParams.title, modelParams.num_dim,
modelParams.num_nodes, modelParams.num_edge, modelParams.num_face, modelParams.num_elem,
modelParams.num_edge_blk, modelParams.num_face_blk, modelParams.num_elem_blk,
@@ -156,27 +157,7 @@ int cReadEdgeFace( int argc, char* argv[] )
modelParams.num_node_maps, modelParams.num_edge_maps, modelParams.num_face_maps,
modelParams.num_elem_maps );
- /* *** NEW API *** */
- EXCHKPI( ex_inquire( exoid, EX_INQ_EDGE, itmp, 0, 0 ), "Inquire failed.\n", "EX_INQ_EDGE : %d\n", itmp[0] );
- EXCHKPI( ex_inquire( exoid, EX_INQ_EDGE_BLK, itmp, 0, 0 ), "Inquire failed.\n", "EX_INQ_EDGE_BLK : %d\n", itmp[0] );
- EXCHKPI( ex_inquire( exoid, EX_INQ_EDGE_SETS, itmp, 0, 0 ), "Inquire failed.\n", "EX_INQ_EDGE_SETS : %d\n", itmp[0] );
- EXCHKPI( ex_inquire( exoid, EX_INQ_ES_LEN, itmp, 0, 0 ), "Inquire failed.\n", "EX_INQ_ES_LEN : %d\n", itmp[0] );
- EXCHKPI( ex_inquire( exoid, EX_INQ_ES_DF_LEN, itmp, 0, 0 ), "Inquire failed.\n", "EX_INQ_ES_DF_LEN : %d\n", itmp[0] );
- EXCHKPI( ex_inquire( exoid, EX_INQ_EDGE_PROP, itmp, 0, 0 ), "Inquire failed.\n", "EX_INQ_EDGE_PROP : %d\n", itmp[0] );
- EXCHKPI( ex_inquire( exoid, EX_INQ_ES_PROP, itmp, 0, 0 ), "Inquire failed.\n", "EX_INQ_ES_PROP : %d\n", itmp[0] );
- EXCHKPI( ex_inquire( exoid, EX_INQ_FACE, itmp, 0, 0 ), "Inquire failed.\n", "EX_INQ_FACE : %d\n", itmp[0] );
- EXCHKPI( ex_inquire( exoid, EX_INQ_FACE_BLK, itmp, 0, 0 ), "Inquire failed.\n", "EX_INQ_FACE_BLK : %d\n", itmp[0] );
- EXCHKPI( ex_inquire( exoid, EX_INQ_FACE_SETS, itmp, 0, 0 ), "Inquire failed.\n", "EX_INQ_FACE_SETS : %d\n", itmp[0] );
- EXCHKPI( ex_inquire( exoid, EX_INQ_FS_LEN, itmp, 0, 0 ), "Inquire failed.\n", "EX_INQ_FS_LEN : %d\n", itmp[0] );
- EXCHKPI( ex_inquire( exoid, EX_INQ_FS_DF_LEN, itmp, 0, 0 ), "Inquire failed.\n", "EX_INQ_FS_DF_LEN : %d\n", itmp[0] );
- EXCHKPI( ex_inquire( exoid, EX_INQ_FACE_PROP, itmp, 0, 0 ), "Inquire failed.\n", "EX_INQ_FACE_PROP : %d\n", itmp[0] );
- EXCHKPI( ex_inquire( exoid, EX_INQ_FS_PROP, itmp, 0, 0 ), "Inquire failed.\n", "EX_INQ_FS_PROP : %d\n", itmp[0] );
- EXCHKPI( ex_inquire( exoid, EX_INQ_ELEM_SETS, itmp, 0, 0 ), "Inquire failed.\n", "EX_INQ_ELEM_SETS : %d\n", itmp[0] );
- EXCHKPI( ex_inquire( exoid, EX_INQ_ELS_LEN, itmp, 0, 0 ), "Inquire failed.\n", "EX_INQ_ELS_LEN : %d\n", itmp[0] );
- EXCHKPI( ex_inquire( exoid, EX_INQ_ELS_DF_LEN, itmp, 0, 0 ), "Inquire failed.\n", "EX_INQ_ELS_DF_LEN : %d\n", itmp[0] );
- EXCHKPI( ex_inquire( exoid, EX_INQ_ELS_PROP, itmp, 0, 0 ), "Inquire failed.\n", "EX_INQ_ELS_PROP : %d\n", itmp[0] );
- EXCHKPI( ex_inquire( exoid, EX_INQ_TIME, itmp, 0, 0 ), "Inquire failed.\n", "EX_INQ_TIME : %d\n", itmp[0] );
- num_timesteps = itmp[0];
+ num_timesteps = ex_inquire_int( exoid, EX_INQ_TIME );
/* *** NEW API *** */
for ( i = 0; i < sizeof(obj_types)/sizeof(obj_types[0]); ++i ) {
diff --git a/exodus/cbind/test/create_mesh.c b/exodus/cbind/test/create_mesh.c
index 44f9544..0362fb8 100644
--- a/exodus/cbind/test/create_mesh.c
+++ b/exodus/cbind/test/create_mesh.c
@@ -38,6 +38,7 @@
#include <stdlib.h>
#include <string.h>
#include <assert.h>
+#include <inttypes.h>
#include "exodusII.h"
@@ -56,14 +57,16 @@
typedef double realtyp;
-int
+typedef int64_t INT;
+
+INT
StringToCount(char * size_str)
{
- int size = 0;
+ INT size = 0;
char range;
int rc;
- rc = sscanf(size_str, "%d%c", &size, &range);
+ rc = sscanf(size_str, "%"PRId64"%c", &size, &range);
if (rc == 2) {
switch ((int)range) {
case 'k': case 'K': size *= 1000; break;
@@ -85,8 +88,8 @@ void get_file_name(const char* base, const char* ext, int rank, int nprocs,
* a brute force approach. Found at
* http://www.hackersdelight.org/HDcode/icbrt.c
*/
-int icbrt(unsigned x) {
- int s;
+INT icbrt(unsigned x) {
+ INT s;
unsigned y, b;
s = 30;
@@ -105,86 +108,90 @@ int icbrt(unsigned x) {
/* Prototypes */
void create_rr_elem_map(
- int loc_num_elements,
- int *elem_map,
- int map_origin,
- int num_domains,
- int current_domain
+ INT loc_num_elements,
+ INT *elem_map,
+ INT map_origin,
+ INT num_domains,
+ INT current_domain
);
void create_elem_map (
- int loc_num_elems,
- int start,
- int *elem_map,
- int map_origin
+ INT loc_num_elems,
+ INT start,
+ INT *elem_map,
+ INT map_origin
);
void create_local_connect(
- int *node_map,
- int len_node_map,
- int len_connect,
- int *domain_connect,
- int *loc_connect,
- int map_origin
+ INT *node_map,
+ INT len_node_map,
+ INT len_connect,
+ INT *domain_connect,
+ INT *loc_connect,
+ INT map_origin
);
void extract_connect(
- int element_offset,
- int num_elem,
- int *elem_map,
- int *connect,
- int *domain_connect,
- int map_origin
+ INT element_offset,
+ INT num_elem,
+ INT *elem_map,
+ INT *connect,
+ INT *domain_connect,
+ INT map_origin
);
void make_mesh(
realtyp *x,
realtyp *y,
realtyp *z,
- int *connect,
- int map_origin,
- int num_elements
+ INT *connect,
+ INT map_origin,
+ INT num_elements
);
void parse_input(
int argc,
char *argv[],
int *debug,
- int *map_origin,
- int *num_elements,
- int *num_domains,
- int *num_nodal_fields,
- int *num_global_fields,
- int *num_element_fields,
- int *num_timesteps,
+ INT *map_origin,
+ INT *num_elements,
+ INT *num_domains,
+ INT *num_nodal_fields,
+ INT *num_global_fields,
+ INT *num_element_fields,
+ INT *num_timesteps,
char *device_name,
char *file_name,
- int *exodus
+ int *exodus,
+ int *compression_level,
+ int *shuffle,
+ int *int64bit
);
void write_exo_mesh(
int debug,
char *file_name,
- int map_origin,
- int num_nodes,
- int num_elements,
- int num_domains,
- int num_nodal_fields,
- int num_global_fields,
- int num_element_fields,
- int num_timesteps,
+ INT map_origin,
+ INT num_nodes,
+ INT num_elements,
+ INT num_domains,
+ INT num_nodal_fields,
+ INT num_global_fields,
+ INT num_element_fields,
+ INT num_timesteps,
realtyp *x,
realtyp *y,
realtyp *z,
- int *connect
+ INT *connect,
+ int compression_level,
+ int shuffle,
+ int int64bit
);
-void create_node_map (int len_map, int len_connect, int *domain_connect, int *node_map,
- int *loc_num_nodes, int map_origin);
+void create_node_map (INT len_map, INT len_connect, INT *domain_connect, INT *node_map,
+ INT *loc_num_nodes, INT map_origin);
-void sort_int(int n, int ra[]);
-
-int bin_search2 (int value, int num, int List[]);
+INT bin_search2 (INT value, INT num, INT List[]);
/***********************************************************************
*
@@ -194,21 +201,24 @@ int bin_search2 (int value, int num, int List[]);
int
main( int argc, char *argv[] ) {
- int *connect;
+ INT *connect;
int debug = FALSE; /* TRUE, display debug information; FALSE */
/* otherwise. */
static char device_name[MAX_STRING_LEN];
static char file_name[MAX_STRING_LEN] = DEFAULT_FILE_NAME;
int exodus = TRUE;
- int map_origin = DEFAULT_MAP_ORIGIN;
- int num_domains = DEFAULT_NUM_DOMAINS;
- int num_elements_1d;
- int num_elements = DEFAULT_NUM_ELEMENTS;
- int num_nodal_fields = DEFAULT_NUM_FIELDS;
- int num_global_fields = DEFAULT_NUM_FIELDS;
- int num_element_fields = DEFAULT_NUM_FIELDS;
- int num_timesteps = DEFAULT_NUM_TIMESTEPS;
- int num_nodes;
+ INT map_origin = DEFAULT_MAP_ORIGIN;
+ INT num_domains = DEFAULT_NUM_DOMAINS;
+ INT num_elements_1d;
+ INT num_elements = DEFAULT_NUM_ELEMENTS;
+ INT num_nodal_fields = DEFAULT_NUM_FIELDS;
+ INT num_global_fields = DEFAULT_NUM_FIELDS;
+ INT num_element_fields = DEFAULT_NUM_FIELDS;
+ INT num_timesteps = DEFAULT_NUM_TIMESTEPS;
+ INT num_nodes;
+ int compression_level = 0;
+ int shuffle = 0;
+ int int64bit = 0;
size_t size;
realtyp *x;
@@ -221,7 +231,7 @@ main( int argc, char *argv[] ) {
parse_input(argc, argv, &debug, &map_origin,
&num_elements, &num_domains, &num_nodal_fields,
&num_global_fields, &num_element_fields, &num_timesteps,
- device_name,file_name, &exodus);
+ device_name,file_name, &exodus, &compression_level, &shuffle, &int64bit);
/* Create Coordinates and Connectivity Array */
num_elements_1d = icbrt(num_elements);
@@ -232,12 +242,12 @@ main( int argc, char *argv[] ) {
assert(x != NULL && y != NULL && z != NULL);
num_elements = num_elements_1d * num_elements_1d * num_elements_1d;
- size = (size_t)NUM_NODES_PER_ELEM * num_elements * sizeof( int );
+ size = (size_t)NUM_NODES_PER_ELEM * num_elements * sizeof( INT );
assert(size > 0);
connect = malloc(size);
assert(connect != NULL);
- fprintf(stderr, "Creating a 3D mesh of %d hex elements and %d nodes.\n", num_elements, num_nodes);
+ fprintf(stderr, "Creating a 3D mesh of %"PRId64" hex elements and %"PRId64" nodes.\n", num_elements, num_nodes);
make_mesh(x, y, z, connect, map_origin, num_elements_1d);
fprintf(stderr, "\t...Mesh topology created.\n");
@@ -261,7 +271,10 @@ main( int argc, char *argv[] ) {
x,
y,
z,
- connect
+ connect,
+ compression_level,
+ shuffle,
+ int64bit
);
}
@@ -279,16 +292,19 @@ void parse_input(
int argc,
char *argv[],
int *debug,
- int *map_origin,
- int *num_elements_1d,
- int *num_domains,
- int *num_nodal_fields,
- int *num_global_fields,
- int *num_element_fields,
- int *num_timesteps,
+ INT *map_origin,
+ INT *num_elements_1d,
+ INT *num_domains,
+ INT *num_nodal_fields,
+ INT *num_global_fields,
+ INT *num_element_fields,
+ INT *num_timesteps,
char *device_name,
char *file_name,
- int *exodus
+ int *exodus,
+ int *compression_level,
+ int *shuffle,
+ int *int64bit
) {
int arg = 0; /* Argument index. */
@@ -296,6 +312,15 @@ void parse_input(
if ( strcmp( "-c", argv[arg] ) == 0 ) {
if ( ++arg < argc ) *num_nodal_fields = atoi( argv[arg] );
}
+ else if ( strcmp( "-compress", argv[arg] ) == 0 ) {
+ if ( ++arg < argc ) *compression_level = atoi( argv[arg] );
+ }
+ else if ( strcmp( "-shuffle", argv[arg] ) == 0 ) {
+ *shuffle = 1;
+ }
+ else if ( strcmp( "-64", argv[arg] ) == 0 ) {
+ *int64bit = 1;
+ }
else if ( strcmp( "-nv", argv[arg] ) == 0 ) {
if ( ++arg < argc ) *num_nodal_fields = atoi( argv[arg] );
}
@@ -369,6 +394,9 @@ void parse_input(
printf( " elements/file = elements/number_of_domains. \n" );
printf( " Default: %d \n", DEFAULT_NUM_ELEMENTS);
printf( "-p domains number of domains. Default: %d \n", DEFAULT_NUM_DOMAINS );
+ printf( "-compress val set compression to level 'val' [0..9] \n" );
+ printf( "-shuffle enable hdf5-shuffle \n" );
+ printf( "-64 enable 64-bit integers \n" );
printf( "-u display help/usage information. \n" );
exit( 0 );
@@ -394,9 +422,9 @@ void make_mesh(
realtyp *x,
realtyp *y,
realtyp *z,
- int *connect,
- int map_origin,
- int num_elements_1d
+ INT *connect,
+ INT map_origin,
+ INT num_elements_1d
) {
size_t i, j, k, m, base, cnt;
size_t elp1sq = (num_elements_1d+1) * (num_elements_1d+1);
@@ -438,27 +466,30 @@ void make_mesh(
void write_exo_mesh(
int debug,
char *file_name,
- int map_origin,
- int num_nodes,
- int num_elements,
- int num_domains,
- int num_nodal_fields,
- int num_global_fields,
- int num_element_fields,
- int num_timesteps,
+ INT map_origin,
+ INT num_nodes,
+ INT num_elements,
+ INT num_domains,
+ INT num_nodal_fields,
+ INT num_global_fields,
+ INT num_element_fields,
+ INT num_timesteps,
realtyp *x,
realtyp *y,
realtyp *z,
- int *connect
+ INT *connect,
+ int compression_level,
+ int shuffle,
+ int int64bit
) {
int CPU_word_size=sizeof(realtyp);
int IO_word_size=sizeof(realtyp);
int exoid, err, num_dim, num_elem_blk, num_node_sets, num_side_sets;
- int i, j, t, index, loc_num_elements, loc_num_nodes, len_connect;
- int *elem_map = NULL, *node_map = NULL, *domain_connect = NULL, *loc_connect = NULL;
+ INT i, j, t, index, loc_num_elements, loc_num_nodes, len_connect;
+ INT *elem_map = NULL, *node_map = NULL, *domain_connect = NULL, *loc_connect = NULL;
int *elem_var_tab;
- int accum_num_elements = 0;
- int loc_node_size = -1;
+ INT accum_num_elements = 0;
+ INT loc_node_size = -1;
realtyp *loc_xcoords = NULL;
realtyp *loc_ycoords = NULL;
@@ -473,13 +504,21 @@ void write_exo_mesh(
/* create the EXODUSII file */
get_file_name(file_name, "e", i, num_domains, NULL, temporary_name);
- exoid = ex_create (temporary_name, EX_CLOBBER, &CPU_word_size, &IO_word_size);
+
+ int mymode = EX_MAPS_INT64_API|EX_BULK_INT64_API|EX_IDS_INT64_API;
+ if (int64bit) {
+ mymode |= EX_MAPS_INT64_DB|EX_BULK_INT64_DB|EX_IDS_INT64_DB;
+ }
+ exoid = ex_create (temporary_name, EX_CLOBBER|mymode, &CPU_word_size, &IO_word_size);
if (exoid < 0) {
fprintf(stderr, "after ex_create, error = %d\n", exoid);
exit(-1);
}
+ ex_set_option(exoid, EX_OPT_COMPRESSION_LEVEL, compression_level);
+ ex_set_option(exoid, EX_OPT_COMPRESSION_SHUFFLE, shuffle);
+
if (num_domains > 1) {
/* Determine local number of elements */
if (num_elements < num_domains)
@@ -498,10 +537,10 @@ void write_exo_mesh(
if (i == 0) { /* first time through; max size arrays occur on
first iteration */
- elem_map = malloc(loc_num_elements * sizeof(int));
- domain_connect = malloc(len_connect * sizeof(int));
- loc_connect = malloc(len_connect * sizeof(int));
- node_map = malloc(num_nodes * sizeof(int));
+ elem_map = malloc(loc_num_elements * sizeof(INT));
+ domain_connect = malloc(len_connect * sizeof(INT));
+ loc_connect = malloc(len_connect * sizeof(INT));
+ node_map = malloc(num_nodes * sizeof(INT));
}
/* Create element local/global map */
@@ -546,9 +585,9 @@ void write_exo_mesh(
if ( debug ) {
fprintf(stderr, "\n\n\n");
- fprintf(stderr, "\n domain: %d\n", i);
- fprintf(stderr, "\n loc_num_elements: %d\n", loc_num_elements);
- fprintf(stderr, "\n loc_num_nodes: %d\n", loc_num_nodes);
+ fprintf(stderr, "\n domain: %"PRId64"\n", i);
+ fprintf(stderr, "\n loc_num_elements: %"PRId64"\n", loc_num_elements);
+ fprintf(stderr, "\n loc_num_nodes: %"PRId64"\n", loc_num_nodes);
}
num_dim = 3;
@@ -596,11 +635,11 @@ void write_exo_mesh(
}
#if 1
{
- int ids[1] = {10};
- int num_elem_per_block[1];
+ INT ids[1] = {100000};
+ INT num_elem_per_block[1];
char *names[1] = {"hex"};
- int num_node_per_elem[1];
- int num_attr_per_block[1];
+ INT num_node_per_elem[1];
+ INT num_attr_per_block[1];
int write_map = num_domains > 1 ? TRUE : FALSE;
write_map = TRUE;
num_elem_per_block[0] = loc_num_elements;
@@ -611,7 +650,7 @@ void write_exo_mesh(
}
#else
err = ex_put_elem_block
- (exoid, 10, "hex", loc_num_elements, NUM_NODES_PER_ELEM, 0);
+ (exoid, 10000000000, "hex", loc_num_elements, NUM_NODES_PER_ELEM, 0);
#endif
if (err) {
@@ -621,9 +660,9 @@ void write_exo_mesh(
}
if (num_domains > 1) {
- err = ex_put_elem_conn (exoid, 10, loc_connect);
+ err = ex_put_elem_conn (exoid, 100000, loc_connect);
} else {
- err = ex_put_elem_conn (exoid, 10, connect);
+ err = ex_put_elem_conn (exoid, 100000, connect);
}
if (err) {
@@ -691,7 +730,7 @@ void write_exo_mesh(
var_name = malloc (num_nodal_fields * sizeof(char *));
for (j=0; j<num_nodal_fields; j++) {
var_name[j] = malloc ((MAX_STRING_LEN+1) * sizeof (char));
- sprintf (var_name[j], "node_field_%d", j+1);
+ sprintf (var_name[j], "node_field_%"PRId64, j+1);
}
err = ex_put_variable_names (exoid, EX_NODAL, num_nodal_fields, var_name);
for (j=0; j<num_nodal_fields; j++) {
@@ -705,7 +744,7 @@ void write_exo_mesh(
var_name = malloc (num_global_fields * sizeof(char *));
for (j=0; j<num_global_fields; j++) {
var_name[j] = malloc ((MAX_STRING_LEN+1) * sizeof (char));
- sprintf (var_name[j], "global_field_%d", j+1);
+ sprintf (var_name[j], "global_field_%"PRId64, j+1);
globals[j] = j;
}
err = ex_put_variable_names (exoid, EX_GLOBAL, num_global_fields, var_name);
@@ -720,7 +759,7 @@ void write_exo_mesh(
var_name = malloc (num_element_fields * sizeof(char *));
for (j=0; j<num_element_fields; j++) {
var_name[j] = malloc ((MAX_STRING_LEN+1) * sizeof (char));
- sprintf (var_name[j], "element_field_%d", j+1);
+ sprintf (var_name[j], "element_field_%"PRId64, j+1);
}
err = ex_put_variable_names (exoid, EX_ELEM_BLOCK, num_element_fields, var_name);
for (j=0; j<num_element_fields; j++) {
@@ -730,11 +769,11 @@ void write_exo_mesh(
}
if (num_nodal_fields+num_global_fields+num_element_fields > 0) {
- fprintf(stderr, "Domain %d/%d, Writing Timestep: ", i+1, num_domains);
+ fprintf(stderr, "Domain %"PRId64"/%"PRId64", Writing Timestep: ", i+1, num_domains);
for (t=0; t<num_timesteps; t++) {
realtyp time = t;
ex_put_time(exoid, t+1, &time);
- fprintf(stderr, "%d, ", t+1);
+ fprintf(stderr, "%"PRId64", ", t+1);
if (num_global_fields > 0) {
err = ex_put_var(exoid, t+1, EX_GLOBAL, 1, 0, num_global_fields, globals);
if (err) {
@@ -752,7 +791,7 @@ void write_exo_mesh(
}
}
for (j=0; j<num_element_fields; j++) {
- err = ex_put_var (exoid, t+1, EX_ELEM_BLOCK, j+1, 10, loc_num_elements, x);
+ err = ex_put_var (exoid, t+1, EX_ELEM_BLOCK, j+1, 100000, loc_num_elements, x);
if (err) {
fprintf(stderr, "after ex_put_element_var, error = %d\n", err);
ex_close (exoid);
@@ -800,12 +839,12 @@ void write_exo_mesh(
*
***********************************************************************/
void create_elem_map (
- int loc_num_elems,
- int elem_num,
- int *elem_map,
- int map_origin)
+ INT loc_num_elems,
+ INT elem_num,
+ INT *elem_map,
+ INT map_origin)
{
- int i;
+ INT i;
for (i=0; i<loc_num_elems; i++) {
elem_map[i] = map_origin + elem_num++;
@@ -824,14 +863,14 @@ void create_elem_map (
***********************************************************************/
void extract_connect(
- int element_offset,
- int num_elem,
- int *elem_map,
- int *connect,
- int *domain_connect,
- int map_origin
+ INT element_offset,
+ INT num_elem,
+ INT *elem_map,
+ INT *connect,
+ INT *domain_connect,
+ INT map_origin
) {
- int i, j, k, m, offset;
+ INT i, j, k, m, offset;
for (i=element_offset, j=0, m=0; j<num_elem; j++) {
if (elem_map[j] == i+map_origin) { /* extract this element */
@@ -851,10 +890,10 @@ void extract_connect(
* trust me.
*
***********************************************************************/
-void create_node_map (int len_map, int len_connect, int *domain_connect, int *node_map,
- int *loc_num_nodes, int map_origin)
+void create_node_map (INT len_map, INT len_connect, INT *domain_connect, INT *node_map,
+ INT *loc_num_nodes, INT map_origin)
{
- int cnt, i;
+ INT cnt, i;
*loc_num_nodes = len_connect;
@@ -890,77 +929,26 @@ void create_node_map (int len_map, int len_connect, int *domain_connect, int *no
* the index of the located value in the node map
*
***********************************************************************/
-void create_local_connect(int *node_map,
- int len_node_map,
- int len_connect,
- int *domain_connect,
- int *loc_connect,
- int map_origin)
+void create_local_connect(INT *node_map,
+ INT len_node_map,
+ INT len_connect,
+ INT *domain_connect,
+ INT *loc_connect,
+ INT map_origin)
{
- int i, index;
+ INT i, index;
for (i=0; i<len_connect; i++) {
index = bin_search2 (domain_connect[i], len_node_map, node_map);
if (index != -1) { /* found */
loc_connect[i] = index+map_origin;
} else {
- fprintf (stderr, "error creating local connectivity; i = %d\n", i);
+ fprintf (stderr, "error creating local connectivity; i = %"PRId64"\n", i);
exit (-1);
}
}
}
-
-
-/*****************************************************************************
- *
- * Numerical Recipies in C source code
- * modified to have first argument an integer array
- *
- * Sorts the array ra[0,..,(n-1)] in ascending numerical order using
- * heapsort algorithm.
- *
- *****************************************************************************/
-
-void sort_int(int n, int ra[])
-
-{
- int l, j, ir, i;
- int rra;
-
- /*
- * No need to sort if one or fewer items.
- */
- if (n <= 1) return;
-
- l=n >> 1;
- ir=n-1;
- for (;;) {
- if (l > 0)
- rra=ra[--l];
- else {
- rra=ra[ir];
- ra[ir]=ra[0];
- if (--ir == 0) {
- ra[0]=rra;
- return;
- }
- }
- i=l;
- j=(l << 1)+1;
- while (j <= ir) {
- if (j < ir && ra[j] < ra[j+1]) ++j;
- if (rra < ra[j]) {
- ra[i]=ra[j];
- j += (i=j)+1;
- }
- else j=ir+1;
- }
- ra[i]=rra;
- }
-}
-
-
/*****************************************************************************
*
* Searches a monotonic list of values for the value, 'value'.
@@ -972,9 +960,9 @@ void sort_int(int n, int ra[])
*
*****************************************************************************/
-int bin_search2 (int value, int num, int List[])
+INT bin_search2 (INT value, INT num, INT List[])
{
- int top, bottom = 0, middle, g_mid;
+ INT top, bottom = 0, middle, g_mid;
top = num - 1;
while (bottom <= top) {
@@ -994,8 +982,8 @@ int bin_search2 (int value, int num, int List[])
void get_file_name(const char* base, const char* ext, int rank, int nprocs,
const char* other,char *output)
{
- int i1, iTemp1;
- int iMaxDigit=0, iMyDigit=0;
+ INT i1, iTemp1;
+ INT iMaxDigit=0, iMyDigit=0;
char cTemp[128];
output[0] = '\0';
diff --git a/exodus/cbind/test/exodus_unit_tests.gold b/exodus/cbind/test/exodus_unit_tests.gold
index c5168ac..dba7a1a 100644
--- a/exodus/cbind/test/exodus_unit_tests.gold
+++ b/exodus/cbind/test/exodus_unit_tests.gold
@@ -2,7 +2,6 @@
************************************************************************
testwt - single precision write test...
testrd - single precision read test...
-testrdv - single precision read test with varid...
testcp_ss - single-to-single precision copy test...
testcp_sd - single-to-double precision copy test...
testcp_ln - large model to normal model single precision copy test...
diff --git a/exodus/cbind/test/oned.c b/exodus/cbind/test/oned.c
new file mode 100644
index 0000000..8b54e77
--- /dev/null
+++ b/exodus/cbind/test/oned.c
@@ -0,0 +1,426 @@
+/*
+ * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
+ * retains certain rights in this software.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * * Neither the name of Sandia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/*****************************************************************************
+*
+* testwt - test write an ExodusII database file
+*
+* author - Sandia National Laboratories
+* Larry A. Schoof - Original
+* Vic Yarberry - Added headers and error logging
+* 7/7/93 Modified for use with Exodus 2.00
+*
+*
+* environment - UNIX
+*
+* entry conditions -
+*
+* exit conditions -
+*
+* revision history -
+*
+* This is a test program for the C binding of the EXODUS II
+* database write routines.
+*
+*
+*****************************************************************************/
+
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+
+#include "exodusII.h"
+
+#define EXCHECK(FUNC) \
+ do { if ( (FUNC) < 0 ) {\
+ fprintf(stderr, "Error code %d returned after calling " #FUNC "\n"); \
+ exit(1); \
+ } else {\
+ fprintf(stderr, "Called " #FUNC " successfully\n"); \
+ }\
+ } while (0)
+
+int main (int argc, char **argv)
+{
+ int exoid, num_dim, num_nodes, num_elem, num_elem_blk;
+ int num_elem_in_block[10], num_nodes_per_elem[10];
+ int num_nodes_in_nset[10];
+ int num_node_sets, num_side_sets;
+ int i, j, k, m, *elem_map, *connect;
+ int node_list[100];
+ int ebids[10], nsids[10];
+ int num_qa_rec, num_info;
+ int num_glo_vars, num_nod_vars, num_ele_vars, num_nset_vars;
+ int *truth_tab;
+ int whole_time_step, num_time_steps;
+ int CPU_word_size,IO_word_size;
+ int prop_array[2];
+
+ float *glob_var_vals, *nodal_var_vals, *elem_var_vals;
+ float *nset_var_vals;
+ float time_value;
+ float x[100];
+ float attrib[10], dist_fact[100];
+ char *coord_names[3], *qa_record[2][4], *info[3], *var_names[3];
+ char *block_names[10], *nset_names[10];
+ char *prop_names[2], *attrib_names[2];
+ char *title = "This is a test";
+ ex_opts (EX_VERBOSE | EX_ABORT );
+
+/* Specify compute and i/o word size */
+
+ CPU_word_size = 0; /* sizeof(float) */
+ IO_word_size = 4; /* (4 bytes) */
+
+/* create EXODUS II file */
+
+ exoid = ex_create ("oned.e", /* filename path */
+ EX_CLOBBER, /* create mode */
+ &CPU_word_size, /* CPU float word size in bytes */
+ &IO_word_size); /* I/O float word size in bytes */
+ printf ("after ex_create for oned.e, exoid = %d\n", exoid);
+ printf (" cpu word size: %d io word size: %d\n",CPU_word_size,IO_word_size);
+
+ EXCHECK(ex_set_max_name_length(exoid, 40));
+ /* ncopts = NC_VERBOSE; */
+
+/* initialize file with parameters */
+
+ num_dim = 1;
+ num_nodes = 10;
+ num_elem = 10; /* 9 lines plus a point */
+ num_elem_blk = 3;
+ num_node_sets = 2;
+ num_side_sets = 0;
+
+
+ EXCHECK(ex_put_init (exoid, title, num_dim, num_nodes, num_elem, num_elem_blk, num_node_sets, num_side_sets));
+
+ for (i=0; i < num_nodes; i++) {
+ x[i] = exp((float)i/10.0);
+ }
+
+ EXCHECK(ex_put_coord (exoid, x, NULL, NULL));
+
+ coord_names[0] = "xcoor";
+ EXCHECK(ex_put_coord_names (exoid, coord_names));
+
+ /* Add nodal attributes */
+ EXCHECK(ex_put_attr_param(exoid, EX_NODAL, 0, 1));
+
+ EXCHECK(ex_put_one_attr(exoid, EX_NODAL, 0, 1, x));
+
+ attrib_names[0] = "Node_attr_1";
+ EXCHECK(ex_put_attr_names (exoid, EX_NODAL, 0, attrib_names));
+
+ /* write element order map */
+ elem_map = (int *) calloc(num_elem, sizeof(int));
+
+ for (i=1; i<=num_elem; i++) {
+ elem_map[i-1] = 10*i;
+ }
+
+ EXCHECK(ex_put_map (exoid, elem_map));
+ free (elem_map);
+
+ /* write element block parameters */
+ block_names[0] = "left_side";
+ block_names[1] = "right_side";
+ block_names[2] = "center";
+
+ num_elem_in_block[0] = 4;
+ num_elem_in_block[1] = 5;
+ num_elem_in_block[2] = 1;
+
+ num_nodes_per_elem[0] = 2;
+ num_nodes_per_elem[1] = 2;
+ num_nodes_per_elem[2] = 1;
+
+ ebids[0] = 10;
+ ebids[1] = 20;
+ ebids[2] = 30;
+
+ EXCHECK(ex_put_elem_block (exoid, ebids[0], "line", num_elem_in_block[0], num_nodes_per_elem[0], 1));
+ EXCHECK(ex_put_elem_block (exoid, ebids[1], "line", num_elem_in_block[1], num_nodes_per_elem[1], 1));
+ EXCHECK(ex_put_elem_block (exoid, ebids[2], "point", num_elem_in_block[2], num_nodes_per_elem[2], 0));
+
+ /* Write element block names */
+ EXCHECK(ex_put_names(exoid, EX_ELEM_BLOCK, block_names));
+
+ /* write element block properties */
+ prop_names[0] = "DENSITY";
+ EXCHECK(ex_put_prop_names(exoid,EX_ELEM_BLOCK,1,prop_names));
+ EXCHECK(ex_put_prop(exoid, EX_ELEM_BLOCK, ebids[0], prop_names[0], 1.345));
+ EXCHECK(ex_put_prop(exoid, EX_ELEM_BLOCK, ebids[1], prop_names[0], 10.995));
+ EXCHECK(ex_put_prop(exoid, EX_ELEM_BLOCK, ebids[2], prop_names[0], 0.001));
+
+
+ /* write element connectivity */
+ connect = (int *) calloc(18, sizeof(int));
+ for (i=0; i < num_elem*2; i+=2) {
+ connect[i] = i/2+1;
+ connect[i+1] = i/2+2;
+ }
+
+ EXCHECK(ex_put_conn (exoid, EX_ELEM_BLOCK, ebids[0], connect, NULL, NULL));
+ EXCHECK(ex_put_conn (exoid, EX_ELEM_BLOCK, ebids[1], connect+8, NULL, NULL));
+
+ /* Circle */
+ connect[0] = 5;
+ EXCHECK(ex_put_conn (exoid, EX_ELEM_BLOCK, ebids[2], connect, NULL, NULL));
+
+ /* write element block attributes */
+ for (i=0; i < num_elem; i++) {
+ attrib[i] = 3.14159 * i;
+ }
+ EXCHECK(ex_put_attr (exoid, EX_ELEM_BLOCK, ebids[0], attrib));
+ EXCHECK(ex_put_attr (exoid, EX_ELEM_BLOCK, ebids[1], attrib+num_elem_in_block[0]));
+
+ attrib_names[0] = "THICKNESS";
+ EXCHECK(ex_put_attr_names (exoid, EX_ELEM_BLOCK, ebids[0], attrib_names));
+ attrib_names[0] = "WIDTH";
+ EXCHECK(ex_put_attr_names (exoid, EX_ELEM_BLOCK, ebids[1], attrib_names));
+
+ /* write individual node sets */
+ num_nodes_in_nset[0] = 5;
+ num_nodes_in_nset[1] = 3;
+
+ nsids[0] = 20;
+ nsids[1] = 21;
+
+ EXCHECK(ex_put_node_set_param (exoid, nsids[0], 5, 5));
+
+ node_list[0] = 1;
+ node_list[1] = 3;
+ node_list[2] = 5;
+ node_list[3] = 7;
+ node_list[4] = 9;
+
+ dist_fact[0] = 1.0;
+ dist_fact[1] = 2.0;
+ dist_fact[2] = 3.0;
+ dist_fact[3] = 4.0;
+ dist_fact[4] = 5.0;
+
+ EXCHECK(ex_put_node_set (exoid, nsids[0], node_list));
+ EXCHECK(ex_put_node_set_dist_fact (exoid, nsids[0], dist_fact));
+
+ EXCHECK(ex_put_node_set_param (exoid, nsids[1], 3, 3));
+
+ node_list[0] = 2;
+ node_list[1] = 4;
+ node_list[2] = 6;
+
+ dist_fact[0] = 1.0;
+ dist_fact[1] = 2.0;
+ dist_fact[2] = 3.0;
+
+ EXCHECK(ex_put_node_set (exoid, nsids[1], node_list));
+ EXCHECK(ex_put_node_set_dist_fact (exoid, nsids[1], dist_fact));
+
+ /* Write node set names */
+ nset_names[0] = "all_odd_nodes";
+ nset_names[1] = "some_even_nodes";
+
+ EXCHECK(ex_put_names(exoid, EX_NODE_SET, nset_names));
+ EXCHECK(ex_put_prop(exoid, EX_NODE_SET, nsids[0], "FACE", 4));
+
+ EXCHECK(ex_put_prop(exoid, EX_NODE_SET, nsids[1], "FACE", 5));
+
+ prop_array[0] = 1000;
+ prop_array[1] = 2000;
+
+ EXCHECK(ex_put_prop_array(exoid, EX_NODE_SET, "VELOCITY", prop_array));
+ /* Add nodeset attributes */
+ EXCHECK(ex_put_attr_param(exoid, EX_NODE_SET, nsids[0], 1));
+
+ EXCHECK(ex_put_attr(exoid, EX_NODE_SET, nsids[0], x));
+
+ attrib_names[0] = "Nodeset_attribute";
+ EXCHECK(ex_put_attr_names (exoid, EX_NODE_SET, nsids[0], attrib_names));
+
+ /* write QA records; test empty and just blank-filled records */
+ num_qa_rec = 2;
+
+ qa_record[0][0] = "TESTWT";
+ qa_record[0][1] = "testwt";
+ qa_record[0][2] = "07/07/93";
+ qa_record[0][3] = "15:41:33";
+ qa_record[1][0] = "";
+ qa_record[1][1] = " ";
+ qa_record[1][2] = "";
+ qa_record[1][3] = " ";
+
+ EXCHECK(ex_put_qa (exoid, num_qa_rec, qa_record));
+
+ /* write information records; test empty and just blank-filled records */
+ num_info = 3;
+
+
+ info[0] = "This is the first information record.";
+ info[1] = "";
+ info[2] = " ";
+
+ EXCHECK(ex_put_info (exoid, num_info, info));
+
+
+ /* write results variables parameters and names */
+ num_glo_vars = 1;
+
+ var_names[0] = "glo_vars";
+
+ EXCHECK(ex_put_variable_param (exoid, EX_GLOBAL, num_glo_vars));
+ EXCHECK(ex_put_variable_names (exoid, EX_GLOBAL, num_glo_vars, var_names));
+
+ num_nod_vars = 2;
+ /* 12345678901234567890123456789012 */
+ var_names[0] = "node_variable_a_very_long_name_0";
+ var_names[1] = "nod_var1";
+
+ EXCHECK(ex_put_variable_param (exoid, EX_NODAL, num_nod_vars));
+ EXCHECK(ex_put_variable_names (exoid, EX_NODAL, num_nod_vars, var_names));
+
+ num_ele_vars = 3;
+ /* 0 1 2 3 */
+ /* 12345678901234567890123456789012 */
+ var_names[0] = "this_variable_name_is_short";
+ var_names[1] = "this_variable_name_is_just_right";
+ var_names[2] = "this_variable_name_is_tooooo_long";
+
+ EXCHECK(ex_put_variable_param (exoid, EX_ELEM_BLOCK, num_ele_vars));
+ EXCHECK(ex_put_variable_names (exoid, EX_ELEM_BLOCK, num_ele_vars, var_names));
+
+ num_nset_vars = 3;
+
+ var_names[0] = "ns_var0";
+ var_names[1] = "ns_var1";
+ var_names[2] = "ns_var2";
+
+ EXCHECK(ex_put_variable_param (exoid, EX_NODE_SET, num_nset_vars));
+ EXCHECK(ex_put_variable_names (exoid, EX_NODE_SET, num_nset_vars, var_names));
+
+
+ /* write element variable truth table */
+ truth_tab = (int *) calloc ((num_elem_blk*num_ele_vars), sizeof(int));
+
+ k = 0;
+ for (i=0; i<num_elem_blk; i++)
+ {
+ for (j=0; j<num_ele_vars; j++)
+ {
+ truth_tab[k++] = 1;
+ }
+ }
+
+ EXCHECK(ex_put_truth_table(exoid, EX_ELEM_BLOCK, num_elem_blk, num_ele_vars, truth_tab));
+
+ free (truth_tab);
+
+
+/* for each time step, write the analysis results;
+ * the code below fills the arrays glob_var_vals,
+ * nodal_var_vals, and elem_var_vals with values for debugging purposes;
+ */
+
+ whole_time_step = 1;
+ num_time_steps = 10;
+
+ glob_var_vals = (float *) calloc (num_glo_vars, CPU_word_size);
+ nodal_var_vals = (float *) calloc (num_nodes, CPU_word_size);
+ elem_var_vals = (float *) calloc (num_elem, CPU_word_size);
+ nset_var_vals = (float *) calloc (10, CPU_word_size);
+
+ for (i=0; i<num_time_steps; i++)
+ {
+ time_value = (float)(i+1)/100.;
+
+ /* write time value */
+ EXCHECK(ex_put_time (exoid, whole_time_step, &time_value));
+
+ /* write global variables */
+ for (j=0; j<num_glo_vars; j++) {
+ glob_var_vals[j] = (float)(j+2) * time_value;
+ }
+
+ EXCHECK(ex_put_var (exoid, whole_time_step, EX_GLOBAL, 0, 0, num_glo_vars, glob_var_vals));
+
+ /* write nodal variables */
+ for (k=1; k<=num_nod_vars; k++) {
+ for (j=0; j<num_nodes; j++) {
+ nodal_var_vals[j] = (float)k + ((float)(j+1) * time_value);
+ }
+ EXCHECK(ex_put_var (exoid, whole_time_step, EX_NODAL, k, 1, num_nodes, nodal_var_vals));
+ }
+
+ /* write element variables */
+ for (k=1; k<=num_ele_vars; k++) {
+ for (j=0; j<num_elem_blk; j++) {
+ for (m=0; m<num_elem_in_block[j]; m++) {
+ elem_var_vals[m] = (float)(k+1) + (float)(j+2) +
+ ((float)(m+1)*time_value);
+ }
+ EXCHECK(ex_put_var (exoid, whole_time_step, EX_ELEM_BLOCK, k, ebids[j], num_elem_in_block[j], elem_var_vals));
+ }
+ }
+
+ /* write nodeset variables */
+ for (k=1; k<=num_nset_vars; k++) {
+ for (j=0; j<num_node_sets; j++) {
+ for (m=0; m<num_nodes_in_nset[j]; m++) {
+ nset_var_vals[m] = (float)(k+3) + (float)(j+4) +
+ ((float)(m+1)*time_value);
+ }
+ EXCHECK(ex_put_var (exoid, whole_time_step, EX_NODE_SET, k, nsids[j], num_nodes_in_nset[j], nset_var_vals));
+ }
+ }
+
+ whole_time_step++;
+
+ /* update the data file; this should be done at the end of every time step
+ * to ensure that no data is lost if the analysis dies
+ */
+ EXCHECK(ex_update (exoid));
+ }
+
+ free(glob_var_vals);
+ free(nodal_var_vals);
+ free(elem_var_vals);
+ free(nset_var_vals);
+
+
+/* close the EXODUS files */
+ EXCHECK(ex_close (exoid));
+ return 0;
+}
diff --git a/exodus/cbind/test/rd_wt_mesh.c b/exodus/cbind/test/rd_wt_mesh.c
index 007106b..4f91fbd 100644
--- a/exodus/cbind/test/rd_wt_mesh.c
+++ b/exodus/cbind/test/rd_wt_mesh.c
@@ -436,8 +436,6 @@ int read_exo_mesh (char *file_name, int rank, int *num_dim, int num_domains,
int num_nodes_per_elem, num_attrs, num_vars, i, iter;
size_t len_connect;
size_t file_size;
- double fdum;
- char *cdum = 0;
struct stat file_status;
size_t glob_file_size;
@@ -589,7 +587,7 @@ int read_exo_mesh (char *file_name, int rank, int *num_dim, int num_domains,
*num_element_fields = num_vars;
/* read number of timesteps */
- ex_inquire (exoid, EX_INQ_TIME, num_timesteps, &fdum, cdum);
+ *num_timesteps = ex_inquire_int (exoid, EX_INQ_TIME);
if (rank == 0) {
fprintf(stderr, " Number of Elements\t\t%8d (per domain)\n", *num_elems );
fprintf(stderr, " Number of Nodes\t\t%8d (per domain)\n", *num_nodes );
diff --git a/exodus/cbind/test/test.dmp b/exodus/cbind/test/test.dmp
index 18c3d0e..53117e6 100644
--- a/exodus/cbind/test/test.dmp
+++ b/exodus/cbind/test/test.dmp
@@ -188,6 +188,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
@@ -348,11 +349,11 @@ data:
eb_prop3 = _, _, _, _, _, _, _ ;
- node_ns1 = 100, 101, 102, 103, 104 ;
+ node_ns1 = 10, 11, 12, 13, 14 ;
dist_fact_ns1 = 1, 2, 3, 4, 5 ;
- node_ns2 = 200, 201, 202 ;
+ node_ns2 = 20, 21, 22 ;
dist_fact_ns2 = 1.1, 2.1, 3.1 ;
diff --git a/exodus/cbind/test/test1.dmp b/exodus/cbind/test/test1.dmp
index 83d02d4..832fdb6 100644
--- a/exodus/cbind/test/test1.dmp
+++ b/exodus/cbind/test/test1.dmp
@@ -174,6 +174,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is testwt1" ;
:maximum_name_length = 32 ;
data:
@@ -333,11 +334,11 @@ data:
eb_prop3 = _, _, _, _, _, _, _ ;
- node_ns1 = 100, 101, 102, 103, 104 ;
+ node_ns1 = 10, 11, 12, 13, 14 ;
dist_fact_ns1 = 1, 2, 3, 4, 5 ;
- node_ns2 = 200, 201, 202 ;
+ node_ns2 = 20, 21, 22 ;
dist_fact_ns2 = 1.1, 2.1, 3.1 ;
diff --git a/exodus/cbind/test/test2-1.dmp b/exodus/cbind/test/test2-1.dmp
index d4e1d39..d7e53b2 100644
--- a/exodus/cbind/test/test2-1.dmp
+++ b/exodus/cbind/test/test2-1.dmp
@@ -137,6 +137,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
@@ -238,11 +239,11 @@ data:
eb_prop3 = _, _, _, _, _ ;
- node_ns1 = 100, 101, 102, 103, 104 ;
+ node_ns1 = 10, 11, 12, 13, 14 ;
dist_fact_ns1 = 1, 2, 3, 4, 5 ;
- node_ns2 = 200, 201, 202 ;
+ node_ns2 = 20, 21, 22 ;
dist_fact_ns2 = 1.1, 2.1, 3.1 ;
diff --git a/exodus/cbind/test/test2-2.dmp b/exodus/cbind/test/test2-2.dmp
index 5e60a2d..c8f3b41 100644
--- a/exodus/cbind/test/test2-2.dmp
+++ b/exodus/cbind/test/test2-2.dmp
@@ -137,6 +137,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is test 2" ;
:maximum_name_length = 32 ;
data:
@@ -238,11 +239,11 @@ data:
eb_prop3 = _, _, _, _, _ ;
- node_ns1 = 100, 101, 102, 103, 104 ;
+ node_ns1 = 10, 11, 12, 13, 14 ;
dist_fact_ns1 = 1, 2, 3, 4, 5 ;
- node_ns2 = 200, 201, 202 ;
+ node_ns2 = 20, 21, 22 ;
dist_fact_ns2 = 1.1, 2.1, 3.1 ;
diff --git a/exodus/cbind/test/test2.dmp b/exodus/cbind/test/test2.dmp
index 8a41281..1265bda 100644
--- a/exodus/cbind/test/test2.dmp
+++ b/exodus/cbind/test/test2.dmp
@@ -119,6 +119,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
@@ -220,11 +221,11 @@ data:
eb_prop4 = _, _, _, _, _ ;
- node_ns1 = 100, 101, 102, 103, 104 ;
+ node_ns1 = 10, 11, 12, 13, 14 ;
dist_fact_ns1 = 1, 2, 3, 4, 5 ;
- node_ns2 = 200, 201, 202 ;
+ node_ns2 = 20, 21, 22 ;
dist_fact_ns2 = 1.1, 2.1, 3.1 ;
diff --git a/exodus/cbind/test/test_clb.dmp b/exodus/cbind/test/test_clb.dmp
index 99024ac..fcac32b 100644
--- a/exodus/cbind/test/test_clb.dmp
+++ b/exodus/cbind/test/test_clb.dmp
@@ -184,6 +184,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
@@ -305,11 +306,11 @@ data:
eb_prop3 = _, _, _, _, _, _, _ ;
- node_ns1 = 100, 101, 102, 103, 104 ;
+ node_ns1 = 10, 11, 12, 13, 14 ;
dist_fact_ns1 = 1, 2, 3, 4, 5 ;
- node_ns2 = 200, 201, 202 ;
+ node_ns2 = 20, 21, 22 ;
dist_fact_ns2 = 1.1, 2.1, 3.1 ;
diff --git a/nemesis/ne_test.c b/exodus/cbind/test/test_nemesis.c
similarity index 93%
copy from nemesis/ne_test.c
copy to exodus/cbind/test/test_nemesis.c
index ccc33be..2926c99 100644
--- a/nemesis/ne_test.c
+++ b/exodus/cbind/test/test_nemesis.c
@@ -49,11 +49,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
#include <exodusII.h>
-#include "ne_nemesisI.h"
-
/* Constants for init_global functions */
#define NNG 100
#define NEG 50
@@ -124,7 +121,7 @@ int main(int argc, char *argv[])
/* Get the location of the temporary file to use for the test */
if (argc <= 1) {
/* Nothing specified. Use defaults. */
- strcpy(file_name, "./ne_test.exoII");
+ strcpy(file_name, "./ne_test.exo");
}
else if (argc == 2) {
/* Test for the help flag */
@@ -137,7 +134,7 @@ int main(int argc, char *argv[])
else if (strcmp(argv[1], "-d") == 0 || strcmp(argv[1], "-d") == 0) {
printf("****DEBUG MODE****\n");
ex_opts(EX_VERBOSE | EX_DEBUG);
- strcpy(file_name, "./ne_test.exoII");
+ strcpy(file_name, "./ne_test.exo");
debug_flag = 1;
}
/* Else get the directory name and assign default name */
@@ -145,11 +142,11 @@ int main(int argc, char *argv[])
strcpy(test_direc, argv[1]);
if (test_direc[strlen(test_direc)-1] != '/') {
strcpy(file_name, test_direc);
- strcat(file_name, "/ne_test.exoII");
+ strcat(file_name, "/ne_test.exo");
}
else {
strcpy(file_name, test_direc);
- strcat(file_name, "ne_test.exoII");
+ strcat(file_name, "ne_test.exo");
}
}
}
@@ -529,7 +526,7 @@ int ne_test_piinf(int fileid)
strcpy(ftype, "s");
- return (ne_put_init_info(fileid, NPROC, NPROCF, ftype));
+ return (ex_put_init_info(fileid, NPROC, NPROCF, ftype));
}
/*****************************************************************************/
@@ -540,7 +537,7 @@ int ne_test_pinig(int fileid)
/*-----------------------------Execution Begins-----------------------------*/
- return (ne_put_init_global(fileid, nng, neg, nebg, nnsg, nssg));
+ return (ex_put_init_global(fileid, nng, neg, nebg, nnsg, nssg));
}
/*****************************************************************************/
@@ -555,7 +552,7 @@ int ne_test_pelbid(int fileid)
elblk_cnt[i]=NEBCG;
}
- return (ne_put_eb_info_global(fileid, elblk_ids, elblk_cnt));
+ return (ex_put_eb_info_global(fileid, elblk_ids, elblk_cnt));
}
/*****************************************************************************/
@@ -571,7 +568,7 @@ int ne_test_pnsp(int fileid)
global_df_cnts[i]=1;
}
- return (ne_put_ns_param_global(fileid, global_ids, global_n_cnts,
+ return (ex_put_ns_param_global(fileid, global_ids, global_n_cnts,
global_df_cnts));
}
@@ -588,7 +585,7 @@ int ne_test_pssp(int fileid)
global_df_cnts[i]=1;
}
- return (ne_put_ss_param_global(fileid, global_ids, global_el_cnts,
+ return (ex_put_ss_param_global(fileid, global_ids, global_el_cnts,
global_df_cnts));
}
@@ -605,7 +602,7 @@ int ne_test_pnm(int fileid)
for(j=0; j < NBORN; node_mapb[j++]=j1++);
for(j=0; j < NEXTN; node_mape[j++]=j1++);
j1 = 0;
- error = ne_put_node_map(fileid, node_mapi, node_mapb, node_mape, iproc);
+ error = ex_put_processor_node_maps(fileid, node_mapi, node_mapb, node_mape, iproc);
if (error < 0) return error;
}
@@ -625,7 +622,7 @@ int ne_test_pem(int fileid)
for(j=0; j < NINTE; elem_mapi[j++]=j1++);
for(j=0; j < NBORE; elem_mapb[j++]=j1++);
j1 = 0;
- error = ne_put_elem_map(fileid, elem_mapi, elem_mapb, iproc);
+ error = ex_put_processor_elem_maps(fileid, elem_mapi, elem_mapb, iproc);
if (error < 0) return error;
}
@@ -653,7 +650,7 @@ int ne_test_pcmp(int fileid)
elem_map_elem_cnts[i]=ECNTCM;
}
- error = ne_put_cmap_params(fileid, node_map_node_cnts, node_map_ids,
+ error = ex_put_cmap_params(fileid, node_map_node_cnts, node_map_ids,
elem_map_elem_cnts, elem_map_ids, iproc);
if (error < 0) return error;
}
@@ -680,7 +677,7 @@ int ne_test_pncm(int fileid)
}
for(i=0; i < NNCMAP; i++) {
- error = ne_put_node_cmap(fileid, node_map_ids[i], node_ids,
+ error = ex_put_node_cmap(fileid, node_map_ids[i], node_ids,
proc_ids, iproc);
if (error < 0) return error;
}
@@ -709,7 +706,7 @@ int ne_test_pecm(int fileid)
}
for(i=0; i < NECMAP; i++) {
- error = ne_put_elem_cmap(fileid, elem_map_ids[i], elem_ids,
+ error = ex_put_elem_cmap(fileid, elem_map_ids[i], elem_ids,
side_ids, proc_ids, iproc);
if (error < 0) return error;
}
@@ -725,7 +722,7 @@ int ne_test_giinf(int fileid)
char ftype[2];
/*-----------------------------Execution Begins-----------------------------*/
- error = ne_get_init_info(fileid, &nproc, &nprocf, ftype);
+ error = ex_get_init_info(fileid, &nproc, &nprocf, ftype);
if (error < 0) return error;
@@ -745,7 +742,7 @@ int ne_test_ginig(int fileid)
/*-----------------------------Execution Begins-----------------------------*/
- error = ne_get_init_global(fileid, &num_nodes_g, &num_elems_g,
+ error = ex_get_init_global(fileid, &num_nodes_g, &num_elems_g,
&num_elem_blks_g, &num_ns_g, &num_ss_g);
if (error < 0) return error;
@@ -768,7 +765,7 @@ int ne_test_gelbid(int fileid)
/*-----------------------------Execution Begins-----------------------------*/
- error = ne_get_eb_info_global(fileid, el_blk_ids, el_blk_cnt);
+ error = ex_get_eb_info_global(fileid, el_blk_ids, el_blk_cnt);
if (error < 0) return error;
@@ -789,7 +786,7 @@ int ne_test_gnsp(int fileid)
/*-----------------------------Execution Begins-----------------------------*/
- error = ne_get_ns_param_global(fileid, global_ids, global_n_cnts,
+ error = ex_get_ns_param_global(fileid, global_ids, global_n_cnts,
global_df_cnts);
if (error < 0) return error;
@@ -812,7 +809,7 @@ int ne_test_gssp(int fileid)
/*-----------------------------Execution Begins-----------------------------*/
- error = ne_get_ss_param_global(fileid, global_ids, global_e_cnts,
+ error = ex_get_ss_param_global(fileid, global_ids, global_e_cnts,
global_df_cnts);
if (error < 0) return error;
@@ -836,7 +833,7 @@ int ne_test_glbp(int fileid)
/*-----------------------------Execution Begins-----------------------------*/
for(iproc=0; iproc < NPROCF; iproc++) {
- error = ne_get_loadbal_param(fileid, &nintn, &nborn, &nextn, &ninte,
+ error = ex_get_loadbal_param(fileid, &nintn, &nborn, &nextn, &ninte,
&nbore, &nncmap, &necmap, iproc);
if (error < 0) return error;
@@ -864,7 +861,7 @@ int ne_test_gnm(int fileid)
for(iproc=0; iproc < NPROCF; iproc++) {
- error = ne_get_node_map(fileid, node_mapi, node_mapb, node_mape, iproc);
+ error = ex_get_processor_node_maps(fileid, node_mapi, node_mapb, node_mape, iproc);
if (error < 0) return error;
@@ -894,7 +891,7 @@ int ne_test_gem(int fileid)
for(iproc=0; iproc < NPROCF; iproc++) {
- error = ne_get_elem_map(fileid, elem_mapi, elem_mapb, iproc);
+ error = ex_get_processor_elem_maps(fileid, elem_mapi, elem_mapb, iproc);
if (error < 0) return error;
@@ -922,13 +919,13 @@ int ne_test_gncm(int fileid)
for(iproc=0; iproc < NPROCF; iproc++) {
- error = ne_get_cmap_params(fileid, node_map_ids, node_map_cnts,
+ error = ex_get_cmap_params(fileid, node_map_ids, node_map_cnts,
NULL, NULL, iproc);
if (error < 0) return error;
for(i=0; i < NNCMAP; i++) {
- error = ne_get_node_cmap(fileid, node_map_ids[i], node_ids,
+ error = ex_get_node_cmap(fileid, node_map_ids[i], node_ids,
proc_ids, iproc);
if (error < 0) return error;
@@ -954,13 +951,13 @@ int ne_test_gecm(int fileid)
for(iproc=0; iproc < NPROCF; iproc++) {
- error = ne_get_cmap_params(fileid, NULL, NULL,
+ error = ex_get_cmap_params(fileid, NULL, NULL,
elem_map_ids, elem_map_cnts, iproc);
if (error < 0) return error;
for(i=0; i < NECMAP; i++) {
- error = ne_get_elem_cmap(fileid, elem_map_ids[i], elem_ids,
+ error = ex_get_elem_cmap(fileid, elem_map_ids[i], elem_ids,
side_ids, proc_ids, iproc);
if (error < 0) return error;
@@ -1000,7 +997,7 @@ int ne_test_plbpc(int fileid)
num_elem_cmaps[iproc] = NECMAP;
}
- return (ne_put_loadbal_param_cc(fileid, num_int_nodes, num_bor_nodes,
+ return (ex_put_loadbal_param_cc(fileid, num_int_nodes, num_bor_nodes,
num_ext_nodes, num_int_elems,
num_bor_elems, num_node_cmaps,
num_elem_cmaps));
@@ -1039,6 +1036,6 @@ int ne_test_pcmpc(int fileid)
}
- return (ne_put_cmap_params_cc(fileid, nmap_ids, nmap_n_cnts, nmap_proc_ptr,
+ return (ex_put_cmap_params_cc(fileid, nmap_ids, nmap_n_cnts, nmap_proc_ptr,
emap_ids, emap_e_cnts, emap_proc_ptr));
}
diff --git a/exodus/cbind/test/test_nemesis.dmp b/exodus/cbind/test/test_nemesis.dmp
new file mode 100644
index 0000000..9807fcf
--- /dev/null
+++ b/exodus/cbind/test/test_nemesis.dmp
@@ -0,0 +1,30 @@
+*********************Output Tests***********************
+creating ExodusII file... (netcdf4 format) successful
+testing init info output...successful
+testing global init info output...successful
+testing global element block ID output...successful
+testing global node-set params output...successful
+testing global side-set params output...successful
+testing concatenated load balance info output...succesful
+testing node map output...successful
+testing element map output...successful
+testing concatenated communication map params output...successful
+testing nodal communication map output...successful
+testing elemental communication map output...successful
+closing ExodusII file...successful
+**********************Input Tests***********************
+reopening ExodusII file...successful
+testing init info input...successful
+testing global init info input...successful
+testing global element block IDs input...successful
+testing global node-set params input...successful
+testing global side-set params input...successful
+testing load-balance params input...successful
+testing node map input...successful
+testing element map input...successful
+testing nodal communication map input...successful
+testing elemental communication map input...successful
+closing ExodusII file...successful
+
+Tests Passed: 24
+Tests Failed: 0
diff --git a/exodus/cbind/test/testall.in b/exodus/cbind/test/testall.in
old mode 100755
new mode 100644
index 6101582..6fbddb8
--- a/exodus/cbind/test/testall.in
+++ b/exodus/cbind/test/testall.in
@@ -42,6 +42,8 @@ set SUFFIX = ""
set BINDIR = @CMAKE_CURRENT_BINARY_DIR@
set SRCDIR = @CMAKE_CURRENT_SOURCE_DIR@
set NCDUMP = @NETCDF_NCDUMP@
+set DIFF = "diff -w"
+
echo "************************************************************************"
echo "************************************************************************"
rm -f test.output
@@ -49,83 +51,78 @@ echo "testwt - single precision write test..."
echo "begin testwt" > test.output
${PREFIX} ${BINDIR}/testwt${SUFFIX} >> test.output
echo "end testwt" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test.dmp | tee testwt.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/test.dmp | tee testwt.res
echo "testrd - single precision read test..."
echo "begin testrd" >> test.output
-${PREFIX} ${BINDIR}/testrd${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd.dmp | tee testrd.res
+${PREFIX} ${BINDIR}/testrd${SUFFIX} | grep -v version | ${DIFF} - ${SRCDIR}/testrd.dmp | tee testrd.res
echo "end testrd" >> test.output
-echo "testrdv - single precision read test with varid..."
-echo "begin testrdv" >> test.output
-${PREFIX} ${BINDIR}/testrdv${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrdv.dmp | tee testrdv.res
-echo "end testrdv" >> test.output
-
echo "testcp_ss - single-to-single precision copy test..."
echo "begin testcp_ss" >> test.output
${PREFIX} ${BINDIR}/testcp${SUFFIX} >> test.output
echo "end testcp_ss" >> test.output
-${NCDUMP} -d5,5 testcp.exo | grep -v version | diff - ${SRCDIR}/testcp_ss.dmp | tee testcp_ss.res
+${NCDUMP} -d5,5 testcp.exo | grep -v version | ${DIFF} - ${SRCDIR}/testcp_ss.dmp | tee testcp_ss.res
echo "testcp_sd - single-to-double precision copy test..."
echo "begin testcp_sd" >> test.output
${PREFIX} ${BINDIR}/testcpd${SUFFIX} >> test.output
echo "end testcp_sd" >> test.output
-${NCDUMP} -d5,5 testcpd.exo | grep -v version | diff - ${SRCDIR}/testcp_sd.dmp | tee testcp_sd.res
+${NCDUMP} -d5,5 testcpd.exo | grep -v version | ${DIFF} - ${SRCDIR}/testcp_sd.dmp | tee testcp_sd.res
echo "testcp_ln - large model to normal model single precision copy test..."
echo "begin testcp_ln" >> test.output
${PREFIX} ${BINDIR}/testcp_ln${SUFFIX} >> test.output
echo "end testcp_ln" >> test.output
-${NCDUMP} -d5,5 testcp.exo | grep -v version | diff - ${SRCDIR}/testcp_ln.dmp | tee testcp_ln.res
+${NCDUMP} -d5,5 testcp.exo | grep -v version | ${DIFF} - ${SRCDIR}/testcp_ln.dmp | tee testcp_ln.res
echo "testcp_nl - normal_model to large_model single precision copy test..."
echo "begin testcp_nl" >> test.output
${PREFIX} ${BINDIR}/testcp_nl${SUFFIX} >> test.output
echo "end testcp_nl" >> test.output
-${NCDUMP} -d5,5 testcp_nl.exo | grep -v version | diff - ${SRCDIR}/testcp_nl.dmp | tee testcp_nl.res
+${NCDUMP} -d5,5 testcp_nl.exo | grep -v version | ${DIFF} - ${SRCDIR}/testcp_nl.dmp | tee testcp_nl.res
echo "testwt_clb - single precision write test using concatenated puts..."
echo "begin testwt_clb" >> test.output
${PREFIX} ${BINDIR}/testwt_clb${SUFFIX} >> test.output
echo "end testwt_clb" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test_clb.dmp | tee testwt_clb.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/test_clb.dmp | tee testwt_clb.res
echo "testwtd - double precision write test..."
echo "begin testwtd" >> test.output
${PREFIX} ${BINDIR}/testwtd${SUFFIX} >> test.output
echo "end testwtd" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/testd.dmp | tee testwtd.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/testd.dmp | tee testwtd.res
echo "testrdd - double precision read test..."
echo "begin testrdd" >> test.output
-${PREFIX} ${BINDIR}/testrdd${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrdd.dmp | tee testrdd.res
+${PREFIX} ${BINDIR}/testrdd${SUFFIX} | grep -v version | ${DIFF} - ${SRCDIR}/testrdd.dmp | tee testrdd.res
echo "end testrdd" >> test.output
echo "testcp_dd - double-to-double precision copy test..."
echo "begin testcp_dd" >> test.output
${PREFIX} ${BINDIR}/testcpd${SUFFIX} >> test.output
echo "end testcp_dd" >> test.output
-${NCDUMP} -d5,5 testcpd.exo | grep -v version | diff - ${SRCDIR}/testcp_dd.dmp | tee testcp_dd.res
+${NCDUMP} -d5,5 testcpd.exo | grep -v version | ${DIFF} - ${SRCDIR}/testcp_dd.dmp | tee testcp_dd.res
echo "testcp_ds - double-to-single precision copy test..."
echo "begin testcp_ds" >> test.output
${PREFIX} ${BINDIR}/testcp${SUFFIX} >> test.output
echo "end testcp_ds" >> test.output
-${NCDUMP} -d5,5 testcp.exo | grep -v version | diff - ${SRCDIR}/testcp_ds.dmp | tee testcp_ds.res
+${NCDUMP} -d5,5 testcp.exo | grep -v version | ${DIFF} - ${SRCDIR}/testcp_ds.dmp | tee testcp_ds.res
echo "testwt1 - single precision write files with several side sets..."
echo "testwt1 ... [Expect WEDGE6 warning from this test]"
echo "begin testwt1" >> test.output
${PREFIX} ${BINDIR}/testwt1${SUFFIX} >> test.output
echo "end testwt1" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test1.dmp | tee testwt1.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/test1.dmp | tee testwt1.res
echo "testrd1 - single precision read test of a file with several side sets..."
echo "testrd1 ... [Expect file create failure error, NOCLOBBER]"
echo "testrd1 ... [Expect failure locating elem var 1 for elem block 12]"
echo "begin testrd1" >> test.output
-${PREFIX} ${BINDIR}/testrd1${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd1.dmp | tee testrd1.res
+${PREFIX} ${BINDIR}/testrd1${SUFFIX} | grep -v version | ${DIFF} - ${SRCDIR}/testrd1.dmp | tee testrd1.res
echo "end testrd1" >> test.output
echo "testwt_ss - write files to test side sets..."
@@ -133,58 +130,58 @@ echo "testwt_ss ... [Expect WEDGE6 warning from this test]"
echo "begin testwt_ss" >> test.output
${PREFIX} ${BINDIR}/testwt_ss${SUFFIX} >> test.output
echo "end testwt_ss" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/testwt_ss.dmp | tee testwt_ss.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/testwt_ss.dmp | tee testwt_ss.res
echo "testrd_ss - read test of a file with several side sets..."
echo "testrd_ss ... [Expect warning for NULL sidesets 30 and 31]"
echo "begin testrd_ss" >> test.output
-${PREFIX} ${BINDIR}/testrd_ss${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd_ss.dmp | tee testrd_ss.res
+${PREFIX} ${BINDIR}/testrd_ss${SUFFIX} | grep -v version | ${DIFF} - ${SRCDIR}/testrd_ss.dmp | tee testrd_ss.res
echo "end testrd_ss" >> test.output
echo "testwt2 - single precision write 2 files (simultaneously open) test..."
echo "begin testwt2" >> test.output
${PREFIX} ${BINDIR}/testwt2${SUFFIX} >> test.output
echo "end testwt2" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test2-1.dmp | tee testwt2-1.res
-${NCDUMP} -d5,5 test2.exo | grep -v version | diff - ${SRCDIR}/test2-2.dmp | tee testwt2-2.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/test2-1.dmp | tee testwt2-1.res
+${NCDUMP} -d5,5 test2.exo | grep -v version | ${DIFF} - ${SRCDIR}/test2-2.dmp | tee testwt2-2.res
echo "testrdwt - read from one and write to another (simutaneously open) file..."
echo "begin testrdwt" >> test.output
${PREFIX} ${BINDIR}/testrdwt${SUFFIX} >> test.output
echo "end testrdwt" >> test.output
-${NCDUMP} -d5,5 test2.exo | grep -v version | diff - ${SRCDIR}/test2.dmp | tee testrdwt.res
+${NCDUMP} -d5,5 test2.exo | grep -v version | ${DIFF} - ${SRCDIR}/test2.dmp | tee testrdwt.res
echo "testwt_nc - write x y z components of coordinates separately..."
echo "begin testwt_nc" >> test.output
${PREFIX} ${BINDIR}/testwt_nc${SUFFIX} >> test.output
echo "end testwt_nc" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test.dmp | tee testwt_nc.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/test.dmp | tee testwt_nc.res
echo "testrd_nc - read x y z components of coordinates separately..."
echo "begin testrd_nc" >> test.output
-${PREFIX} ${BINDIR}/testrd_nc${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd_nc.dmp | tee testrd_nc.res
+${PREFIX} ${BINDIR}/testrd_nc${SUFFIX} | grep -v version | ${DIFF} - ${SRCDIR}/testrd_nc.dmp | tee testrd_nc.res
echo "end testrd" >> test.output
echo "testwt-zeron - write file with zero nodes and elements..."
echo "begin testwt-zeron" >> test.output
${PREFIX} ${BINDIR}/testwt-zeron${SUFFIX} >> test.output
echo "end testwt-zeron" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/testwt-zeron.dmp | tee testwt-zeron.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/testwt-zeron.dmp | tee testwt-zeron.res
echo "testrd - read test of file with zero nodes and elements..."
echo "begin testrd zero nodes" >> test.output
-${PREFIX} ${BINDIR}/testrd${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd_zeron.dmp | tee testrd_zeron.res
+${PREFIX} ${BINDIR}/testrd${SUFFIX} | grep -v version | ${DIFF} - ${SRCDIR}/testrd_zeron.dmp | tee testrd_zeron.res
echo "end testrd zero nodes" >> test.output
echo "testwt-zeroe - write file with zero elements..."
echo "begin testwt-zeroe" >> test.output
${PREFIX} ${BINDIR}/testwt-zeroe${SUFFIX} >> test.output
echo "end testwt-zeroe" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/testwt-zeroe.dmp | tee testwt-zeroe.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/testwt-zeroe.dmp | tee testwt-zeroe.res
echo "testrd - read test of file with zero elements..."
echo "begin testrd zero elements" >> test.output
-${PREFIX} ${BINDIR}/testrd${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd_zeroe.dmp | tee testrd_zeroe.res
+${PREFIX} ${BINDIR}/testrd${SUFFIX} | grep -v version | ${DIFF} - ${SRCDIR}/testrd_zeroe.dmp | tee testrd_zeroe.res
echo "end testrd zero elements" >> test.output
echo "testwt-one-attrib - read/write test of element attributes - read one at a time..."
@@ -196,39 +193,44 @@ echo "testwt-nsided - write file with nsided elements..."
echo "begin testwt-nsided" >> test.output
${PREFIX} ${BINDIR}/testwt-nsided${SUFFIX} >> test.output
echo "end testwt-nsided" >> test.output
-${NCDUMP} -d5,5 test-nsided.exo | grep -v version | diff - ${SRCDIR}/testwt-nsided.dmp | tee testwt-nsided.res
+${NCDUMP} -d5,5 test-nsided.exo | grep -v version | ${DIFF} - ${SRCDIR}/testwt-nsided.dmp | tee testwt-nsided.res
echo "testrd-nsided - read file with nsided elements..."
echo "begin testrd-nsided" >> test.output
-${PREFIX} ${BINDIR}/testrd-nsided${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd-nsided.dmp | tee testrd-nsided.res
+${PREFIX} ${BINDIR}/testrd-nsided${SUFFIX} | grep -v version | ${DIFF} - ${SRCDIR}/testrd-nsided.dmp | tee testrd-nsided.res
echo "end testrd-nsided" >> test.output
echo "testwt-nfaced - write file with nfaced elements..."
echo "begin testwt-nfaced" >> test.output
${PREFIX} ${BINDIR}/testwt-nfaced${SUFFIX} >> test.output
echo "end testwt-nfaced" >> test.output
-${NCDUMP} -d5,5 test-nfaced.exo | grep -v version | diff - ${SRCDIR}/testwt-nfaced.dmp | tee testwt-nfaced.res
+${NCDUMP} -d5,5 test-nfaced.exo | grep -v version | ${DIFF} - ${SRCDIR}/testwt-nfaced.dmp | tee testwt-nfaced.res
echo "testrd-nfaced - read file with nfaced elements..."
echo "begin testrd-nfaced" >> test.output
-${PREFIX} ${BINDIR}/testrd-nfaced${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd-nfaced.dmp | tee testrd-nfaced.res
+${PREFIX} ${BINDIR}/testrd-nfaced${SUFFIX} | grep -v version | ${DIFF} - ${SRCDIR}/testrd-nfaced.dmp | tee testrd-nfaced.res
echo "end testrd-nfaced" >> test.output
echo "testwt-long-name - write file with long (64-character) names..."
echo "begin testwt-long-name" >> test.output
${PREFIX} ${BINDIR}/testwt-long-name${SUFFIX} >> test.output
echo "end testwt-long-name" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/testwt-long-name.dmp | tee testwt-long-name.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/testwt-long-name.dmp | tee testwt-long-name.res
echo "testrd - read long name file truncating to 32 characters on read..."
echo "begin testrd (truncate)" >> test.output
-${PREFIX} ${BINDIR}/testrd${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd-nm32.dmp | tee testrd-nm32.res
+${PREFIX} ${BINDIR}/testrd${SUFFIX} | grep -v version | ${DIFF} - ${SRCDIR}/testrd-nm32.dmp | tee testrd-nm32.res
echo "end testrd (truncate)" >> test.output
echo "testrd-long-name - read long name file..."
echo "begin testrd-long-name" >> test.output
-${PREFIX} ${BINDIR}/testrd-long-name${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd-long-name.dmp | tee testrd-long-name.res
+${PREFIX} ${BINDIR}/testrd-long-name${SUFFIX} | grep -v version | ${DIFF} - ${SRCDIR}/testrd-long-name.dmp | tee testrd-long-name.res
echo "end testrd-long-name" >> test.output
+echo "test_nemesis - read long name file..."
+echo "begin test_nemesis" >> test.output
+${PREFIX} ${BINDIR}/test_nemesis${SUFFIX} | grep -v version | ${DIFF} - ${SRCDIR}/test_nemesis.dmp | tee test_nemesis.res
+echo "end test_nemesis" >> test.output
+
echo "************************************************************************"
echo "************************************************************************"
diff --git a/exodus/cbind/test/testall.in1 b/exodus/cbind/test/testall.in1
index 7a65d4d..40522d3 100644
--- a/exodus/cbind/test/testall.in1
+++ b/exodus/cbind/test/testall.in1
@@ -40,6 +40,7 @@
set PREFIX = ""
set SRCDIR = .
set NCDUMP = @<BINDIR>@/ncdump
+set DIFF = "diff -w"
echo "************************************************************************"
echo "************************************************************************"
rm -f test.output
@@ -47,83 +48,78 @@ echo "testwt - single precision write test..."
echo "begin testwt" > test.output
${PREFIX} ${SRCDIR}/testwt >> test.output
echo "end testwt" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test.dmp | tee testwt.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/test.dmp | tee testwt.res
echo "testrd - single precision read test..."
echo "begin testrd" >> test.output
-${PREFIX} ${SRCDIR}/testrd | grep -v version | diff - ${SRCDIR}/testrd.dmp | tee testrd.res
+${PREFIX} ${SRCDIR}/testrd | grep -v version | ${DIFF} - ${SRCDIR}/testrd.dmp | tee testrd.res
echo "end testrd" >> test.output
-echo "testrdv - single precision read test with varid..."
-echo "begin testrdv" >> test.output
-${PREFIX} ${SRCDIR}/testrdv | grep -v version | diff - ${SRCDIR}/testrdv.dmp | tee testrdv.res
-echo "end testrdv" >> test.output
-
echo "testcp_ss - single-to-single precision copy test..."
echo "begin testcp_ss" >> test.output
${PREFIX} ${SRCDIR}/testcp >> test.output
echo "end testcp_ss" >> test.output
-${NCDUMP} -d5,5 testcp.exo | grep -v version | diff - ${SRCDIR}/testcp_ss.dmp | tee testcp_ss.res
+${NCDUMP} -d5,5 testcp.exo | grep -v version | ${DIFF} - ${SRCDIR}/testcp_ss.dmp | tee testcp_ss.res
echo "testcp_sd - single-to-double precision copy test..."
echo "begin testcp_sd" >> test.output
${PREFIX} ${SRCDIR}/testcpd >> test.output
echo "end testcp_sd" >> test.output
-${NCDUMP} -d5,5 testcpd.exo | grep -v version | diff - ${SRCDIR}/testcp_sd.dmp | tee testcp_sd.res
+${NCDUMP} -d5,5 testcpd.exo | grep -v version | ${DIFF} - ${SRCDIR}/testcp_sd.dmp | tee testcp_sd.res
echo "testcp_ln - large model to normal model single precision copy test..."
echo "begin testcp_ln" >> test.output
${PREFIX} ${SRCDIR}/testcp_ln >> test.output
echo "end testcp_ln" >> test.output
-${NCDUMP} -d5,5 testcp.exo | grep -v version | diff - ${SRCDIR}/testcp_ln.dmp | tee testcp_ln.res
+${NCDUMP} -d5,5 testcp.exo | grep -v version | ${DIFF} - ${SRCDIR}/testcp_ln.dmp | tee testcp_ln.res
echo "testcp_nl - normal_model to large_model single precision copy test..."
echo "begin testcp_nl" >> test.output
${PREFIX} ${SRCDIR}/testcp_nl >> test.output
echo "end testcp_nl" >> test.output
-${NCDUMP} -d5,5 testcp_nl.exo | grep -v version | diff - ${SRCDIR}/testcp_nl.dmp | tee testcp_nl.res
+${NCDUMP} -d5,5 testcp_nl.exo | grep -v version | ${DIFF} - ${SRCDIR}/testcp_nl.dmp | tee testcp_nl.res
echo "testwt_clb - single precision write test using concatenated puts..."
echo "begin testwt_clb" >> test.output
${PREFIX} ${SRCDIR}/testwt_clb >> test.output
echo "end testwt_clb" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test_clb.dmp | tee testwt_clb.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/test_clb.dmp | tee testwt_clb.res
echo "testwtd - double precision write test..."
echo "begin testwtd" >> test.output
${PREFIX} ${SRCDIR}/testwtd >> test.output
echo "end testwtd" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/testd.dmp | tee testwtd.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/testd.dmp | tee testwtd.res
echo "testrdd - double precision read test..."
echo "begin testrdd" >> test.output
-${PREFIX} ${SRCDIR}/testrdd | grep -v version | diff - ${SRCDIR}/testrdd.dmp | tee testrdd.res
+${PREFIX} ${SRCDIR}/testrdd | grep -v version | ${DIFF} - ${SRCDIR}/testrdd.dmp | tee testrdd.res
echo "end testrdd" >> test.output
echo "testcp_dd - double-to-double precision copy test..."
echo "begin testcp_dd" >> test.output
${PREFIX} ${SRCDIR}/testcpd >> test.output
echo "end testcp_dd" >> test.output
-${NCDUMP} -d5,5 testcpd.exo | grep -v version | diff - ${SRCDIR}/testcp_dd.dmp | tee testcp_dd.res
+${NCDUMP} -d5,5 testcpd.exo | grep -v version | ${DIFF} - ${SRCDIR}/testcp_dd.dmp | tee testcp_dd.res
echo "testcp_ds - double-to-single precision copy test..."
echo "begin testcp_ds" >> test.output
${PREFIX} ${SRCDIR}/testcp >> test.output
echo "end testcp_ds" >> test.output
-${NCDUMP} -d5,5 testcp.exo | grep -v version | diff - ${SRCDIR}/testcp_ds.dmp | tee testcp_ds.res
+${NCDUMP} -d5,5 testcp.exo | grep -v version | ${DIFF} - ${SRCDIR}/testcp_ds.dmp | tee testcp_ds.res
echo "testwt1 - single precision write files with several side sets..."
echo "testwt1 ... [Expect WEDGE6 warning from this test]"
echo "begin testwt1" >> test.output
${PREFIX} ${SRCDIR}/testwt1 >> test.output
echo "end testwt1" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test1.dmp | tee testwt1.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/test1.dmp | tee testwt1.res
echo "testrd1 - single precision read test of a file with several side sets..."
echo "testrd1 ... [Expect file create failure error, NOCLOBBER]"
echo "testrd1 ... [Expect failure locating elem var 1 for elem block 12]"
echo "begin testrd1" >> test.output
-${PREFIX} ${SRCDIR}/testrd1 | grep -v version | diff - ${SRCDIR}/testrd1.dmp | tee testrd1.res
+${PREFIX} ${SRCDIR}/testrd1 | grep -v version | ${DIFF} - ${SRCDIR}/testrd1.dmp | tee testrd1.res
echo "end testrd1" >> test.output
echo "testwt_ss - write files to test side sets..."
@@ -131,58 +127,58 @@ echo "testwt_ss ... [Expect WEDGE6 warning from this test]"
echo "begin testwt_ss" >> test.output
${PREFIX} ${SRCDIR}/testwt_ss >> test.output
echo "end testwt_ss" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/testwt_ss.dmp | tee testwt_ss.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/testwt_ss.dmp | tee testwt_ss.res
echo "testrd_ss - read test of a file with several side sets..."
echo "testrd_ss ... [Expect warning for NULL sidesets 30 and 31]"
echo "begin testrd_ss" >> test.output
-${PREFIX} ${SRCDIR}/testrd_ss | grep -v version | diff - ${SRCDIR}/testrd_ss.dmp | tee testrd_ss.res
+${PREFIX} ${SRCDIR}/testrd_ss | grep -v version | ${DIFF} - ${SRCDIR}/testrd_ss.dmp | tee testrd_ss.res
echo "end testrd_ss" >> test.output
echo "testwt2 - single precision write 2 files (simultaneously open) test..."
echo "begin testwt2" >> test.output
${PREFIX} ${SRCDIR}/testwt2 >> test.output
echo "end testwt2" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test2-1.dmp | tee testwt2-1.res
-${NCDUMP} -d5,5 test2.exo | grep -v version | diff - ${SRCDIR}/test2-2.dmp | tee testwt2-2.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/test2-1.dmp | tee testwt2-1.res
+${NCDUMP} -d5,5 test2.exo | grep -v version | ${DIFF} - ${SRCDIR}/test2-2.dmp | tee testwt2-2.res
echo "testrdwt - read from one and write to another (simutaneously open) file..."
echo "begin testrdwt" >> test.output
${PREFIX} ${SRCDIR}/testrdwt >> test.output
echo "end testrdwt" >> test.output
-${NCDUMP} -d5,5 test2.exo | grep -v version | diff - ${SRCDIR}/test2.dmp | tee testrdwt.res
+${NCDUMP} -d5,5 test2.exo | grep -v version | ${DIFF} - ${SRCDIR}/test2.dmp | tee testrdwt.res
echo "testwt_nc - write x y z components of coordinates separately..."
echo "begin testwt_nc" >> test.output
${PREFIX} ${SRCDIR}/testwt_nc >> test.output
echo "end testwt_nc" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test.dmp | tee testwt_nc.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/test.dmp | tee testwt_nc.res
echo "testrd_nc - read x y z components of coordinates separately..."
echo "begin testrd_nc" >> test.output
-${PREFIX} ${SRCDIR}/testrd_nc | grep -v version | diff - ${SRCDIR}/testrd_nc.dmp | tee testrd_nc.res
+${PREFIX} ${SRCDIR}/testrd_nc | grep -v version | ${DIFF} - ${SRCDIR}/testrd_nc.dmp | tee testrd_nc.res
echo "end testrd" >> test.output
echo "testwt-zeron - write file with zero nodes and elements..."
echo "begin testwt-zeron" >> test.output
${PREFIX} ${SRCDIR}/testwt-zeron >> test.output
echo "end testwt-zeron" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/testwt-zeron.dmp | tee testwt-zeron.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/testwt-zeron.dmp | tee testwt-zeron.res
echo "testrd - read test of file with zero nodes and elements..."
echo "begin testrd zero nodes" >> test.output
-${PREFIX} ${SRCDIR}/testrd | grep -v version | diff - ${SRCDIR}/testrd_zeron.dmp | tee testrd_zeron.res
+${PREFIX} ${SRCDIR}/testrd | grep -v version | ${DIFF} - ${SRCDIR}/testrd_zeron.dmp | tee testrd_zeron.res
echo "end testrd zero nodes" >> test.output
echo "testwt-zeroe - write file with zero elements..."
echo "begin testwt-zeroe" >> test.output
${PREFIX} ${SRCDIR}/testwt-zeroe >> test.output
echo "end testwt-zeroe" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/testwt-zeroe.dmp | tee testwt-zeroe.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/testwt-zeroe.dmp | tee testwt-zeroe.res
echo "testrd - read test of file with zero elements..."
echo "begin testrd zero elements" >> test.output
-${PREFIX} ${SRCDIR}/testrd | grep -v version | diff - ${SRCDIR}/testrd_zeroe.dmp | tee testrd_zeroe.res
+${PREFIX} ${SRCDIR}/testrd | grep -v version | ${DIFF} - ${SRCDIR}/testrd_zeroe.dmp | tee testrd_zeroe.res
echo "end testrd zero elements" >> test.output
echo "testwt-one-attrib - read/write test of element attributes - read one at a time..."
@@ -194,39 +190,44 @@ echo "testwt-nsided - write file with nsided elements..."
echo "begin testwt-nsided" >> test.output
${PREFIX} ${SRCDIR}/testwt-nsided >> test.output
echo "end testwt-nsided" >> test.output
-${NCDUMP} -d5,5 test-nsided.exo | grep -v version | diff - ${SRCDIR}/testwt-nsided.dmp | tee testwt-nsided.res
+${NCDUMP} -d5,5 test-nsided.exo | grep -v version | ${DIFF} - ${SRCDIR}/testwt-nsided.dmp | tee testwt-nsided.res
echo "testrd-nsided - read file with nsided elements..."
echo "begin testrd-nsided" >> test.output
-${PREFIX} ${SRCDIR}/testrd-nsided | grep -v version | diff - ${SRCDIR}/testrd-nsided.dmp | tee testrd-nsided.res
+${PREFIX} ${SRCDIR}/testrd-nsided | grep -v version | ${DIFF} - ${SRCDIR}/testrd-nsided.dmp | tee testrd-nsided.res
echo "end testrd-nsided" >> test.output
echo "testwt-nfaced - write file with nfaced elements..."
echo "begin testwt-nfaced" >> test.output
${PREFIX} ${SRCDIR}/testwt-nfaced >> test.output
echo "end testwt-nfaced" >> test.output
-${NCDUMP} -d5,5 test-nfaced.exo | grep -v version | diff - ${SRCDIR}/testwt-nfaced.dmp | tee testwt-nfaced.res
+${NCDUMP} -d5,5 test-nfaced.exo | grep -v version | ${DIFF} - ${SRCDIR}/testwt-nfaced.dmp | tee testwt-nfaced.res
echo "testrd-nfaced - read file with nfaced elements..."
echo "begin testrd-nfaced" >> test.output
-${PREFIX} ${SRCDIR}/testrd-nfaced | grep -v version | diff - ${SRCDIR}/testrd-nfaced.dmp | tee testrd-nfaced.res
+${PREFIX} ${SRCDIR}/testrd-nfaced | grep -v version | ${DIFF} - ${SRCDIR}/testrd-nfaced.dmp | tee testrd-nfaced.res
echo "end testrd-nfaced" >> test.output
echo "testwt-long-name - write file with long (64-character) names..."
echo "begin testwt-long-name" >> test.output
${PREFIX} ${SRCDIR}/testwt-long-name >> test.output
echo "end testwt-long-name" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/testwt-long-name.dmp | tee testwt-long-name.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/testwt-long-name.dmp | tee testwt-long-name.res
echo "testrd - read long name file truncating to 32 characters on read..."
echo "begin testrd (truncate)" >> test.output
-${PREFIX} ${SRCDIR}/testrd | grep -v version | diff - ${SRCDIR}/testrd-nm32.dmp | tee testrd-nm32.res
+${PREFIX} ${SRCDIR}/testrd | grep -v version | ${DIFF} - ${SRCDIR}/testrd-nm32.dmp | tee testrd-nm32.res
echo "end testrd (truncate)" >> test.output
echo "testrd-long-name - read long name file..."
echo "begin testrd-long-name" >> test.output
-${PREFIX} ${SRCDIR}/testrd-long-name | grep -v version | diff - ${SRCDIR}/testrd-long-name.dmp | tee testrd-long-name.res
+${PREFIX} ${SRCDIR}/testrd-long-name | grep -v version | ${DIFF} - ${SRCDIR}/testrd-long-name.dmp | tee testrd-long-name.res
echo "end testrd-long-name" >> test.output
+echo "test_nemesis - read long name file..."
+echo "begin test_nemesis" >> test.output
+${PREFIX} ${SRCDIR}/test_nemesis | grep -v version | ${DIFF} - ${SRCDIR}/test_nemesis.dmp | tee test_nemesis.res
+echo "end test_nemesis" >> test.output
+
echo "************************************************************************"
echo "************************************************************************"
diff --git a/exodus/cbind/test/testall.in1 b/exodus/cbind/test/testall.standalone
similarity index 69%
copy from exodus/cbind/test/testall.in1
copy to exodus/cbind/test/testall.standalone
index 7a65d4d..b4ba8a0 100644
--- a/exodus/cbind/test/testall.in1
+++ b/exodus/cbind/test/testall.standalone
@@ -36,10 +36,16 @@
# To run the tests with valgrind checking, uncomment the next line and comment the
# following line. Can also define other prefixes if wanted.
+if ($#argv == 0) then
+ set NCDUMP = `which ncdump`
+else
+ set NCDUMP = $1
+endif
+
#set PREFIX = "valgrind --tool=memcheck"
set PREFIX = ""
set SRCDIR = .
-set NCDUMP = @<BINDIR>@/ncdump
+set DIFF = "diff -w"
echo "************************************************************************"
echo "************************************************************************"
rm -f test.output
@@ -47,83 +53,78 @@ echo "testwt - single precision write test..."
echo "begin testwt" > test.output
${PREFIX} ${SRCDIR}/testwt >> test.output
echo "end testwt" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test.dmp | tee testwt.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/test.dmp | tee testwt.res
echo "testrd - single precision read test..."
echo "begin testrd" >> test.output
-${PREFIX} ${SRCDIR}/testrd | grep -v version | diff - ${SRCDIR}/testrd.dmp | tee testrd.res
+${PREFIX} ${SRCDIR}/testrd | grep -v version | ${DIFF} - ${SRCDIR}/testrd.dmp | tee testrd.res
echo "end testrd" >> test.output
-echo "testrdv - single precision read test with varid..."
-echo "begin testrdv" >> test.output
-${PREFIX} ${SRCDIR}/testrdv | grep -v version | diff - ${SRCDIR}/testrdv.dmp | tee testrdv.res
-echo "end testrdv" >> test.output
-
echo "testcp_ss - single-to-single precision copy test..."
echo "begin testcp_ss" >> test.output
${PREFIX} ${SRCDIR}/testcp >> test.output
echo "end testcp_ss" >> test.output
-${NCDUMP} -d5,5 testcp.exo | grep -v version | diff - ${SRCDIR}/testcp_ss.dmp | tee testcp_ss.res
+${NCDUMP} -d5,5 testcp.exo | grep -v version | ${DIFF} - ${SRCDIR}/testcp_ss.dmp | tee testcp_ss.res
echo "testcp_sd - single-to-double precision copy test..."
echo "begin testcp_sd" >> test.output
${PREFIX} ${SRCDIR}/testcpd >> test.output
echo "end testcp_sd" >> test.output
-${NCDUMP} -d5,5 testcpd.exo | grep -v version | diff - ${SRCDIR}/testcp_sd.dmp | tee testcp_sd.res
+${NCDUMP} -d5,5 testcpd.exo | grep -v version | ${DIFF} - ${SRCDIR}/testcp_sd.dmp | tee testcp_sd.res
echo "testcp_ln - large model to normal model single precision copy test..."
echo "begin testcp_ln" >> test.output
${PREFIX} ${SRCDIR}/testcp_ln >> test.output
echo "end testcp_ln" >> test.output
-${NCDUMP} -d5,5 testcp.exo | grep -v version | diff - ${SRCDIR}/testcp_ln.dmp | tee testcp_ln.res
+${NCDUMP} -d5,5 testcp.exo | grep -v version | ${DIFF} - ${SRCDIR}/testcp_ln.dmp | tee testcp_ln.res
echo "testcp_nl - normal_model to large_model single precision copy test..."
echo "begin testcp_nl" >> test.output
${PREFIX} ${SRCDIR}/testcp_nl >> test.output
echo "end testcp_nl" >> test.output
-${NCDUMP} -d5,5 testcp_nl.exo | grep -v version | diff - ${SRCDIR}/testcp_nl.dmp | tee testcp_nl.res
+${NCDUMP} -d5,5 testcp_nl.exo | grep -v version | ${DIFF} - ${SRCDIR}/testcp_nl.dmp | tee testcp_nl.res
echo "testwt_clb - single precision write test using concatenated puts..."
echo "begin testwt_clb" >> test.output
${PREFIX} ${SRCDIR}/testwt_clb >> test.output
echo "end testwt_clb" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test_clb.dmp | tee testwt_clb.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/test_clb.dmp | tee testwt_clb.res
echo "testwtd - double precision write test..."
echo "begin testwtd" >> test.output
${PREFIX} ${SRCDIR}/testwtd >> test.output
echo "end testwtd" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/testd.dmp | tee testwtd.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/testd.dmp | tee testwtd.res
echo "testrdd - double precision read test..."
echo "begin testrdd" >> test.output
-${PREFIX} ${SRCDIR}/testrdd | grep -v version | diff - ${SRCDIR}/testrdd.dmp | tee testrdd.res
+${PREFIX} ${SRCDIR}/testrdd | grep -v version | ${DIFF} - ${SRCDIR}/testrdd.dmp | tee testrdd.res
echo "end testrdd" >> test.output
echo "testcp_dd - double-to-double precision copy test..."
echo "begin testcp_dd" >> test.output
${PREFIX} ${SRCDIR}/testcpd >> test.output
echo "end testcp_dd" >> test.output
-${NCDUMP} -d5,5 testcpd.exo | grep -v version | diff - ${SRCDIR}/testcp_dd.dmp | tee testcp_dd.res
+${NCDUMP} -d5,5 testcpd.exo | grep -v version | ${DIFF} - ${SRCDIR}/testcp_dd.dmp | tee testcp_dd.res
echo "testcp_ds - double-to-single precision copy test..."
echo "begin testcp_ds" >> test.output
${PREFIX} ${SRCDIR}/testcp >> test.output
echo "end testcp_ds" >> test.output
-${NCDUMP} -d5,5 testcp.exo | grep -v version | diff - ${SRCDIR}/testcp_ds.dmp | tee testcp_ds.res
+${NCDUMP} -d5,5 testcp.exo | grep -v version | ${DIFF} - ${SRCDIR}/testcp_ds.dmp | tee testcp_ds.res
echo "testwt1 - single precision write files with several side sets..."
echo "testwt1 ... [Expect WEDGE6 warning from this test]"
echo "begin testwt1" >> test.output
${PREFIX} ${SRCDIR}/testwt1 >> test.output
echo "end testwt1" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test1.dmp | tee testwt1.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/test1.dmp | tee testwt1.res
echo "testrd1 - single precision read test of a file with several side sets..."
echo "testrd1 ... [Expect file create failure error, NOCLOBBER]"
echo "testrd1 ... [Expect failure locating elem var 1 for elem block 12]"
echo "begin testrd1" >> test.output
-${PREFIX} ${SRCDIR}/testrd1 | grep -v version | diff - ${SRCDIR}/testrd1.dmp | tee testrd1.res
+${PREFIX} ${SRCDIR}/testrd1 | grep -v version | ${DIFF} - ${SRCDIR}/testrd1.dmp | tee testrd1.res
echo "end testrd1" >> test.output
echo "testwt_ss - write files to test side sets..."
@@ -131,58 +132,58 @@ echo "testwt_ss ... [Expect WEDGE6 warning from this test]"
echo "begin testwt_ss" >> test.output
${PREFIX} ${SRCDIR}/testwt_ss >> test.output
echo "end testwt_ss" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/testwt_ss.dmp | tee testwt_ss.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/testwt_ss.dmp | tee testwt_ss.res
echo "testrd_ss - read test of a file with several side sets..."
echo "testrd_ss ... [Expect warning for NULL sidesets 30 and 31]"
echo "begin testrd_ss" >> test.output
-${PREFIX} ${SRCDIR}/testrd_ss | grep -v version | diff - ${SRCDIR}/testrd_ss.dmp | tee testrd_ss.res
+${PREFIX} ${SRCDIR}/testrd_ss | grep -v version | ${DIFF} - ${SRCDIR}/testrd_ss.dmp | tee testrd_ss.res
echo "end testrd_ss" >> test.output
echo "testwt2 - single precision write 2 files (simultaneously open) test..."
echo "begin testwt2" >> test.output
${PREFIX} ${SRCDIR}/testwt2 >> test.output
echo "end testwt2" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test2-1.dmp | tee testwt2-1.res
-${NCDUMP} -d5,5 test2.exo | grep -v version | diff - ${SRCDIR}/test2-2.dmp | tee testwt2-2.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/test2-1.dmp | tee testwt2-1.res
+${NCDUMP} -d5,5 test2.exo | grep -v version | ${DIFF} - ${SRCDIR}/test2-2.dmp | tee testwt2-2.res
echo "testrdwt - read from one and write to another (simutaneously open) file..."
echo "begin testrdwt" >> test.output
${PREFIX} ${SRCDIR}/testrdwt >> test.output
echo "end testrdwt" >> test.output
-${NCDUMP} -d5,5 test2.exo | grep -v version | diff - ${SRCDIR}/test2.dmp | tee testrdwt.res
+${NCDUMP} -d5,5 test2.exo | grep -v version | ${DIFF} - ${SRCDIR}/test2.dmp | tee testrdwt.res
echo "testwt_nc - write x y z components of coordinates separately..."
echo "begin testwt_nc" >> test.output
${PREFIX} ${SRCDIR}/testwt_nc >> test.output
echo "end testwt_nc" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test.dmp | tee testwt_nc.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/test.dmp | tee testwt_nc.res
echo "testrd_nc - read x y z components of coordinates separately..."
echo "begin testrd_nc" >> test.output
-${PREFIX} ${SRCDIR}/testrd_nc | grep -v version | diff - ${SRCDIR}/testrd_nc.dmp | tee testrd_nc.res
+${PREFIX} ${SRCDIR}/testrd_nc | grep -v version | ${DIFF} - ${SRCDIR}/testrd_nc.dmp | tee testrd_nc.res
echo "end testrd" >> test.output
echo "testwt-zeron - write file with zero nodes and elements..."
echo "begin testwt-zeron" >> test.output
${PREFIX} ${SRCDIR}/testwt-zeron >> test.output
echo "end testwt-zeron" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/testwt-zeron.dmp | tee testwt-zeron.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/testwt-zeron.dmp | tee testwt-zeron.res
echo "testrd - read test of file with zero nodes and elements..."
echo "begin testrd zero nodes" >> test.output
-${PREFIX} ${SRCDIR}/testrd | grep -v version | diff - ${SRCDIR}/testrd_zeron.dmp | tee testrd_zeron.res
+${PREFIX} ${SRCDIR}/testrd | grep -v version | ${DIFF} - ${SRCDIR}/testrd_zeron.dmp | tee testrd_zeron.res
echo "end testrd zero nodes" >> test.output
echo "testwt-zeroe - write file with zero elements..."
echo "begin testwt-zeroe" >> test.output
${PREFIX} ${SRCDIR}/testwt-zeroe >> test.output
echo "end testwt-zeroe" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/testwt-zeroe.dmp | tee testwt-zeroe.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/testwt-zeroe.dmp | tee testwt-zeroe.res
echo "testrd - read test of file with zero elements..."
echo "begin testrd zero elements" >> test.output
-${PREFIX} ${SRCDIR}/testrd | grep -v version | diff - ${SRCDIR}/testrd_zeroe.dmp | tee testrd_zeroe.res
+${PREFIX} ${SRCDIR}/testrd | grep -v version | ${DIFF} - ${SRCDIR}/testrd_zeroe.dmp | tee testrd_zeroe.res
echo "end testrd zero elements" >> test.output
echo "testwt-one-attrib - read/write test of element attributes - read one at a time..."
@@ -194,39 +195,44 @@ echo "testwt-nsided - write file with nsided elements..."
echo "begin testwt-nsided" >> test.output
${PREFIX} ${SRCDIR}/testwt-nsided >> test.output
echo "end testwt-nsided" >> test.output
-${NCDUMP} -d5,5 test-nsided.exo | grep -v version | diff - ${SRCDIR}/testwt-nsided.dmp | tee testwt-nsided.res
+${NCDUMP} -d5,5 test-nsided.exo | grep -v version | ${DIFF} - ${SRCDIR}/testwt-nsided.dmp | tee testwt-nsided.res
echo "testrd-nsided - read file with nsided elements..."
echo "begin testrd-nsided" >> test.output
-${PREFIX} ${SRCDIR}/testrd-nsided | grep -v version | diff - ${SRCDIR}/testrd-nsided.dmp | tee testrd-nsided.res
+${PREFIX} ${SRCDIR}/testrd-nsided | grep -v version | ${DIFF} - ${SRCDIR}/testrd-nsided.dmp | tee testrd-nsided.res
echo "end testrd-nsided" >> test.output
echo "testwt-nfaced - write file with nfaced elements..."
echo "begin testwt-nfaced" >> test.output
${PREFIX} ${SRCDIR}/testwt-nfaced >> test.output
echo "end testwt-nfaced" >> test.output
-${NCDUMP} -d5,5 test-nfaced.exo | grep -v version | diff - ${SRCDIR}/testwt-nfaced.dmp | tee testwt-nfaced.res
+${NCDUMP} -d5,5 test-nfaced.exo | grep -v version | ${DIFF} - ${SRCDIR}/testwt-nfaced.dmp | tee testwt-nfaced.res
echo "testrd-nfaced - read file with nfaced elements..."
echo "begin testrd-nfaced" >> test.output
-${PREFIX} ${SRCDIR}/testrd-nfaced | grep -v version | diff - ${SRCDIR}/testrd-nfaced.dmp | tee testrd-nfaced.res
+${PREFIX} ${SRCDIR}/testrd-nfaced | grep -v version | ${DIFF} - ${SRCDIR}/testrd-nfaced.dmp | tee testrd-nfaced.res
echo "end testrd-nfaced" >> test.output
echo "testwt-long-name - write file with long (64-character) names..."
echo "begin testwt-long-name" >> test.output
${PREFIX} ${SRCDIR}/testwt-long-name >> test.output
echo "end testwt-long-name" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/testwt-long-name.dmp | tee testwt-long-name.res
+${NCDUMP} -d5,5 test.exo | grep -v version | ${DIFF} - ${SRCDIR}/testwt-long-name.dmp | tee testwt-long-name.res
echo "testrd - read long name file truncating to 32 characters on read..."
echo "begin testrd (truncate)" >> test.output
-${PREFIX} ${SRCDIR}/testrd | grep -v version | diff - ${SRCDIR}/testrd-nm32.dmp | tee testrd-nm32.res
+${PREFIX} ${SRCDIR}/testrd | grep -v version | ${DIFF} - ${SRCDIR}/testrd-nm32.dmp | tee testrd-nm32.res
echo "end testrd (truncate)" >> test.output
echo "testrd-long-name - read long name file..."
echo "begin testrd-long-name" >> test.output
-${PREFIX} ${SRCDIR}/testrd-long-name | grep -v version | diff - ${SRCDIR}/testrd-long-name.dmp | tee testrd-long-name.res
+${PREFIX} ${SRCDIR}/testrd-long-name | grep -v version | ${DIFF} - ${SRCDIR}/testrd-long-name.dmp | tee testrd-long-name.res
echo "end testrd-long-name" >> test.output
+echo "test_nemesis - read long name file..."
+echo "begin test_nemesis" >> test.output
+${PREFIX} ${SRCDIR}/test_nemesis | grep -v version | ${DIFF} - ${SRCDIR}/test_nemesis.dmp | tee test_nemesis.res
+echo "end test_nemesis" >> test.output
+
echo "************************************************************************"
echo "************************************************************************"
diff --git a/exodus/cbind/test/testcp_dd.dmp b/exodus/cbind/test/testcp_dd.dmp
index 6131dc2..ff7c1cf 100644
--- a/exodus/cbind/test/testcp_dd.dmp
+++ b/exodus/cbind/test/testcp_dd.dmp
@@ -108,6 +108,7 @@ variables:
// global attributes:
:floating_point_word_size = 8 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
@@ -207,11 +208,11 @@ data:
eb_prop3 = _, _, _, _, _ ;
- node_ns1 = 100, 101, 102, 103, 104 ;
+ node_ns1 = 10, 11, 12, 13, 14 ;
dist_fact_ns1 = 1, 2, 3, 4, 5 ;
- node_ns2 = 200, 201, 202 ;
+ node_ns2 = 20, 21, 22 ;
dist_fact_ns2 = 1.1, 2.1, 3.1 ;
diff --git a/exodus/cbind/test/testcp_ds.dmp b/exodus/cbind/test/testcp_ds.dmp
index 057c952..2ac3a2f 100644
--- a/exodus/cbind/test/testcp_ds.dmp
+++ b/exodus/cbind/test/testcp_ds.dmp
@@ -108,6 +108,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
@@ -207,11 +208,11 @@ data:
eb_prop3 = _, _, _, _, _ ;
- node_ns1 = 100, 101, 102, 103, 104 ;
+ node_ns1 = 10, 11, 12, 13, 14 ;
dist_fact_ns1 = 1, 2, 3, 4, 5 ;
- node_ns2 = 200, 201, 202 ;
+ node_ns2 = 20, 21, 22 ;
dist_fact_ns2 = 1.1, 2.1, 3.1 ;
diff --git a/exodus/cbind/test/testcp_ln.dmp b/exodus/cbind/test/testcp_ln.dmp
index 460f12f..e85aa0c 100644
--- a/exodus/cbind/test/testcp_ln.dmp
+++ b/exodus/cbind/test/testcp_ln.dmp
@@ -126,6 +126,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 0 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
@@ -283,11 +284,11 @@ data:
eb_prop3 = _, _, _, _, _, _, _ ;
- node_ns1 = 100, 101, 102, 103, 104 ;
+ node_ns1 = 10, 11, 12, 13, 14 ;
dist_fact_ns1 = 1, 2, 3, 4, 5 ;
- node_ns2 = 200, 201, 202 ;
+ node_ns2 = 20, 21, 22 ;
dist_fact_ns2 = 1.1, 2.1, 3.1 ;
diff --git a/exodus/cbind/test/testcp_nl.dmp b/exodus/cbind/test/testcp_nl.dmp
index 52698ff..1f4983c 100644
--- a/exodus/cbind/test/testcp_nl.dmp
+++ b/exodus/cbind/test/testcp_nl.dmp
@@ -128,6 +128,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
@@ -286,11 +287,11 @@ data:
eb_prop3 = _, _, _, _, _, _, _ ;
- node_ns1 = 100, 101, 102, 103, 104 ;
+ node_ns1 = 10, 11, 12, 13, 14 ;
dist_fact_ns1 = 1, 2, 3, 4, 5 ;
- node_ns2 = 200, 201, 202 ;
+ node_ns2 = 20, 21, 22 ;
dist_fact_ns2 = 1.1, 2.1, 3.1 ;
diff --git a/exodus/cbind/test/testcp_sd.dmp b/exodus/cbind/test/testcp_sd.dmp
index b771a6e..852c97b 100644
--- a/exodus/cbind/test/testcp_sd.dmp
+++ b/exodus/cbind/test/testcp_sd.dmp
@@ -128,6 +128,7 @@ variables:
// global attributes:
:floating_point_word_size = 8 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
@@ -286,11 +287,11 @@ data:
eb_prop3 = _, _, _, _, _, _, _ ;
- node_ns1 = 100, 101, 102, 103, 104 ;
+ node_ns1 = 10, 11, 12, 13, 14 ;
dist_fact_ns1 = 1, 2, 3, 4, 5 ;
- node_ns2 = 200, 201, 202 ;
+ node_ns2 = 20, 21, 22 ;
dist_fact_ns2 = 1.1, 2.1, 3.1 ;
diff --git a/exodus/cbind/test/testcp_ss.dmp b/exodus/cbind/test/testcp_ss.dmp
index 096ecd3..fe3289e 100644
--- a/exodus/cbind/test/testcp_ss.dmp
+++ b/exodus/cbind/test/testcp_ss.dmp
@@ -128,6 +128,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
@@ -286,11 +287,11 @@ data:
eb_prop3 = _, _, _, _, _, _, _ ;
- node_ns1 = 100, 101, 102, 103, 104 ;
+ node_ns1 = 10, 11, 12, 13, 14 ;
dist_fact_ns1 = 1, 2, 3, 4, 5 ;
- node_ns2 = 200, 201, 202 ;
+ node_ns2 = 20, 21, 22 ;
dist_fact_ns2 = 1.1, 2.1, 3.1 ;
diff --git a/exodus/cbind/test/testd.dmp b/exodus/cbind/test/testd.dmp
index 669e945..893292f 100644
--- a/exodus/cbind/test/testd.dmp
+++ b/exodus/cbind/test/testd.dmp
@@ -137,6 +137,7 @@ variables:
// global attributes:
:floating_point_word_size = 8 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
@@ -238,11 +239,11 @@ data:
eb_prop3 = _, _, _, _, _ ;
- node_ns1 = 100, 101, 102, 103, 104 ;
+ node_ns1 = 10, 11, 12, 13, 14 ;
dist_fact_ns1 = 1, 2, 3, 4, 5 ;
- node_ns2 = 200, 201, 202 ;
+ node_ns2 = 20, 21, 22 ;
dist_fact_ns2 = 1.1, 2.1, 3.1 ;
diff --git a/exodus/cbind/test/testrd-long-name.c b/exodus/cbind/test/testrd-long-name.c
index 7867d4a..4114b5d 100644
--- a/exodus/cbind/test/testrd-long-name.c
+++ b/exodus/cbind/test/testrd-long-name.c
@@ -99,11 +99,11 @@ int main (int argc, char **argv)
char *coord_names[3], *qa_record[2][4], *info[3], *var_names[3];
char *block_names[10], *nset_names[10], *sset_names[10];
char *attrib_names[10];
- char name[MAX_STR_LENGTH+1];
char title[MAX_LINE_LENGTH+1], elem_type[MAX_STR_LENGTH+1];
char title_chk[MAX_LINE_LENGTH+1];
char *cdum = 0;
char *prop_names[3];
+ char *name = NULL;
CPU_word_size = 0; /* sizeof(float) */
IO_word_size = 0; /* use what is stored in file */
@@ -137,12 +137,14 @@ int main (int argc, char **argv)
int max_all_name_length = ex_inquire_int(exoid, EX_INQ_DB_MAX_ALLOWED_NAME_LENGTH);
int max_use_name_length = ex_inquire_int(exoid, EX_INQ_DB_MAX_USED_NAME_LENGTH);
printf ("This file can use at most %d-character names\n", max_all_name_length);
- printf ("This maximum name length used is %d-character names\n", max_use_name_length);
+ printf ("The maximum name length used is %d-character names\n", max_use_name_length);
max_name_length = max_use_name_length;
ex_set_max_name_length(exoid, max_name_length);
}
+ name = (char*) calloc((max_name_length+1), sizeof(char));
+
/* read database parameters */
error = ex_get_init (exoid, title, &num_dim, &num_nodes, &num_elem,
&num_elem_blk, &num_node_sets, &num_side_sets);
@@ -160,6 +162,7 @@ int main (int argc, char **argv)
/* Check that ex_inquire gives same title */
error = ex_inquire (exoid, EX_INQ_TITLE, &idum, &fdum, title_chk);
+ printf ("after ex_inquire, error = %3d\n", error);
if (strcmp(title, title_chk) != 0) {
printf ("error in ex_inquire for EX_INQ_TITLE\n");
}
@@ -231,6 +234,7 @@ int main (int argc, char **argv)
{
int num_attrs = 0;
error = ex_get_attr_param(exoid, EX_NODAL, 0, &num_attrs);
+ printf (" after ex_get_attr_param, error = %d\n", error);
printf ("num nodal attributes = %d\n", num_attrs);
if (num_attrs > 0) {
for (j=0; j<num_attrs; j++) {
@@ -244,6 +248,7 @@ int main (int argc, char **argv)
for (j=0; j<num_attrs; j++) {
printf ("nodal attribute %d = '%s'\n", j, attrib_names[j]);
error = ex_get_one_attr(exoid, EX_NODAL, 0, j+1, attrib);
+ printf (" after ex_get_one_attr, error = %d\n", error);
for (i=0; i < num_nodes; i++) {
printf ("%5.1f\n", attrib[i]);
}
@@ -286,26 +291,25 @@ int main (int argc, char **argv)
error = ex_get_names(exoid, EX_ELEM_BLOCK, block_names);
printf ("\nafter ex_get_names, error = %3d\n", error);
- for (i=0; i<num_elem_blk; i++)
- {
- ex_get_name(exoid, EX_ELEM_BLOCK, ids[i], name);
- if (strcmp(name, block_names[i]) != 0) {
- printf ("error in ex_get_name for block id %d\n", ids[i]);
- }
- error = ex_get_elem_block (exoid, ids[i], elem_type,
- &(num_elem_in_block[i]),
- &(num_nodes_per_elem[i]), &(num_attr[i]));
- printf ("\nafter ex_get_elem_block, error = %d\n", error);
-
- printf ("element block id = %2d\n",ids[i]);
- printf ("element type = '%s'\n", elem_type);
- printf ("num_elem_in_block = %2d\n",num_elem_in_block[i]);
- printf ("num_nodes_per_elem = %2d\n",num_nodes_per_elem[i]);
- printf ("num_attr = %2d\n",num_attr[i]);
- printf ("name = '%s'\n",block_names[i]);
- free(block_names[i]);
+ for (i=0; i<num_elem_blk; i++) {
+ ex_get_name(exoid, EX_ELEM_BLOCK, ids[i], name);
+ if (strcmp(name, block_names[i]) != 0) {
+ printf ("error in ex_get_name for block id %d\n", ids[i]);
}
-
+ error = ex_get_elem_block (exoid, ids[i], elem_type,
+ &(num_elem_in_block[i]),
+ &(num_nodes_per_elem[i]), &(num_attr[i]));
+ printf ("\nafter ex_get_elem_block, error = %d\n", error);
+
+ printf ("element block id = %2d\n",ids[i]);
+ printf ("element type = '%s'\n", elem_type);
+ printf ("num_elem_in_block = %2d\n",num_elem_in_block[i]);
+ printf ("num_nodes_per_elem = %2d\n",num_nodes_per_elem[i]);
+ printf ("num_attr = %2d\n",num_attr[i]);
+ printf ("name = '%s'\n",block_names[i]);
+ free(block_names[i]);
+ }
+
/* read element block properties */
error = ex_inquire (exoid, EX_INQ_EB_PROP, &num_props, &fdum, cdum);
printf ("\nafter ex_inquire, error = %d\n", error);
@@ -468,6 +472,7 @@ int main (int argc, char **argv)
{
int num_attrs = 0;
error = ex_get_attr_param(exoid, EX_NODE_SET, ids[i], &num_attrs);
+ printf (" after ex_get_attr_param, error = %d\n", error);
printf ("num nodeset attributes for nodeset %d = %d\n", ids[i], num_attrs);
if (num_attrs > 0) {
for (j=0; j<num_attrs; j++) {
@@ -481,6 +486,7 @@ int main (int argc, char **argv)
for (j=0; j<num_attrs; j++) {
printf ("nodeset attribute %d = '%s'\n", j, attrib_names[j]);
error = ex_get_one_attr(exoid, EX_NODE_SET, ids[i], j+1, attrib);
+ printf (" after ex_get_one_attr, error = %d\n", error);
for (k=0; k < num_nodes_in_set; k++) {
printf ("%5.1f\n", attrib[k]);
}
@@ -849,7 +855,7 @@ int main (int argc, char **argv)
/* read nodal variables parameters and names */
num_nod_vars = 0;
if (num_nodes > 0) {
- error = ex_get_var_param (exoid, "n", &num_nod_vars);
+ error = ex_get_variable_param (exoid, EX_NODAL, &num_nod_vars);
printf ("\nafter ex_get_var_param, error = %3d\n", error);
for (i=0; i<num_nod_vars; i++)
@@ -857,7 +863,7 @@ int main (int argc, char **argv)
var_names[i] = (char *) calloc ((max_name_length+1), sizeof(char));
}
- error = ex_get_var_names (exoid, "n", num_nod_vars, var_names);
+ error = ex_get_variable_names (exoid, EX_NODAL, num_nod_vars, var_names);
printf ("\nafter ex_get_var_names, error = %3d\n", error);
printf ("There are %2d nodal variables; their names are :\n", num_nod_vars);
@@ -1193,10 +1199,9 @@ int main (int argc, char **argv)
}
free(ids);
}
+ free(name);
if (num_node_sets > 0)
free (num_nodes_per_set);
-
error = ex_close (exoid);
printf ("\nafter ex_close, error = %3d\n", error);
- return 0;
}
diff --git a/exodus/cbind/test/testrd-long-name.dmp b/exodus/cbind/test/testrd-long-name.dmp
index 38b0b40..6187d2a 100644
--- a/exodus/cbind/test/testrd-long-name.dmp
+++ b/exodus/cbind/test/testrd-long-name.dmp
@@ -2,7 +2,7 @@
after ex_open
I/O word size 4
This file can use at most 127-character names
-This maximum name length used is 64-character names
+The maximum name length used is 64-character names
after ex_get_init, error = 0
database parameters:
title = 'This is a test'
@@ -12,6 +12,7 @@ num_elem = 7
num_elem_blk = 7
num_node_sets = 2
num_side_sets = 5
+after ex_inquire, error = 0
after ex_get_coord, error = 0
x coords =
@@ -121,9 +122,11 @@ after ex_get_coord_names, error = 0
x coord name = 'X coordinate name that is padded to be longer than 32 characters'
y coord name = 'Y coordinate name that is padded to be longer than 32 characters'
z coord name = 'Z coordinate name that is padded to be longer than 32 characters'
+ after ex_get_attr_param, error = 0
num nodal attributes = 2
after ex_get_attr_names, error = 0
nodal attribute 0 = 'Node_attr_1'
+ after ex_get_one_attr, error = 0
0.0
1.0
1.0
@@ -158,6 +161,7 @@ nodal attribute 0 = 'Node_attr_1'
10.0
10.0
nodal attribute 1 = 'Node_attr_2'
+ after ex_get_one_attr, error = 0
0.0
0.0
1.0
@@ -381,20 +385,22 @@ after ex_get_node_set, error = 0
after ex_get_node_set_dist_fact, error = 0
node list for node set 20
-100
-101
-102
-103
-104
+ 10
+ 11
+ 12
+ 13
+ 14
dist factors for node set 20
1.00
2.00
3.00
4.00
5.00
+ after ex_get_attr_param, error = 0
num nodeset attributes for nodeset 20 = 1
after ex_get_attr_names, error = 0
nodeset attribute 0 = 'Nodeset_attribute'
+ after ex_get_one_attr, error = 0
0.0
1.0
1.0
@@ -412,13 +418,14 @@ after ex_get_node_set, error = 0
after ex_get_node_set_dist_fact, error = 0
node list for node set 21
-200
-201
-202
+ 20
+ 21
+ 22
dist factors for node set 21
1.10
2.10
3.10
+ after ex_get_attr_param, error = 0
num nodeset attributes for nodeset 21 = 0
after ex_inquire, error = 0
@@ -451,14 +458,14 @@ node_ind =
0
5
node_list =
-100
-101
-102
-103
-104
-200
-201
-202
+ 10
+ 11
+ 12
+ 13
+ 14
+ 20
+ 21
+ 22
dist_fact =
1.000
2.000
diff --git a/exodus/cbind/test/testrd-nfaced.c b/exodus/cbind/test/testrd-nfaced.c
index 0fc5b87..b81ac21 100644
--- a/exodus/cbind/test/testrd-nfaced.c
+++ b/exodus/cbind/test/testrd-nfaced.c
@@ -43,11 +43,12 @@
#include <string.h>
#include "netcdf.h"
#include <assert.h>
+#include <inttypes.h>
#include "exodusII.h"
int main (int argc, char **argv)
{
- int exoid, num_dim, num_nodes, num_elem, num_elem_blk;
+ int exoid, num_dim, num_nodes, num_elem_blk;
int *num_elem_in_block, *num_face_in_block, *num_nodes_per_elem, *num_edges_per_elem, *num_faces_per_elem, *num_attr;
int error, nnodes;
int i, j, k;
@@ -97,18 +98,17 @@ int main (int argc, char **argv)
printf ("database parameters:\n");
printf ("title = '%s'\n",par.title);
- printf ("num_dim = %3d\n",par.num_dim);
- printf ("num_nodes = %3d\n",par.num_nodes);
- printf ("num_edge = %3d\n",par.num_edge);
- printf ("num_face = %3d\n",par.num_face);
- printf ("num_elem = %3d\n",par.num_elem);
- printf ("num_elem_blk = %3d\n",par.num_elem_blk);
- printf ("num_node_sets = %3d\n",par.num_node_sets);
- printf ("num_side_sets = %3d\n",par.num_side_sets);
+ printf ("num_dim = %"PRId64"\n",par.num_dim);
+ printf ("num_nodes = %"PRId64"\n",par.num_nodes);
+ printf ("num_edge = %"PRId64"\n",par.num_edge);
+ printf ("num_face = %"PRId64"\n",par.num_face);
+ printf ("num_elem = %"PRId64"\n",par.num_elem);
+ printf ("num_elem_blk = %"PRId64"\n",par.num_elem_blk);
+ printf ("num_node_sets = %"PRId64"\n",par.num_node_sets);
+ printf ("num_side_sets = %"PRId64"\n",par.num_side_sets);
num_dim = par.num_dim;
num_nodes = par.num_nodes;
- num_elem = par.num_elem;
num_elem_blk = par.num_elem_blk;
}
diff --git a/exodus/cbind/test/testrd-nfaced.dmp b/exodus/cbind/test/testrd-nfaced.dmp
index 74b691d..933936b 100644
--- a/exodus/cbind/test/testrd-nfaced.dmp
+++ b/exodus/cbind/test/testrd-nfaced.dmp
@@ -4,14 +4,14 @@ after ex_open
after ex_get_init, error = 0
database parameters:
title = 'This is a test'
-num_dim = 3
-num_nodes = 14
-num_edge = 0
-num_face = 15
-num_elem = 3
-num_elem_blk = 1
-num_node_sets = 0
-num_side_sets = 0
+num_dim = 3
+num_nodes = 14
+num_edge = 0
+num_face = 15
+num_elem = 3
+num_elem_blk = 1
+num_node_sets = 0
+num_side_sets = 0
after ex_get_coord, error = 0
x, y, z coords =
diff --git a/exodus/cbind/test/testrd-nm32.dmp b/exodus/cbind/test/testrd-nm32.dmp
index 5fd70ce..356c32d 100644
--- a/exodus/cbind/test/testrd-nm32.dmp
+++ b/exodus/cbind/test/testrd-nm32.dmp
@@ -10,6 +10,7 @@ num_elem = 7
num_elem_blk = 7
num_node_sets = 2
num_side_sets = 5
+ after ex_inquire, error = 0
after ex_get_coord, error = 0
x coords =
@@ -119,9 +120,11 @@ after ex_get_coord_names, error = 0
x coord name = 'X coordinate name that is padded'
y coord name = 'Y coordinate name that is padded'
z coord name = 'Z coordinate name that is padded'
+ after ex_get_attr_param, error = 0
num nodal attributes = 2
after ex_get_attr_names, error = 0
nodal attribute 0 = 'Node_attr_1'
+ after ex_get_one_attr, error = 0
0.0
1.0
1.0
@@ -156,6 +159,7 @@ nodal attribute 0 = 'Node_attr_1'
10.0
10.0
nodal attribute 1 = 'Node_attr_2'
+ after ex_get_one_attr, error = 0
0.0
0.0
1.0
@@ -379,20 +383,22 @@ after ex_get_node_set, error = 0
after ex_get_node_set_dist_fact, error = 0
node list for node set 20
-100
-101
-102
-103
-104
+ 10
+ 11
+ 12
+ 13
+ 14
dist factors for node set 20
1.00
2.00
3.00
4.00
5.00
+ after ex_get_attr_param, error = 0
num nodeset attributes for nodeset 20 = 1
after ex_get_attr_names, error = 0
nodeset attribute 0 = 'Nodeset_attribute'
+ after ex_get_one_attr, error = 0
0.0
1.0
1.0
@@ -410,13 +416,14 @@ after ex_get_node_set, error = 0
after ex_get_node_set_dist_fact, error = 0
node list for node set 21
-200
-201
-202
+ 20
+ 21
+ 22
dist factors for node set 21
1.10
2.10
3.10
+ after ex_get_attr_param, error = 0
num nodeset attributes for nodeset 21 = 0
after ex_inquire, error = 0
@@ -449,14 +456,14 @@ node_ind =
0
5
node_list =
-100
-101
-102
-103
-104
-200
-201
-202
+ 10
+ 11
+ 12
+ 13
+ 14
+ 20
+ 21
+ 22
dist_fact =
1.000
2.000
diff --git a/exodus/cbind/test/testrd-nsided.c b/exodus/cbind/test/testrd-nsided.c
index 47f05fc..820f62c 100644
--- a/exodus/cbind/test/testrd-nsided.c
+++ b/exodus/cbind/test/testrd-nsided.c
@@ -187,6 +187,7 @@ int main (int argc, char **argv)
{
int num_attrs = 0;
error = ex_get_attr_param(exoid, EX_NODAL, 0, &num_attrs);
+ printf (" after ex_get_attr_param, error = %d\n", error);
printf ("num nodal attributes = %d\n", num_attrs);
if (num_attrs > 0) {
for (j=0; j<num_attrs; j++) {
@@ -200,6 +201,7 @@ int main (int argc, char **argv)
for (j=0; j<num_attrs; j++) {
printf ("nodal attribute %d = '%s'\n", j, attrib_names[j]);
error = ex_get_one_attr(exoid, EX_NODAL, 0, j+1, attrib);
+ printf (" after ex_get_one_attr, error = %d\n", error);
for (i=0; i < num_nodes; i++) {
printf ("%5.1f\n", attrib[i]);
}
@@ -279,6 +281,7 @@ int main (int argc, char **argv)
for (j=0; j<num_elem_blk; j++) {
error = ex_get_prop(exoid, EX_ELEM_BLOCK, ids[j], prop_names[i],
&prop_value);
+ printf (" after ex_get_prop, error = %d\n", error);
if (error == 0)
printf ("element block %2d, property(%2d): '%s'= %5d\n",
j+1, i+1, prop_names[i], prop_value);
@@ -320,6 +323,7 @@ int main (int argc, char **argv)
printf("\n");
nnodes += nnpe[j];
}
+ free(nnpe);
} else {
connect = (int *) calloc((num_nodes_per_elem[i] * num_elem_in_block[i]),
sizeof(int));
@@ -337,28 +341,26 @@ int main (int argc, char **argv)
}
/* read element block attributes */
- if (num_attr[i] > 0) {
- for (i=0; i<num_elem_blk; i++) {
- if (num_elem_in_block[i] > 0) {
- for (j=0; j<num_attr[i]; j++)
- attrib_names[j] = (char *) calloc ((MAX_STR_LENGTH+1), sizeof(char));
-
- attrib = (float *) calloc(num_attr[i]*num_elem_in_block[i],sizeof(float));
- error = ex_get_elem_attr (exoid, ids[i], attrib);
- printf ("\n after ex_get_elem_attr, error = %d\n", error);
+ for (i=0; i<num_elem_blk; i++) {
+ if (num_attr[i] > 0) {
+ for (j=0; j<num_attr[i]; j++)
+ attrib_names[j] = (char *) calloc ((MAX_STR_LENGTH+1), sizeof(char));
+
+ attrib = (float *) calloc(num_attr[i]*num_elem_in_block[i],sizeof(float));
+ error = ex_get_elem_attr (exoid, ids[i], attrib);
+ printf ("\n after ex_get_elem_attr, error = %d\n", error);
+
+ if (error == 0) {
+ error = ex_get_elem_attr_names (exoid, ids[i], attrib_names);
+ printf (" after ex_get_elem_attr_names, error = %d\n", error);
if (error == 0) {
- error = ex_get_elem_attr_names (exoid, ids[i], attrib_names);
- printf (" after ex_get_elem_attr_names, error = %d\n", error);
-
- if (error == 0) {
- printf ("element block %d attribute '%s' = %6.4f\n", ids[i], attrib_names[0], *attrib);
- }
+ printf ("element block %d attribute '%s' = %6.4f\n", ids[i], attrib_names[0], *attrib);
}
- free (attrib);
- for (j=0; j<num_attr[i]; j++)
- free (attrib_names[j]);
}
+ free (attrib);
+ for (j=0; j<num_attr[i]; j++)
+ free (attrib_names[j]);
}
}
@@ -434,6 +436,7 @@ int main (int argc, char **argv)
{
int num_attrs = 0;
error = ex_get_attr_param(exoid, EX_NODE_SET, ids[i], &num_attrs);
+ printf (" after ex_get_attr_param, error = %d\n", error);
printf ("num nodeset attributes for nodeset %d = %d\n", ids[i], num_attrs);
if (num_attrs > 0) {
for (j=0; j<num_attrs; j++) {
@@ -447,6 +450,7 @@ int main (int argc, char **argv)
for (j=0; j<num_attrs; j++) {
printf ("nodeset attribute %d = '%s'\n", j, attrib_names[j]);
error = ex_get_one_attr(exoid, EX_NODE_SET, ids[i], j+1, attrib);
+ printf (" after ex_get_one_attr, error = %d\n", error);
for (k=0; k < num_nodes_in_set; k++) {
printf ("%5.1f\n", attrib[k]);
}
@@ -1139,6 +1143,10 @@ int main (int argc, char **argv)
if (num_node_sets > 0)
free (num_nodes_per_set);
+ for (i=0; i<num_elem_blk; i++) {
+ free(elem_type[i]);
+ }
+
error = ex_close (exoid);
printf ("\nafter ex_close, error = %3d\n", error);
return 0;
diff --git a/exodus/cbind/test/testrd-nsided.dmp b/exodus/cbind/test/testrd-nsided.dmp
index ab42f39..61a2004 100644
--- a/exodus/cbind/test/testrd-nsided.dmp
+++ b/exodus/cbind/test/testrd-nsided.dmp
@@ -118,9 +118,11 @@ z coords =
after ex_get_coord_names, error = 0
x coord name = 'xcoor'
y coord name = 'ycoor'
+ after ex_get_attr_param, error = 0
num nodal attributes = 2
after ex_get_attr_names, error = 0
nodal attribute 0 = 'Node_attr_1'
+ after ex_get_one_attr, error = 0
0.0
1.0
1.0
@@ -155,6 +157,7 @@ nodal attribute 0 = 'Node_attr_1'
10.0
10.0
nodal attribute 1 = 'Node_attr_2'
+ after ex_get_one_attr, error = 0
0.0
0.0
1.0
@@ -242,20 +245,22 @@ after ex_get_node_set, error = 0
after ex_get_node_set_dist_fact, error = 0
node list for node set 20
-100
-101
-102
-103
-104
+ 10
+ 11
+ 12
+ 13
+ 14
dist factors for node set 20
1.00
2.00
3.00
4.00
5.00
+ after ex_get_attr_param, error = 0
num nodeset attributes for nodeset 20 = 1
after ex_get_attr_names, error = 0
nodeset attribute 0 = 'Nodeset_attribute'
+ after ex_get_one_attr, error = 0
0.0
1.0
1.0
@@ -273,13 +278,14 @@ after ex_get_node_set, error = 0
after ex_get_node_set_dist_fact, error = 0
node list for node set 21
-200
-201
-202
+ 20
+ 21
+ 22
dist factors for node set 21
1.10
2.10
3.10
+ after ex_get_attr_param, error = 0
num nodeset attributes for nodeset 21 = 0
after ex_inquire, error = 0
@@ -312,14 +318,14 @@ node_ind =
0
5
node_list =
-100
-101
-102
-103
-104
-200
-201
-202
+ 10
+ 11
+ 12
+ 13
+ 14
+ 20
+ 21
+ 22
dist_fact =
1.000
2.000
diff --git a/exodus/cbind/test/testrd.c b/exodus/cbind/test/testrd.c
index eb74e87..70be670 100644
--- a/exodus/cbind/test/testrd.c
+++ b/exodus/cbind/test/testrd.c
@@ -149,6 +149,7 @@ int main (int argc, char **argv)
/* Check that ex_inquire gives same title */
error = ex_inquire (exoid, EX_INQ_TITLE, &idum, &fdum, title_chk);
+ printf (" after ex_inquire, error = %d\n", error);
if (strcmp(title, title_chk) != 0) {
printf ("error in ex_inquire for EX_INQ_TITLE\n");
}
@@ -156,7 +157,11 @@ int main (int argc, char **argv)
/* read nodal coordinates values and names from database */
x = (float *) calloc(num_nodes, sizeof(float));
- y = (float *) calloc(num_nodes, sizeof(float));
+ if (num_dim >= 2)
+ y = (float *) calloc(num_nodes, sizeof(float));
+ else
+ y = 0;
+
if (num_dim >= 3)
z = (float *) calloc(num_nodes, sizeof(float));
else
@@ -171,12 +176,13 @@ int main (int argc, char **argv)
printf ("%5.1f\n", x[i]);
}
- printf ("y coords = \n");
- for (i=0; i<num_nodes; i++)
- {
- printf ("%5.1f\n", y[i]);
- }
-
+ if (num_dim >= 2) {
+ printf ("y coords = \n");
+ for (i=0; i<num_nodes; i++)
+ {
+ printf ("%5.1f\n", y[i]);
+ }
+ }
if (num_dim >= 3)
{
printf ("z coords = \n");
@@ -197,7 +203,8 @@ int main (int argc, char **argv)
printf ("%f \n", y[0]);
*/
free (x);
- free (y);
+ if (num_dim >= 2)
+ free (y);
if (num_dim >= 3)
free (z);
@@ -210,7 +217,8 @@ int main (int argc, char **argv)
error = ex_get_coord_names (exoid, coord_names);
printf ("\nafter ex_get_coord_names, error = %3d\n", error);
printf ("x coord name = '%s'\n", coord_names[0]);
- printf ("y coord name = '%s'\n", coord_names[1]);
+ if (num_dim >1)
+ printf ("y coord name = '%s'\n", coord_names[1]);
if (num_dim >2)
printf ("z coord name = '%s'\n", coord_names[2]);
@@ -220,6 +228,7 @@ int main (int argc, char **argv)
{
int num_attrs = 0;
error = ex_get_attr_param(exoid, EX_NODAL, 0, &num_attrs);
+ printf (" after ex_get_attr_param, error = %d\n", error);
printf ("num nodal attributes = %d\n", num_attrs);
if (num_attrs > 0) {
for (j=0; j<num_attrs; j++) {
@@ -233,6 +242,7 @@ int main (int argc, char **argv)
for (j=0; j<num_attrs; j++) {
printf ("nodal attribute %d = '%s'\n", j, attrib_names[j]);
error = ex_get_one_attr(exoid, EX_NODAL, 0, j+1, attrib);
+ printf (" after ex_get_one_attr, error = %d\n", error);
for (i=0; i < num_nodes; i++) {
printf ("%5.1f\n", attrib[i]);
}
@@ -457,6 +467,7 @@ int main (int argc, char **argv)
{
int num_attrs = 0;
error = ex_get_attr_param(exoid, EX_NODE_SET, ids[i], &num_attrs);
+ printf (" after ex_get_attr_param, error = %d\n", error);
printf ("num nodeset attributes for nodeset %d = %d\n", ids[i], num_attrs);
if (num_attrs > 0) {
for (j=0; j<num_attrs; j++) {
@@ -470,6 +481,7 @@ int main (int argc, char **argv)
for (j=0; j<num_attrs; j++) {
printf ("nodeset attribute %d = '%s'\n", j, attrib_names[j]);
error = ex_get_one_attr(exoid, EX_NODE_SET, ids[i], j+1, attrib);
+ printf (" after ex_get_one_attr, error = %d\n", error);
for (k=0; k < num_nodes_in_set; k++) {
printf ("%5.1f\n", attrib[k]);
}
diff --git a/exodus/cbind/test/testrd.dmp b/exodus/cbind/test/testrd.dmp
index 04c0d17..5f3b0b4 100644
--- a/exodus/cbind/test/testrd.dmp
+++ b/exodus/cbind/test/testrd.dmp
@@ -10,6 +10,7 @@ num_elem = 7
num_elem_blk = 7
num_node_sets = 2
num_side_sets = 5
+ after ex_inquire, error = 0
after ex_get_coord, error = 0
x coords =
@@ -119,9 +120,11 @@ after ex_get_coord_names, error = 0
x coord name = 'xcoor'
y coord name = 'ycoor'
z coord name = 'zcoor'
+ after ex_get_attr_param, error = 0
num nodal attributes = 2
after ex_get_attr_names, error = 0
nodal attribute 0 = 'Node_attr_1'
+ after ex_get_one_attr, error = 0
0.0
1.0
1.0
@@ -156,6 +159,7 @@ nodal attribute 0 = 'Node_attr_1'
10.0
10.0
nodal attribute 1 = 'Node_attr_2'
+ after ex_get_one_attr, error = 0
0.0
0.0
1.0
@@ -379,20 +383,22 @@ after ex_get_node_set, error = 0
after ex_get_node_set_dist_fact, error = 0
node list for node set 20
-100
-101
-102
-103
-104
+ 10
+ 11
+ 12
+ 13
+ 14
dist factors for node set 20
1.00
2.00
3.00
4.00
5.00
+ after ex_get_attr_param, error = 0
num nodeset attributes for nodeset 20 = 1
after ex_get_attr_names, error = 0
nodeset attribute 0 = 'Nodeset_attribute'
+ after ex_get_one_attr, error = 0
0.0
1.0
1.0
@@ -410,13 +416,14 @@ after ex_get_node_set, error = 0
after ex_get_node_set_dist_fact, error = 0
node list for node set 21
-200
-201
-202
+ 20
+ 21
+ 22
dist factors for node set 21
1.10
2.10
3.10
+ after ex_get_attr_param, error = 0
num nodeset attributes for nodeset 21 = 0
after ex_inquire, error = 0
@@ -449,14 +456,14 @@ node_ind =
0
5
node_list =
-100
-101
-102
-103
-104
-200
-201
-202
+ 10
+ 11
+ 12
+ 13
+ 14
+ 20
+ 21
+ 22
dist_fact =
1.000
2.000
diff --git a/exodus/cbind/test/testrd1.c b/exodus/cbind/test/testrd1.c
index 7cdca45..cdaeef0 100644
--- a/exodus/cbind/test/testrd1.c
+++ b/exodus/cbind/test/testrd1.c
@@ -75,7 +75,10 @@ int main (int argc, char **argv)
int *num_elem_in_block, *num_nodes_per_elem, *num_attr;
int num_nodes_in_set, num_elem_in_set;
int num_sides_in_set, num_df_in_set;
- int list_len, elem_list_len, node_list_len, df_list_len;
+ int list_len = 0;
+ int elem_list_len = 0;
+ int node_list_len = 0;
+ int df_list_len = 0;
int node_num, time_step, var_index, beg_time, end_time, elem_num;
int CPU_word_size,IO_word_size;
int num_props, prop_value, *prop_values;
@@ -86,7 +89,7 @@ int main (int argc, char **argv)
float *attrib, *dist_fact;
float version, fdum;
- char *coord_names[3], *qa_record[2][4], *info[3], *var_names[3];
+ char *coord_names[3], *qa_record[2][4], *info[3], *var_names[10];
char title[MAX_LINE_LENGTH+1], elem_type[MAX_STR_LENGTH+1];
char *cdum = 0;
char *prop_names[3];
@@ -843,8 +846,7 @@ int main (int argc, char **argv)
error = ex_get_var_name(exoid, "g", 1, var_names[0]);
printf ("\nafter ex_get_var_name, error = %3d\n", error);
- printf ("There are %2d global variables; their names are :\n",
- num_glo_vars);
+ printf ("There are %2d global variables; their names are :\n", num_glo_vars);
for (i=0; i<num_glo_vars; i++)
{
printf (" '%s'\n", var_names[i]);
diff --git a/exodus/cbind/test/testrd1.dmp b/exodus/cbind/test/testrd1.dmp
index 13ade90..cd74b16 100644
--- a/exodus/cbind/test/testrd1.dmp
+++ b/exodus/cbind/test/testrd1.dmp
@@ -371,11 +371,11 @@ after ex_get_node_set, error = 0
after ex_get_node_set_dist_fact, error = 0
node list for node set 20
-100
-101
-102
-103
-104
+ 10
+ 11
+ 12
+ 13
+ 14
dist factors for node set 20
1.00
2.00
@@ -393,9 +393,9 @@ after ex_get_node_set, error = 0
after ex_get_node_set_dist_fact, error = 0
node list for node set 21
-200
-201
-202
+ 20
+ 21
+ 22
dist factors for node set 21
1.10
2.10
@@ -431,14 +431,14 @@ node_ind =
0
5
node_list =
-100
-101
-102
-103
-104
-200
-201
-202
+ 10
+ 11
+ 12
+ 13
+ 14
+ 20
+ 21
+ 22
dist_fact =
1.000
2.000
diff --git a/exodus/cbind/test/testrd_nc.c b/exodus/cbind/test/testrd_nc.c
index 997c1c8..a913f83 100644
--- a/exodus/cbind/test/testrd_nc.c
+++ b/exodus/cbind/test/testrd_nc.c
@@ -76,7 +76,10 @@ int main (int argc, char **argv)
int *num_elem_in_block, *num_nodes_per_elem, *num_attr;
int num_nodes_in_set, num_elem_in_set;
int num_sides_in_set, num_df_in_set;
- int list_len, elem_list_len, node_list_len, df_list_len;
+ int list_len = 0;
+ int elem_list_len = 0;
+ int node_list_len = 0;
+ int df_list_len = 0;
int node_num, time_step, var_index, beg_time, end_time, elem_num;
int CPU_word_size,IO_word_size;
int num_props, prop_value, *prop_values;
@@ -140,6 +143,7 @@ int main (int argc, char **argv)
printf ("\nafter ex_get_coord, error = %3d\n", error);
error = ex_get_coord (exoid, xyz, NULL, NULL);
+ printf ("\nafter ex_get_coord (x), error = %3d\n", error);
printf ("x coords = \n");
for (i=0; i<num_nodes; i++)
{
@@ -147,6 +151,7 @@ int main (int argc, char **argv)
}
error = ex_get_coord (exoid, NULL, xyz, NULL);
+ printf ("\nafter ex_get_coord (y), error = %3d\n", error);
printf ("y coords = \n");
for (i=0; i<num_nodes; i++)
{
@@ -154,6 +159,7 @@ int main (int argc, char **argv)
}
error = ex_get_coord (exoid, NULL, NULL, xyz);
+ printf ("\nafter ex_get_coord (z), error = %3d\n", error);
if (num_dim >= 3)
{
printf ("z coords = \n");
diff --git a/exodus/cbind/test/testrd_nc.dmp b/exodus/cbind/test/testrd_nc.dmp
index 71d8257..ae30d7c 100644
--- a/exodus/cbind/test/testrd_nc.dmp
+++ b/exodus/cbind/test/testrd_nc.dmp
@@ -12,6 +12,8 @@ num_node_sets = 2
num_side_sets = 5
after ex_get_coord, error = 0
+
+after ex_get_coord (x), error = 0
x coords =
0.0
1.0
@@ -46,6 +48,8 @@ x coords =
0.0
10.0
10.0
+
+after ex_get_coord (y), error = 0
y coords =
0.0
0.0
@@ -80,6 +84,8 @@ y coords =
0.0
0.0
10.0
+
+after ex_get_coord (z), error = 0
z coords =
0.0
0.0
@@ -296,11 +302,11 @@ after ex_get_node_set, error = 0
after ex_get_node_set_dist_fact, error = 0
node list for node set 20
-100
-101
-102
-103
-104
+ 10
+ 11
+ 12
+ 13
+ 14
dist factors for node set 20
1.00
2.00
@@ -318,9 +324,9 @@ after ex_get_node_set, error = 0
after ex_get_node_set_dist_fact, error = 0
node list for node set 21
-200
-201
-202
+ 20
+ 21
+ 22
dist factors for node set 21
1.10
2.10
@@ -356,14 +362,14 @@ node_ind =
0
5
node_list =
-100
-101
-102
-103
-104
-200
-201
-202
+ 10
+ 11
+ 12
+ 13
+ 14
+ 20
+ 21
+ 22
dist_fact =
1.000
2.000
diff --git a/exodus/cbind/test/testrd-partial.c b/exodus/cbind/test/testrd_par.c
similarity index 95%
rename from exodus/cbind/test/testrd-partial.c
rename to exodus/cbind/test/testrd_par.c
index 7d4693c..5d2ddb0 100644
--- a/exodus/cbind/test/testrd-partial.c
+++ b/exodus/cbind/test/testrd_par.c
@@ -53,16 +53,17 @@
*
*****************************************************************************/
+#include <mpi.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include "netcdf.h"
-#include "exodusII.h"
-/* #include "drmd.h" */
-
+#include "exodusII_par.h"
int main (int argc, char **argv)
{
+ MPI_Comm mpi_comm = MPI_COMM_WORLD;
+ MPI_Info mpi_info = MPI_INFO_NULL;
+
int exoid, num_dim, num_nodes, num_elem, num_elem_blk, num_node_sets;
int num_side_sets, error;
int i, j, k, node_ctr;
@@ -70,8 +71,11 @@ int main (int argc, char **argv)
int *ids;
int *num_nodes_per_set = NULL;
int *num_elem_per_set = NULL;
- int *num_df_per_set;
- int *node_ind, *elem_ind, *df_ind, num_qa_rec, num_info;
+ int *num_df_per_set = NULL;
+ int *node_ind = NULL;
+ int *elem_ind = NULL;
+ int *df_ind = NULL;
+ int num_qa_rec, num_info;
int num_glo_vars, num_nod_vars, num_ele_vars;
int num_nset_vars, num_sset_vars;
int *truth_tab;
@@ -97,6 +101,7 @@ int main (int argc, char **argv)
char *attrib_names[10];
char name[MAX_STR_LENGTH+1];
char title[MAX_LINE_LENGTH+1], elem_type[MAX_STR_LENGTH+1];
+ char title_chk[MAX_LINE_LENGTH+1];
char *cdum = 0;
char *prop_names[3];
@@ -105,12 +110,16 @@ int main (int argc, char **argv)
ex_opts (EX_VERBOSE | EX_ABORT );
+ /* Initialize MPI. */
+ MPI_Init(&argc,&argv);
+
/* open EXODUS II files */
- exoid = ex_open ("test.exo", /* filename path */
- EX_READ, /* access mode = READ */
- &CPU_word_size, /* CPU word size */
- &IO_word_size, /* IO word size */
- &version); /* ExodusII library version */
+ exoid = ex_open_par ("test.exo", /* filename path */
+ EX_READ, /* access mode = READ */
+ &CPU_word_size, /* CPU word size */
+ &IO_word_size, /* IO word size */
+ &version, /* ExodusII library version */
+ mpi_comm, mpi_info);
printf ("\nafter ex_open\n");
if (exoid < 0) exit(1);
@@ -143,10 +152,21 @@ int main (int argc, char **argv)
printf ("num_node_sets = %3d\n",num_node_sets);
printf ("num_side_sets = %3d\n",num_side_sets);
+ /* Check that ex_inquire gives same title */
+ error = ex_inquire (exoid, EX_INQ_TITLE, &idum, &fdum, title_chk);
+ printf (" after ex_inquire, error = %d\n", error);
+ if (strcmp(title, title_chk) != 0) {
+ printf ("error in ex_inquire for EX_INQ_TITLE\n");
+ }
+
/* read nodal coordinates values and names from database */
x = (float *) calloc(num_nodes, sizeof(float));
- y = (float *) calloc(num_nodes, sizeof(float));
+ if (num_dim >= 2)
+ y = (float *) calloc(num_nodes, sizeof(float));
+ else
+ y = 0;
+
if (num_dim >= 3)
z = (float *) calloc(num_nodes, sizeof(float));
else
@@ -161,12 +181,13 @@ int main (int argc, char **argv)
printf ("%5.1f\n", x[i]);
}
- printf ("y coords = \n");
- for (i=0; i<num_nodes; i++)
- {
- printf ("%5.1f\n", y[i]);
- }
-
+ if (num_dim >= 2) {
+ printf ("y coords = \n");
+ for (i=0; i<num_nodes; i++)
+ {
+ printf ("%5.1f\n", y[i]);
+ }
+ }
if (num_dim >= 3)
{
printf ("z coords = \n");
@@ -187,7 +208,8 @@ int main (int argc, char **argv)
printf ("%f \n", y[0]);
*/
free (x);
- free (y);
+ if (num_dim >= 2)
+ free (y);
if (num_dim >= 3)
free (z);
@@ -199,9 +221,11 @@ int main (int argc, char **argv)
error = ex_get_coord_names (exoid, coord_names);
printf ("\nafter ex_get_coord_names, error = %3d\n", error);
-
printf ("x coord name = '%s'\n", coord_names[0]);
- printf ("y coord name = '%s'\n", coord_names[1]);
+ if (num_dim >1)
+ printf ("y coord name = '%s'\n", coord_names[1]);
+ if (num_dim >2)
+ printf ("z coord name = '%s'\n", coord_names[2]);
for (i=0; i<num_dim; i++)
free(coord_names[i]);
@@ -209,6 +233,7 @@ int main (int argc, char **argv)
{
int num_attrs = 0;
error = ex_get_attr_param(exoid, EX_NODAL, 0, &num_attrs);
+ printf (" after ex_get_attr_param, error = %d\n", error);
printf ("num nodal attributes = %d\n", num_attrs);
if (num_attrs > 0) {
for (j=0; j<num_attrs; j++) {
@@ -222,6 +247,7 @@ int main (int argc, char **argv)
for (j=0; j<num_attrs; j++) {
printf ("nodal attribute %d = '%s'\n", j, attrib_names[j]);
error = ex_get_one_attr(exoid, EX_NODAL, 0, j+1, attrib);
+ printf (" after ex_get_one_attr, error = %d\n", error);
for (i=0; i < num_nodes; i++) {
printf ("%5.1f\n", attrib[i]);
}
@@ -258,6 +284,7 @@ int main (int argc, char **argv)
printf ("\nafter ex_get_elem_blk_ids, error = %3d\n", error);
for (i=0; i<num_elem_blk; i++) {
+ printf("Block # %d is id %d\n", i, ids[i]);
block_names[i] = (char *) calloc ((MAX_STR_LENGTH+1), sizeof(char));
}
@@ -273,7 +300,7 @@ int main (int argc, char **argv)
error = ex_get_elem_block (exoid, ids[i], elem_type,
&(num_elem_in_block[i]),
&(num_nodes_per_elem[i]), &(num_attr[i]));
- printf ("\nafter ex_get_elem_block, error = %d\n", error);
+ printf ("\nafter ex_get_elem_block, id = %d, error = %d\n", ids[i], error);
printf ("element block id = %2d\n",ids[i]);
printf ("element type = '%s'\n", elem_type);
@@ -446,6 +473,7 @@ int main (int argc, char **argv)
{
int num_attrs = 0;
error = ex_get_attr_param(exoid, EX_NODE_SET, ids[i], &num_attrs);
+ printf (" after ex_get_attr_param, error = %d\n", error);
printf ("num nodeset attributes for nodeset %d = %d\n", ids[i], num_attrs);
if (num_attrs > 0) {
for (j=0; j<num_attrs; j++) {
@@ -459,6 +487,7 @@ int main (int argc, char **argv)
for (j=0; j<num_attrs; j++) {
printf ("nodeset attribute %d = '%s'\n", j, attrib_names[j]);
error = ex_get_one_attr(exoid, EX_NODE_SET, ids[i], j+1, attrib);
+ printf (" after ex_get_one_attr, error = %d\n", error);
for (k=0; k < num_nodes_in_set; k++) {
printf ("%5.1f\n", attrib[k]);
}
@@ -1176,5 +1205,6 @@ int main (int argc, char **argv)
error = ex_close (exoid);
printf ("\nafter ex_close, error = %3d\n", error);
+ MPI_Finalize();
return 0;
}
diff --git a/exodus/cbind/test/testrd_ss.c b/exodus/cbind/test/testrd_ss.c
index 5be5c2a..98cb749 100644
--- a/exodus/cbind/test/testrd_ss.c
+++ b/exodus/cbind/test/testrd_ss.c
@@ -73,7 +73,9 @@ int main (int argc, char **argv)
int *num_elem_in_block, *num_nodes_per_elem, *num_attr;
int num_elem_in_set;
int num_sides_in_set, num_df_in_set;
- int elem_list_len, node_list_len, df_list_len;
+ int elem_list_len = 0;
+ int node_list_len = 0;
+ int df_list_len = 0;
int CPU_word_size,IO_word_size;
int idum;
diff --git a/exodus/cbind/test/testrd_zeroe.dmp b/exodus/cbind/test/testrd_zeroe.dmp
index 4121df3..9bef1e7 100644
--- a/exodus/cbind/test/testrd_zeroe.dmp
+++ b/exodus/cbind/test/testrd_zeroe.dmp
@@ -10,6 +10,7 @@ num_elem = 0
num_elem_blk = 0
num_node_sets = 2
num_side_sets = 0
+ after ex_inquire, error = 0
after ex_get_coord, error = 0
x coords =
@@ -119,6 +120,7 @@ after ex_get_coord_names, error = 0
x coord name = 'xcoor'
y coord name = 'ycoor'
z coord name = 'zcoor'
+ after ex_get_attr_param, error = 0
num nodal attributes = 0
after ex_get_map, error = 0
@@ -138,17 +140,18 @@ after ex_get_node_set, error = 0
after ex_get_node_set_dist_fact, error = 0
node list for node set 20
-100
-101
-102
-103
-104
+ 10
+ 11
+ 12
+ 13
+ 14
dist factors for node set 20
1.00
2.00
3.00
4.00
5.00
+ after ex_get_attr_param, error = 0
num nodeset attributes for nodeset 20 = 0
after ex_get_node_set_param, error = 0
@@ -162,13 +165,14 @@ after ex_get_node_set, error = 0
after ex_get_node_set_dist_fact, error = 0
node list for node set 21
-200
-201
-202
+ 20
+ 21
+ 22
dist factors for node set 21
1.10
2.10
3.10
+ after ex_get_attr_param, error = 0
num nodeset attributes for nodeset 21 = 0
after ex_inquire, error = 0
@@ -201,14 +205,14 @@ node_ind =
0
5
node_list =
-100
-101
-102
-103
-104
-200
-201
-202
+ 10
+ 11
+ 12
+ 13
+ 14
+ 20
+ 21
+ 22
dist_fact =
1.000
2.000
diff --git a/exodus/cbind/test/testrd_zeron.dmp b/exodus/cbind/test/testrd_zeron.dmp
index ab3d197..ec494dc 100644
--- a/exodus/cbind/test/testrd_zeron.dmp
+++ b/exodus/cbind/test/testrd_zeron.dmp
@@ -4,91 +4,24 @@ after ex_open
after ex_get_init, error = 0
database parameters:
title = 'This is a test'
-num_dim = 3
+num_dim = 1
num_nodes = 0
num_elem = 0
-num_elem_blk = 7
+num_elem_blk = 0
num_node_sets = 0
num_side_sets = 0
+ after ex_inquire, error = 0
after ex_get_coord, error = 0
x coords =
-y coords =
-z coords =
after ex_get_coord_names, error = 0
x coord name = 'xcoor'
-y coord name = 'ycoor'
-z coord name = 'zcoor'
+ after ex_get_attr_param, error = 0
num nodal attributes = 0
after ex_get_map, error = 0
-after ex_get_elem_blk_ids, error = 0
-
-after ex_get_names, error = 0
-
-after ex_get_elem_block, error = 0
-element block id = 10
-element type = 'NULL'
-num_elem_in_block = 0
-num_nodes_per_elem = 0
-num_attr = 0
-name = ''
-
-after ex_get_elem_block, error = 0
-element block id = 11
-element type = 'NULL'
-num_elem_in_block = 0
-num_nodes_per_elem = 0
-num_attr = 0
-name = ''
-
-after ex_get_elem_block, error = 0
-element block id = 12
-element type = 'NULL'
-num_elem_in_block = 0
-num_nodes_per_elem = 0
-num_attr = 0
-name = ''
-
-after ex_get_elem_block, error = 0
-element block id = 13
-element type = 'NULL'
-num_elem_in_block = 0
-num_nodes_per_elem = 0
-num_attr = 0
-name = ''
-
-after ex_get_elem_block, error = 0
-element block id = 14
-element type = 'NULL'
-num_elem_in_block = 0
-num_nodes_per_elem = 0
-num_attr = 0
-name = ''
-
-after ex_get_elem_block, error = 0
-element block id = 15
-element type = 'NULL'
-num_elem_in_block = 0
-num_nodes_per_elem = 0
-num_attr = 0
-name = ''
-
-after ex_get_elem_block, error = 0
-element block id = 16
-element type = 'NULL'
-num_elem_in_block = 0
-num_nodes_per_elem = 0
-num_attr = 0
-name = ''
-
-after ex_inquire, error = 0
-
-There are 1 properties for each element block
-after ex_get_prop_names, error = 0
-
after ex_get_qa, error = 0
QA records =
'TESTWT'
@@ -150,6 +83,4 @@ global variable 1 values through time:
0.180
0.200
- after ex_get_elem_blk_ids, error = 0
-
after ex_close, error = 0
diff --git a/exodus/cbind/test/testrdd.c b/exodus/cbind/test/testrdd.c
index aaea247..5ecf7fb 100644
--- a/exodus/cbind/test/testrdd.c
+++ b/exodus/cbind/test/testrdd.c
@@ -76,7 +76,10 @@ int main (int argc, char **argv)
int *num_elem_in_block, *num_nodes_per_elem, *num_attr;
int num_nodes_in_set, num_elem_in_set;
int num_sides_in_set, num_df_in_set;
- int list_len, elem_list_len, node_list_len, df_list_len;
+ int list_len = 0;
+ int elem_list_len = 0;
+ int node_list_len = 0;
+ int df_list_len = 0;
int node_num, time_step, var_index, beg_time, end_time, elem_num;
int CPU_word_size,IO_word_size;
int num_props, prop_value, *prop_values;
diff --git a/exodus/cbind/test/testrdd.dmp b/exodus/cbind/test/testrdd.dmp
index 024507c..eec0204 100644
--- a/exodus/cbind/test/testrdd.dmp
+++ b/exodus/cbind/test/testrdd.dmp
@@ -231,11 +231,11 @@ after ex_get_node_set, error = 0
after ex_get_node_set_dist_fact, error = 0
node list for node set 20
-100
-101
-102
-103
-104
+ 10
+ 11
+ 12
+ 13
+ 14
dist factors for node set 20
1.00
2.00
@@ -253,9 +253,9 @@ after ex_get_node_set, error = 0
after ex_get_node_set_dist_fact, error = 0
node list for node set 21
-200
-201
-202
+ 20
+ 21
+ 22
dist factors for node set 21
1.10
2.10
@@ -291,14 +291,14 @@ node_ind =
0
5
node_list =
-100
-101
-102
-103
-104
-200
-201
-202
+ 10
+ 11
+ 12
+ 13
+ 14
+ 20
+ 21
+ 22
dist_fact =
1.000
2.000
diff --git a/exodus/cbind/test/testrdv.c b/exodus/cbind/test/testrdv.c
deleted file mode 100644
index d16b962..0000000
--- a/exodus/cbind/test/testrdv.c
+++ /dev/null
@@ -1,930 +0,0 @@
-/*
- * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*****************************************************************************
-*
-* testrd - read exodus file test.exo created by testwt
-* -- use varid routines to read node and element variables.
-*
-* author - Sandia National Laboratories
-* Larry A. Schoof - Original
-*
-*
-* environment - UNIX
-*
-* entry conditions -
-* input parameters:
-* int exoid exodus file id
-*
-* exit conditions -
-*
-* revision history -
-*
-*
-*****************************************************************************/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "netcdf.h"
-#include "exodusII.h"
-/* #include "drmd.h" */
-
-
-int main (int argc, char **argv)
-{
- int exoid, num_dim, num_nodes, num_elem, num_elem_blk, num_node_sets;
- int num_side_sets, error;
- int i, j, k, node_ctr;
- int *elem_map, *connect, *node_list, *node_ctr_list, *elem_list, *side_list;
- int *ids;
- int *num_nodes_per_set, *num_elem_per_set;
- int *num_df_per_set;
- int *node_ind, *elem_ind, *df_ind, num_qa_rec, num_info;
- int num_glo_vars, num_nod_vars, num_ele_vars;
- int *truth_tab;
- int *node_varid = NULL;
- int *elem_varid = NULL;
-
- int num_time_steps;
- int *num_elem_in_block = NULL;
- int *num_nodes_per_elem = NULL;
- int *num_attr = NULL;
- int num_nodes_in_set, num_elem_in_set;
- int num_sides_in_set, num_df_in_set;
- int list_len, elem_list_len, node_list_len, df_list_len;
- int node_num, time_step, var_index, beg_time, end_time, elem_num;
- int CPU_word_size,IO_word_size;
- int num_props, prop_value, *prop_values;
- int idum;
-
- float time_value, *time_values, *var_values;
- float *x, *y, *z;
- float *attrib, *dist_fact;
- float version, fdum;
-
- char *coord_names[3], *qa_record[2][4], *info[3], *var_names[3];
- char title[MAX_LINE_LENGTH+1], elem_type[MAX_STR_LENGTH+1];
- char *cdum = 0;
- char *prop_names[3];
-
- CPU_word_size = 0; /* sizeof(float) */
- IO_word_size = 0; /* use what is stored in file */
-
- ex_opts (EX_VERBOSE | EX_ABORT );
-
- /* open EXODUS II files */
-
- exoid = ex_open ("test.exo", /* filename path */
- EX_READ, /* access mode = READ */
- &CPU_word_size, /* CPU word size */
- &IO_word_size, /* IO word size */
- &version); /* ExodusII library version */
-
- printf ("\nafter ex_open\n");
- if (exoid < 0) exit(1);
-
- printf ("test.exo is an EXODUSII file; version %4.2f\n",
- version);
- /* printf (" CPU word size %1d\n",CPU_word_size); */
- printf (" I/O word size %1d\n",IO_word_size);
- ex_inquire(exoid,EX_INQ_API_VERS, &idum, &version, cdum);
- printf ("EXODUSII API; version %4.2f\n", version);
-
- /* ncopts = NC_VERBOSE; */
-
- /* read database parameters */
-
- error = ex_get_init (exoid, title, &num_dim, &num_nodes, &num_elem,
- &num_elem_blk, &num_node_sets, &num_side_sets);
-
- printf ("after ex_get_init, error = %3d\n", error);
-
- printf ("database parameters:\n");
- printf ("title = '%s'\n",title);
- printf ("num_dim = %3d\n",num_dim);
- printf ("num_nodes = %3d\n",num_nodes);
- printf ("num_elem = %3d\n",num_elem);
- printf ("num_elem_blk = %3d\n",num_elem_blk);
- printf ("num_node_sets = %3d\n",num_node_sets);
- printf ("num_side_sets = %3d\n",num_side_sets);
-
- /* read nodal coordinates values and names from database */
-
- x = (float *) calloc(num_nodes, sizeof(float));
- y = (float *) calloc(num_nodes, sizeof(float));
- if (num_dim >= 3)
- z = (float *) calloc(num_nodes, sizeof(float));
- else
- z = 0;
-
- error = ex_get_coord (exoid, x, y, z);
- printf ("\nafter ex_get_coord, error = %3d\n", error);
-
- printf ("x coords = \n");
- for (i=0; i<num_nodes; i++)
- {
- printf ("%5.1f\n", x[i]);
- }
-
- printf ("y coords = \n");
- for (i=0; i<num_nodes; i++)
- {
- printf ("%5.1f\n", y[i]);
- }
-
- if (num_dim >= 3)
- {
- printf ("z coords = \n");
- for (i=0; i<num_nodes; i++)
- {
- printf ("%5.1f\n", z[i]);
- }
- }
-
- /*
- error = ex_get_1_coord (exoid, 2, x, y, z);
- printf ("\nafter ex_get_1_coord, error = %3d\n", error);
-
- printf ("x coord of node 2 = \n");
- printf ("%f \n", x[0]);
-
- printf ("y coord of node 2 = \n");
- printf ("%f \n", y[0]);
- */
- free (x);
- free (y);
- if (num_dim >= 3)
- free (z);
-
-
- for (i=0; i<num_dim; i++)
- {
- coord_names[i] = (char *) calloc ((MAX_STR_LENGTH+1), sizeof(char));
- }
-
- error = ex_get_coord_names (exoid, coord_names);
- printf ("\nafter ex_get_coord_names, error = %3d\n", error);
-
- printf ("x coord name = '%s'\n", coord_names[0]);
- printf ("y coord name = '%s'\n", coord_names[1]);
-
- for (i=0; i<num_dim; i++)
- free(coord_names[i]);
-
-
- /* read element order map */
-
- elem_map = (int *) calloc(num_elem, sizeof(int));
-
- error = ex_get_map (exoid, elem_map);
- printf ("\nafter ex_get_map, error = %3d\n", error);
-
- for (i=0; i<num_elem; i++)
- {
- printf ("elem_map(%d) = %d \n", i, elem_map[i]);
- }
-
- free (elem_map);
-
- /* read element block parameters */
-
- if (num_elem_blk > 0) {
- ids = (int *) calloc(num_elem_blk, sizeof(int));
- num_elem_in_block = (int *) calloc(num_elem_blk, sizeof(int));
- num_nodes_per_elem = (int *) calloc(num_elem_blk, sizeof(int));
- num_attr = (int *) calloc(num_elem_blk, sizeof(int));
-
- error = ex_get_elem_blk_ids (exoid, ids);
- printf ("\nafter ex_get_elem_blk_ids, error = %3d\n", error);
-
- for (i=0; i<num_elem_blk; i++)
- {
- error = ex_get_elem_block (exoid, ids[i], elem_type,
- &(num_elem_in_block[i]),
- &(num_nodes_per_elem[i]), &(num_attr[i]));
- printf ("\nafter ex_get_elem_block, error = %d\n", error);
-
- printf ("element block id = %2d\n",ids[i]);
- printf ("element type = '%s'\n", elem_type);
- printf ("num_elem_in_block = %2d\n",num_elem_in_block[i]);
- printf ("num_nodes_per_elem = %2d\n",num_nodes_per_elem[i]);
- printf ("num_attr = %2d\n",num_attr[i]);
- }
-
- /* read element block properties */
- error = ex_inquire (exoid, EX_INQ_EB_PROP, &num_props, &fdum, cdum);
- printf ("\nafter ex_inquire, error = %d\n", error);
- printf ("\nThere are %2d properties for each element block\n", num_props);
-
- for (i=0; i<num_props; i++)
- {
- prop_names[i] = (char *) calloc ((MAX_STR_LENGTH+1), sizeof(char));
- }
-
- error = ex_get_prop_names(exoid,EX_ELEM_BLOCK,prop_names);
- printf ("after ex_get_prop_names, error = %d\n", error);
-
-
- for (i=0; i<num_props; i++)
- {
- for (j=0; j<num_elem_blk; j++)
- {
- error = ex_get_prop(exoid, EX_ELEM_BLOCK, ids[j], prop_names[i],
- &prop_value);
- if (error == 0)
- printf ("element block %2d, property(%2d): '%s'= %5d\n",
- j+1, i+1, prop_names[i], prop_value);
- else
- printf ("after ex_get_prop, error = %d\n", error);
- }
- }
-
- for (i=0; i<num_props; i++)
- free(prop_names[i]);
- }
-
- /* read element connectivity */
-
- for (i=0; i<num_elem_blk; i++)
- {
- connect = (int *) calloc((num_nodes_per_elem[i] * num_elem_in_block[i]),
- sizeof(int));
-
- error = ex_get_elem_conn (exoid, ids[i], connect);
- printf ("\nafter ex_get_elem_conn, error = %d\n", error);
-
-
- printf ("connect array for elem block %2d\n", ids[i]);
-
- for (j=0; j<num_nodes_per_elem[i]; j++)
- {
- printf ("%3d\n", connect[j]);
- }
- /*
- error = ex_get_1_elem_conn (exoid, 1, ids[i], connect);
- printf ("\nafter ex_get_elem_conn, error = %d\n", error);
-
- printf ("node list for first element of element block %d \n ", ids[i]);
- for (j=0; j<num_nodes_per_elem[i]; j++)
- {
- printf ("%d \n", connect[j]);
- }
- */
- free (connect);
-
- }
-
- /* read element block attributes */
-
- for (i=0; i<num_elem_blk; i++)
- {
- attrib = (float *) calloc(num_attr[i]*num_elem_in_block[i],sizeof(float));
- error = ex_get_elem_attr (exoid, ids[i], attrib);
- printf ("\n after ex_get_elem_attr, error = %d\n", error);
-
- if (error == 0)
- printf ("element block %d attributes = %6.4f\n", ids[i], *attrib);
- free (attrib);
- }
-
- if (num_elem_blk > 0) {
- free (ids);
- free (num_nodes_per_elem);
- free (num_attr);
- }
-
- /* read individual node sets */
- if (num_node_sets > 0) {
- ids = (int *) calloc(num_node_sets, sizeof(int));
-
- error = ex_get_node_set_ids (exoid, ids);
- printf ("\nafter ex_get_node_set_ids, error = %3d\n", error);
-
- for (i=0; i<num_node_sets; i++)
- {
- error = ex_get_node_set_param (exoid, ids[i],
- &num_nodes_in_set, &num_df_in_set);
- printf ("\nafter ex_get_node_set_param, error = %3d\n", error);
-
- printf ("\nnode set %2d parameters: \n", ids[i]);
- printf ("num_nodes = %2d\n", num_nodes_in_set);
-
- node_list = (int *) calloc(num_nodes_in_set, sizeof(int));
- dist_fact = (float *) calloc(num_nodes_in_set, sizeof(float));
-
- error = ex_get_node_set (exoid, ids[i], node_list);
- printf ("\nafter ex_get_node_set, error = %3d\n", error);
-
- if (num_df_in_set > 0)
- {
- error = ex_get_node_set_dist_fact (exoid, ids[i], dist_fact);
- printf ("\nafter ex_get_node_set_dist_fact, error = %3d\n", error);
- }
-
- printf ("\nnode list for node set %2d\n", ids[i]);
-
- for (j=0; j<num_nodes_in_set; j++)
- {
- printf ("%3d\n", node_list[j]);
- }
-
- if (num_df_in_set > 0)
- {
- printf ("dist factors for node set %2d\n", ids[i]);
-
- for (j=0; j<num_nodes_in_set; j++)
- {
- printf ("%5.2f\n", dist_fact[j]);
- }
- }
- else
- printf ("no dist factors for node set %2d\n", ids[i]);
-
- free (node_list);
- free (dist_fact);
- }
- free(ids);
-
- /* read node set properties */
- error = ex_inquire (exoid, EX_INQ_NS_PROP, &num_props, &fdum, cdum);
- printf ("\nafter ex_inquire, error = %d\n", error);
- printf ("\nThere are %2d properties for each node set\n", num_props);
-
- for (i=0; i<num_props; i++)
- {
- prop_names[i] = (char *) calloc ((MAX_STR_LENGTH+1), sizeof(char));
- }
- prop_values = (int *) calloc (num_node_sets, sizeof(int));
-
- error = ex_get_prop_names(exoid,EX_NODE_SET,prop_names);
- printf ("after ex_get_prop_names, error = %d\n", error);
-
-
- for (i=0; i<num_props; i++)
- {
- error = ex_get_prop_array(exoid, EX_NODE_SET, prop_names[i],
- prop_values);
- if (error == 0)
- for (j=0; j<num_node_sets; j++)
- printf ("node set %2d, property(%2d): '%s'= %5d\n",
- j+1, i+1, prop_names[i], prop_values[j]);
- else
- printf ("after ex_get_prop_array, error = %d\n", error);
- }
- for (i=0; i<num_props; i++)
- free(prop_names[i]);
- free(prop_values);
-
- /* read concatenated node sets; this produces the same information as
- * the above code which reads individual node sets
- */
-
- error = ex_inquire (exoid, EX_INQ_NODE_SETS, &num_node_sets, &fdum, cdum);
- printf ("\nafter ex_inquire, error = %3d\n",error);
-
- ids = (int *) calloc(num_node_sets, sizeof(int));
- num_nodes_per_set = (int *) calloc(num_node_sets, sizeof(int));
- num_df_per_set = (int *) calloc(num_node_sets, sizeof(int));
- node_ind = (int *) calloc(num_node_sets, sizeof(int));
- df_ind = (int *) calloc(num_node_sets, sizeof(int));
-
- error = ex_inquire (exoid, EX_INQ_NS_NODE_LEN, &list_len, &fdum, cdum);
- printf ("\nafter ex_inquire: EX_INQ_NS_NODE_LEN = %d, error = %3d\n",
- list_len, error);
- node_list = (int *) calloc(list_len, sizeof(int));
-
- error = ex_inquire (exoid, EX_INQ_NS_DF_LEN, &list_len, &fdum, cdum);
- printf ("\nafter ex_inquire: EX_INQ_NS_DF_LEN = %d, error = %3d\n",
- list_len, error);
- dist_fact = (float *) calloc(list_len, sizeof(float));
-
- error = ex_get_concat_node_sets (exoid,ids,num_nodes_per_set,num_df_per_set,
- node_ind, df_ind, node_list, dist_fact);
- printf ("\nafter ex_get_concat_node_sets, error = %3d\n", error);
-
- printf ("\nconcatenated node set info\n");
-
- printf ("ids = \n");
- for (i=0; i<num_node_sets; i++) printf ("%3d\n", ids[i]);
-
- printf ("num_nodes_per_set = \n");
- for (i=0; i<num_node_sets; i++) printf ("%3d\n", num_nodes_per_set[i]);
-
- printf ("node_ind = \n");
- for (i=0; i<num_node_sets; i++) printf ("%3d\n", node_ind[i]);
-
- printf ("node_list = \n");
- for (i=0; i<list_len; i++) printf ("%3d\n", node_list[i]);
-
- printf ("dist_fact = \n");
- for (i=0; i<list_len; i++) printf ("%5.3f\n", dist_fact[i]);
-
- free (ids);
- free (num_nodes_per_set);
- free (df_ind);
- free (node_ind);
- free (num_df_per_set);
- free (node_list);
- free (dist_fact);
- }
-
- /* read individual side sets */
-
- if (num_side_sets > 0) {
- ids = (int *) calloc(num_side_sets, sizeof(int));
-
- error = ex_get_side_set_ids (exoid, ids);
- printf ("\nafter ex_get_side_set_ids, error = %3d\n", error);
-
- for (i=0; i<num_side_sets; i++)
- {
- error = ex_get_side_set_param (exoid, ids[i], &num_sides_in_set,
- &num_df_in_set);
- printf ("\nafter ex_get_side_set_param, error = %3d\n", error);
-
- printf ("side set %2d parameters:\n",ids[i]);
- printf ("num_sides = %3d\n",num_sides_in_set);
- printf ("num_dist_factors = %3d\n", num_df_in_set);
-
-
- /* Note: The # of elements is same as # of sides! */
- num_elem_in_set = num_sides_in_set;
- elem_list = (int *) calloc(num_elem_in_set, sizeof(int));
- side_list = (int *) calloc(num_sides_in_set, sizeof(int));
- node_ctr_list = (int *) calloc(num_elem_in_set, sizeof(int));
- node_list = (int *) calloc(num_elem_in_set*21, sizeof(int));
- dist_fact = (float *) calloc(num_df_in_set, sizeof(float));
-
- error = ex_get_side_set (exoid, ids[i], elem_list, side_list);
- printf ("\nafter ex_get_side_set, error = %3d\n", error);
-
- error = ex_get_side_set_node_list (exoid, ids[i], node_ctr_list,
- node_list);
- printf ("\nafter ex_get_side_set_node_list, error = %3d\n", error);
-
- if (num_df_in_set > 0)
- {
- error = ex_get_side_set_dist_fact (exoid, ids[i], dist_fact);
- printf ("\nafter ex_get_side_set_dist_fact, error = %3d\n", error);
- }
-
- printf ("element list for side set %2d\n", ids[i]);
- for (j=0; j<num_elem_in_set; j++)
- {
- printf ("%3d\n", elem_list[j]);
- }
-
- printf ("side list for side set %2d\n", ids[i]);
- for (j=0; j<num_sides_in_set; j++)
- {
- printf ("%3d\n", side_list[j]);
- }
-
- node_ctr = 0;
- printf ("node list for side set %2d\n", ids[i]);
- for (k=0; k<num_elem_in_set; k++)
- {
- for (j=0; j<node_ctr_list[k]; j++)
- {
- printf ("%3d\n", node_list[node_ctr+j]);
- }
- node_ctr += node_ctr_list[k];
- }
-
- if (num_df_in_set > 0)
- {
- printf ("dist factors for side set %2d\n", ids[i]);
-
- for (j=0; j<num_df_in_set; j++)
- {
- printf ("%5.3f\n", dist_fact[j]);
- }
- }
- else
- printf ("no dist factors for side set %2d\n", ids[i]);
-
- free (elem_list);
- free (side_list);
- free (node_ctr_list);
- free (node_list);
- free (dist_fact);
-
- }
-
- /* read side set properties */
- error = ex_inquire (exoid, EX_INQ_SS_PROP, &num_props, &fdum, cdum);
- printf ("\nafter ex_inquire, error = %d\n", error);
- printf ("\nThere are %2d properties for each side set\n", num_props);
-
- for (i=0; i<num_props; i++)
- {
- prop_names[i] = (char *) calloc ((MAX_STR_LENGTH+1), sizeof(char));
- }
-
- error = ex_get_prop_names(exoid,EX_SIDE_SET,prop_names);
- printf ("after ex_get_prop_names, error = %d\n", error);
-
-
- for (i=0; i<num_props; i++)
- {
- for (j=0; j<num_side_sets; j++)
- {
- error = ex_get_prop(exoid, EX_SIDE_SET, ids[j], prop_names[i],
- &prop_value);
- if (error == 0)
- printf ("side set %2d, property(%2d): '%s'= %5d\n",
- j+1, i+1, prop_names[i], prop_value);
- else
- printf ("after ex_get_prop, error = %d\n", error);
- }
- }
- for (i=0; i<num_props; i++)
- free(prop_names[i]);
- free (ids);
-
- error = ex_inquire (exoid, EX_INQ_SIDE_SETS, &num_side_sets, &fdum, cdum);
- printf ("\nafter ex_inquire: EX_INQ_SIDE_SETS = %d, error = %d\n",
- num_side_sets, error);
-
- if (num_side_sets > 0)
- {
- error = ex_inquire(exoid, EX_INQ_SS_ELEM_LEN, &elem_list_len, &fdum, cdum);
- printf ("\nafter ex_inquire: EX_INQ_SS_ELEM_LEN = %d, error = %d\n",
- elem_list_len, error);
-
- error = ex_inquire(exoid, EX_INQ_SS_NODE_LEN, &node_list_len, &fdum, cdum);
- printf ("\nafter ex_inquire: EX_INQ_SS_NODE_LEN = %d, error = %d\n",
- node_list_len, error);
-
- error = ex_inquire(exoid, EX_INQ_SS_DF_LEN, &df_list_len, &fdum, cdum);
- printf ("\nafter ex_inquire: EX_INQ_SS_DF_LEN = %d, error = %d\n",
- df_list_len, error);
- }
-
- /* read concatenated side sets; this produces the same information as
- * the above code which reads individual side sets
- */
-
- /* concatenated side set read */
-
- if (num_side_sets > 0) {
- ids = (int *) calloc(num_side_sets, sizeof(int));
- num_elem_per_set = (int *) calloc(num_side_sets, sizeof(int));
- num_df_per_set = (int *) calloc(num_side_sets, sizeof(int));
- elem_ind = (int *) calloc(num_side_sets, sizeof(int));
- df_ind = (int *) calloc(num_side_sets, sizeof(int));
- elem_list = (int *) calloc(elem_list_len, sizeof(int));
- side_list = (int *) calloc(elem_list_len, sizeof(int));
- dist_fact = (float *) calloc(df_list_len, sizeof(float));
-
- error = ex_get_concat_side_sets (exoid, ids, num_elem_per_set,
- num_df_per_set, elem_ind, df_ind,
- elem_list, side_list, dist_fact);
- printf ("\nafter ex_get_concat_side_sets, error = %3d\n", error);
-
- printf ("concatenated side set info\n");
-
- printf ("ids = \n");
- for (i=0; i<num_side_sets; i++) printf ("%3d\n", ids[i]);
-
- printf ("num_elem_per_set = \n");
- for (i=0; i<num_side_sets; i++) printf ("%3d\n", num_elem_per_set[i]);
-
- printf ("num_dist_per_set = \n");
- for (i=0; i<num_side_sets; i++) printf ("%3d\n", num_df_per_set[i]);
-
- printf ("elem_ind = \n");
- for (i=0; i<num_side_sets; i++) printf ("%3d\n", elem_ind[i]);
-
- printf ("dist_ind = \n");
- for (i=0; i<num_side_sets; i++) printf ("%3d\n", df_ind[i]);
-
- printf ("elem_list = \n");
- for (i=0; i<elem_list_len; i++) printf ("%3d\n", elem_list[i]);
-
- printf ("side_list = \n");
- for (i=0; i<elem_list_len; i++) printf ("%3d\n", side_list[i]);
-
- printf ("dist_fact = \n");
- for (i=0; i<df_list_len; i++) printf ("%5.3f\n", dist_fact[i]);
-
- free (ids);
- free (num_elem_per_set);
- free (num_df_per_set);
- free (df_ind);
- free (elem_ind);
- free (elem_list);
- free (side_list);
- free (dist_fact);
- }
- }
- /* end of concatenated side set read */
-
- /* read QA records */
-
- ex_inquire (exoid, EX_INQ_QA, &num_qa_rec, &fdum, cdum);
-
- for (i=0; i<num_qa_rec; i++)
- {
- for (j=0; j<4; j++)
- {
- qa_record[i][j] = (char *) calloc ((MAX_STR_LENGTH+1), sizeof(char));
- }
- }
-
- error = ex_get_qa (exoid, qa_record);
- printf ("\nafter ex_get_qa, error = %3d\n", error);
-
- printf ("QA records = \n");
- for (i=0; i<num_qa_rec; i++)
- {
- for (j=0; j<4; j++)
- {
- printf (" '%s'\n", qa_record[i][j]);
- free(qa_record[i][j]);
- }
- }
-
- /* read information records */
-
- error = ex_inquire (exoid, EX_INQ_INFO, &num_info, &fdum, cdum);
- printf ("\nafter ex_inquire, error = %3d\n", error);
-
- for (i=0; i<num_info; i++)
- {
- info[i] = (char *) calloc ((MAX_LINE_LENGTH+1), sizeof(char));
- }
-
- error = ex_get_info (exoid, info);
- printf ("\nafter ex_get_info, error = %3d\n", error);
-
- printf ("info records = \n");
- for (i=0; i<num_info; i++)
- {
- printf (" '%s'\n", info[i]);
- free(info[i]);
- }
-
- /* read global variables parameters and names */
-
- error = ex_get_var_param (exoid, "g", &num_glo_vars);
- printf ("\nafter ex_get_var_param, error = %3d\n", error);
-
- for (i=0; i<num_glo_vars; i++)
- {
- var_names[i] = (char *) calloc ((MAX_STR_LENGTH+1), sizeof(char));
- }
-
- error = ex_get_var_names (exoid, "g", num_glo_vars, var_names);
- printf ("\nafter ex_get_var_names, error = %3d\n", error);
-
- printf ("There are %2d global variables; their names are :\n",
- num_glo_vars);
- for (i=0; i<num_glo_vars; i++)
- {
- printf (" '%s'\n", var_names[i]);
- free(var_names[i]);
- }
-
- /* read nodal variables parameters and names */
- num_nod_vars = 0;
- if (num_nodes > 0) {
- error = ex_get_var_param (exoid, "n", &num_nod_vars);
- printf ("\nafter ex_get_var_param, error = %3d\n", error);
-
- for (i=0; i<num_nod_vars; i++)
- {
- var_names[i] = (char *) calloc ((MAX_STR_LENGTH+1), sizeof(char));
- }
-
- error = ex_get_var_names (exoid, "n", num_nod_vars, var_names);
- printf ("\nafter ex_get_var_names, error = %3d\n", error);
-
- printf ("There are %2d nodal variables; their names are :\n", num_nod_vars);
- for (i=0; i<num_nod_vars; i++)
- {
- printf (" '%s'\n", var_names[i]);
- free(var_names[i]);
- }
-
- node_varid = calloc(num_nod_vars, sizeof(int));
- error = ex_get_nodal_varid(exoid, node_varid);
- printf ("\nafter ex_get_nodal_varid, error = %3d\n", error);
- }
-
- /* read element variables parameters and names */
-
- num_ele_vars = 0;
- if (num_elem > 0) {
- error = ex_get_var_param (exoid, "e", &num_ele_vars);
- printf ("\nafter ex_get_var_param, error = %3d\n", error);
-
- for (i=0; i<num_ele_vars; i++)
- {
- var_names[i] = (char *) calloc ((MAX_STR_LENGTH+1), sizeof(char));
- }
-
- error = ex_get_var_names (exoid, "e", num_ele_vars, var_names);
- printf ("\nafter ex_get_var_names, error = %3d\n", error);
-
- printf ("There are %2d element variables; their names are :\n",
- num_ele_vars);
- for (i=0; i<num_ele_vars; i++)
- {
- printf (" '%s'\n", var_names[i]);
- free(var_names[i]);
- }
-
- /* read element variable truth table */
-
- if (num_ele_vars > 0) {
- truth_tab = (int *) calloc ((num_elem_blk*num_ele_vars), sizeof(int));
-
- error = ex_get_elem_var_tab (exoid, num_elem_blk, num_ele_vars, truth_tab);
- printf ("\nafter ex_get_elem_var_tab, error = %3d\n", error);
-
- printf ("This is the element variable truth table:\n");
-
- k = 0;
- for (i=0; i<num_elem_blk*num_ele_vars; i++)
- {
- printf ("%2d\n", truth_tab[k++]);
- }
- free (truth_tab);
-
- elem_varid = calloc((num_elem_blk*num_ele_vars), sizeof(int));
- error = ex_get_elem_varid(exoid, elem_varid);
- printf ("\nafter ex_get_elem_varid, error = %3d\n", error);
- }
- }
-
- /* determine how many time steps are stored */
-
- error = ex_inquire (exoid, EX_INQ_TIME, &num_time_steps, &fdum, cdum);
- printf ("\nafter ex_inquire, error = %3d\n", error);
- printf ("There are %2d time steps in the database.\n", num_time_steps);
-
- /* read time value at one time step */
-
- time_step = 3;
- error = ex_get_time (exoid, time_step, &time_value);
- printf ("\nafter ex_get_time, error = %3d\n", error);
-
- printf ("time value at time step %2d = %5.3f\n", time_step, time_value);
-
- /* read time values at all time steps */
-
- time_values = (float *) calloc (num_time_steps, sizeof(float));
-
- error = ex_get_all_times (exoid, time_values);
- printf ("\nafter ex_get_all_times, error = %3d\n", error);
-
- printf ("time values at all time steps are:\n");
- for (i=0; i<num_time_steps; i++) printf ("%5.3f\n", time_values[i]);
-
- free (time_values);
-
- /* read all global variables at one time step */
-
- var_values = (float *) calloc (num_glo_vars, sizeof(float));
-
- error = ex_get_glob_vars (exoid, time_step, num_glo_vars, var_values);
- printf ("\nafter ex_get_glob_vars, error = %3d\n", error);
-
- printf ("global variable values at time step %2d\n", time_step);
- for (i=0; i<num_glo_vars; i++) printf ("%5.3f\n", var_values[i]);
-
- free (var_values);
-
- /* read a single global variable through time */
-
- var_index = 1;
- beg_time = 1;
- end_time = -1;
-
- var_values = (float *) calloc (num_time_steps, sizeof(float));
-
- error = ex_get_glob_var_time (exoid, var_index, beg_time, end_time,
- var_values);
- printf ("\nafter ex_get_glob_var_time, error = %3d\n", error);
-
- printf ("global variable %2d values through time:\n", var_index);
- for (i=0; i<num_time_steps; i++) printf ("%5.3f\n", var_values[i]);
-
- free (var_values);
-
- /* read a nodal variable at one time step */
-
- if (num_nodes > 0) {
- var_values = (float *) calloc (num_nodes, sizeof(float));
-
- error = ex_get_nodal_varid_var(exoid, time_step, var_index, num_nodes,
- node_varid[var_index-1], var_values);
- printf ("\nafter ex_get_nodal_var, error = %3d\n", error);
-
- printf ("nodal variable %2d values at time step %2d\n", var_index,
- time_step);
- for (i=0; i<num_nodes; i++) printf ("%5.3f\n", var_values[i]);
-
- free (var_values);
-
- /* read a nodal variable through time */
-
- var_values = (float *) calloc (num_time_steps, sizeof(float));
-
- node_num = 1;
- error = ex_get_nodal_var_time (exoid, var_index, node_num, beg_time,
- end_time, var_values);
- printf ("\nafter ex_get_nodal_var_time, error = %3d\n", error);
-
- printf ("nodal variable %2d values for node %2d through time:\n", var_index,
- node_num);
- for (i=0; i<num_time_steps; i++) printf ("%5.3f\n", var_values[i]);
-
- free (var_values);
- }
- /* read an element variable at one time step */
-
- if (num_elem_blk > 0) {
- ids = (int *) calloc(num_elem_blk, sizeof(int));
-
- error = ex_get_elem_blk_ids (exoid, ids);
- printf ("\n after ex_get_elem_blk_ids, error = %3d\n", error);
-
- for (i=0; i<num_elem_blk; i++)
- {
- var_values = (float *) calloc (num_elem_in_block[i], sizeof(float));
-
- error = ex_get_varid_var(exoid, time_step, elem_varid[i*num_ele_vars+var_index-1],
- num_elem_in_block[i], var_values);
- printf ("\nafter ex_get_varid_var, error = %3d\n", error);
-
- if (!error)
- {
- printf
- ("element variable %2d values of element block %2d at time step %2d\n",
- var_index, ids[i], time_step);
- for (j=0; j<num_elem_in_block[i]; j++)
- printf ("%5.3f\n", var_values[j]);
- }
-
- free (var_values);
- }
- free (num_elem_in_block);
- free(ids);
- }
- free(elem_varid);
- free(node_varid);
- /* read an element variable through time */
-
- if (num_ele_vars > 0) {
- var_values = (float *) calloc (num_time_steps, sizeof(float));
-
- var_index = 2;
- elem_num = 2;
- error = ex_get_elem_var_time (exoid, var_index, elem_num, beg_time,
- end_time, var_values);
- printf ("\nafter ex_get_elem_var_time, error = %3d\n", error);
-
- printf ("element variable %2d values for element %2d through time:\n",
- var_index, elem_num);
- for (i=0; i<num_time_steps; i++) printf ("%5.3f\n", var_values[i]);
-
- free (var_values);
- }
-
- error = ex_close (exoid);
- printf ("\nafter ex_close, error = %3d\n", error);
- return 0;
-}
diff --git a/exodus/cbind/test/testrdv.dmp b/exodus/cbind/test/testrdv.dmp
deleted file mode 100644
index 80e9b57..0000000
--- a/exodus/cbind/test/testrdv.dmp
+++ /dev/null
@@ -1,929 +0,0 @@
-
-after ex_open
- I/O word size 4
-after ex_get_init, error = 0
-database parameters:
-title = 'This is a test'
-num_dim = 3
-num_nodes = 33
-num_elem = 7
-num_elem_blk = 7
-num_node_sets = 2
-num_side_sets = 5
-
-after ex_get_coord, error = 0
-x coords =
- 0.0
- 1.0
- 1.0
- 0.0
- 1.0
- 2.0
- 2.0
- 1.0
- 0.0
- 10.0
- 10.0
- 1.0
- 1.0
- 10.0
- 10.0
- 1.0
- 0.0
- 1.0
- 10.0
- 7.0
- 3.0
- 6.0
- 0.0
- 3.0
- 6.0
- 0.0
- 2.7
- 6.0
- 5.7
- 3.7
- 0.0
- 10.0
- 10.0
-y coords =
- 0.0
- 0.0
- 1.0
- 1.0
- 0.0
- 0.0
- 1.0
- 1.0
- 0.0
- 0.0
- 0.0
- 0.0
- 10.0
- 10.0
- 10.0
- 10.0
- 0.0
- 0.0
- 0.0
- 5.0
- 0.0
- 0.0
- 0.0
- 2.0
- 2.0
- 2.0
- 1.7
- 1.7
- 1.7
- 0.0
- 0.0
- 0.0
- 10.0
-z coords =
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
--10.0
--10.0
- 0.0
- 0.0
--10.0
--10.0
- 0.0
- 5.0
- 2.0
- 3.0
- 6.0
- 0.0
- 0.0
- 6.0
- 2.0
- 0.0
- 2.7
- 3.3
- 1.7
- 2.3
- 0.0
- 0.0
- 10.0
-
-after ex_get_coord_names, error = 0
-x coord name = 'xcoor'
-y coord name = 'ycoor'
-
-after ex_get_map, error = 0
-elem_map(0) = 1
-elem_map(1) = 2
-elem_map(2) = 3
-elem_map(3) = 4
-elem_map(4) = 5
-elem_map(5) = 6
-elem_map(6) = 7
-
-after ex_get_elem_blk_ids, error = 0
-
-after ex_get_elem_block, error = 0
-element block id = 10
-element type = 'quad'
-num_elem_in_block = 1
-num_nodes_per_elem = 4
-num_attr = 1
-
-after ex_get_elem_block, error = 0
-element block id = 11
-element type = 'quad'
-num_elem_in_block = 1
-num_nodes_per_elem = 4
-num_attr = 1
-
-after ex_get_elem_block, error = 0
-element block id = 12
-element type = 'hex'
-num_elem_in_block = 1
-num_nodes_per_elem = 8
-num_attr = 1
-
-after ex_get_elem_block, error = 0
-element block id = 13
-element type = 'tetra'
-num_elem_in_block = 1
-num_nodes_per_elem = 4
-num_attr = 1
-
-after ex_get_elem_block, error = 0
-element block id = 14
-element type = 'wedge'
-num_elem_in_block = 1
-num_nodes_per_elem = 6
-num_attr = 1
-
-after ex_get_elem_block, error = 0
-element block id = 15
-element type = 'tetra'
-num_elem_in_block = 1
-num_nodes_per_elem = 8
-num_attr = 1
-
-after ex_get_elem_block, error = 0
-element block id = 16
-element type = 'tri'
-num_elem_in_block = 1
-num_nodes_per_elem = 3
-num_attr = 1
-
-after ex_inquire, error = 0
-
-There are 3 properties for each element block
-after ex_get_prop_names, error = 0
-element block 1, property( 1): 'ID'= 10
-element block 2, property( 1): 'ID'= 11
-element block 3, property( 1): 'ID'= 12
-element block 4, property( 1): 'ID'= 13
-element block 5, property( 1): 'ID'= 14
-element block 6, property( 1): 'ID'= 15
-element block 7, property( 1): 'ID'= 16
-element block 1, property( 2): 'MATERIAL_PROPERTY_LONG_NAME_32CH'= 10
-element block 2, property( 2): 'MATERIAL_PROPERTY_LONG_NAME_32CH'= 20
-element block 3, property( 2): 'MATERIAL_PROPERTY_LONG_NAME_32CH'= 30
-element block 4, property( 2): 'MATERIAL_PROPERTY_LONG_NAME_32CH'= 40
-element block 5, property( 2): 'MATERIAL_PROPERTY_LONG_NAME_32CH'= 50
-element block 6, property( 2): 'MATERIAL_PROPERTY_LONG_NAME_32CH'= 60
-element block 7, property( 2): 'MATERIAL_PROPERTY_LONG_NAME_32CH'= 70
-element block 1, property( 3): 'DENSITY'= 0
-element block 2, property( 3): 'DENSITY'= 0
-element block 3, property( 3): 'DENSITY'= 0
-element block 4, property( 3): 'DENSITY'= 0
-element block 5, property( 3): 'DENSITY'= 0
-element block 6, property( 3): 'DENSITY'= 0
-element block 7, property( 3): 'DENSITY'= 0
-
-after ex_get_elem_conn, error = 0
-connect array for elem block 10
- 1
- 2
- 3
- 4
-
-after ex_get_elem_conn, error = 0
-connect array for elem block 11
- 5
- 6
- 7
- 8
-
-after ex_get_elem_conn, error = 0
-connect array for elem block 12
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
-
-after ex_get_elem_conn, error = 0
-connect array for elem block 13
- 17
- 18
- 19
- 20
-
-after ex_get_elem_conn, error = 0
-connect array for elem block 14
- 21
- 22
- 23
- 24
- 25
- 26
-
-after ex_get_elem_conn, error = 0
-connect array for elem block 15
- 17
- 18
- 19
- 20
- 27
- 28
- 30
- 29
-
-after ex_get_elem_conn, error = 0
-connect array for elem block 16
- 31
- 32
- 33
-
- after ex_get_elem_attr, error = 0
-element block 10 attributes = 3.1416
-
- after ex_get_elem_attr, error = 0
-element block 11 attributes = 6.1416
-
- after ex_get_elem_attr, error = 0
-element block 12 attributes = 6.1416
-
- after ex_get_elem_attr, error = 0
-element block 13 attributes = 6.1416
-
- after ex_get_elem_attr, error = 0
-element block 14 attributes = 6.1416
-
- after ex_get_elem_attr, error = 0
-element block 15 attributes = 6.1416
-
- after ex_get_elem_attr, error = 0
-element block 16 attributes = 6.1416
-
-after ex_get_node_set_ids, error = 0
-
-after ex_get_node_set_param, error = 0
-
-node set 20 parameters:
-num_nodes = 5
-
-after ex_get_node_set, error = 0
-
-after ex_get_node_set_dist_fact, error = 0
-
-node list for node set 20
-100
-101
-102
-103
-104
-dist factors for node set 20
- 1.00
- 2.00
- 3.00
- 4.00
- 5.00
-
-after ex_get_node_set_param, error = 0
-
-node set 21 parameters:
-num_nodes = 3
-
-after ex_get_node_set, error = 0
-
-after ex_get_node_set_dist_fact, error = 0
-
-node list for node set 21
-200
-201
-202
-dist factors for node set 21
- 1.10
- 2.10
- 3.10
-
-after ex_inquire, error = 0
-
-There are 3 properties for each node set
-after ex_get_prop_names, error = 0
-node set 1, property( 1): 'ID'= 20
-node set 2, property( 1): 'ID'= 21
-node set 1, property( 2): 'FACE'= 4
-node set 2, property( 2): 'FACE'= 5
-node set 1, property( 3): 'VELOCITY'= 1000
-node set 2, property( 3): 'VELOCITY'= 2000
-
-after ex_inquire, error = 0
-
-after ex_inquire: EX_INQ_NS_NODE_LEN = 8, error = 0
-
-after ex_inquire: EX_INQ_NS_DF_LEN = 8, error = 0
-
-after ex_get_concat_node_sets, error = 0
-
-concatenated node set info
-ids =
- 20
- 21
-num_nodes_per_set =
- 5
- 3
-node_ind =
- 0
- 5
-node_list =
-100
-101
-102
-103
-104
-200
-201
-202
-dist_fact =
-1.000
-2.000
-3.000
-4.000
-5.000
-1.100
-2.100
-3.100
-
-after ex_get_side_set_ids, error = 0
-
-after ex_get_side_set_param, error = 0
-side set 30 parameters:
-num_sides = 2
-num_dist_factors = 4
-
-after ex_get_side_set, error = 0
-
-after ex_get_side_set_node_list, error = 0
-
-after ex_get_side_set_dist_fact, error = 0
-element list for side set 30
- 2
- 2
-side list for side set 30
- 4
- 2
-node list for side set 30
- 8
- 5
- 6
- 7
-dist factors for side set 30
-30.000
-30.100
-30.200
-30.300
-
-after ex_get_side_set_param, error = 0
-side set 31 parameters:
-num_sides = 2
-num_dist_factors = 4
-
-after ex_get_side_set, error = 0
-
-after ex_get_side_set_node_list, error = 0
-
-after ex_get_side_set_dist_fact, error = 0
-element list for side set 31
- 1
- 2
-side list for side set 31
- 2
- 3
-node list for side set 31
- 2
- 3
- 7
- 8
-dist factors for side set 31
-31.000
-31.100
-31.200
-31.300
-
-after ex_get_side_set_param, error = 0
-side set 32 parameters:
-num_sides = 7
-num_dist_factors = 0
-
-after ex_get_side_set, error = 0
-
-after ex_get_side_set_node_list, error = 0
-element list for side set 32
- 3
- 3
- 3
- 3
- 3
- 3
- 3
-side list for side set 32
- 5
- 3
- 3
- 2
- 4
- 1
- 6
-node list for side set 32
- 9
- 12
- 11
- 10
- 11
- 12
- 16
- 15
- 11
- 12
- 16
- 15
- 10
- 11
- 15
- 14
- 9
- 13
- 16
- 12
- 9
- 10
- 14
- 13
- 13
- 14
- 15
- 16
-no dist factors for side set 32
-
-after ex_get_side_set_param, error = 0
-side set 33 parameters:
-num_sides = 8
-num_dist_factors = 0
-
-after ex_get_side_set, error = 0
-
-after ex_get_side_set_node_list, error = 0
-element list for side set 33
- 4
- 4
- 4
- 4
- 6
- 6
- 6
- 6
-side list for side set 33
- 1
- 2
- 3
- 4
- 1
- 2
- 3
- 4
-node list for side set 33
- 17
- 18
- 20
- 18
- 19
- 20
- 17
- 20
- 19
- 17
- 19
- 18
- 17
- 18
- 20
- 27
- 18
- 19
- 20
- 28
- 17
- 20
- 19
- 29
- 17
- 19
- 18
- 30
-no dist factors for side set 33
-
-after ex_get_side_set_param, error = 0
-side set 34 parameters:
-num_sides = 10
-num_dist_factors = 0
-
-after ex_get_side_set, error = 0
-
-after ex_get_side_set_node_list, error = 0
-element list for side set 34
- 5
- 5
- 5
- 5
- 5
- 7
- 7
- 7
- 7
- 7
-side list for side set 34
- 1
- 2
- 3
- 4
- 5
- 1
- 2
- 3
- 4
- 5
-node list for side set 34
- 21
- 22
- 25
- 24
- 22
- 23
- 26
- 25
- 21
- 24
- 26
- 23
- 21
- 23
- 22
- 24
- 25
- 26
- 31
- 32
- 33
- 33
- 32
- 31
- 31
- 32
- 32
- 33
- 33
- 31
-no dist factors for side set 34
-
-after ex_inquire, error = 0
-
-There are 2 properties for each side set
-after ex_get_prop_names, error = 0
-side set 1, property( 1): 'ID'= 30
-side set 2, property( 1): 'ID'= 31
-side set 3, property( 1): 'ID'= 32
-side set 4, property( 1): 'ID'= 33
-side set 5, property( 1): 'ID'= 34
-side set 1, property( 2): 'COLOR'= 100
-side set 2, property( 2): 'COLOR'= 101
-side set 3, property( 2): 'COLOR'= 0
-side set 4, property( 2): 'COLOR'= 0
-side set 5, property( 2): 'COLOR'= 0
-
-after ex_inquire: EX_INQ_SIDE_SETS = 5, error = 0
-
-after ex_inquire: EX_INQ_SS_ELEM_LEN = 29, error = 0
-
-after ex_inquire: EX_INQ_SS_NODE_LEN = 94, error = 0
-
-after ex_inquire: EX_INQ_SS_DF_LEN = 8, error = 0
-
-after ex_get_concat_side_sets, error = 0
-concatenated side set info
-ids =
- 30
- 31
- 32
- 33
- 34
-num_elem_per_set =
- 2
- 2
- 7
- 8
- 10
-num_dist_per_set =
- 4
- 4
- 0
- 0
- 0
-elem_ind =
- 0
- 2
- 4
- 11
- 19
-dist_ind =
- 0
- 4
- 8
- 8
- 8
-elem_list =
- 2
- 2
- 1
- 2
- 3
- 3
- 3
- 3
- 3
- 3
- 3
- 4
- 4
- 4
- 4
- 6
- 6
- 6
- 6
- 5
- 5
- 5
- 5
- 5
- 7
- 7
- 7
- 7
- 7
-side_list =
- 4
- 2
- 2
- 3
- 5
- 3
- 3
- 2
- 4
- 1
- 6
- 1
- 2
- 3
- 4
- 1
- 2
- 3
- 4
- 1
- 2
- 3
- 4
- 5
- 1
- 2
- 3
- 4
- 5
-dist_fact =
-30.000
-30.100
-30.200
-30.300
-31.000
-31.100
-31.200
-31.300
-
-after ex_get_qa, error = 0
-QA records =
- 'TESTWT'
- 'testwt'
- '07/07/93'
- '15:41:33'
- ''
- ''
- ''
- ''
-
-after ex_inquire, error = 0
-
-after ex_get_info, error = 0
-info records =
- 'This is the first information record.'
- ''
- ''
-
-after ex_get_var_param, error = 0
-
-after ex_get_var_names, error = 0
-There are 1 global variables; their names are :
- 'glo_vars'
-
-after ex_get_var_param, error = 0
-
-after ex_get_var_names, error = 0
-There are 2 nodal variables; their names are :
- 'node_variable_a_very_long_name_0'
- 'nod_var1'
-
-after ex_get_nodal_varid, error = 0
-
-after ex_get_var_param, error = 0
-
-after ex_get_var_names, error = 0
-There are 3 element variables; their names are :
- 'this_variable_name_is_short'
- 'this_variable_name_is_just_right'
- 'this_variable_name_is_tooooo_lon'
-
-after ex_get_elem_var_tab, error = 0
-This is the element variable truth table:
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
-
-after ex_get_elem_varid, error = 0
-
-after ex_inquire, error = 0
-There are 10 time steps in the database.
-
-after ex_get_time, error = 0
-time value at time step 3 = 0.030
-
-after ex_get_all_times, error = 0
-time values at all time steps are:
-0.010
-0.020
-0.030
-0.040
-0.050
-0.060
-0.070
-0.080
-0.090
-0.100
-
-after ex_get_glob_vars, error = 0
-global variable values at time step 3
-0.060
-
-after ex_get_glob_var_time, error = 0
-global variable 1 values through time:
-0.020
-0.040
-0.060
-0.080
-0.100
-0.120
-0.140
-0.160
-0.180
-0.200
-
-after ex_get_nodal_var, error = 0
-nodal variable 1 values at time step 3
-1.030
-1.060
-1.090
-1.120
-1.150
-1.180
-1.210
-1.240
-1.270
-1.300
-1.330
-1.360
-1.390
-1.420
-1.450
-1.480
-1.510
-1.540
-1.570
-1.600
-1.630
-1.660
-1.690
-1.720
-1.750
-1.780
-1.810
-1.840
-1.870
-1.900
-1.930
-1.960
-1.990
-
-after ex_get_nodal_var_time, error = 0
-nodal variable 1 values for node 1 through time:
-1.010
-1.020
-1.030
-1.040
-1.050
-1.060
-1.070
-1.080
-1.090
-1.100
-
- after ex_get_elem_blk_ids, error = 0
-
-after ex_get_varid_var, error = 0
-element variable 1 values of element block 10 at time step 3
-4.030
-
-after ex_get_varid_var, error = 0
-element variable 1 values of element block 11 at time step 3
-5.030
-
-after ex_get_varid_var, error = 0
-element variable 1 values of element block 12 at time step 3
-6.030
-
-after ex_get_varid_var, error = 0
-element variable 1 values of element block 13 at time step 3
-7.030
-
-after ex_get_varid_var, error = 0
-element variable 1 values of element block 14 at time step 3
-8.030
-
-after ex_get_varid_var, error = 0
-element variable 1 values of element block 15 at time step 3
-9.030
-
-after ex_get_varid_var, error = 0
-element variable 1 values of element block 16 at time step 3
-10.030
-
-after ex_get_elem_var_time, error = 0
-element variable 2 values for element 2 through time:
-6.010
-6.020
-6.030
-6.040
-6.050
-6.060
-6.070
-6.080
-6.090
-6.100
-
-after ex_close, error = 0
diff --git a/exodus/cbind/test/testwt-long-name.c b/exodus/cbind/test/testwt-long-name.c
index dba8a54..75432e0 100644
--- a/exodus/cbind/test/testwt-long-name.c
+++ b/exodus/cbind/test/testwt-long-name.c
@@ -80,7 +80,7 @@ int main (int argc, char **argv)
printf ("after ex_create for test.exo, exoid = %d\n", exoid);
printf (" cpu word size: %d io word size: %d\n",CPU_word_size,IO_word_size);
- ex_set_max_name_length(exoid, 127); /* Using long names */
+ ex_set_option(exoid, EX_OPT_MAX_NAME_LENGTH, 127); /* Using long names */
/* initialize file with parameters */
@@ -568,8 +568,8 @@ int main (int argc, char **argv)
exit(-1);
}
- node_list[0] = 100; node_list[1] = 101; node_list[2] = 102;
- node_list[3] = 103; node_list[4] = 104;
+ node_list[0] = 10; node_list[1] = 11; node_list[2] = 12;
+ node_list[3] = 13; node_list[4] = 14;
dist_fact[0] = 1.0; dist_fact[1] = 2.0; dist_fact[2] = 3.0;
dist_fact[3] = 4.0; dist_fact[4] = 5.0;
@@ -597,7 +597,7 @@ int main (int argc, char **argv)
exit(-1);
}
- node_list[0] = 200; node_list[1] = 201; node_list[2] = 202;
+ node_list[0] = 20; node_list[1] = 21; node_list[2] = 22;
dist_fact[0] = 1.1; dist_fact[1] = 2.1; dist_fact[2] = 3.1;
diff --git a/exodus/cbind/test/testwt-long-name.dmp b/exodus/cbind/test/testwt-long-name.dmp
index b4bd6fe..8a47141 100644
--- a/exodus/cbind/test/testwt-long-name.dmp
+++ b/exodus/cbind/test/testwt-long-name.dmp
@@ -188,6 +188,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 64 ;
data:
@@ -348,11 +349,11 @@ data:
eb_prop3 = _, _, _, _, _, _, _ ;
- node_ns1 = 100, 101, 102, 103, 104 ;
+ node_ns1 = 10, 11, 12, 13, 14 ;
dist_fact_ns1 = 1, 2, 3, 4, 5 ;
- node_ns2 = 200, 201, 202 ;
+ node_ns2 = 20, 21, 22 ;
dist_fact_ns2 = 1.1, 2.1, 3.1 ;
diff --git a/exodus/cbind/test/testwt-nface-nside.c b/exodus/cbind/test/testwt-nface-nside.c
index a70e861..9250c40 100644
--- a/exodus/cbind/test/testwt-nface-nside.c
+++ b/exodus/cbind/test/testwt-nface-nside.c
@@ -220,33 +220,6 @@ int main (int argc, char **argv)
connect[i++] = 5;
connect[i++] = 8;
connect[i++] = 7; /* connectivity of face 1 of element 2 */
- 1 3 4 # face 2 of element 2
-7 8 4 3 # face 3 of element 2
-7 3 1 5 # face 4 of element 2
-5 1 4 8 # face 5 of element 2 -- dup
-
-8 4 14 10 12 # connectivity of face 1 of element 3
-7 11 9 13 3 # face 2 of element 3
-7 8 12 11 # face 3 of element 3
-11 12 10 9 # face 4 of element 3
-9 10 14 13 # face 5 of element 3
-13 14 4 3 # face 6 of element 3
-7 3 4 8 # face 7 of element 3 -- dup
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
connect[i++] = 1; connect[i++] = 2; connect[i++] = 3; connect[i++] = 4;
nnpe[j++] = 4;
diff --git a/exodus/cbind/test/testwt-nfaced.dmp b/exodus/cbind/test/testwt-nfaced.dmp
index fce2533..005c1cb 100644
--- a/exodus/cbind/test/testwt-nfaced.dmp
+++ b/exodus/cbind/test/testwt-nfaced.dmp
@@ -47,6 +47,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
diff --git a/exodus/cbind/test/testwt-nsided.c b/exodus/cbind/test/testwt-nsided.c
index 0fa53ea..480d2a2 100644
--- a/exodus/cbind/test/testwt-nsided.c
+++ b/exodus/cbind/test/testwt-nsided.c
@@ -329,8 +329,8 @@ int main (int argc, char **argv)
exit(-1);
}
- node_list[0] = 100; node_list[1] = 101; node_list[2] = 102;
- node_list[3] = 103; node_list[4] = 104;
+ node_list[0] = 10; node_list[1] = 11; node_list[2] = 12;
+ node_list[3] = 13; node_list[4] = 14;
dist_fact[0] = 1.0; dist_fact[1] = 2.0; dist_fact[2] = 3.0;
dist_fact[3] = 4.0; dist_fact[4] = 5.0;
@@ -358,7 +358,7 @@ int main (int argc, char **argv)
exit(-1);
}
- node_list[0] = 200; node_list[1] = 201; node_list[2] = 202;
+ node_list[0] = 20; node_list[1] = 21; node_list[2] = 22;
dist_fact[0] = 1.1; dist_fact[1] = 2.1; dist_fact[2] = 3.1;
diff --git a/exodus/cbind/test/testwt-nsided.dmp b/exodus/cbind/test/testwt-nsided.dmp
index fe2bcb7..8be1fc8 100644
--- a/exodus/cbind/test/testwt-nsided.dmp
+++ b/exodus/cbind/test/testwt-nsided.dmp
@@ -122,6 +122,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
@@ -214,11 +215,11 @@ data:
ebepecnt1 = 4, 4, 8, 4, 6, 8, 3 ;
- node_ns1 = 100, 101, 102, 103, 104 ;
+ node_ns1 = 10, 11, 12, 13, 14 ;
dist_fact_ns1 = 1, 2, 3, 4, 5 ;
- node_ns2 = 200, 201, 202 ;
+ node_ns2 = 20, 21, 22 ;
dist_fact_ns2 = 1.1, 2.1, 3.1 ;
diff --git a/exodus/cbind/test/testwt-partial.c b/exodus/cbind/test/testwt-partial.c
index 81898cc..ac7f04d 100644
--- a/exodus/cbind/test/testwt-partial.c
+++ b/exodus/cbind/test/testwt-partial.c
@@ -591,8 +591,8 @@ int main (int argc, char **argv)
exit(-1);
}
- node_list[0] = 100; node_list[1] = 101; node_list[2] = 102;
- node_list[3] = 103; node_list[4] = 104;
+ node_list[0] = 10; node_list[1] = 11; node_list[2] = 12;
+ node_list[3] = 13; node_list[4] = 14;
dist_fact[0] = 1.0; dist_fact[1] = 2.0; dist_fact[2] = 3.0;
dist_fact[3] = 4.0; dist_fact[4] = 5.0;
@@ -620,7 +620,7 @@ int main (int argc, char **argv)
exit(-1);
}
- node_list[0] = 200; node_list[1] = 201; node_list[2] = 202;
+ node_list[0] = 20; node_list[1] = 21; node_list[2] = 22;
dist_fact[0] = 1.1; dist_fact[1] = 2.1; dist_fact[2] = 3.1;
diff --git a/exodus/cbind/test/testwt-zeroe.c b/exodus/cbind/test/testwt-zeroe.c
index 9ea69e4..6165ebb 100644
--- a/exodus/cbind/test/testwt-zeroe.c
+++ b/exodus/cbind/test/testwt-zeroe.c
@@ -199,8 +199,8 @@ int main (int argc, char **argv)
exit(-1);
}
- node_list[0] = 100; node_list[1] = 101; node_list[2] = 102;
- node_list[3] = 103; node_list[4] = 104;
+ node_list[0] = 10; node_list[1] = 11; node_list[2] = 12;
+ node_list[3] = 13; node_list[4] = 14;
dist_fact[0] = 1.0; dist_fact[1] = 2.0; dist_fact[2] = 3.0;
dist_fact[3] = 4.0; dist_fact[4] = 5.0;
@@ -228,7 +228,7 @@ int main (int argc, char **argv)
exit(-1);
}
- node_list[0] = 200; node_list[1] = 201; node_list[2] = 202;
+ node_list[0] = 20; node_list[1] = 21; node_list[2] = 22;
dist_fact[0] = 1.1; dist_fact[1] = 2.1; dist_fact[2] = 3.1;
diff --git a/exodus/cbind/test/testwt-zeroe.dmp b/exodus/cbind/test/testwt-zeroe.dmp
index b856f2e..1eb0a65 100644
--- a/exodus/cbind/test/testwt-zeroe.dmp
+++ b/exodus/cbind/test/testwt-zeroe.dmp
@@ -44,6 +44,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
@@ -72,11 +73,11 @@ data:
"ycoor",
"zcoor" ;
- node_ns1 = 100, 101, 102, 103, 104 ;
+ node_ns1 = 10, 11, 12, 13, 14 ;
dist_fact_ns1 = 1, 2, 3, 4, 5 ;
- node_ns2 = 200, 201, 202 ;
+ node_ns2 = 20, 21, 22 ;
dist_fact_ns2 = 1.1, 2.1, 3.1 ;
diff --git a/exodus/cbind/test/testwt-zeron.c b/exodus/cbind/test/testwt-zeron.c
index f75e412..fa83573 100644
--- a/exodus/cbind/test/testwt-zeron.c
+++ b/exodus/cbind/test/testwt-zeron.c
@@ -65,18 +65,15 @@
int main (int argc, char **argv)
{
int exoid, num_dim, num_nodes, num_elem, num_elem_blk;
- int num_elem_in_block[10], num_nodes_per_elem[10];
int num_node_sets, num_side_sets, error;
- int i, j, *elem_map;
- int ebids[10];
+ int i, j;
int num_qa_rec, num_info;
int num_glo_vars;
int whole_time_step, num_time_steps;
int CPU_word_size,IO_word_size;
- float *glob_var_vals, *nodal_var_vals, *elem_var_vals;
+ float *glob_var_vals;
float time_value;
- float x[100], y[100], z[100];
char *coord_names[3], *qa_record[2][4], *info[3], *var_names[3];
ex_opts (EX_VERBOSE | EX_ABORT );
@@ -99,10 +96,10 @@ int main (int argc, char **argv)
/* initialize file with parameters */
- num_dim = 3;
+ num_dim = 1;
num_nodes = 0;
num_elem = 0;
- num_elem_blk = 7;
+ num_elem_blk = 0;
num_node_sets = 0;
num_side_sets = 0;
@@ -116,66 +113,7 @@ int main (int argc, char **argv)
exit(-1);
}
-/* write nodal varcoordinates values and names to database */
-
-/* Quad #1 */
- x[0] = 0.0; y[0] = 0.0; z[0] = 0.0;
- x[1] = 1.0; y[1] = 0.0; z[1] = 0.0;
- x[2] = 1.0; y[2] = 1.0; z[2] = 0.0;
- x[3] = 0.0; y[3] = 1.0; z[3] = 0.0;
-
-/* Quad #2 */
- x[4] = 1.0; y[4] = 0.0; z[4] = 0.0;
- x[5] = 2.0; y[5] = 0.0; z[5] = 0.0;
- x[6] = 2.0; y[6] = 1.0; z[6] = 0.0;
- x[7] = 1.0; y[7] = 1.0; z[7] = 0.0;
-
-/* Hex #1 */
- x[8] = 0.0; y[8] = 0.0; z[8] = 0.0;
- x[9] = 10.0; y[9] = 0.0; z[9] = 0.0;
- x[10] = 10.0; y[10] = 0.0; z[10] =-10.0;
- x[11] = 1.0; y[11] = 0.0; z[11] =-10.0;
- x[12] = 1.0; y[12] = 10.0; z[12] = 0.0;
- x[13] = 10.0; y[13] = 10.0; z[13] = 0.0;
- x[14] = 10.0; y[14] = 10.0; z[14] =-10.0;
- x[15] = 1.0; y[15] = 10.0; z[15] =-10.0;
-
-/* Tetra #1 */
- x[16] = 0.0; y[16] = 0.0; z[16] = 0.0;
- x[17] = 1.0; y[17] = 0.0; z[17] = 5.0;
- x[18] = 10.0; y[18] = 0.0; z[18] = 2.0;
- x[19] = 7.0; y[19] = 5.0; z[19] = 3.0;
-
-/* Wedge #1 */
- x[20] = 3.0; y[20] = 0.0; z[20] = 6.0;
- x[21] = 6.0; y[21] = 0.0; z[21] = 0.0;
- x[22] = 0.0; y[22] = 0.0; z[22] = 0.0;
- x[23] = 3.0; y[23] = 2.0; z[23] = 6.0;
- x[24] = 6.0; y[24] = 2.0; z[24] = 2.0;
- x[25] = 0.0; y[25] = 2.0; z[25] = 0.0;
-
-/* Tetra #2 */
- x[26] = 2.7; y[26] = 1.7; z[26] = 2.7;
- x[27] = 6.0; y[27] = 1.7; z[27] = 3.3;
- x[28] = 5.7; y[28] = 1.7; z[28] = 1.7;
- x[29] = 3.7; y[29] = 0.0; z[29] = 2.3;
-
-/* 3d Tri */
- x[30] = 0.0; y[30] = 0.0; z[30] = 0.0;
- x[31] = 10.0; y[31] = 0.0; z[31] = 0.0;
- x[32] = 10.0; y[32] = 10.0; z[32] = 10.0;
-
- /* error = ex_put_coord (exoid, x, y, z); */
- printf ("after ex_put_coord, error = %d\n", error);
-
- if (error) {
- ex_close (exoid);
- exit(-1);
- }
-
coord_names[0] = "xcoor";
- coord_names[1] = "ycoor";
- coord_names[2] = "zcoor";
error = ex_put_coord_names (exoid, coord_names);
printf ("after ex_put_coord_names, error = %d\n", error);
@@ -185,115 +123,6 @@ int main (int argc, char **argv)
exit(-1);
}
-/* write element order map */
-
- elem_map = (int *) calloc(num_elem, sizeof(int));
-
- for (i=1; i<=num_elem; i++)
- {
- elem_map[i-1] = i;
- }
-
- error = ex_put_map (exoid, elem_map);
- printf ("after ex_put_map, error = %d\n", error);
-
- if (error) {
- ex_close (exoid);
- exit(-1);
- }
-
- free (elem_map);
-
-
-/* write element block parameters */
-
- num_elem_in_block[0] = 0;
- num_elem_in_block[1] = 0;
- num_elem_in_block[2] = 0;
- num_elem_in_block[3] = 0;
- num_elem_in_block[4] = 0;
- num_elem_in_block[5] = 0;
- num_elem_in_block[6] = 0;
-
- num_nodes_per_elem[0] = 4; /* elements in block #1 are 4-node quads */
- num_nodes_per_elem[1] = 4; /* elements in block #2 are 4-node quads */
- num_nodes_per_elem[2] = 8; /* elements in block #3 are 8-node hexes */
- num_nodes_per_elem[3] = 4; /* elements in block #4 are 4-node tetras */
- num_nodes_per_elem[4] = 6; /* elements in block #5 are 6-node wedges */
- num_nodes_per_elem[5] = 8; /* elements in block #6 are 8-node tetras */
- num_nodes_per_elem[6] = 3; /* elements in block #7 are 3-node tris */
-
- ebids[0] = 10;
- ebids[1] = 11;
- ebids[2] = 12;
- ebids[3] = 13;
- ebids[4] = 14;
- ebids[5] = 15;
- ebids[6] = 16;
-
- error = ex_put_elem_block (exoid, ebids[0], "quad", num_elem_in_block[0],
- num_nodes_per_elem[0], 1);
- printf ("after ex_put_elem_block, error = %d\n", error);
-
- if (error) {
- ex_close (exoid);
- exit(-1);
- }
-
- error = ex_put_elem_block (exoid, ebids[1], "quad", num_elem_in_block[1],
- num_nodes_per_elem[1], 1);
- printf ("after ex_put_elem_block, error = %d\n", error);
-
- if (error) {
- ex_close (exoid);
- exit(-1);
- }
-
- error = ex_put_elem_block (exoid, ebids[2], "hex", num_elem_in_block[2],
- num_nodes_per_elem[2], 1);
- printf ("after ex_put_elem_block, error = %d\n", error);
-
- if (error) {
- ex_close (exoid);
- exit(-1);
- }
-
- error = ex_put_elem_block (exoid, ebids[3], "tetra", num_elem_in_block[3],
- num_nodes_per_elem[3], 1);
- printf ("after ex_put_elem_block, error = %d\n", error);
-
- if (error) {
- ex_close (exoid);
- exit(-1);
- }
-
- error = ex_put_elem_block (exoid, ebids[4], "wedge", num_elem_in_block[4],
- num_nodes_per_elem[4], 1);
- printf ("after ex_put_elem_block, error = %d\n", error);
-
- if (error) {
- ex_close (exoid);
- exit(-1);
- }
-
- error = ex_put_elem_block (exoid, ebids[5], "tetra", num_elem_in_block[5],
- num_nodes_per_elem[5], 1);
- printf ("after ex_put_elem_block, error = %d\n", error);
-
- if (error) {
- ex_close (exoid);
- exit(-1);
- }
-
- error = ex_put_elem_block (exoid, ebids[6], "tri", num_elem_in_block[6],
- num_nodes_per_elem[6], 1);
- printf ("after ex_put_elem_block, error = %d\n", error);
-
- if (error) {
- ex_close (exoid);
- exit(-1);
- }
-
/* write QA records; test empty and just blank-filled records */
num_qa_rec = 2;
@@ -368,8 +197,6 @@ int main (int argc, char **argv)
num_time_steps = 10;
glob_var_vals = (float *) calloc (num_glo_vars, CPU_word_size);
- nodal_var_vals = (float *) calloc (num_nodes, CPU_word_size);
- elem_var_vals = (float *) calloc (4, CPU_word_size);
for (i=0; i<num_time_steps; i++)
{
@@ -414,8 +241,6 @@ int main (int argc, char **argv)
}
}
free(glob_var_vals);
- free(nodal_var_vals);
- free(elem_var_vals);
/* close the EXODUS files
diff --git a/exodus/cbind/test/testwt-zeron.dmp b/exodus/cbind/test/testwt-zeron.dmp
index 339348c..006c7ae 100644
--- a/exodus/cbind/test/testwt-zeron.dmp
+++ b/exodus/cbind/test/testwt-zeron.dmp
@@ -5,17 +5,12 @@ dimensions:
four = 4 ;
time_step = UNLIMITED ; // (10 currently)
len_name = 33 ;
- num_dim = 3 ;
- num_el_blk = 7 ;
+ num_dim = 1 ;
num_qa_rec = 2 ;
num_info = 3 ;
num_glo_var = 1 ;
variables:
float time_whole(time_step) ;
- int eb_status(num_el_blk) ;
- int eb_prop1(num_el_blk) ;
- eb_prop1:name = "ID" ;
- char eb_names(num_el_blk, len_name) ;
char coor_names(num_dim, len_name) ;
char qa_records(num_qa_rec, four, len_string) ;
char info_records(num_info, len_line) ;
@@ -25,29 +20,15 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
time_whole = 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1 ;
- eb_status = 0, 0, 0, 0, 0, 0, 0 ;
-
- eb_prop1 = 10, 11, 12, 13, 14, 15, 16 ;
-
- eb_names =
- "",
- "",
- "",
- "",
- "",
- "",
- "" ;
-
coor_names =
- "xcoor",
- "ycoor",
- "zcoor" ;
+ "xcoor" ;
qa_records =
"TESTWT",
diff --git a/exodus/cbind/test/testwt.c b/exodus/cbind/test/testwt.c
index fa7ef55..bff799a 100644
--- a/exodus/cbind/test/testwt.c
+++ b/exodus/cbind/test/testwt.c
@@ -586,8 +586,8 @@ int main (int argc, char **argv)
exit(-1);
}
- node_list[0] = 100; node_list[1] = 101; node_list[2] = 102;
- node_list[3] = 103; node_list[4] = 104;
+ node_list[0] = 10; node_list[1] = 11; node_list[2] = 12;
+ node_list[3] = 13; node_list[4] = 14;
dist_fact[0] = 1.0; dist_fact[1] = 2.0; dist_fact[2] = 3.0;
dist_fact[3] = 4.0; dist_fact[4] = 5.0;
@@ -615,7 +615,7 @@ int main (int argc, char **argv)
exit(-1);
}
- node_list[0] = 200; node_list[1] = 201; node_list[2] = 202;
+ node_list[0] = 20; node_list[1] = 21; node_list[2] = 22;
dist_fact[0] = 1.1; dist_fact[1] = 2.1; dist_fact[2] = 3.1;
diff --git a/exodus/cbind/test/testwt1.c b/exodus/cbind/test/testwt1.c
index ecc8130..7f6176c 100644
--- a/exodus/cbind/test/testwt1.c
+++ b/exodus/cbind/test/testwt1.c
@@ -436,8 +436,8 @@ int main (int argc, char **argv)
error = ex_put_node_set_param (exoid, 20, 5, 5);
printf ("after ex_put_node_set_param, error = %d\n", error);
- node_list[0] = 100; node_list[1] = 101; node_list[2] = 102;
- node_list[3] = 103; node_list[4] = 104;
+ node_list[0] = 10; node_list[1] = 11; node_list[2] = 12;
+ node_list[3] = 13; node_list[4] = 14;
dist_fact[0] = 1.0; dist_fact[1] = 2.0; dist_fact[2] = 3.0;
dist_fact[3] = 4.0; dist_fact[4] = 5.0;
@@ -450,7 +450,7 @@ int main (int argc, char **argv)
error = ex_put_node_set_param (exoid, 21, 3, 3);
printf ("after ex_put_node_set_param, error = %d\n", error);
- node_list[0] = 200; node_list[1] = 201; node_list[2] = 202;
+ node_list[0] = 20; node_list[1] = 21; node_list[2] = 22;
dist_fact[0] = 1.1; dist_fact[1] = 2.1; dist_fact[2] = 3.1;
@@ -486,9 +486,9 @@ int main (int argc, char **argv)
node_ind[0] = 0; node_ind[1] = 5;
- node_list[0] = 100; node_list[1] = 101; node_list[2] = 102;
- node_list[3] = 103; node_list[4] = 104;
- node_list[5] = 200; node_list[6] = 201; node_list[7] = 202;
+ node_list[0] = 10; node_list[1] = 11; node_list[2] = 12;
+ node_list[3] = 13; node_list[4] = 14;
+ node_list[5] = 20; node_list[6] = 21; node_list[7] = 22;
num_df_per_set[0] = 5; num_df_per_set[1] = 3;
@@ -582,68 +582,67 @@ int main (int argc, char **argv)
ids[5] = 35;
/* side set #1 - quad */
- node_list[0] = 8; node_list[1] = 5;
- node_list[2] = 6; node_list[3] = 7;
+ node_list[0] = 8; node_list[1] = 5; elem_list[0] = 3;
+ node_list[2] = 6; node_list[3] = 7; elem_list[1] = 3;
/* side set #2 - quad/hex, spanning 2 element types */
- node_list[4] = 2; node_list[5] = 3;
- node_list[6] = 7; node_list[7] = 8;
+ node_list[4] = 2; node_list[5] = 3; elem_list[2] = 1;
+ node_list[6] = 7; node_list[7] = 8; elem_list[3] = 3;
/* side set #3 - hex */
- node_list[8] = 9; node_list[9] = 12;
- node_list[10] = 11; node_list[11] = 10;
-
+ node_list[ 8] = 9; node_list[ 9] = 12;
+ node_list[10] = 11; node_list[11] = 10; elem_list[4] = 4;
node_list[12] = 11; node_list[13] = 12;
- node_list[14] = 16; node_list[15] = 15;
+ node_list[14] = 16; node_list[15] = 15; elem_list[5] = 4;
node_list[16] = 16; node_list[17] = 15;
- node_list[18] = 11; node_list[19] = 12;
+ node_list[18] = 11; node_list[19] = 12; elem_list[6] = 4;
node_list[20] = 10; node_list[21] = 11;
- node_list[22] = 15; node_list[23] = 14;
+ node_list[22] = 15; node_list[23] = 14; elem_list[7] = 4;
node_list[24] = 13; node_list[25] = 16;
- node_list[26] = 12; node_list[27] = 9;
+ node_list[26] = 12; node_list[27] = 9; elem_list[8] = 4;
node_list[28] = 14; node_list[29] = 13;
- node_list[30] = 9; node_list[31] = 10;
+ node_list[30] = 9; node_list[31] = 10; elem_list[9] = 4;
node_list[32] = 16; node_list[33] = 13;
- node_list[34] = 14; node_list[35] = 15;
+ node_list[34] = 14; node_list[35] = 15; elem_list[10] = 4;
/* side set #4 - tetras */
node_list[36] = 17; node_list[37] = 18;
- node_list[38] = 20;
+ node_list[38] = 20; elem_list[11] = 5;
node_list[39] = 18; node_list[40] = 19;
- node_list[41] = 20;
+ node_list[41] = 20; elem_list[12] = 5;
node_list[42] = 20; node_list[43] = 19;
- node_list[44] = 17;
+ node_list[44] = 17; elem_list[13] = 5;
node_list[45] = 19; node_list[46] = 18;
- node_list[47] = 17;
+ node_list[47] = 17; elem_list[14] = 5;
/* side set #5 - circle and sphere */
- node_list[48] = 21;
- node_list[49] = 22;
+ node_list[48] = 21; elem_list[15] = 6;
+ node_list[49] = 22; elem_list[16] = 7;
/* side set #6 - wedges */
node_list[50] = 27; node_list[51] = 26;
- node_list[52] = 23; node_list[53] = 24;
+ node_list[52] = 23; node_list[53] = 24; elem_list[17] = 8;
node_list[54] = 28; node_list[55] = 27;
- node_list[56] = 24; node_list[57] = 25;
+ node_list[56] = 24; node_list[57] = 25; elem_list[18] = 8;
node_list[58] = 28; node_list[59] = 25;
- node_list[60] = 23; node_list[61] = 26;
+ node_list[60] = 23; node_list[61] = 26; elem_list[19] = 8;
node_list[62] = 25; node_list[63] = 24;
- node_list[64] = 23;
+ node_list[64] = 23; elem_list[20] = 8;
node_list[65] = 26; node_list[66] = 27;
- node_list[67] = 28;
+ node_list[67] = 28; elem_list[21] = 8;
node_ind[0] = 0;
node_ind[1] = 4;
@@ -674,19 +673,6 @@ int main (int argc, char **argv)
elem_ind[4] = 15;
elem_ind[5] = 17;
- elem_list[0] = 3; elem_list[1] = 3; /* side set 1: Quad #2 */
- elem_list[2] = 1; elem_list[3] = 3; /* side set 2: Quad #1 & #2 */
- elem_list[4] = 4; elem_list[5] = 4; /* side set 3: Hex */
- elem_list[6] = 4; elem_list[7] = 4;
- elem_list[8] = 4; elem_list[9] = 4;
- elem_list[10] = 4;
- elem_list[11] = 5; elem_list[12] = 5; /* side set 4: Tetra */
- elem_list[13] = 5; elem_list[14] = 5;
- elem_list[15] = 6; elem_list[16] = 7; /* side set 5: Circle & Sphere */
- elem_list[17] = 8; elem_list[18] = 8; /* side set 6: Wedge */
- elem_list[19] = 8; elem_list[20] = 8;
- elem_list[21] = 8;
-
/* side set 0
side_list[0]= 4; side_list[1]= 2;*/
/* side set 1
diff --git a/exodus/cbind/test/testwt2.c b/exodus/cbind/test/testwt2.c
index a1c5b9d..9c60cb5 100644
--- a/exodus/cbind/test/testwt2.c
+++ b/exodus/cbind/test/testwt2.c
@@ -461,8 +461,8 @@ int main (int argc, char **argv)
error = ex_put_node_set_param (exoid, 20, 5, 5);
printf ("after ex_put_node_set_param, error = %d\n", error);
- node_list[0] = 100; node_list[1] = 101; node_list[2] = 102;
- node_list[3] = 103; node_list[4] = 104;
+ node_list[0] = 10; node_list[1] = 11; node_list[2] = 12;
+ node_list[3] = 13; node_list[4] = 14;
dist_fact[0] = 1.0; dist_fact[1] = 2.0; dist_fact[2] = 3.0;
dist_fact[3] = 4.0; dist_fact[4] = 5.0;
@@ -475,7 +475,7 @@ int main (int argc, char **argv)
error = ex_put_node_set_param (exoid, 21, 3, 3);
printf ("after ex_put_node_set_param, error = %d\n", error);
- node_list[0] = 200; node_list[1] = 201; node_list[2] = 202;
+ node_list[0] = 20; node_list[1] = 21; node_list[2] = 22;
dist_fact[0] = 1.1; dist_fact[1] = 2.1; dist_fact[2] = 3.1;
@@ -500,8 +500,8 @@ int main (int argc, char **argv)
error = ex_put_node_set_param (exoid2, 20, 5, 5);
printf ("after ex_put_node_set_param (2), error = %d\n", error);
- node_list2[0] = 100; node_list2[1] = 101; node_list2[2] = 102;
- node_list2[3] = 103; node_list2[4] = 104;
+ node_list2[0] = 10; node_list2[1] = 11; node_list2[2] = 12;
+ node_list2[3] = 13; node_list2[4] = 14;
dist_fact2[0] = 1.0; dist_fact2[1] = 2.0; dist_fact2[2] = 3.0;
dist_fact2[3] = 4.0; dist_fact2[4] = 5.0;
@@ -514,7 +514,7 @@ int main (int argc, char **argv)
error = ex_put_node_set_param (exoid2, 21, 3, 3);
printf ("after ex_put_node_set_param (2), error = %d\n", error);
- node_list2[0] = 200; node_list2[1] = 201; node_list2[2] = 202;
+ node_list2[0] = 20; node_list2[1] = 21; node_list2[2] = 22;
dist_fact2[0] = 1.1; dist_fact2[1] = 2.1; dist_fact2[2] = 3.1;
@@ -546,9 +546,9 @@ int main (int argc, char **argv)
node_ind[0] = 0; node_ind[1] = 5;
- node_list[0] = 100; node_list[1] = 101; node_list[2] = 102;
- node_list[3] = 103; node_list[4] = 104;
- node_list[5] = 200; node_list[6] = 201; node_list[7] = 202;
+ node_list[0] = 10; node_list[1] = 11; node_list[2] = 12;
+ node_list[3] = 13; node_list[4] = 14;
+ node_list[5] = 20; node_list[6] = 21; node_list[7] = 22;
num_df_per_set[0] = 5; num_df_per_set[1] = 3;
@@ -558,44 +558,25 @@ int main (int argc, char **argv)
dist_fact[3] = 4.0; dist_fact[4] = 5.0;
dist_fact[5] = 1.1; dist_fact[6] = 2.1; dist_fact[7] = 3.1;
+ prop_array[0] = 1000;
+ prop_array[1] = 2000;
+
error = ex_put_concat_node_sets (exoid, ids, num_nodes_per_set,
num_df_per_set, node_ind,
df_ind, node_list, dist_fact);
printf ("after ex_put_concat_node_sets, error = %d\n", error);
-
error = ex_put_prop(exoid, EX_NODE_SET, 20, "FACE", 4);
printf ("after ex_put_prop, error = %d\n", error);
error = ex_put_prop(exoid, EX_NODE_SET, 21, "FACE", 5);
printf ("after ex_put_prop, error = %d\n", error);
- prop_array[0] = 1000;
- prop_array[1] = 2000;
-
error = ex_put_prop_array(exoid, EX_NODE_SET, "VELOCITY", prop_array);
printf ("after ex_put_prop_array, error = %d\n", error);
- ids2[0] = 20; ids2[1] = 21;
-
- num_nodes_per_set2[0] = 5; num_nodes_per_set2[1] = 3;
-
- node_ind2[0] = 0; node_ind2[1] = 5;
-
- node_list2[0] = 100; node_list2[1] = 101; node_list2[2] = 102;
- node_list2[3] = 103; node_list2[4] = 104;
- node_list2[5] = 200; node_list2[6] = 201; node_list2[7] = 202;
-
- num_df_per_set2[0] = 5; num_df_per_set2[1] = 3;
-
- df_ind2[0] = 0; df_ind2[1] = 5;
-
- dist_fact2[0] = 1.0; dist_fact2[1] = 2.0; dist_fact2[2] = 3.0;
- dist_fact2[3] = 4.0; dist_fact2[4] = 5.0;
- dist_fact2[5] = 1.1; dist_fact2[6] = 2.1; dist_fact2[7] = 3.1;
-
- error = ex_put_concat_node_sets (exoid2, ids2, num_nodes_per_set2,
- num_df_per_set2, node_ind2,
- df_ind2, node_list2, dist_fact2);
+ error = ex_put_concat_node_sets (exoid2, ids, num_nodes_per_set,
+ num_df_per_set, node_ind,
+ df_ind, node_list, dist_fact);
printf ("after ex_put_concat_node_sets, error = %d\n", error);
@@ -604,11 +585,9 @@ int main (int argc, char **argv)
error = ex_put_prop(exoid2, EX_NODE_SET, 21, "FACE", 5);
printf ("after ex_put_prop, error = %d\n", error);
- prop_array2[0] = 1000;
- prop_array2[1] = 2000;
-
- error = ex_put_prop_array(exoid2, EX_NODE_SET, "VELOCITY", prop_array2);
+ error = ex_put_prop_array(exoid2, EX_NODE_SET, "VELOCITY", prop_array);
printf ("after ex_put_prop_array, error = %d\n", error);
+
#endif /* EX_TEST_INDIV_NODESET */
#ifdef EX_TEST_INDIV_SIDESET
diff --git a/exodus/cbind/test/testwt_clb.c b/exodus/cbind/test/testwt_clb.c
index 824f3d7..42ef824 100644
--- a/exodus/cbind/test/testwt_clb.c
+++ b/exodus/cbind/test/testwt_clb.c
@@ -85,7 +85,7 @@ int main (int argc, char **argv)
char *prop_names[2];
char *eb_type[10];
- ex_opts (EX_VERBOSE || EX_ABORT);
+ ex_opts (EX_VERBOSE|EX_ABORT);
/* Specify compute and i/o word size */
@@ -476,8 +476,8 @@ int main (int argc, char **argv)
exit(-1);
}
- node_list[0] = 100; node_list[1] = 101; node_list[2] = 102;
- node_list[3] = 103; node_list[4] = 104;
+ node_list[0] = 10; node_list[1] = 11; node_list[2] = 12;
+ node_list[3] = 13; node_list[4] = 14;
dist_fact[0] = 1.0; dist_fact[1] = 2.0; dist_fact[2] = 3.0;
dist_fact[3] = 4.0; dist_fact[4] = 5.0;
@@ -496,7 +496,7 @@ int main (int argc, char **argv)
exit(-1);
}
- node_list[0] = 200; node_list[1] = 201; node_list[2] = 202;
+ node_list[0] = 20; node_list[1] = 21; node_list[2] = 22;
dist_fact[0] = 1.1; dist_fact[1] = 2.1; dist_fact[2] = 3.1;
diff --git a/exodus/cbind/test/testwt_nc.c b/exodus/cbind/test/testwt_nc.c
index 22a4bbe..280a877 100644
--- a/exodus/cbind/test/testwt_nc.c
+++ b/exodus/cbind/test/testwt_nc.c
@@ -589,8 +589,8 @@ int main (int argc, char **argv)
exit(-1);
}
- node_list[0] = 100; node_list[1] = 101; node_list[2] = 102;
- node_list[3] = 103; node_list[4] = 104;
+ node_list[0] = 10; node_list[1] = 11; node_list[2] = 12;
+ node_list[3] = 13; node_list[4] = 14;
dist_fact[0] = 1.0; dist_fact[1] = 2.0; dist_fact[2] = 3.0;
dist_fact[3] = 4.0; dist_fact[4] = 5.0;
@@ -618,7 +618,7 @@ int main (int argc, char **argv)
exit(-1);
}
- node_list[0] = 200; node_list[1] = 201; node_list[2] = 202;
+ node_list[0] = 20; node_list[1] = 21; node_list[2] = 22;
dist_fact[0] = 1.1; dist_fact[1] = 2.1; dist_fact[2] = 3.1;
diff --git a/exodus/cbind/test/testwt_nossnsdf.c b/exodus/cbind/test/testwt_nossnsdf.c
index 96bef9f..575d016 100644
--- a/exodus/cbind/test/testwt_nossnsdf.c
+++ b/exodus/cbind/test/testwt_nossnsdf.c
@@ -82,15 +82,13 @@ int main (int argc, char **argv)
float *glob_var_vals, *nodal_var_vals, *elem_var_vals;
float time_value;
- float x[100], y[100], z[100], *dummy;
+ float x[100], y[100], z[100];
float attrib[100], dist_fact[100];
char *coord_names[3], *qa_record[2][4], *info[3], *var_names[3];
char *prop_names[2];
ex_opts (EX_VERBOSE | EX_ABORT);
- dummy = 0; /* assign this so the Cray compiler doesn't complain */
-
/* Specify compute and i/o word size */
CPU_word_size = 0; /* float or double */
@@ -389,8 +387,8 @@ int main (int argc, char **argv)
error = ex_put_node_set_param (exoid, 20, 5, 5);
printf ("after ex_put_node_set_param, error = %d\n", error);
- node_list[0] = 100; node_list[1] = 101; node_list[2] = 102;
- node_list[3] = 103; node_list[4] = 104;
+ node_list[0] = 10; node_list[1] = 11; node_list[2] = 12;
+ node_list[3] = 13; node_list[4] = 14;
dist_fact[0] = 1.0; dist_fact[1] = 2.0; dist_fact[2] = 3.0;
dist_fact[3] = 4.0; dist_fact[4] = 5.0;
@@ -403,7 +401,7 @@ int main (int argc, char **argv)
error = ex_put_node_set_param (exoid, 21, 3, 3);
printf ("after ex_put_node_set_param, error = %d\n", error);
- node_list[0] = 200; node_list[1] = 201; node_list[2] = 202;
+ node_list[0] = 20; node_list[1] = 21; node_list[2] = 22;
dist_fact[0] = 1.1; dist_fact[1] = 2.1; dist_fact[2] = 3.1;
@@ -439,9 +437,9 @@ int main (int argc, char **argv)
node_ind[0] = 0; node_ind[1] = 5;
- node_list[0] = 100; node_list[1] = 101; node_list[2] = 102;
- node_list[3] = 103; node_list[4] = 104;
- node_list[5] = 200; node_list[6] = 201; node_list[7] = 202;
+ node_list[0] = 10; node_list[1] = 11; node_list[2] = 12;
+ node_list[3] = 13; node_list[4] = 14;
+ node_list[5] = 20; node_list[6] = 21; node_list[7] = 22;
num_df_per_set[0] = 5; num_df_per_set[1] = 3;
diff --git a/exodus/cbind/test/testwt_ss.c b/exodus/cbind/test/testwt_ss.c
index 4edf631..cd40278 100644
--- a/exodus/cbind/test/testwt_ss.c
+++ b/exodus/cbind/test/testwt_ss.c
@@ -80,7 +80,7 @@ int main (int argc, char **argv)
float dist_fact[100];
char *coord_names[3], *qa_record[2][4], *info[3];
- ex_opts (EX_VERBOSE || EX_ABORT);
+ ex_opts (EX_VERBOSE|EX_ABORT);
/* Specify compute and i/o word size */
diff --git a/exodus/cbind/test/testwt_ss.dmp b/exodus/cbind/test/testwt_ss.dmp
index 4a8879d..cc71b72 100644
--- a/exodus/cbind/test/testwt_ss.dmp
+++ b/exodus/cbind/test/testwt_ss.dmp
@@ -118,6 +118,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
diff --git a/exodus/cbind/test/testwtbig.c b/exodus/cbind/test/testwtbig.c
index bf441df..193f8e6 100644
--- a/exodus/cbind/test/testwtbig.c
+++ b/exodus/cbind/test/testwtbig.c
@@ -295,8 +295,8 @@ int main (int argc, char **argv)
error = ex_put_node_set_param (exoid, 20, 5, 5);
printf ("after ex_put_node_set_param, error = %d\n", error);
- node_list[0] = 100; node_list[1] = 101; node_list[2] = 102;
- node_list[3] = 103; node_list[4] = 104;
+ node_list[0] = 10; node_list[1] = 11; node_list[2] = 12;
+ node_list[3] = 13; node_list[4] = 14;
dist_fact[0] = 1.0; dist_fact[1] = 2.0; dist_fact[2] = 3.0;
dist_fact[3] = 4.0; dist_fact[4] = 5.0;
@@ -309,7 +309,7 @@ int main (int argc, char **argv)
error = ex_put_node_set_param (exoid, 21, 3, 3);
printf ("after ex_put_node_set_param, error = %d\n", error);
- node_list[0] = 200; node_list[1] = 201; node_list[2] = 202;
+ node_list[0] = 20; node_list[1] = 21; node_list[2] = 22;
dist_fact[0] = 1.1; dist_fact[1] = 2.1; dist_fact[2] = 3.1;
@@ -342,9 +342,9 @@ int main (int argc, char **argv)
node_ind[0] = 0; node_ind[1] = 5;
- node_list[0] = 100; node_list[1] = 101; node_list[2] = 102;
- node_list[3] = 103; node_list[4] = 104;
- node_list[5] = 200; node_list[6] = 201; node_list[7] = 202;
+ node_list[0] = 10; node_list[1] = 11; node_list[2] = 12;
+ node_list[3] = 13; node_list[4] = 14;
+ node_list[5] = 20; node_list[6] = 21; node_list[7] = 22;
num_df_per_set[0] = 5; num_df_per_set[1] = 3;
diff --git a/exodus/cbind/test/testwtd.c b/exodus/cbind/test/testwtd.c
index 0dc23e9..35acdaf 100644
--- a/exodus/cbind/test/testwtd.c
+++ b/exodus/cbind/test/testwtd.c
@@ -303,8 +303,8 @@ int main (int argc, char **argv)
error = ex_put_node_set_param (exoid, 20, 5, 5);
printf ("after ex_put_node_set_param, error = %d\n", error);
- node_list[0] = 100; node_list[1] = 101; node_list[2] = 102;
- node_list[3] = 103; node_list[4] = 104;
+ node_list[0] = 10; node_list[1] = 11; node_list[2] = 12;
+ node_list[3] = 13; node_list[4] = 14;
dist_fact[0] = 1.0; dist_fact[1] = 2.0; dist_fact[2] = 3.0;
dist_fact[3] = 4.0; dist_fact[4] = 5.0;
@@ -317,7 +317,7 @@ int main (int argc, char **argv)
error = ex_put_node_set_param (exoid, 21, 3, 3);
printf ("after ex_put_node_set_param, error = %d\n", error);
- node_list[0] = 200; node_list[1] = 201; node_list[2] = 202;
+ node_list[0] = 20; node_list[1] = 21; node_list[2] = 22;
dist_fact[0] = 1.1; dist_fact[1] = 2.1; dist_fact[2] = 3.1;
diff --git a/exodus/cbind/test/testwtm.c b/exodus/cbind/test/testwtm.c
index f1cf47b..242bf19 100644
--- a/exodus/cbind/test/testwtm.c
+++ b/exodus/cbind/test/testwtm.c
@@ -294,6 +294,7 @@ int main (int argc, char **argv)
error = ex_put_elem_block (exoid, ebids[2], "hex", num_elem_in_block[2],
num_nodes_per_elem[2], 1);
+ printf ("after ex_put_elem_block, error = %d\n", error);
error = ex_put_elem_block (exoid, ebids[3], "tetra", num_elem_in_block[3],
num_nodes_per_elem[3], 1);
@@ -493,8 +494,8 @@ int main (int argc, char **argv)
error = ex_put_node_set_param (exoid, 20, 5, 5);
printf ("after ex_put_node_set_param, error = %d\n", error);
- node_list[0] = 100; node_list[1] = 101; node_list[2] = 102;
- node_list[3] = 103; node_list[4] = 104;
+ node_list[0] = 10; node_list[1] = 11; node_list[2] = 12;
+ node_list[3] = 13; node_list[4] = 14;
dist_fact[0] = 1.0; dist_fact[1] = 2.0; dist_fact[2] = 3.0;
dist_fact[3] = 4.0; dist_fact[4] = 5.0;
@@ -507,7 +508,7 @@ int main (int argc, char **argv)
error = ex_put_node_set_param (exoid, 21, 3, 3);
printf ("after ex_put_node_set_param, error = %d\n", error);
- node_list[0] = 200; node_list[1] = 201; node_list[2] = 202;
+ node_list[0] = 20; node_list[1] = 21; node_list[2] = 22;
dist_fact[0] = 1.1; dist_fact[1] = 2.1; dist_fact[2] = 3.1;
@@ -534,8 +535,8 @@ int main (int argc, char **argv)
error = ex_put_node_set_param (exoidm[n], 20, 5, 5);
printf ("after ex_put_node_set_param (%d), error = %d\n", n, error);
- node_list2[0] = 100; node_list2[1] = 101; node_list2[2] = 102;
- node_list2[3] = 103; node_list2[4] = 104;
+ node_list2[0] = 10; node_list2[1] = 11; node_list2[2] = 12;
+ node_list2[3] = 13; node_list2[4] = 14;
dist_fact2[0] = 1.0; dist_fact2[1] = 2.0; dist_fact2[2] = 3.0;
dist_fact2[3] = 4.0; dist_fact2[4] = 5.0;
@@ -548,7 +549,7 @@ int main (int argc, char **argv)
error = ex_put_node_set_param (exoidm[n], 21, 3, 3);
printf ("after ex_put_node_set_param (%d), error = %d\n", n, error);
- node_list2[0] = 200; node_list2[1] = 201; node_list2[2] = 202;
+ node_list2[0] = 20; node_list2[1] = 21; node_list2[2] = 22;
dist_fact2[0] = 1.1; dist_fact2[1] = 2.1; dist_fact2[2] = 3.1;
@@ -581,9 +582,9 @@ int main (int argc, char **argv)
node_ind[0] = 0; node_ind[1] = 5;
- node_list[0] = 100; node_list[1] = 101; node_list[2] = 102;
- node_list[3] = 103; node_list[4] = 104;
- node_list[5] = 200; node_list[6] = 201; node_list[7] = 202;
+ node_list[0] = 10; node_list[1] = 11; node_list[2] = 12;
+ node_list[3] = 13; node_list[4] = 14;
+ node_list[5] = 20; node_list[6] = 21; node_list[7] = 22;
num_df_per_set[0] = 5; num_df_per_set[1] = 3;
@@ -614,9 +615,9 @@ int main (int argc, char **argv)
node_ind2[0] = 0; node_ind2[1] = 5;
- node_list2[0] = 100; node_list2[1] = 101; node_list2[2] = 102;
- node_list2[3] = 103; node_list2[4] = 104;
- node_list2[5] = 200; node_list2[6] = 201; node_list2[7] = 202;
+ node_list2[0] = 10; node_list2[1] = 11; node_list2[2] = 12;
+ node_list2[3] = 13; node_list2[4] = 14;
+ node_list2[5] = 20; node_list2[6] = 21; node_list2[7] = 22;
num_df_per_set2[0] = 5; num_df_per_set2[1] = 3;
diff --git a/exodus/cbind/test/twod.c b/exodus/cbind/test/twod.c
new file mode 100644
index 0000000..1fe69d3
--- /dev/null
+++ b/exodus/cbind/test/twod.c
@@ -0,0 +1,378 @@
+/*
+ * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
+ * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
+ * retains certain rights in this software.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * * Neither the name of Sandia Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include "exodusII.h"
+
+int main (int argc, char **argv)
+{
+ int num_glo_vars = 10;
+ int num_nod_vars = 2;
+ int CPU_word_size = 8;
+ int IO_word_size = 8;
+ const char* title = "This is a 2D mesh example with tri, quad, beam, truss, circle";
+ int ebids[] = {100, 200, 300, 400, 500};
+ int num_dim = 2;
+ int num_nodes = 13;
+ int num_elem = 20;
+ int num_elem_blk = 5;
+ int num_node_sets = 2;
+ int num_side_sets = 2;
+
+ /* create EXODUS II file */
+ int exoid = ex_create ("twod.e", /* filename path */
+ EX_CLOBBER, /* create mode */
+ &CPU_word_size, /* CPU float word size in bytes */
+ &IO_word_size); /* I/O float word size in bytes */
+
+ ex_opts(EX_VERBOSE);
+
+ /* initialize file with parameters */
+ ex_put_init (exoid, title, num_dim, num_nodes, num_elem,
+ num_elem_blk, num_node_sets, num_side_sets);
+
+ /* write nodal coordinates values and names to database */
+ {
+ double x[13], y[13];
+ x[0] = 0.0; y[0] = 0.0;
+ x[1] = -0.5; y[1] = -0.5;
+ x[2] = 0.5; y[2] = -0.5;
+ x[3] = 0.5; y[3] = 0.5;
+ x[4] = -0.5; y[4] = 0.5;
+ x[5] = -1.0; y[5] = -1.0;
+ x[6] = 1.0; y[6] = -1.0;
+ x[7] = 1.0; y[7] = 1.0;
+ x[8] = -1.0; y[8] = 1.0;
+ x[9] = -2.0; y[9] = 0.0;
+ x[10] = 0.0; y[10] = -2.0;
+ x[11] = 2.0; y[11] = 0.0;
+ x[12] = 0.0; y[12] = 2.0;
+
+ ex_put_coord (exoid, x, y, 0);
+ }
+
+ {
+ const char* coord_names[] = {"xcoor", "ycoor"};
+ ex_put_coord_names (exoid, (char**)coord_names);
+ }
+
+
+ {
+ int node_map[] = {10,20,30,40,50,60,70,80,90,100,110,120,130};
+ ex_put_node_num_map(exoid, node_map);
+ }
+
+ /* write element order map */
+ {
+ int elem_map[] = {11,21,31,41, 52, 62, 72, 82, 93,103,113,123,133,143,153,163, 174,184,194,204};
+ ex_put_elem_num_map (exoid, elem_map);
+ }
+
+ /* write element block parameters */
+ {
+ const char* block_names[] = {"Triangles", "Quadrilaterals", "", "Trusses", "Circles"};
+ int num_elem_in_block[] = {4, 4, 4, 4, 4};
+ int num_nodes_per_elem[] = {3, 4, 2, 2, 1};
+
+ ex_put_elem_block (exoid, ebids[0], "triangle", num_elem_in_block[0], num_nodes_per_elem[0], 0);
+ ex_put_elem_block (exoid, ebids[1], "quad", num_elem_in_block[1], num_nodes_per_elem[1], 0);
+ ex_put_elem_block (exoid, ebids[2], "beam", num_elem_in_block[2], num_nodes_per_elem[2], 3);
+ ex_put_elem_block (exoid, ebids[3], "truss", num_elem_in_block[3], num_nodes_per_elem[3], 1);
+ ex_put_elem_block (exoid, ebids[4], "circle", num_elem_in_block[4], num_nodes_per_elem[4], 2);
+
+ /* Write element block names */
+ ex_put_names(exoid, EX_ELEM_BLOCK, (char**)block_names);
+ }
+
+ /* write element connectivity */
+ {
+ int conn_t[] = {2,3,1, 3,4,1, 4,5,1, 5,2,1};
+ int conn_q[] = {6,7,3,2, 7,8,4,3, 8,9,5,4, 9,6,2,5};
+ int conn_B[] = {11,7, 8,13, 13,9, 6,11};
+ int conn_T[] = {10,6, 9,10, 7,12, 12,8};
+ int conn_c[] = {6,7,8,9};
+
+ ex_put_elem_conn (exoid, ebids[0], conn_t);
+ ex_put_elem_conn (exoid, ebids[1], conn_q);
+ ex_put_elem_conn (exoid, ebids[2], conn_B);
+ ex_put_elem_conn (exoid, ebids[3], conn_T);
+ ex_put_elem_conn (exoid, ebids[4], conn_c);
+ }
+
+ /* write element block attributes */
+ {
+ const char* attn_T[] = {"Area"};
+ double attr_T[] = {1.0, 1.1, 1.2, 1.3};
+
+ const char* attn_B[] = {"A", "I", "J"};
+ double attr_B[] = {1.0, 100.0, 200.0, 1.1, 100.1, 200.1, 1.2, 100.2, 200.2, 1.3, 100.3, 200.3};
+
+ const char* attn_c[] = {"Radius", "A"};
+ double attr_c[] = {1.0, 3.14, 1.1, 4.14, 1.2, 5.14, 1.3, 6.14};
+
+ ex_put_elem_attr (exoid, ebids[2], attr_B);
+ ex_put_elem_attr (exoid, ebids[3], attr_T);
+ ex_put_elem_attr (exoid, ebids[4], attr_c);
+
+ ex_put_elem_attr_names (exoid, ebids[2], (char**)attn_B);
+ ex_put_elem_attr_names (exoid, ebids[3], (char**)attn_T);
+ ex_put_elem_attr_names (exoid, ebids[4], (char**)attn_c);
+ }
+
+ /* write individual node sets */
+ {
+ int num_nodes_in_nset[] = {5, 8};
+ int nsids[] = {20, 22};
+ int nod1[] = {5,4,3,2,1};
+ int nod2[] = {6,7,8,9,2,3,4,5};
+ const char* nset_names[] = {"Triangle_Nodes", "Quadrilateral_Nodes"};
+
+ ex_put_set_param (exoid, EX_NODE_SET, nsids[0], num_nodes_in_nset[0], 0);
+ ex_put_set_param (exoid, EX_NODE_SET, nsids[1], num_nodes_in_nset[1], 0);
+
+ ex_put_set (exoid, EX_NODE_SET, nsids[0], nod1, 0);
+ ex_put_set (exoid, EX_NODE_SET, nsids[1], nod2, 0);
+ ex_put_names(exoid, EX_NODE_SET, (char**)nset_names);
+ }
+
+ {
+ /* write individual side sets */
+ int num_face_in_sset[] = {4,4};
+ int ssids[] = {100,200};
+ int ss1el[] = {1,2,3,4};
+ int ss1si[] = {1,1,1,1};
+
+ int ss2el[] = {5,7,6,8};
+ int ss2si[] = {1,1,1,1};
+ const char* sset_names[] = {"A", "B"};
+
+ ex_put_set_param (exoid, EX_SIDE_SET, ssids[0], num_face_in_sset[0], 0);
+ ex_put_set_param (exoid, EX_SIDE_SET, ssids[1], num_face_in_sset[1], 0);
+
+ ex_put_set (exoid, EX_SIDE_SET, ssids[0], ss1el, ss1si);
+ ex_put_set (exoid, EX_SIDE_SET, ssids[1], ss2el, ss2si);
+ ex_put_names(exoid, EX_SIDE_SET, (char**)sset_names);
+ }
+
+
+ /* write results variables parameters and names */
+ {
+ const char* gvarn[] = {"g_01", "g_02", "g_03", "g_04", "g_05", "g_06", "g_07", "g_08", "g_09", "g_10"};
+ ex_put_variable_param (exoid, EX_GLOBAL, num_glo_vars);
+ ex_put_variable_names (exoid, EX_GLOBAL, num_glo_vars, (char**)gvarn);
+ }
+
+ {
+ const char* nvarn[] = {"disp_x", "disp_y"};
+ ex_put_variable_param (exoid, EX_NODAL, num_nod_vars);
+ ex_put_variable_names (exoid, EX_NODAL, num_nod_vars, (char**)nvarn);
+ }
+
+
+#if 0
+ num_ele_vars = 3;
+ /* 0 1 2 3 */
+ /* 12345678901234567890123456789012 */
+ var_names[0] = "this_variable_name_is_short";
+ var_names[1] = "this_variable_name_is_just_right";
+ var_names[2] = "this_variable_name_is_tooooo_long";
+
+ ex_put_var_param (exoid, "e", num_ele_vars);
+ printf ("after ex_put_var_param, %d\n", error);
+ if (error) {
+ ex_close (exoid);
+ exit(-1);
+ }
+
+ ex_put_var_names (exoid, "e", num_ele_vars, var_names);
+ printf ("after ex_put_var_names, %d\n", error);
+ if (error) {
+ ex_close (exoid);
+ exit(-1);
+ }
+
+ {
+ num_nset_vars = 3;
+
+ var_names[0] = "ns_var0";
+ var_names[1] = "ns_var1";
+ var_names[2] = "ns_var2";
+
+ ex_put_var_param (exoid, "m", num_nset_vars);
+ printf ("after ex_put_var_param, %d\n", error);
+ if (error) {
+ ex_close (exoid);
+ exit(-1);
+ }
+
+ ex_put_var_names (exoid, "m", num_nset_vars, var_names);
+ printf ("after ex_put_var_names, %d\n", error);
+ if (error) {
+ ex_close (exoid);
+ exit(-1);
+ }
+ }
+
+ {
+ num_sset_vars = 3;
+
+ var_names[0] = "ss_var0";
+ var_names[1] = "ss_var1";
+ var_names[2] = "ss_var2";
+
+ ex_put_var_param (exoid, "s", num_sset_vars);
+ printf ("after ex_put_var_param, %d\n", error);
+ if (error) {
+ ex_close (exoid);
+ exit(-1);
+ }
+
+ ex_put_var_names (exoid, "s", num_sset_vars, var_names);
+ printf ("after ex_put_var_names, %d\n", error);
+ if (error) {
+ ex_close (exoid);
+ exit(-1);
+ }
+ }
+#endif
+
+ /* for each time step, write the analysis results;
+ * the code below fills the arrays glob_var_vals,
+ * nodal_var_vals, and elem_var_vals with values for debugging purposes;
+ * obviously the analysis code will populate these arrays
+ */
+
+ {
+ int i, j, k;
+ int whole_time_step = 1;
+ int num_time_steps = 10;
+
+ double gvar[10];
+ double nvar[20];
+
+ for (i=0; i<num_time_steps; i++) {
+ double time_value = (double)(i)/100.;
+
+ ex_put_time (exoid, whole_time_step, &time_value);
+
+ for (j=0; j<num_glo_vars; j++) {
+ gvar[j] = (double)(j+2) * time_value;
+ }
+ ex_put_glob_vars (exoid, whole_time_step, num_glo_vars, gvar);
+
+ /* write nodal variables */
+ for (k=0; k < num_nod_vars; k++) {
+ for (j=0; j<num_nodes; j++) {
+ nvar[j] = (double)k + ((double)(j+1) * time_value);
+ }
+
+ ex_put_nodal_var (exoid, whole_time_step, k+1, num_nodes, nvar);
+ }
+
+#if 0
+/* write element variables */
+
+ for (k=1; k<=num_ele_vars; k++)
+ {
+ for (j=0; j<num_elem_blk; j++)
+ {
+ for (m=0; m<num_elem_in_block[j]; m++)
+ {
+ elem_var_vals[m] = (float)(k+1) + (float)(j+2) +
+ ((float)(m+1)*time_value);
+ /* printf("elem_var_vals[%d]: %f\n",m,elem_var_vals[m]); */
+ }
+ ex_put_elem_var (exoid, whole_time_step, k, ebids[j],
+ num_elem_in_block[j], elem_var_vals);
+ printf ("after ex_put_elem_var, %d\n", error);
+ if (error) {
+ ex_close (exoid);
+ exit(-1);
+ }
+ }
+ }
+
+/* write sideset variables */
+
+ for (k=1; k<=num_sset_vars; k++)
+ {
+ for (j=0; j<num_side_sets; j++)
+ {
+ for (m=0; m<num_face_in_sset[j]; m++)
+ {
+ sset_var_vals[m] = (float)(k+2) + (float)(j+3) +
+ ((float)(m+1)*time_value);
+ /* printf("sset_var_vals[%d]: %f\n",m,sset_var_vals[m]); */
+ }
+ ex_put_sset_var (exoid, whole_time_step, k, ssids[j],
+ num_face_in_sset[j], sset_var_vals);
+ printf ("after ex_put_sset_var, %d\n", error);
+ if (error) {
+ ex_close (exoid);
+ exit(-1);
+ }
+ }
+ }
+
+/* write nodeset variables */
+
+ for (k=1; k<=num_nset_vars; k++)
+ {
+ for (j=0; j<num_node_sets; j++)
+ {
+ for (m=0; m<num_nodes_in_nset[j]; m++)
+ {
+ nset_var_vals[m] = (float)(k+3) + (float)(j+4) +
+ ((float)(m+1)*time_value);
+ /* printf("nset_var_vals[%d]: %f\n",m,nset_var_vals[m]); */
+ }
+ ex_put_nset_var (exoid, whole_time_step, k, nsids[j],
+ num_nodes_in_nset[j], nset_var_vals);
+ printf ("after ex_put_nset_var, %d\n", error);
+ if (error) {
+ ex_close (exoid);
+ exit(-1);
+ }
+ }
+ }
+#endif
+
+ whole_time_step++;
+ }
+ }
+ ex_close (exoid);
+ return 0;
+}
diff --git a/exodus/cbind/test/testall b/exodus/cbind/test/update_all_tests
old mode 100755
new mode 100644
similarity index 61%
rename from exodus/cbind/test/testall
rename to exodus/cbind/test/update_all_tests
index 17099e3..08041aa
--- a/exodus/cbind/test/testall
+++ b/exodus/cbind/test/update_all_tests
@@ -38,196 +38,194 @@
#set PREFIX = "valgrind --tool=memcheck"
set PREFIX = ""
-set SUFFIX = ""
-set BINDIR = /Users/gdsjaar/src/exodusii-sf/exodus/cbind/test
-set SRCDIR = /Users/gdsjaar/src/exodusii-sf/exodus/cbind/test
-set NCDUMP = /Users/gdsjaar/src/SEACAS.git/bin/ncdump
+set SRCDIR = .
+set NCDUMP = /Users/gdsjaar/src/SEACAS/bin/ncdump
echo "************************************************************************"
echo "************************************************************************"
rm -f test.output
echo "testwt - single precision write test..."
echo "begin testwt" > test.output
-${PREFIX} ${BINDIR}/testwt${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testwt >> test.output
echo "end testwt" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test.dmp | tee testwt.res
+${NCDUMP} -d5,5 test.exo | grep -v version > ${SRCDIR}/test.dmp
echo "testrd - single precision read test..."
echo "begin testrd" >> test.output
-${PREFIX} ${BINDIR}/testrd${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd.dmp | tee testrd.res
+${PREFIX} ${SRCDIR}/testrd | grep -v version > ${SRCDIR}/testrd.dmp
echo "end testrd" >> test.output
echo "testrdv - single precision read test with varid..."
echo "begin testrdv" >> test.output
-${PREFIX} ${BINDIR}/testrdv${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrdv.dmp | tee testrdv.res
+${PREFIX} ${SRCDIR}/testrdv | grep -v version > ${SRCDIR}/testrdv.dmp
echo "end testrdv" >> test.output
echo "testcp_ss - single-to-single precision copy test..."
echo "begin testcp_ss" >> test.output
-${PREFIX} ${BINDIR}/testcp${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testcp >> test.output
echo "end testcp_ss" >> test.output
-${NCDUMP} -d5,5 testcp.exo | grep -v version | diff - ${SRCDIR}/testcp_ss.dmp | tee testcp_ss.res
+${NCDUMP} -d5,5 testcp.exo | grep -v version > ${SRCDIR}/testcp_ss.dmp
echo "testcp_sd - single-to-double precision copy test..."
echo "begin testcp_sd" >> test.output
-${PREFIX} ${BINDIR}/testcpd${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testcpd >> test.output
echo "end testcp_sd" >> test.output
-${NCDUMP} -d5,5 testcpd.exo | grep -v version | diff - ${SRCDIR}/testcp_sd.dmp | tee testcp_sd.res
+${NCDUMP} -d5,5 testcpd.exo | grep -v version > ${SRCDIR}/testcp_sd.dmp
echo "testcp_ln - large model to normal model single precision copy test..."
echo "begin testcp_ln" >> test.output
-${PREFIX} ${BINDIR}/testcp_ln${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testcp_ln >> test.output
echo "end testcp_ln" >> test.output
-${NCDUMP} -d5,5 testcp.exo | grep -v version | diff - ${SRCDIR}/testcp_ln.dmp | tee testcp_ln.res
+${NCDUMP} -d5,5 testcp.exo | grep -v version > ${SRCDIR}/testcp_ln.dmp
echo "testcp_nl - normal_model to large_model single precision copy test..."
echo "begin testcp_nl" >> test.output
-${PREFIX} ${BINDIR}/testcp_nl${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testcp_nl >> test.output
echo "end testcp_nl" >> test.output
-${NCDUMP} -d5,5 testcp_nl.exo | grep -v version | diff - ${SRCDIR}/testcp_nl.dmp | tee testcp_nl.res
+${NCDUMP} -d5,5 testcp_nl.exo | grep -v version > ${SRCDIR}/testcp_nl.dmp
echo "testwt_clb - single precision write test using concatenated puts..."
echo "begin testwt_clb" >> test.output
-${PREFIX} ${BINDIR}/testwt_clb${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testwt_clb >> test.output
echo "end testwt_clb" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test_clb.dmp | tee testwt_clb.res
+${NCDUMP} -d5,5 test.exo | grep -v version > ${SRCDIR}/test_clb.dmp
echo "testwtd - double precision write test..."
echo "begin testwtd" >> test.output
-${PREFIX} ${BINDIR}/testwtd${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testwtd >> test.output
echo "end testwtd" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/testd.dmp | tee testwtd.res
+${NCDUMP} -d5,5 test.exo | grep -v version > ${SRCDIR}/testd.dmp
echo "testrdd - double precision read test..."
echo "begin testrdd" >> test.output
-${PREFIX} ${BINDIR}/testrdd${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrdd.dmp | tee testrdd.res
+${PREFIX} ${SRCDIR}/testrdd | grep -v version >- ${SRCDIR}/testrdd.dmp
echo "end testrdd" >> test.output
echo "testcp_dd - double-to-double precision copy test..."
echo "begin testcp_dd" >> test.output
-${PREFIX} ${BINDIR}/testcpd${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testcpd >> test.output
echo "end testcp_dd" >> test.output
-${NCDUMP} -d5,5 testcpd.exo | grep -v version | diff - ${SRCDIR}/testcp_dd.dmp | tee testcp_dd.res
+${NCDUMP} -d5,5 testcpd.exo | grep -v version > ${SRCDIR}/testcp_dd.dmp
echo "testcp_ds - double-to-single precision copy test..."
echo "begin testcp_ds" >> test.output
-${PREFIX} ${BINDIR}/testcp${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testcp >> test.output
echo "end testcp_ds" >> test.output
-${NCDUMP} -d5,5 testcp.exo | grep -v version | diff - ${SRCDIR}/testcp_ds.dmp | tee testcp_ds.res
+${NCDUMP} -d5,5 testcp.exo | grep -v version > ${SRCDIR}/testcp_ds.dmp
echo "testwt1 - single precision write files with several side sets..."
echo "testwt1 ... [Expect WEDGE6 warning from this test]"
echo "begin testwt1" >> test.output
-${PREFIX} ${BINDIR}/testwt1${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testwt1 >> test.output
echo "end testwt1" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test1.dmp | tee testwt1.res
+${NCDUMP} -d5,5 test.exo | grep -v version > ${SRCDIR}/test1.dmp
echo "testrd1 - single precision read test of a file with several side sets..."
echo "testrd1 ... [Expect file create failure error, NOCLOBBER]"
echo "testrd1 ... [Expect failure locating elem var 1 for elem block 12]"
echo "begin testrd1" >> test.output
-${PREFIX} ${BINDIR}/testrd1${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd1.dmp | tee testrd1.res
+${PREFIX} ${SRCDIR}/testrd1 | grep -v version > ${SRCDIR}/testrd1.dmp
echo "end testrd1" >> test.output
echo "testwt_ss - write files to test side sets..."
echo "testwt_ss ... [Expect WEDGE6 warning from this test]"
echo "begin testwt_ss" >> test.output
-${PREFIX} ${BINDIR}/testwt_ss${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testwt_ss >> test.output
echo "end testwt_ss" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/testwt_ss.dmp | tee testwt_ss.res
+${NCDUMP} -d5,5 test.exo | grep -v version > ${SRCDIR}/testwt_ss.dmp
echo "testrd_ss - read test of a file with several side sets..."
echo "testrd_ss ... [Expect warning for NULL sidesets 30 and 31]"
echo "begin testrd_ss" >> test.output
-${PREFIX} ${BINDIR}/testrd_ss${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd_ss.dmp | tee testrd_ss.res
+${PREFIX} ${SRCDIR}/testrd_ss | grep -v version > ${SRCDIR}/testrd_ss.dmp
echo "end testrd_ss" >> test.output
echo "testwt2 - single precision write 2 files (simultaneously open) test..."
echo "begin testwt2" >> test.output
-${PREFIX} ${BINDIR}/testwt2${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testwt2 >> test.output
echo "end testwt2" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test2-1.dmp | tee testwt2-1.res
-${NCDUMP} -d5,5 test2.exo | grep -v version | diff - ${SRCDIR}/test2-2.dmp | tee testwt2-2.res
+${NCDUMP} -d5,5 test.exo | grep -v version > ${SRCDIR}/test2-1.dmp
+${NCDUMP} -d5,5 test2.exo | grep -v version > ${SRCDIR}/test2-2.dmp
echo "testrdwt - read from one and write to another (simutaneously open) file..."
echo "begin testrdwt" >> test.output
-${PREFIX} ${BINDIR}/testrdwt${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testrdwt >> test.output
echo "end testrdwt" >> test.output
-${NCDUMP} -d5,5 test2.exo | grep -v version | diff - ${SRCDIR}/test2.dmp | tee testrdwt.res
+${NCDUMP} -d5,5 test2.exo | grep -v version > ${SRCDIR}/test2.dmp
echo "testwt_nc - write x y z components of coordinates separately..."
echo "begin testwt_nc" >> test.output
-${PREFIX} ${BINDIR}/testwt_nc${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testwt_nc >> test.output
echo "end testwt_nc" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test.dmp | tee testwt_nc.res
+${NCDUMP} -d5,5 test.exo | grep -v version > ${SRCDIR}/test.dmp
echo "testrd_nc - read x y z components of coordinates separately..."
echo "begin testrd_nc" >> test.output
-${PREFIX} ${BINDIR}/testrd_nc${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd_nc.dmp | tee testrd_nc.res
+${PREFIX} ${SRCDIR}/testrd_nc | grep -v version > ${SRCDIR}/testrd_nc.dmp
echo "end testrd" >> test.output
echo "testwt-zeron - write file with zero nodes and elements..."
echo "begin testwt-zeron" >> test.output
-${PREFIX} ${BINDIR}/testwt-zeron${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testwt-zeron >> test.output
echo "end testwt-zeron" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/testwt-zeron.dmp | tee testwt-zeron.res
+${NCDUMP} -d5,5 test.exo | grep -v version > ${SRCDIR}/testwt-zeron.dmp
echo "testrd - read test of file with zero nodes and elements..."
echo "begin testrd zero nodes" >> test.output
-${PREFIX} ${BINDIR}/testrd${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd_zeron.dmp | tee testrd_zeron.res
+${PREFIX} ${SRCDIR}/testrd | grep -v version > ${SRCDIR}/testrd_zeron.dmp
echo "end testrd zero nodes" >> test.output
echo "testwt-zeroe - write file with zero elements..."
echo "begin testwt-zeroe" >> test.output
-${PREFIX} ${BINDIR}/testwt-zeroe${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testwt-zeroe >> test.output
echo "end testwt-zeroe" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/testwt-zeroe.dmp | tee testwt-zeroe.res
+${NCDUMP} -d5,5 test.exo | grep -v version > ${SRCDIR}/testwt-zeroe.dmp
echo "testrd - read test of file with zero elements..."
echo "begin testrd zero elements" >> test.output
-${PREFIX} ${BINDIR}/testrd${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd_zeroe.dmp | tee testrd_zeroe.res
+${PREFIX} ${SRCDIR}/testrd | grep -v version > ${SRCDIR}/testrd_zeroe.dmp
echo "end testrd zero elements" >> test.output
echo "testwt-one-attrib - read/write test of element attributes - read one at a time..."
echo "begin testwt-one-attrib - read attributes one at a time" >> test.output
-${PREFIX} ${BINDIR}/testwt-one-attrib${SUFFIX} | tee testrd_zeroe.res
+${PREFIX} ${SRCDIR}/testwt-one-attrib | tee testrd_zeroe.res
echo "end testwt-one-attrib - read attributes one at a time" >> test.output
echo "testwt-nsided - write file with nsided elements..."
echo "begin testwt-nsided" >> test.output
-${PREFIX} ${BINDIR}/testwt-nsided${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testwt-nsided >> test.output
echo "end testwt-nsided" >> test.output
-${NCDUMP} -d5,5 test-nsided.exo | grep -v version | diff - ${SRCDIR}/testwt-nsided.dmp | tee testwt-nsided.res
+${NCDUMP} -d5,5 test-nsided.exo | grep -v version > ${SRCDIR}/testwt-nsided.dmp
echo "testrd-nsided - read file with nsided elements..."
echo "begin testrd-nsided" >> test.output
-${PREFIX} ${BINDIR}/testrd-nsided${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd-nsided.dmp | tee testrd-nsided.res
+${PREFIX} ${SRCDIR}/testrd-nsided | grep -v version > ${SRCDIR}/testrd-nsided.dmp
echo "end testrd-nsided" >> test.output
echo "testwt-nfaced - write file with nfaced elements..."
echo "begin testwt-nfaced" >> test.output
-${PREFIX} ${BINDIR}/testwt-nfaced${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testwt-nfaced >> test.output
echo "end testwt-nfaced" >> test.output
-${NCDUMP} -d5,5 test-nfaced.exo | grep -v version | diff - ${SRCDIR}/testwt-nfaced.dmp | tee testwt-nfaced.res
+${NCDUMP} -d5,5 test-nfaced.exo | grep -v version > ${SRCDIR}/testwt-nfaced.dmp
echo "testrd-nfaced - read file with nfaced elements..."
echo "begin testrd-nfaced" >> test.output
-${PREFIX} ${BINDIR}/testrd-nfaced${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd-nfaced.dmp | tee testrd-nfaced.res
+${PREFIX} ${SRCDIR}/testrd-nfaced | grep -v version > ${SRCDIR}/testrd-nfaced.dmp
echo "end testrd-nfaced" >> test.output
echo "testwt-long-name - write file with long (64-character) names..."
echo "begin testwt-long-name" >> test.output
-${PREFIX} ${BINDIR}/testwt-long-name${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testwt-long-name >> test.output
echo "end testwt-long-name" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/testwt-long-name.dmp | tee testwt-long-name.res
+${NCDUMP} -d5,5 test.exo | grep -v version > ${SRCDIR}/testwt-long-name.dmp
echo "testrd - read long name file truncating to 32 characters on read..."
echo "begin testrd (truncate)" >> test.output
-${PREFIX} ${BINDIR}/testrd${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd-nm32.dmp | tee testrd-nm32.res
+${PREFIX} ${SRCDIR}/testrd | grep -v version > ${SRCDIR}/testrd-nm32.dmp
echo "end testrd (truncate)" >> test.output
echo "testrd-long-name - read long name file..."
echo "begin testrd-long-name" >> test.output
-${PREFIX} ${BINDIR}/testrd-long-name${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd-long-name.dmp | tee testrd-long-name.res
+${PREFIX} ${SRCDIR}/testrd-long-name | grep -v version > ${SRCDIR}/testrd-long-name.dmp
echo "end testrd-long-name" >> test.output
echo "************************************************************************"
diff --git a/exodus/cmake/Dependencies.cmake b/exodus/cmake/Dependencies.cmake
new file mode 100644
index 0000000..4d0922a
--- /dev/null
+++ b/exodus/cmake/Dependencies.cmake
@@ -0,0 +1,8 @@
+SET(LIB_REQUIRED_DEP_PACKAGES)
+SET(LIB_OPTIONAL_DEP_PACKAGES)
+SET(TEST_REQUIRED_DEP_PACKAGES)
+SET(TEST_OPTIONAL_DEP_PACKAGES)
+SET(LIB_REQUIRED_DEP_TPLS Netcdf)
+SET(LIB_OPTIONAL_DEP_TPLS HDF5)
+SET(TEST_REQUIRED_DEP_TPLS Netcdf)
+SET(TEST_OPTIONAL_DEP_TPLS)
diff --git a/exodus/doc/exodus-face-edge.pdf b/exodus/doc/exodus-face-edge.pdf
new file mode 100644
index 0000000..b3d13bf
Binary files /dev/null and b/exodus/doc/exodus-face-edge.pdf differ
diff --git a/exodus/doc/exodus.pdf b/exodus/doc/exodus.pdf
new file mode 100644
index 0000000..a0a6aa5
Binary files /dev/null and b/exodus/doc/exodus.pdf differ
diff --git a/exodus/doc/nemesis.pdf b/exodus/doc/nemesis.pdf
new file mode 100644
index 0000000..169b3df
Binary files /dev/null and b/exodus/doc/nemesis.pdf differ
diff --git a/exodus/forbind/CMakeLists.txt b/exodus/forbind/CMakeLists.txt
index 2d116ba..4a5e7c7 100644
--- a/exodus/forbind/CMakeLists.txt
+++ b/exodus/forbind/CMakeLists.txt
@@ -1,27 +1,76 @@
-INCLUDE(PackageLibraryMacros)
-INCLUDE(FortranSettings)
+# Set Mangling by hand
+# Assume _name mangling see src/exo_jack.c code for how ADDC_ will be used in
+# Fortran mangling
+add_definitions (-DADDC_)
+
+
+find_path( NETCDF_INCLUDE_DIR netcdf.h
+ $ENV{ACCESS}/inc
+ $ENV{NETCDF_DIR}/inc
+ $ENV{NETCDF_DIR}/include
+ $ENV{NETCDF_DIR}/libsrc
+)
+
+find_library( NETCDF_LIBRARY
+ NAMES netcdf
+ PATHS "$ENV{ACCESS}/lib"
+ "$ENV{NETCDF_DIR}/lib"
+ "$ENV{NETCDF_DIR}/libsrc/.libs"
+)
+
+find_program (NETCDF_NCDUMP ncdump
+ $ENV{ACCESS}/bin
+ $ENV{NETCDF_DIR}/bin
+ $ENV{NETCDF_DIR}/ncdump
+)
+
+# Hack for HDF5
+find_library( HDF5_LIBRARY hdf5
+ $ENV{ACCESS}/lib/shared
+ $ENV{ACCESS}/lib
+ $ENV{NETCDF_DIR}/lib
+ $ENV{NETCDF_DIR}/libsrc/.libs
+ /usr/local/hdf5/lib
+ )
+find_library( HDF5HL_LIBRARY hdf5_hl
+ $ENV{ACCESS}/lib/shared
+ $ENV{ACCESS}/lib
+ $ENV{NETCDF_DIR}/lib
+ $ENV{NETCDF_DIR}/libsrc/.libs
+ /usr/local/hdf5/lib
+ )
INCLUDE_DIRECTORIES(
"${CMAKE_CURRENT_SOURCE_DIR}/include"
"${CMAKE_CURRENT_BINARY_DIR}/include"
+ "${NETCDF_INCLUDE_DIR}"
)
-SET(SOURCES "")
-SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR})
+SET(forbind_SRCS
+ src/exo_jack.c
+)
-APPEND_GLOB(SOURCES ${DIR}/src/*.c ${DIR}/src/*.F)
+ADD_LIBRARY(exoIIv2for ${forbind_SRCS})
-SET(HEADERS
- include/exodusII.inc
- include/exodusII_int.inc
-)
+TARGET_LINK_LIBRARIES(exoIIv2for exoIIv2c ${NETCDF_LIBRARY} ${HDF5_LIBRARY} ${HDF5HL_LIBRARY})
-PACKAGE_ADD_LIBRARY(
- exodus_for
- HEADERS ${HEADERS}
- SOURCES ${SOURCES}
- DEPLIBS exodus
-)
+IF(EXODUS_LIBRARY_PROPERTIES)
+ SET_TARGET_PROPERTIES(exoIIv2for PROPERTIES ${EXODUS_LIBRARY_PROPERTIES})
+ENDIF(EXODUS_LIBRARY_PROPERTIES)
+
+IF(NOT EXODUS_INSTALL_NO_LIBRARIES)
+ INSTALL(TARGETS exoIIv2for
+ RUNTIME DESTINATION lib COMPONENT Runtime
+ LIBRARY DESTINATION lib COMPONENT Runtime
+ ARCHIVE DESTINATION lib COMPONENT Development)
+ INSTALL(FILES ${forbind_HEADERS} DESTINATION include COMPONENT Development)
+ENDIF(NOT EXODUS_INSTALL_NO_LIBRARIES)
+
+
+INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake)
-PACKAGE_ADD_TEST_DIRECTORIES(test)
+IF (BUILD_TESTING)
+ ENABLE_TESTING()
+ SUBDIRS(test)
+ENDIF (BUILD_TESTING)
diff --git a/exodus/forbind/include/exodusII.inc b/exodus/forbind/include/exodusII.inc
index d5ff8cf..d732d70 100644
--- a/exodus/forbind/include/exodusII.inc
+++ b/exodus/forbind/include/exodusII.inc
@@ -1,4 +1,4 @@
-! -*- mode: fortran -*-
+ ! -*- mode: fortran -*-
!
! Copyright 1994 Sandia Corporation. Under the terms of Contract
! DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
@@ -8,7 +8,7 @@
!
!***************************************************************
!
-! Name: exodusII.inc - Exodus II Application include file
+! Name: exodusII.inc - Exodus II Application include file
!
! Use this include file to define general Exodus II parameters
!
@@ -16,142 +16,178 @@
!
! Define Exodus functions that return values
!
- integer excre,exopen,exlgmd
- external excre, exopen, exlgmd
+ integer excre,exopen,exlgmd, exinqi
+ external excre, exopen, exlgmd, exinqi
!
! Define access modes
!
integer EXNOCL,EXCLOB,EXREAD,EXWRIT,EXWRT,EXNORM,EXLARG
integer EXNET4, EXNOSH, EXSHAR
- parameter (EXNOCL = 0) ! EXNOCL - File create with no overwrite (no clobber), default
- parameter (EXCLOB = 1) ! EXCLOB - File create with overwrite (clobber)
- parameter (EXNORM = 2) ! EXNORM - Disable large model modifications
- parameter (EXLARG = 4) ! EXLARG - Large model modifications
- parameter (EXNET4 = 8) ! EXNET4 - use the hdf5-based netcdf4 output
- parameter (EXNOSH = 16) ! EXNOSH - Do not open netcdf file in "share" mode
- parameter (EXSHAR = 32) ! EXSHAR - Do open netcdf file in "share" mode
+ integer EX_READ,EX_WRITE,EX_NOCLOBBER,EX_CLOBBER,EX_NORMAL_MODEL
+ integer EX_LARGE_MODEL,EX_NETCDF4,EX_NOSHARE,EX_SHARE
+ integer EX_NOCLASSIC,EX_MAPS_INT64_DB,EX_IDS_INT64_DB
+ integer EX_BULK_INT64_DB,EX_ALL_INT64_DB
+ integer EX_MAPS_INT64_API
+ integer EX_IDS_INT64_API,EX_BULK_INT64_API,EX_ALL_INT64_API
+
+ parameter (EXREAD = 0) ! EXREAD - File open for read
+ parameter (EXWRIT = 1) ! EXWRIT - File open for write
+ parameter (EXWRT = 1) ! EXWRT - File open for write (alternate to EXWRIT)
+
+ parameter (EXNOCL = 4) ! EXNOCL - File create with no overwrite (no clobber), default
+ parameter (EXCLOB = 8) ! EXCLOB - File create with overwrite (clobber)
+ parameter (EXNORM = 16) ! EXNORM - Disable large model modifications
+ parameter (EXLARG = 32) ! EXLARG - Large model modifications
+ parameter (EXNET4 = 64) ! EXNET4 - use the hdf5-based netcdf4 output
+ parameter (EXNOSH = 128) ! EXNOSH - Do not open netcdf file in "share" mode
+ parameter (EXSHAR = 256) ! EXSHAR - Do open netcdf file in "share" mode
+
+! Some of these are repeated from above, but use the same name as the C/C++ versions...
+
+ parameter (EX_READ = 0) !ex_open(): open file for reading (default)
+ parameter (EX_WRITE = 1) ! ex_open(): open existing file for appending.
+
+ parameter (EX_NOCLOBBER = 4) ! Don't overwrite existing database, default
+ parameter (EX_CLOBBER = 8) ! Overwrite existing database if it exists
+ parameter (EX_NORMAL_MODEL = 16) ! disable mods that permit storage of larger models
+ parameter (EX_LARGE_MODEL = 32) ! enable mods that permit storage of larger models
+ parameter (EX_NETCDF4 = 64) ! use the hdf5-based netcdf4 output
+ parameter (EX_NOSHARE = 128) ! Do not open netcdf file in "share" mode
+ parameter (EX_SHARE = 256) ! Do open netcdf file in "share" mode
+ parameter (EX_NOCLASSIC = 512) ! Do not force netcdf to classic mode in netcdf4 mode
+
+! Need to distinguish between storage on database (DB in name) and
+! passed through the API functions (API in name).
+
+ parameter (EX_MAPS_INT64_DB = 1024) ! All maps (id, order, ...) store int64_t values
+ parameter (EX_IDS_INT64_DB = 2048) ! All entity ids (sets, blocks, maps) are int64_t values
+ parameter (EX_BULK_INT64_DB = 4096) ! All integer bulk data (local indices, counts, maps); not ids
+ parameter (EX_ALL_INT64_DB = 1024+2048+4096) ! All of the above...
+
+ parameter (EX_MAPS_INT64_API= 8192) ! All maps (id, order, ...) store int64_t values
+ parameter (EX_IDS_INT64_API = 16384) ! All entity ids (sets, blocks, maps) are int64_t values
+ parameter (EX_BULK_INT64_API= 32768) ! All integer bulk data (local indices, counts, maps); not ids
+ parameter (EX_ALL_INT64_API = 8192+16384+32768) ! All of the above...
- parameter (EXREAD = 0) ! EXREAD - File open for read
- parameter (EXWRIT = 1) ! EXWRIT - File open for write
- parameter (EXWRT = 1) ! EXWRT - File open for write (alternate to EXWRIT)
!
! --INQUIRE FLAGS
- integer EXTYPE, EXVERS, EXDBVR, EXTITL, EXDIM, EXNODE, &
- & EXELEM, EXELBL, EXNODS, EXSIDS, EXQA, EXINFO, &
- & EXTIMS, EXSSNL, EXSSEL, EXNSNL, EXNEBP, EXNNSP, &
- & EXNSSP, EXNSDF, EXSSDF, EXLBVR, EXNEMP, EXNNMP, &
- & EXNEM, EXNNM, EXNEDG, EXNEDB, EXNEDS, EXESL , &
- & EXESDL, EXEDBP, EXEDSP, EXNFAC, EXNFB , EXNFS , &
- & EXFSL , EXFSDL, EXFABP, EXFASP, EXNELS, EXELSL, &
- & EXELSD, EXELSP, EXNEDM, EXNFAM, EXNCF, EXDBMXALNM, &
- & EXDBMXUSNM, EXMXRDNM
-
-!
- parameter (EXTYPE = 1) ! -- inquire EXODUS II file type
- parameter (EXVERS = 2) ! -- inquire API version number
- parameter (EXDBVR = 3) ! -- inquire database version number
- parameter (EXTITL = 4) ! -- inquire database title
- parameter (EXDIM = 5) ! -- inquire number of dimensions
- parameter (EXNODE = 6) ! -- inquire number of nodes
- parameter (EXELEM = 7) ! -- inquire number of elements
- parameter (EXELBL = 8) ! -- inquire number of element blocks
- parameter (EXNODS = 9) ! -- inquire number of node sets
- parameter (EXNSNL = 10) ! -- inquire length of node set node list
- parameter (EXSIDS = 11) ! -- inquire number of side sets
- parameter (EXSSNL = 12) ! -- inquire length of side set node list
- parameter (EXSSEL = 13) ! -- inquire length of side set element list
- parameter (EXQA = 14) ! -- inquire number of QA records
- parameter (EXINFO = 15) ! -- inquire number of info records
- parameter (EXTIMS = 16) ! -- inquire number of time steps in the database
- parameter (EXNEBP = 17) ! -- inquire number of element block properties
- parameter (EXNNSP = 18) ! -- inquire number of node set properties
- parameter (EXNSSP = 19) ! -- inquire number of side set properties
- parameter (EXNSDF = 20) ! -- inquire length of node set distribution factor list
- parameter (EXSSDF = 21) ! -- inquire length of side set distribution factor list
- parameter (EXLBVR = 22) ! -- inquire API Lib vers number
- parameter (EXNEMP = 23) ! -- inquire number of element map properties
- parameter (EXNNMP = 24) ! -- inquire number of node map properties
- parameter (EXNEM = 25) ! -- inquire number of element maps
- parameter (EXNNM = 26) ! -- inquire number of node maps
- parameter (EXNEDG = 27) ! -- inquire number of edges
- parameter (EXNEDB = 28) ! -- inquire number of edge blocks
- parameter (EXNEDS = 29) ! -- inquire number of edge sets
- parameter (EXESL = 30) ! -- inquire length of concat edge set edge list
- parameter (EXESDL = 31) ! -- inquire length of concat edge set dist factor list
- parameter (EXEDBP = 32) ! -- inquire number of properties stored per edge block
- parameter (EXEDSP = 33) ! -- inquire number of properties stored per edge set
- Parameter (EXNFAC = 34) ! -- inquire number of faces
- parameter (EXNFB = 35) ! -- inquire number of face blocks
- parameter (EXNFS = 36) ! -- inquire number of face sets
- parameter (EXFSL = 37) ! -- inquire length of concat face set face list
- parameter (EXFSDL = 38) ! -- inquire length of concat face set dist factor list
- parameter (EXFABP = 39) ! -- inquire number of properties stored per face block
- parameter (EXFASP = 40) ! -- inquire number of properties stored per face set
- parameter (EXNELS = 41) ! -- inquire number of element sets
- parameter (EXELSL = 42) ! -- inquire length of concat element set element list
- parameter (EXELSD = 43) ! -- inquire length of concat element set dist factor list
- parameter (EXELSP = 44) ! -- inquire number of properties stored per elem set
- parameter (EXNEDM = 45) ! -- inquire number of edge maps
- parameter (EXNFAM = 46) ! -- inquire number of face maps
- parameter (EXNCF = 47) ! -- inquire number of coordinate frames
+ integer EXTYPE, EXVERS, EXDBVR, EXTITL, EXDIM, EXNODE
+ integer EXELEM, EXELBL, EXNODS, EXSIDS, EXQA, EXINFO
+ integer EXTIMS, EXSSNL, EXSSEL, EXNSNL, EXNEBP, EXNNSP
+ integer EXNSSP, EXNSDF, EXSSDF, EXLBVR, EXNEMP, EXNNMP
+ integer EXNEM, EXNNM, EXNEDG, EXNEDB, EXNEDS, EXESL
+ integer EXESDL, EXEDBP, EXEDSP, EXNFAC, EXNFB , EXNFS
+ integer EXFSL , EXFSDL, EXFABP, EXFASP, EXNELS, EXELSL
+ integer EXELSD, EXELSP, EXNEDM, EXNFAM, EXNCF, EXDBMXALNM
+ integer EXDBMXUSNM, EXMXRDNM
+
+!
+ parameter (EXTYPE = 1) ! -- inquire EXODUS II file type
+ parameter (EXVERS = 2) ! -- inquire API version number
+ parameter (EXDBVR = 3) ! -- inquire database version number
+ parameter (EXTITL = 4) ! -- inquire database title
+ parameter (EXDIM = 5) ! -- inquire number of dimensions
+ parameter (EXNODE = 6) ! -- inquire number of nodes
+ parameter (EXELEM = 7) ! -- inquire number of elements
+ parameter (EXELBL = 8) ! -- inquire number of element blocks
+ parameter (EXNODS = 9) ! -- inquire number of node sets
+ parameter (EXNSNL = 10) ! -- inquire length of node set node list
+ parameter (EXSIDS = 11) ! -- inquire number of side sets
+ parameter (EXSSNL = 12) ! -- inquire length of side set node list
+ parameter (EXSSEL = 13) ! -- inquire length of side set element list
+ parameter (EXQA = 14) ! -- inquire number of QA records
+ parameter (EXINFO = 15) ! -- inquire number of info records
+ parameter (EXTIMS = 16) ! -- inquire number of time steps in the database
+ parameter (EXNEBP = 17) ! -- inquire number of element block properties
+ parameter (EXNNSP = 18) ! -- inquire number of node set properties
+ parameter (EXNSSP = 19) ! -- inquire number of side set properties
+ parameter (EXNSDF = 20) ! -- inquire length of node set distribution factor list
+ parameter (EXSSDF = 21) ! -- inquire length of side set distribution factor list
+ parameter (EXLBVR = 22) ! -- inquire API Lib vers number
+ parameter (EXNEMP = 23) ! -- inquire number of element map properties
+ parameter (EXNNMP = 24) ! -- inquire number of node map properties
+ parameter (EXNEM = 25) ! -- inquire number of element maps
+ parameter (EXNNM = 26) ! -- inquire number of node maps
+ parameter (EXNEDG = 27) ! -- inquire number of edges
+ parameter (EXNEDB = 28) ! -- inquire number of edge blocks
+ parameter (EXNEDS = 29) ! -- inquire number of edge sets
+ parameter (EXESL = 30) ! -- inquire length of concat edge set edge list
+ parameter (EXESDL = 31) ! -- inquire length of concat edge set dist factor list
+ parameter (EXEDBP = 32) ! -- inquire number of properties stored per edge block
+ parameter (EXEDSP = 33) ! -- inquire number of properties stored per edge set
+ Parameter (EXNFAC = 34) ! -- inquire number of faces
+ parameter (EXNFB = 35) ! -- inquire number of face blocks
+ parameter (EXNFS = 36) ! -- inquire number of face sets
+ parameter (EXFSL = 37) ! -- inquire length of concat face set face list
+ parameter (EXFSDL = 38) ! -- inquire length of concat face set dist factor list
+ parameter (EXFABP = 39) ! -- inquire number of properties stored per face block
+ parameter (EXFASP = 40) ! -- inquire number of properties stored per face set
+ parameter (EXNELS = 41) ! -- inquire number of element sets
+ parameter (EXELSL = 42) ! -- inquire length of concat element set element list
+ parameter (EXELSD = 43) ! -- inquire length of concat element set dist factor list
+ parameter (EXELSP = 44) ! -- inquire number of properties stored per elem set
+ parameter (EXNEDM = 45) ! -- inquire number of edge maps
+ parameter (EXNFAM = 46) ! -- inquire number of face maps
+ parameter (EXNCF = 47) ! -- inquire number of coordinate frames
parameter (EXDBMXALNM = 48)! -- inquire size of MAX_NAME_LENGTH dimension on database
parameter (EXDBMXUSNM = 49)! -- inquire max size of any name existing on database
parameter (EXMXRDNM = 50) ! -- inquire user-specified max size of names returned; truncated if longer
!
! Define limits
!
- integer MXSTLN, MXLNLN
-! MXSTLN - Maximum string length: used for store strings
- parameter (MXSTLN = 32)
-! MXLNLN - Maximum line string length
- parameter (MXLNLN = 80)
+ integer MXSTLN, MXLNLN, MXNAME
+! MXSTLN - Maximum string length: used for store strings
+ parameter (MXSTLN = 32)
+! MXLNLN - Maximum line string length
+ parameter (MXLNLN = 80)
+! MXNAME - Maximum possible length of a name (due to netcdf NC_MAX_NAME)
+ parameter (MXNAME = 256)
!
-! properties
+! properties
!
- integer EXEBLK, EXNSET, EXSSET, EXEMAP, EXNMAP
+ integer EXEBLK, EXNSET, EXSSET, EXEMAP, EXNMAP
- parameter (EXEBLK = 1) ! EXEBLK - element block property code
- parameter (EXNSET = 2) ! EXNSPR - node set property code
- parameter (EXSSET = 3) ! EXSSPR - side set property code
- parameter (EXEMAP = 4) ! EXEMAP - element map property code
- parameter (EXNMAP = 5) ! EXNMAP - node map property code
+ parameter (EXEBLK = 1) ! EXEBLK - element block property code
+ parameter (EXNSET = 2) ! EXNSPR - node set property code
+ parameter (EXSSET = 3) ! EXSSPR - side set property code
+ parameter (EXEMAP = 4) ! EXEMAP - element map property code
+ parameter (EXNMAP = 5) ! EXNMAP - node map property code
!
-! Define options codes
+! Define options codes
!
- integer EXVRBS, EXDEBG, EXABRT
+ integer EXVRBS, EXDEBG, EXABRT
- parameter (EXVRBS = 1) ! EXVRBS - verbose mode message flag
- parameter (EXDEBG = 2) ! EXDEBG - debug mode message flag
- parameter (EXABRT = 4) ! EXABRT - abort mode flag
+ parameter (EXVRBS = 1) ! EXVRBS - verbose mode message flag
+ parameter (EXDEBG = 2) ! EXDEBG - debug mode message flag
+ parameter (EXABRT = 4) ! EXABRT - abort mode flag
!
-! Define coordinate frames
+! Define coordinate frames
!
- integer EXCFREC, EXCFCYL, EXCFSPH
-
- parameter (EXCFREC = 1) ! Rectangular
- parameter (EXCFCYL = 2) ! Cylindrical
- parameter (EXCFSPH = 3) ! Spherical
+ integer EXCFREC, EXCFCYL, EXCFSPH
+ parameter (EXCFREC = 1) ! Rectangular
+ parameter (EXCFCYL = 2) ! Cylindrical
+ parameter (EXCFSPH = 3) ! Spherical
!
-! Define error return codes
+! Define error return codes
!
- integer EXFATL, EXOK, EXWARN
+ integer EXFATL, EXOK, EXWARN
- parameter (EXFATL = -1) ! EXFATL - fatal error flag def
- parameter (EXOK = 0) ! EXOK - no err (success) flag def
- parameter (EXWARN = 1) ! EXWARN - warning flag def
+ parameter (EXFATL = -1) ! EXFATL - fatal error flag def
+ parameter (EXOK = 0) ! EXOK - no err (success) flag def
+ parameter (EXWARN = 1) ! EXWARN - warning flag def
!
-! Define error return codes and flags
+! Define error return codes and flags
!
- integer EXMEMF, EXBFMD, EXBFID, EXBTID, EXBPRM, EXNULL, &
- & EXPMSG, EXLMSG
+ integer EXMEMF, EXBFMD, EXBFID, EXBTID, EXBPRM, EXNULL
+ integer EXPMSG, EXLMSG
- parameter (EXMEMF = 1000) ! EXMEMF - memory allocation failure flag def
- parameter (EXBFMD = 1001) ! EXBFMD - wrong file mode
- parameter (EXBFID = 1002) ! EXBFID - bad file id def
- parameter (EXBTID = 1004) ! EXBTID - id table lookup failed
- parameter (EXBPRM = 1005) ! EXBPRM - bad parameter passed
- parameter (EXNULL = -1006) ! EXNULL - null entity found
- parameter (EXPMSG = -1000) ! EXPMSG - message print code - no error implied
- parameter (EXLMSG = -1001) ! EXLMSG - print last error message msg code
+ parameter (EXMEMF = 1000) ! EXMEMF - memory allocation failure flag def
+ parameter (EXBFMD = 1001) ! EXBFMD - wrong file mode
+ parameter (EXBFID = 1002) ! EXBFID - bad file id def
+ parameter (EXBTID = 1004) ! EXBTID - id table lookup failed
+ parameter (EXBPRM = 1005) ! EXBPRM - bad parameter passed
+ parameter (EXNULL = -1006) ! EXNULL - null entity found
+ parameter (EXPMSG = -1000) ! EXPMSG - message print code - no error implied
+ parameter (EXLMSG = -1001) ! EXLMSG - print last error message msg code
diff --git a/exodus/forbind/src/Makefile.standalone b/exodus/forbind/src/Makefile.standalone
index e635ea1..e7a5a7e 100644
--- a/exodus/forbind/src/Makefile.standalone
+++ b/exodus/forbind/src/Makefile.standalone
@@ -31,49 +31,45 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
-INCLUDES = -I../../cbind/include
-F77EXTRAOPTIONS = -I../include
+AR = ar cr
+INCLUDES = -I../../cbind/include -I/Users/gdsjaar/src/SEACAS-SF-INSTALL/include
+F77EXTRAOPTIONS = -I../include
+CFLAGS = -DADDC_
+CC = /opt/local/bin/clang-mp-3.1
+FC = /opt/local/bin/gfortran-mp-4.8
+RANLIB = true
SRCS = exo_jack.c
-SRCSF = addrwrap.F
+SRCSF = addrwrap.f
-OBJS = ${SRCS:.c=.o} ${SRCSF:.F=.o}
+OBJS = ${SRCS:.c=.o} ${SRCSF:.f=.o}l
-ifeq ($(BITS),64)
+all:: libexoIIv2for.a libexoIIv2for32.a
-LOCALFLAGS=-DBuild64
-
-# Need to compile exo_jack.c without the -DBuild64 option
-# real* -> float* (actually void* since it handles both float* and double*)
-exo_jack32.o: exo_jack.c
- $(CC) -o exo_jack32.o -c $(CFLAGS) -DDEFAULT_REAL_INT exo_jack.c
-
-all:: libexoIIv2for32.a
-libexoIIv2for32.a: exo_jack32.o
+libexoIIv2for.a: addrwrap.o exo_jack.o
$(AR) $@ $?
- $(_NULLCMD_)
- $(_NULLCMD_)
- $(CP) $@ ../../
-
-endif
+ $(RANLIB) $@
+ cp libexoIIv2for.a ../../
-all:: libexoIIv2for.a
-libexoIIv2for.a: $(OBJS)
+libexoIIv2for32.a: exo_jack32.o
$(AR) $@ $?
$(RANLIB) $@
- cp libexoIIv2for.a ../../
+ cp libexoIIv2for32.a ../../
+exo_jack32.o: exo_jack.c
+ $(CC) -o exo_jack32.o -c $(CFLAGS) $(INCLUDES) -DDEFAULT_REAL_INT exo_jack.c
+
clean::
rm -f *.CKP *.ln *.BAK *.bak *.o *.M *.mod core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut "#"*
.SUFFIXES: .c .F .f
.c.o:
- $(CC) -c $(LOCALFLAGS) $(CFLAGS) -DADDC_ $*.c
+ $(CC) $(INCLUDES) -c $(CFLAGS) $*.c
.f.o:
$(FC) -c $(FFLAGS) $*.f
.F.o:
- $(FC) -c $(LOCALFLAGS) $(DEFINES) $(FFLAGS) $*.F
+ $(FC) -c $(DEFINES) $(FFLAGS) $*.F
# ----------------------------------------------------------------------
# dependencies generated by makedepend or sfmakedepend
diff --git a/exodus/forbind/src/addrwrap.F b/exodus/forbind/src/addrwrap.F
index 3b83937..a5290c5 100644
--- a/exodus/forbind/src/addrwrap.F
+++ b/exodus/forbind/src/addrwrap.F
@@ -70,66 +70,11 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 NSESS4 (1) ! (R)
- INTEGER*4 NDESS4 (1) ! (R)
- INTEGER*4 IXEESS4 (1) ! (R)
- INTEGER*4 IXNESS4 (1) ! (R)
- INTEGER*4 LTEESS4 (1) ! (R)
- INTEGER*4 LTNESS4 (1) ! (R)
- INTEGER*4 LTSESS4 (1) ! (W)
- POINTER (PNSESS4, NSESS4)
- POINTER (PNDESS4, NDESS4)
- POINTER (PIXEESS4, IXEESS4)
- POINTER (PIXNESS4, IXNESS4)
- POINTER (PLTEESS4, LTEESS4)
- POINTER (PLTNESS4, LTNESS4)
- POINTER (PLTSESS4, LTSESS4)
- INTEGER*4 IERR4 ! (W)
-
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
-
- INTEGER NEXSIDS
- INTEGER NEXELEM
- INTEGER NEXNODE
- INTEGER NEXNSNL
- INTEGER NEXSSEL
- INTEGER I
+ INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
- INFREQ4 = EXSIDS
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXSIDS = INTRET4
- INFREQ4 = EXELEM
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXELEM = INTRET4
- INFREQ4 = EXNODE
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXNODE = INTRET4
- NEXNSNL = 0
- NEXSSEL = 0
- DO I = 1, NEXSIDS
- NEXNSNL = NEXNSNL + NDESS(I)
- NEXSSEL = NEXSSEL + NSESS(I)
- END DO
- CALL I8I4 (NEXSIDS, NSESS, PNSESS4)
- CALL I8I4 (NEXSIDS, NDESS, PNDESS4)
- CALL I8I4 (NEXSIDS, IXEESS, PIXEESS4)
- CALL I8I4 (NEXSIDS, IXNESS, PIXNESS4)
- CALL I8I4 (NEXSSEL, LTEESS, PLTEESS4)
- CALL I8I4 (NEXNSNL, LTNESS, PLTNESS4)
- CALL I4ALLOC (NEXSSEL, PLTSESS4)
- CALL EXCN2S4 (IDEXO4, NSESS4, NDESS4, IXEESS4, IXNESS4,
- & LTEESS4, LTNESS4, LTSESS4, IERR4)
- CALL I4I8 (NEXSSEL, PLTSESS4, LTSESS)
- CALL I4FREE (PNSESS4)
- CALL I4FREE (PNDESS4)
- CALL I4FREE (PIXEESS4)
- CALL I4FREE (PIXNESS4)
- CALL I4FREE (PLTEESS4)
- CALL I4FREE (PLTNESS4)
+ CALL EXCN2S4 (IDEXO4, NSESS, NDESS, IXEESS, IXNESS,
+ & LTEESS, LTNESS, LTSESS, IERR4)
IERR = IERR4
END
@@ -152,13 +97,31 @@ C
INTEGER*4 ICOMPWS4 ! (RW)
INTEGER*4 IOWS4 ! (RW)
INTEGER*4 IERR4 ! (W)
-
+ INTEGER*4 IFLAG4
+
+C ... This is hardwired instead of getting from exodusII.inc due to compiler errors about
+C exopen/excre already having a type...
+ integer EX_MAPS_INT64_API
+ integer EX_BULK_INT64_API
+ integer EX_IDS_INT64_API
+ integer EX_INQ_INT64_API
+ parameter (EX_MAPS_INT64_API= 8192) ! All maps (id, order, ...) store int64_t values
+ parameter (EX_IDS_INT64_API = 16384) ! All entity ids
+ parameter (EX_BULK_INT64_API= 32768) ! All integer bulk data
+ parameter (EX_INQ_INT64_API = 65536) ! All integer inquire arguments
+
+C ... All wrapper routines are passing INTEGER*8, but at this
+C time, only the maps are supported...
ICMODE4 = ICMODE
+ IFLAG4 = EX_MAPS_INT64_API+EX_IDS_INT64_API+EX_BULK_INT64_API+
+ * EX_INQ_INT64_API
+ ICMODE4 = IOR(ICMODE4, IFLAG4)
C ... This needs to be set explicitly since all wrapper routines
C are passing REAL*8 and the exo_jack.c routines all take double*
ICOMPWS4 = 8
IOWS4 = IOWS
+
IRET4 = EXCRE4 (PATH, ICMODE4, ICOMPWS4, IOWS4, IERR4)
ICOMPWS = ICOMPWS4
IOWS = IOWS4
@@ -217,49 +180,13 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDNPSS4 (1) ! (W)
- INTEGER*4 NNNPS4 (1) ! (W)
- INTEGER*4 NDNPS4 (1) ! (W)
- INTEGER*4 IXNNPS4 (1) ! (W)
- INTEGER*4 IXDNPS4 (1) ! (W)
- INTEGER*4 LTNNPS4 (1) ! (W)
- POINTER (PIDNPSS4, IDNPSS4)
- POINTER (PNNNPS4, NNNPS4)
- POINTER (PNDNPS4, NDNPS4)
- POINTER (PIXNNPS4, IXNNPS4)
- POINTER (PIXDNPS4, IXDNPS4)
- POINTER (PLTNNPS4, LTNNPS4)
- INTEGER*4 IERR4 ! (W)
-
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
-
- INTEGER NEXNODS
- INTEGER NEXNSNL
-
- IDEXO4 = IDEXO
- INFREQ4 = EXNODS
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXNODS = INTRET4
- INFREQ4 = EXNSNL
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXNSNL = INTRET4
- CALL I4ALLOC (NEXNODS, PIDNPSS4)
- CALL I4ALLOC (NEXNODS, PNNNPS4)
- CALL I4ALLOC (NEXNODS, PNDNPS4)
- CALL I4ALLOC (NEXNODS, PIXNNPS4)
- CALL I4ALLOC (NEXNODS, PIXDNPS4)
- CALL I4ALLOC (NEXNSNL, PLTNNPS4)
- CALL EXGCNS4 (IDEXO4, IDNPSS4, NNNPS4, NDNPS4, IXNNPS4,
- & IXDNPS4, LTNNPS4, FACNPS, IERR4)
- CALL I4I8 (NEXNODS, PIDNPSS4, IDNPSS)
- CALL I4I8 (NEXNODS, PNNNPS4, NNNPS)
- CALL I4I8 (NEXNODS, PNDNPS4, NDNPS)
- CALL I4I8 (NEXNODS, PIXNNPS4, IXNNPS)
- CALL I4I8 (NEXNODS, PIXDNPS4, IXDNPS)
- CALL I4I8 (NEXNSNL, PLTNNPS4, LTNNPS)
+ INTEGER*4 IERR4 ! (W)
+
+ IDEXO4 = IDEXO
+
+ CALL EXGCNS4 (IDEXO4, IDNPSS, NNNPS, NDNPS, IXNNPS,
+ & IXDNPS, LTNNPS, FACNPS, IERR4)
+
IERR = IERR4
END
@@ -280,31 +207,20 @@ C
INTEGER*4 IDEXO4 ! (R)
integer*4 nframe4 ! (R)
- integer*4 idscf4(1) ! (W)
integer*4 itags4(1) ! (W)
INTEGER*4 IERR4 ! (W)
- POINTER (PIDSCF4, IDSCF4)
POINTER (PITAGS4, ITAGS4)
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
-
idexo4 = idexo
- infreq4 = EXNCF
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
+ NFRAME = EXINQI (IDEXO, EXNCF)
+ NFRAME4 = NFRAME
- NFRAME4 = INTRET4
- NFRAME = NFRAME4
- CALL I4ALLOC (NFRAME, PIDSCF4)
CALL I4ALLOC (NFRAME, PITAGS4)
- call exgfrm4(idexo4, nframe4, idscf4, coord, itags4, ierr4)
+ call exgfrm4(idexo4, nframe4, idscf, coord, itags4, ierr4)
- CALL I4I8 (NFRAME, PIDSCF4, IDSCF)
CALL I4I8 (NFRAME, PITAGS4, ITAGS)
ierr = ierr4
@@ -327,22 +243,18 @@ C
INTEGER*4 IDEXO4 ! (R)
integer*4 nframe4 ! (R)
- integer*4 idscf4(1) ! (R)
integer*4 itags4(1) ! (R)
INTEGER*4 IERR4 ! (W)
- POINTER (PIDSCF4, IDSCF4)
POINTER (PITAGS4, ITAGS4)
idexo4 = idexo
NFRAME4 = NFRAME
- CALL I8I4 (NFRAME, IDSCF, PIDSCF4)
CALL I8I4 (NFRAME, ITAGS, PITAGS4)
- call expfrm4(idexo4, nframe4, idscf4, coord, itags4, ierr4)
+ call expfrm4(idexo4, nframe4, idscf, coord, itags4, ierr4)
- CALL I4FREE (PIDSCF4)
CALL I4FREE (PITAGS4)
ierr = ierr4
@@ -406,57 +318,12 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDESSS4 (1) ! (W)
- INTEGER*4 NSESS4 (1) ! (W)
- INTEGER*4 NDESS4 (1) ! (W)
- INTEGER*4 IXEESS4 (1) ! (W)
- INTEGER*4 IXDESS4 (1) ! (W)
- INTEGER*4 LTEESS4 (1) ! (W)
- INTEGER*4 LTSESS4 (1) ! (W)
- POINTER (PIDESSS4, IDESSS4)
- POINTER (PNSESS4, NSESS4)
- POINTER (PNDESS4, NDESS4)
- POINTER (PIXEESS4, IXEESS4)
- POINTER (PIXDESS4, IXDESS4)
- POINTER (PLTEESS4, LTEESS4)
- POINTER (PLTSESS4, LTSESS4)
- INTEGER*4 IERR4 ! (W)
-
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
-
- INTEGER NEXSIDS
- INTEGER NEXSSEL
- INTEGER NEXSSDF
-
- IDEXO4 = IDEXO
- INFREQ4 = EXSIDS
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXSIDS = INTRET4
- INFREQ4 = EXSSEL
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXSSEL = INTRET4
- INFREQ4 = EXSSDF
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXSSDF = INTRET4
- CALL I4ALLOC (NEXSIDS, PIDESSS4)
- CALL I4ALLOC (NEXSIDS, PNSESS4)
- CALL I4ALLOC (NEXSIDS, PNDESS4)
- CALL I4ALLOC (NEXSIDS, PIXEESS4)
- CALL I4ALLOC (NEXSIDS, PIXDESS4)
- CALL I4ALLOC (NEXSSEL, PLTEESS4)
- CALL I4ALLOC (NEXSSEL, PLTSESS4)
- CALL EXGCSS4 (IDEXO4, IDESSS4, NSESS4, NDESS4, IXEESS4,
- & IXDESS4, LTEESS4, LTSESS4, FACESS, IERR4)
- CALL I4I8 (NEXSIDS, PIDESSS4, IDESSS)
- CALL I4I8 (NEXSIDS, PNSESS4, NSESS)
- CALL I4I8 (NEXSIDS, PNDESS4, NDESS)
- CALL I4I8 (NEXSIDS, PIXEESS4, IXEESS)
- CALL I4I8 (NEXSIDS, PIXDESS4, IXDESS)
- CALL I4I8 (NEXSSEL, PLTEESS4, LTEESS)
- CALL I4I8 (NEXSSEL, PLTSESS4, LTSESS)
+ INTEGER*4 IERR4 ! (W)
+
+ IDEXO4 = IDEXO
+
+ CALL EXGCSS4 (IDEXO4, IDESSS, NSESS, NDESS, IXEESS,
+ & IXDESS, LTEESS, LTSESS, FACESS, IERR4)
IERR = IERR4
END
@@ -470,8 +337,8 @@ C
INCLUDE 'exodusII.inc'
INTEGER IDEXO ! (R)
INTEGER IDESSS (*) ! (W)
- INTEGER NSESS (*) ! (W)
- INTEGER NDESS (*) ! (W)
+ INTEGER NSESS (*) ! (W)
+ INTEGER NDESS (*) ! (W)
INTEGER IXEESS (*) ! (W)
INTEGER IXDESS (*) ! (W)
INTEGER LTEESS (*) ! (W)
@@ -479,57 +346,12 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDESSS4 (1) ! (W)
- INTEGER*4 NSESS4 (1) ! (W)
- INTEGER*4 NDESS4 (1) ! (W)
- INTEGER*4 IXEESS4 (1) ! (W)
- INTEGER*4 IXDESS4 (1) ! (W)
- INTEGER*4 LTEESS4 (1) ! (W)
- INTEGER*4 LTSESS4 (1) ! (W)
- POINTER (PIDESSS4, IDESSS4)
- POINTER (PNSESS4, NSESS4)
- POINTER (PNDESS4, NDESS4)
- POINTER (PIXEESS4, IXEESS4)
- POINTER (PIXDESS4, IXDESS4)
- POINTER (PLTEESS4, LTEESS4)
- POINTER (PLTSESS4, LTSESS4)
- INTEGER*4 IERR4 ! (W)
-
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
-
- INTEGER NEXSIDS
- INTEGER NEXSSEL
- INTEGER NEXSSDF
-
- IDEXO4 = IDEXO
- INFREQ4 = EXSIDS
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXSIDS = INTRET4
- INFREQ4 = EXSSEL
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXSSEL = INTRET4
- INFREQ4 = EXSSDF
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXSSDF = INTRET4
- CALL I4ALLOC (NEXSIDS, PIDESSS4)
- CALL I4ALLOC (NEXSIDS, PNSESS4)
- CALL I4ALLOC (NEXSIDS, PNDESS4)
- CALL I4ALLOC (NEXSIDS, PIXEESS4)
- CALL I4ALLOC (NEXSIDS, PIXDESS4)
- CALL I4ALLOC (NEXSSEL, PLTEESS4)
- CALL I4ALLOC (NEXSSEL, PLTSESS4)
- CALL EXGCSSF4 (IDEXO4, IDESSS4, NSESS4, NDESS4, IXEESS4,
- & IXDESS4, LTEESS4, LTSESS4, IERR4)
- CALL I4I8 (NEXSIDS, PIDESSS4, IDESSS)
- CALL I4I8 (NEXSIDS, PNSESS4, NSESS)
- CALL I4I8 (NEXSIDS, PNDESS4, NDESS)
- CALL I4I8 (NEXSIDS, PIXEESS4, IXEESS)
- CALL I4I8 (NEXSIDS, PIXDESS4, IXDESS)
- CALL I4I8 (NEXSSEL, PLTEESS4, LTEESS)
- CALL I4I8 (NEXSSEL, PLTSESS4, LTSESS)
+ INTEGER*4 IERR4 ! (W)
+
+ IDEXO4 = IDEXO
+
+ CALL EXGCSSF4 (IDEXO4, IDESSS, NSESS, NDESS, IXEESS,
+ & IXDESS, LTEESS, LTSESS, IERR4)
IERR = IERR4
END
@@ -546,12 +368,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDELB4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
- IDELB4 = IDELB
- CALL EXGEAT4 (IDEXO4, IDELB4, ATRIB, IERR4)
+ CALL EXGEAT4 (IDEXO4, IDELB, ATRIB, IERR4)
IERR = IERR4
END
@@ -568,14 +388,12 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDELB4 ! (R)
INTEGER*4 NATTR4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
- IDELB4 = IDELB
NATTR4 = NATTR
- CALL EXGEAN4 (IDEXO4, IDELB4, NATTR4, NAMES, IERR4)
+ CALL EXGEAN4 (IDEXO4, IDELB, NATTR4, NAMES, IERR4)
IERR = IERR4
END
@@ -590,24 +408,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDELBS4 (1) ! (W)
- POINTER (PIDELBS4, IDELBS4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
-
- INTEGER NEXELBL
-
IDEXO4 = IDEXO
- INFREQ4 = EXELBL
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXELBL = INTRET4
- CALL I4ALLOC (NEXELBL, PIDELBS4)
- CALL EXGEBI4 (IDEXO4, IDELBS4, IERR4)
- CALL I4I8 (NEXELBL, PIDELBS4, IDELBS)
+ CALL EXGEBI4 (IDEXO4, IDELBS, IERR4)
IERR = IERR4
END
@@ -627,19 +431,11 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDELB4 ! (R)
- INTEGER*4 NUMELB4 ! (W)
- INTEGER*4 NUMLNK4 ! (W)
- INTEGER*4 NUMATR4 ! (W)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
- IDELB4 = IDELB
- CALL EXGELB4 (IDEXO4, IDELB4, NAMELB, NUMELB4, NUMLNK4,
- & NUMATR4, IERR4)
- NUMELB = NUMELB4
- NUMLNK = NUMLNK4
- NUMATR = NUMATR4
+ CALL EXGELB4 (IDEXO4, IDELB, NAMELB, NUMELB, NUMLNK,
+ & NUMATR, IERR4)
IERR = IERR4
END
@@ -655,34 +451,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDELB4 ! (R)
- INTEGER*4 LINK4 (1) ! (NUMLNK,NUMELB) ! (W)
- POINTER (PLINK4, LINK4)
INTEGER*4 IERR4 ! (W)
- CHARACTER* (MXSTLN) NAMELB
- INTEGER*4 NUMELB4
- INTEGER*4 NUMLNK4
- INTEGER*4 NUMATR4
- INTEGER NUMLNK
- INTEGER NUMELB
-
IDEXO4 = IDEXO
- IDELB4 = IDELB
- CALL EXGELB4 (IDEXO4, IDELB4, NAMELB, NUMELB4, NUMLNK4,
- & NUMATR4, IERR4)
- IF (NAMELB .EQ. 'NSIDED' .OR. NAMELB .EQ. 'nsided') THEN
- NUMLNK = NUMLNK4
- CALL I4ALLOC (NUMLNK, PLINK4)
- CALL EXGELC4 (IDEXO4, IDELB4, LINK4, IERR4)
- CALL I4I8 (NUMLNK, PLINK4, LINK)
- ELSE
- NUMLNK = NUMLNK4
- NUMELB = NUMELB4
- CALL I4ALLOC (NUMLNK*NUMELB, PLINK4)
- CALL EXGELC4 (IDEXO4, IDELB4, LINK4, IERR4)
- CALL I4I8 (NUMLNK*NUMELB, PLINK4, LINK)
- ENDIF
+ CALL EXGELC4 (IDEXO4, IDELB, LINK, IERR4)
IERR = IERR4
END
@@ -699,28 +471,24 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDELB4 ! (R)
INTEGER*4 ITYPE4 ! (R)
INTEGER*4 COUNTS4 (1) ! (NUMELB) ! (W)
POINTER (PCOUNTS4, COUNTS4)
INTEGER*4 IERR4 ! (W)
CHARACTER* (MXSTLN) NAMELB
- INTEGER*4 NUMELB4
- INTEGER*4 NUMLNK4
- INTEGER*4 NUMATR4
INTEGER NUMELB
-
+ INTEGER NUMATR
+ INTEGER NUMLNK
+
IDEXO4 = IDEXO
ITYPE4 = ITYPE
- IDELB4 = IDELB
- CALL EXGELB4 (IDEXO4, IDELB4, NAMELB, NUMELB4, NUMLNK4,
- & NUMATR4, IERR4)
- numelb = numelb4
-
+ CALL EXGELB4 (IDEXO4, IDELB, NAMELB, NUMELB, NUMLNK,
+ & NUMATR, IERR4)
+
CALL I4ALLOC (NUMELB, PCOUNTS4)
- CALL EXGECPP4 (IDEXO4, ITYPE4, IDELB4, COUNTS4, IERR4)
+ CALL EXGECPP4 (IDEXO4, ITYPE4, IDELB, COUNTS4, IERR4)
CALL I4I8 (NUMELB, PCOUNTS4, COUNTS)
IERR = IERR4
END
@@ -736,24 +504,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 MAPEL4 (1) ! (W)
- POINTER (PMAPEL4, MAPEL4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
-
- INTEGER NEXELEM
-
IDEXO4 = IDEXO
- INFREQ4 = EXELEM
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXELEM = INTRET4
- CALL I4ALLOC (NEXELEM, PMAPEL4)
- CALL EXGENM4 (IDEXO4, MAPEL4, IERR4)
- CALL I4I8 (NEXELEM, PMAPEL4, MAPEL)
+ CALL EXGENM4 (IDEXO4, MAPEL, IERR4)
IERR = IERR4
END
@@ -769,26 +523,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 MAPID4 ! (R)
- INTEGER*4 MAPEL4 (1) ! (W)
- POINTER (PMAPEL4, MAPEL4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
-
- INTEGER NEXELEM
-
IDEXO4 = IDEXO
- MAPID4 = MAPID
- INFREQ4 = EXELEM
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXELEM = INTRET4
- CALL I4ALLOC (NEXELEM, PMAPEL4)
- CALL EXGEM4 (IDEXO4, MAPID4, MAPEL4, IERR4)
- CALL I4I8 (NEXELEM, PMAPEL4, MAPEL)
+ CALL EXGEM4 (IDEXO4, MAPID, MAPEL, IERR4)
IERR = IERR4
END
@@ -806,20 +544,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 MAPID4 ! (R)
- INTEGER*4 ISTART4 ! (R)
- INTEGER*4 ICOUNT4 ! (R)
- INTEGER*4 MAPEL4 (1) ! (W)
- POINTER (PMAPEL4, MAPEL4)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
- MAPID4 = MAPID
- ISTART4 = ISTART
- ICOUNT4 = ICOUNT
- CALL I4ALLOC (ICOUNT, PMAPEL4)
- CALL EXGPEM4 (IDEXO4, MAPID4, ISTART4, ICOUNT4, MAPEL4, IERR4)
- CALL I4I8 (ICOUNT, PMAPEL4, MAPEL)
+ CALL EXGPEM4 (IDEXO4, MAPID, ISTART, ICOUNT, MAPEL, IERR4)
IERR = IERR4
END
@@ -841,16 +569,12 @@ C
INTEGER*4 IDEXO4 ! (R)
INTEGER*4 ISTEP4 ! (R)
INTEGER*4 IXELEV4 ! (R)
- INTEGER*4 IDELB4 ! (R)
- INTEGER*4 NUMELB4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
ISTEP4 = ISTEP
IXELEV4 = IXELEV
- IDELB4 = IDELB
- NUMELB4 = NUMELB
- CALL EXGEV4 (IDEXO4, ISTEP4, IXELEV4, IDELB4, NUMELB4,
+ CALL EXGEV4 (IDEXO4, ISTEP4, IXELEV4, IDELB, NUMELB,
& VALEV, IERR4)
IERR = IERR4
END
@@ -872,18 +596,16 @@ C
INTEGER*4 IDEXO4 ! (R)
INTEGER*4 IXELEV4 ! (R)
- INTEGER*4 IELNUM4 ! (R)
INTEGER*4 ISTPB4 ! (R)
INTEGER*4 ISTPE4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
IXELEV4 = IXELEV
- IELNUM4 = IELNUM
ISTPB4 = ISTPB
ISTPE4 = ISTPE
- CALL EXGEVT4 (IDEXO4, IXELEV4, IELNUM4, ISTPB4, ISTPE4,
+ CALL EXGEVT4 (IDEXO4, IXELEV4, IELNUM, ISTPB4, ISTPE4,
& VALEV, IERR4)
IERR = IERR4
END
@@ -905,16 +627,12 @@ C
INTEGER*4 IDEXO4 ! (R)
INTEGER*4 ISTEP4 ! (R)
INTEGER*4 IXV4 ! (R)
- INTEGER*4 ID4 ! (R)
- INTEGER*4 NUM4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
ISTEP4 = ISTEP
IXV4 = IXV
- ID4 = ID
- NUM4 = NUM
- CALL EXGNSV4 (IDEXO4, ISTEP4, IXV4, ID4, NUM4, VAL, IERR4)
+ CALL EXGNSV4 (IDEXO4, ISTEP4, IXV4, ID, NUM, VAL, IERR4)
IERR = IERR4
END
@@ -934,17 +652,13 @@ C
INTEGER*4 IDEXO4 ! (R)
INTEGER*4 ISTEP4 ! (R)
- INTEGER*4 IXV4 ! (R)
- INTEGER*4 ID4 ! (R)
- INTEGER*4 NUM4 ! (R)
+ INTEGER*4 IXV4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
ISTEP4 = ISTEP
IXV4 = IXV
- ID4 = ID
- NUM4 = NUM
- CALL EXGSSV4 (IDEXO4, ISTEP4, IXV4, ID4, NUM4, VAL, IERR4)
+ CALL EXGSSV4 (IDEXO4, ISTEP4, IXV4, ID, NUM, VAL, IERR4)
IERR = IERR4
END
@@ -1035,23 +749,11 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 NDIM4 ! (W)
- INTEGER*4 NUMNP4 ! (W)
- INTEGER*4 NUMEL4 ! (W)
- INTEGER*4 NELBLK4 ! (W)
- INTEGER*4 NUMNPS4 ! (W)
- INTEGER*4 NUMESS4 ! (W)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
- CALL EXGINI4 (IDEXO4, TITLE, NDIM4, NUMNP4, NUMEL4, NELBLK4,
- & NUMNPS4, NUMESS4, IERR4)
- NDIM = NDIM4
- NUMNP = NUMNP4
- NUMEL = NUMEL4
- NELBLK = NELBLK4
- NUMNPS = NUMNPS4
- NUMESS = NUMESS4
+ CALL EXGINI4 (IDEXO4, TITLE, NDIM, NUMNP, NUMEL, NELBLK,
+ & NUMNPS, NUMESS, IERR4)
IERR = IERR4
END
@@ -1112,24 +814,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 MAPEL4 (1) ! (W)
- POINTER (PMAPEL4, MAPEL4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
-
- INTEGER NEXELEM
-
IDEXO4 = IDEXO
- INFREQ4 = EXELEM
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXELEM = INTRET4
- CALL I4ALLOC (NEXELEM, PMAPEL4)
- CALL EXGMAP4 (IDEXO4, MAPEL4, IERR4)
- CALL I4I8 (NEXELEM, PMAPEL4, MAPEL)
+ CALL EXGMAP4 (IDEXO4, MAPEL, IERR4)
IERR = IERR4
END
@@ -1144,24 +832,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 MAPNOD4 (1) ! (W)
- POINTER (PMAPNOD4, MAPNOD4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
-
- INTEGER NEXNODE
-
IDEXO4 = IDEXO
- INFREQ4 = EXNODE
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXNODE = INTRET4
- CALL I4ALLOC (NEXNODE, PMAPNOD4)
- CALL EXGNNM4 (IDEXO4, MAPNOD4, IERR4)
- CALL I4I8 (NEXNODE, PMAPNOD4, MAPNOD)
+ CALL EXGNNM4 (IDEXO4, MAPNOD, IERR4)
IERR = IERR4
END
@@ -1177,26 +851,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 MAPID4 ! (R)
- INTEGER*4 MAPNOD4 (1) ! (W)
- POINTER (PMAPNOD4, MAPNOD4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
-
- INTEGER NEXNODE
-
IDEXO4 = IDEXO
- MAPID4 = MAPID
- INFREQ4 = EXNODE
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXNODE = INTRET4
- CALL I4ALLOC (NEXNODE, PMAPNOD4)
- CALL EXGNM4 (IDEXO4, MAPID4, MAPNOD4, IERR4)
- CALL I4I8 (NEXNODE, PMAPNOD4, MAPNOD)
+ CALL EXGNM4 (IDEXO4, MAPID, MAPNOD, IERR4)
IERR = IERR4
END
@@ -1213,16 +871,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDNPS4 ! (R)
- INTEGER*4 NNNPS4 ! (W)
- INTEGER*4 NDNPS4 ! (W)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
- IDNPS4 = IDNPS
- CALL EXGNP4 (IDEXO4, IDNPS4, NNNPS4, NDNPS4, IERR4)
- NNNPS = NNNPS4
- NDNPS = NDNPS4
+ CALL EXGNP4 (IDEXO4, IDNPS, NNNPS, NDNPS, IERR4)
IERR = IERR4
END
@@ -1238,22 +890,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDNPS4 ! (R)
- INTEGER*4 LTNNPS4 (1) ! (W)
- POINTER (PLTNNPS4, LTNNPS4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 NNNPS4
- INTEGER*4 NDNPS4
- integer nnnps
-
IDEXO4 = IDEXO
- IDNPS4 = IDNPS
- CALL EXGNP4 (IDEXO4, IDNPS4, NNNPS4, NDNPS4, IERR4)
- nnnps = nnnps4
- CALL I4ALLOC (NNNPS, PLTNNPS4)
- CALL EXGNS4 (IDEXO4, IDNPS4, LTNNPS4, IERR4)
- CALL I4I8 (NNNPS, PLTNNPS4, LTNNPS)
+ CALL EXGNS4 (IDEXO4, IDNPS, LTNNPS, IERR4)
IERR = IERR4
END
@@ -1269,13 +909,11 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDNPS4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
- IDNPS4 = IDNPS
- CALL EXGNSD4 (IDEXO4, IDNPS4, FACNPS, IERR4)
+ CALL EXGNSD4 (IDEXO4, IDNPS, FACNPS, IERR4)
IERR = IERR4
END
@@ -1290,24 +928,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDNPSS4 (1) ! (W)
- POINTER (PIDNPSS4, IDNPSS4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
-
- INTEGER NEXNODS
-
IDEXO4 = IDEXO
- INFREQ4 = EXNODS
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXNODS = INTRET4
- CALL I4ALLOC (NEXNODS, PIDNPSS4)
- CALL EXGNSI4 (IDEXO4, IDNPSS4, IERR4)
- CALL I4I8 (NEXNODS, PIDNPSS4, IDNPSS)
+ CALL EXGNSI4 (IDEXO4, IDNPSS, IERR4)
IERR = IERR4
END
@@ -1327,14 +951,12 @@ C
INTEGER*4 IDEXO4 ! (R)
INTEGER*4 ISTEP4 ! (R)
INTEGER*4 IXNODV4 ! (R)
- INTEGER*4 NUMNP4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
ISTEP4 = ISTEP
IXNODV4 = IXNODV
- NUMNP4 = NUMNP
- CALL EXGNV4 (IDEXO4, ISTEP4, IXNODV4, NUMNP4, VALNV, IERR4)
+ CALL EXGNV4 (IDEXO4, ISTEP4, IXNODV4, NUMNP, VALNV, IERR4)
IERR = IERR4
END
@@ -1355,17 +977,15 @@ C
INTEGER*4 IDEXO4 ! (R)
INTEGER*4 IXNODV4 ! (R)
- INTEGER*4 NODNUM4 ! (R)
INTEGER*4 ISTPB4 ! (R)
INTEGER*4 ISTPE4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
IXNODV4 = IXNODV
- NODNUM4 = NODNUM
ISTPB4 = ISTPB
ISTPE4 = ISTPE
- CALL EXGNVT4 (IDEXO4, IXNODV4, NODNUM4, ISTPB4, ISTPE4,
+ CALL EXGNVT4 (IDEXO4, IXNODV4, NODNUM, ISTPB4, ISTPE4,
& VALNV, IERR4)
IERR = IERR4
END
@@ -1385,15 +1005,11 @@ C
INTEGER*4 IDEXO4 ! (R)
INTEGER*4 ITYPE4 ! (R)
- INTEGER*4 ID4 ! (R)
- INTEGER*4 IVAL4 ! (W)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
ITYPE4 = ITYPE
- ID4 = ID
- CALL EXGP4 (IDEXO4, ITYPE4, ID4, NAMEPR, IVAL4, IERR4)
- IVAL = IVAL4
+ CALL EXGP4 (IDEXO4, ITYPE4, ID, NAMEPR, IVAL, IERR4)
IERR = IERR4
END
@@ -1411,35 +1027,11 @@ C
INTEGER*4 IDEXO4 ! (R)
INTEGER*4 ITYPE4 ! (R)
- INTEGER*4 IVAL4 (1) ! (W)
- POINTER (PIVAL4, IVAL4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
-
- INTEGER NUMOBJ
-
IDEXO4 = IDEXO
ITYPE4 = ITYPE
- IF (ITYPE4 .EQ. EXEBLK) THEN
- INFREQ4 = EXELBL
- ELSE IF (ITYPE4 .EQ. EXNSET) THEN
- INFREQ4 = EXNODS
- ELSE IF (ITYPE4 .EQ. EXSSET) THEN
- INFREQ4 = EXSIDS
- ELSE IF (ITYPE4 .EQ. EXEMAP) THEN
- INFREQ4 = EXNEM
- ELSE IF (ITYPE4 .EQ. EXNMAP) THEN
- INFREQ4 = EXNNM
- END IF
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NUMOBJ = INTRET4
- CALL I4ALLOC (NUMOBJ, PIVAL4)
- CALL EXGPA4 (IDEXO4, ITYPE4, NAMEPR, IVAL4, IERR4)
- CALL I4I8 (NUMOBJ, PIVAL4, IVAL)
+ CALL EXGPA4 (IDEXO4, ITYPE4, NAMEPR, IVAL, IERR4)
IERR = IERR4
END
@@ -1495,16 +1087,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDESS4 ! (R)
- INTEGER*4 NSESS4 ! (W)
- INTEGER*4 NDESS4 ! (W)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
- IDESS4 = IDESS
- CALL EXGSP4 (IDEXO4, IDESS4, NSESS4, NDESS4, IERR4)
- NSESS = NSESS4
- NDESS = NDESS4
+ CALL EXGSP4 (IDEXO4, IDESS, NSESS, NDESS, IERR4)
IERR = IERR4
END
@@ -1520,14 +1106,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDESS4 ! (R)
- INTEGER*4 NNESS4 ! (W)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
- IDESS4 = IDESS
- CALL EXGSNL4 (IDEXO4, IDESS4, NNESS4, IERR4)
- NNESS = NNESS4
+ CALL EXGSNL4 (IDEXO4, IDESS, NNESS, IERR4)
IERR = IERR4
END
@@ -1544,27 +1126,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDESS4 ! (R)
- INTEGER*4 LTEESS4 (1) ! (W)
- INTEGER*4 LTSESS4 (1) ! (W)
- POINTER (PLTEESS4, LTEESS4)
- POINTER (PLTSESS4, LTSESS4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 NSESS4
- INTEGER*4 NDESS4
-
- integer nsess
-
IDEXO4 = IDEXO
- IDESS4 = IDESS
- CALL EXGSP4 (IDEXO4, IDESS4, NSESS4, NDESS4, IERR4)
- nsess = nsess4
- CALL I4ALLOC (NSESS, PLTEESS4)
- CALL I4ALLOC (NSESS, PLTSESS4)
- CALL EXGSS4 (IDEXO4, IDESS4, LTEESS4, LTSESS4, IERR4)
- CALL I4I8 (NSESS, PLTEESS4, LTEESS)
- CALL I4I8 (NSESS, PLTSESS4, LTSESS)
+ CALL EXGSS4 (IDEXO4, IDESS, LTEESS, LTSESS, IERR4)
IERR = IERR4
END
@@ -1580,13 +1145,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDESS4 ! (R)
INTEGER*4 IERR4 ! (W)
-
IDEXO4 = IDEXO
- IDESS4 = IDESS
- CALL EXGSSD4 (IDEXO4, IDESS4, FACESS, IERR4)
+ CALL EXGSSD4 (IDEXO4, IDESS, FACESS, IERR4)
IERR = IERR4
END
@@ -1601,23 +1163,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDESSS4 (1) ! (W)
- POINTER (PIDESSS4, IDESSS4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
- INTEGER NEXSIDS
-
IDEXO4 = IDEXO
- INFREQ4 = EXSIDS
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXSIDS = INTRET4
- CALL I4ALLOC (NEXSIDS, PIDESSS4)
- CALL EXGSSI4 (IDEXO4, IDESSS4, IERR4)
- CALL I4I8 (NEXSIDS, PIDESSS4, IDESSS)
+ CALL EXGSSI4 (IDEXO4, IDESSS, IERR4)
IERR = IERR4
END
@@ -1634,55 +1183,16 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDESS4 ! (R)
- INTEGER*4 INCNT4 (1) ! (W)
- INTEGER*4 LTNESS4 (1) ! (W)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 TMP4(1)
- POINTER (PTMP4, TMP4)
- POINTER (PINCNT4, INCNT4)
- POINTER (PLTNESS4, LTNESS4)
-
- INTEGER*4 NSESS4
- INTEGER*4 NDESS4
- INTEGER NLTNESS
-
- INTEGER NINCNT
- integer i
-
IDEXO4 = IDEXO
- IDESS4 = IDESS
-C ... NOTE: It is not permissible to assume that the number of
-C distribution factors is the same as the number of
-C nodes associated with a sideset since some codes
-C are not maintaining that associativity...
- CALL EXGSP4 (IDEXO4, IDESS4, NSESS4, NDESS4, IERR4)
- NINCNT = NSESS4
-
-C MUST COMPUTE NODE LIST SIZE
-
- NINCNT = NSESS4
- CALL I4ALLOC (NINCNT, PTMP4)
-
- CALL EXGSSC4 (IDEXO4, IDESS4, TMP4, IERR4)
- nltness = 0
- do 11 i=1, nincnt
- nltness = nltness + tmp4(i)
- 11 continue
- CALL I4FREE (PTMP4)
- CALL I4ALLOC (NINCNT, PINCNT4)
- CALL I4ALLOC (NLTNESS, PLTNESS4)
-
- CALL EXGSSN4 (IDEXO4, IDESS4, INCNT4, LTNESS4, IERR4)
- CALL I4I8 (NLTNESS, PLTNESS4, LTNESS)
- CALL I4I8 (NINCNT, PINCNT4, INCNT)
+ CALL EXGSSN4 (IDEXO4, IDESS, INCNT, LTNESS, IERR4)
IERR = IERR4
END
SUBROUTINE EXGSSC (IDEXO, IDESS, INCNT, IERR)
C
-C READ SIDE SET NODE LIST
+C READ SIDE SET NODE LIST COUNT
C
IMPLICIT NONE
INCLUDE 'exodusII.inc'
@@ -1692,7 +1202,6 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDESS4 ! (R)
INTEGER*4 INCNT4 (1) ! (W)
POINTER (PINCNT4, INCNT4)
INTEGER*4 IERR4 ! (W)
@@ -1702,12 +1211,11 @@ C
INTEGER NINCNT
IDEXO4 = IDEXO
- IDESS4 = IDESS
- CALL EXGSP4 (IDEXO4, IDESS4, NSESS4, NDESS4, IERR4)
+ CALL EXGSP4 (IDEXO4, IDESS, NSESS4, NDESS4, IERR4)
NINCNT = NSESS4
CALL I4ALLOC (NINCNT, PINCNT4)
- CALL EXGSSC4 (IDEXO4, IDESS4, INCNT4, IERR4)
+ CALL EXGSSC4 (IDEXO4, IDESS, INCNT4, IERR4)
CALL I4I8 (NINCNT, PINCNT4, INCNT)
IERR = IERR4
@@ -1729,17 +1237,11 @@ C
POINTER (PINCNT4, INCNT4)
INTEGER*4 IERR4 ! (W)
- integer*4 nsess4
INTEGER NINCNT
- INTEGER*4 INFREQ4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
-
IDEXO4 = IDEXO
- INFREQ4 = EXSSEL
- CALL EXINQ4 (IDEXO4, INFREQ4, NSESS4, RELRET4, CHRRET, IERR4)
- NINCNT = NSESS4
+ NINCNT = EXINQI (IDEXO, EXSSEL)
+
CALL I4ALLOC (NINCNT, PINCNT4)
CALL EXGCSSC4 (IDEXO4, INCNT4, IERR4)
@@ -1955,18 +1457,35 @@ C
INTEGER*4 IDEXO4 ! (R)
INTEGER*4 INFREQ4 ! (R)
- INTEGER*4 INTRET4 ! (W)
REAL*4 RELRET4 ! (W)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
INFREQ4 = INFREQ
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- INTRET = INTRET4
+ CALL EXINQ4 (IDEXO4, INFREQ4, INTRET, RELRET4, CHRRET, IERR4)
RELRET = RELRET4
IERR = IERR4
END
+ INTEGER FUNCTION EXINQI (IDEXO, INFREQ)
+C
+C INQUIRE EXODUS PARAMETERS
+C
+ IMPLICIT NONE
+ INTEGER IDEXO ! (R)
+ INTEGER INFREQ ! (R)
+
+ INTEGER*4 EXINQI4
+ EXTERNAL EXINQI4
+
+ INTEGER*4 IDEXO4 ! (R)
+ INTEGER*4 INFREQ4 ! (R)
+
+ IDEXO4 = IDEXO
+ INFREQ4 = INFREQ
+ EXINQI = EXINQI4 (IDEXO4, INFREQ4)
+ END
+
INTEGER FUNCTION EXOPEN (PATH, IMODE, ICOMPWS, IOWS, VERS, IERR)
C
C OPEN EXODUS II FILE
@@ -1988,6 +1507,18 @@ C
INTEGER*4 IOWS4 ! (RW)
REAL*4 VERS4 ! (W)
INTEGER*4 IERR4 ! (W)
+ INTEGER*4 IFLAG4
+
+C ... This is hardwired instead of getting from exodusII.inc due to compiler errors about
+C exopen/excre already having a type...
+ integer EX_MAPS_INT64_API
+ integer EX_BULK_INT64_API
+ integer EX_IDS_INT64_API
+ integer EX_INQ_INT64_API
+ parameter (EX_MAPS_INT64_API= 8192) ! All maps (id, order, ...) store int64_t values
+ parameter (EX_IDS_INT64_API = 16384) ! All entity ids
+ parameter (EX_BULK_INT64_API= 32768) ! All integer bulk data
+ parameter (EX_INQ_INT64_API = 65536) ! All integer inquire arguments
IMODE4 = IMODE
@@ -1995,6 +1526,13 @@ C ... This needs to be set explicitly since all wrapper routines
C are passing REAL*8 and the exo_jack.c routines all take double*
ICOMPWS4 = 8
IOWS4 = IOWS
+
+C ... All wrapper routines are passing INTEGER*8, but at this
+C time, only the maps are supported...
+ IFLAG4 = EX_MAPS_INT64_API+EX_IDS_INT64_API+EX_BULK_INT64_API+
+ * EX_INQ_INT64_API
+ IMODE4 = IOR(IMODE4, IFLAG4)
+
IRET4 = EXOPEN4 (PATH, IMODE4, ICOMPWS4, IOWS4, VERS4, IERR4)
ICOMPWS = ICOMPWS4
IOWS = IOWS4
@@ -2078,51 +1616,13 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDNPSS4 (1) ! (R)
- INTEGER*4 NNNPS4 (1) ! (R)
- INTEGER*4 NDNPS4 (1) ! (R)
- INTEGER*4 IXNNPS4 (1) ! (R)
- INTEGER*4 IXDNPS4 (1) ! (R)
- INTEGER*4 LTNNPS4 (1) ! (R)
- POINTER (PIDNPSS4, IDNPSS4)
- POINTER (PNNNPS4, NNNPS4)
- POINTER (PNDNPS4, NDNPS4)
- POINTER (PIXNNPS4, IXNNPS4)
- POINTER (PIXDNPS4, IXDNPS4)
- POINTER (PLTNNPS4, LTNNPS4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
+ IDEXO4 = IDEXO
- INTEGER NEXNODS
- INTEGER NEXNSNL
- INTEGER I
+ CALL EXPCNS4 (IDEXO4, IDNPSS, NNNPS, NDNPS, IXNNPS,
+ & IXDNPS, LTNNPS, FACNPS, IERR4)
- IDEXO4 = IDEXO
- INFREQ4 = EXNODS
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXNODS = INTRET4
- NEXNSNL = 0
- DO I = 1, NEXNODS
- NEXNSNL = NEXNSNL + NNNPS(I)
- END DO
- CALL I8I4 (NEXNODS, IDNPSS, PIDNPSS4)
- CALL I8I4 (NEXNODS, NNNPS, PNNNPS4)
- CALL I8I4 (NEXNODS, NDNPS, PNDNPS4)
- CALL I8I4 (NEXNODS, IXNNPS, PIXNNPS4)
- CALL I8I4 (NEXNODS, IXDNPS, PIXDNPS4)
- CALL I8I4 (NEXNSNL, LTNNPS, PLTNNPS4)
- CALL EXPCNS4 (IDEXO4, IDNPSS4, NNNPS4, NDNPS4, IXNNPS4,
- & IXDNPS4, LTNNPS4, FACNPS, IERR4)
- CALL I4FREE (PIDNPSS4)
- CALL I4FREE (PNNNPS4)
- CALL I4FREE (PNDNPS4)
- CALL I4FREE (PIXNNPS4)
- CALL I4FREE (PIXDNPS4)
- CALL I4FREE (PLTNNPS4)
IERR = IERR4
END
@@ -2140,7 +1640,9 @@ C
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
+
CALL EXPCON4 (IDEXO4, NAMECO, IERR4)
+
IERR = IERR4
END
@@ -2160,7 +1662,9 @@ C
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
+
CALL EXPCOR4 (IDEXO4, XN, YN, ZN, IERR4)
+
IERR = IERR4
END
@@ -2183,55 +1687,13 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDESSS4 (1) ! (R)
- INTEGER*4 NSESS4 (1) ! (R)
- INTEGER*4 NDESS4 (1) ! (R)
- INTEGER*4 IXEESS4 (1) ! (R)
- INTEGER*4 IXDESS4 (1) ! (R)
- INTEGER*4 LTEESS4 (1) ! (R)
- INTEGER*4 LTSESS4 (1) ! (R)
- POINTER (PIDESSS4, IDESSS4)
- POINTER (PNSESS4, NSESS4)
- POINTER (PNDESS4, NDESS4)
- POINTER (PIXEESS4, IXEESS4)
- POINTER (PIXDESS4, IXDESS4)
- POINTER (PLTEESS4, LTEESS4)
- POINTER (PLTSESS4, LTSESS4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
+ IDEXO4 = IDEXO
- INTEGER NEXSIDS
- INTEGER NEXSSEL
- INTEGER I
+ CALL EXPCSS4 (IDEXO4, IDESSS, NSESS, NDESS, IXEESS,
+ & IXDESS, LTEESS, LTSESS, FACESS, IERR4)
- IDEXO4 = IDEXO
- INFREQ4 = EXSIDS
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXSIDS = INTRET4
- NEXSSEL = 0
- DO I = 1, NEXSIDS
- NEXSSEL = NEXSSEL + NSESS(I)
- END DO
- CALL I8I4 (NEXSIDS, IDESSS, PIDESSS4)
- CALL I8I4 (NEXSIDS, NSESS, PNSESS4)
- CALL I8I4 (NEXSIDS, NDESS, PNDESS4)
- CALL I8I4 (NEXSIDS, IXEESS, PIXEESS4)
- CALL I8I4 (NEXSIDS, IXDESS, PIXDESS4)
- CALL I8I4 (NEXSSEL, LTEESS, PLTEESS4)
- CALL I8I4 (NEXSSEL, LTSESS, PLTSESS4)
- CALL EXPCSS4 (IDEXO4, IDESSS4, NSESS4, NDESS4, IXEESS4,
- & IXDESS4, LTEESS4, LTSESS4, FACESS, IERR4)
- CALL I4FREE (PIDESSS4)
- CALL I4FREE (PNSESS4)
- CALL I4FREE (PNDESS4)
- CALL I4FREE (PIXEESS4)
- CALL I4FREE (PIXDESS4)
- CALL I4FREE (PLTEESS4)
- CALL I4FREE (PLTSESS4)
IERR = IERR4
END
@@ -2247,13 +1709,11 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDELB4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
- IDELB4 = IDELB
- CALL EXPEAT4 (IDEXO4, IDELB4, ATRIB, IERR4)
+ CALL EXPEAT4 (IDEXO4, IDELB, ATRIB, IERR4)
IERR = IERR4
END
@@ -2271,15 +1731,13 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDELB4 ! (R)
INTEGER*4 NATTR4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
- IDELB4 = IDELB
NATTR4 = NATTR
- CALL EXPEAN4 (IDEXO4, IDELB4, NATTR4, NAMES, IERR4)
+ CALL EXPEAN4 (IDEXO4, IDELB, NATTR4, NAMES, IERR4)
IERR = IERR4
END
@@ -2301,38 +1759,14 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDELB4(1) ! (R)
- INTEGER*4 NUMELB4(1) ! (R)
- INTEGER*4 NUMLNK4(1) ! (R)
- INTEGER*4 NUMATR4(1) ! (R)
INTEGER*4 MKMAP4 ! (R)
- POINTER (PIDELB4, IDELB4)
- POINTER (PNUMELB4, NUMELB4)
- POINTER (PNUMLNK4, NUMLNK4)
- POINTER (PNUMATR4, NUMATR4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
-
- INTEGER NUMBLK
-
IDEXO4 = IDEXO
-
- INFREQ4 = EXELBL
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NUMBLK = INTRET4
-
- CALL I8I4 (NUMBLK, IDELB, PIDELB4)
- CALL I8I4 (NUMBLK, NUMELB, PNUMELB4)
- CALL I8I4 (NUMBLK, NUMLNK, PNUMLNK4)
- CALL I8I4 (NUMBLK, NUMATR, PNUMATR4)
MKMAP4 = MKMAP
- CALL EXPCLB4 (IDEXO4, IDELB4, NAMELB, NUMELB4, NUMLNK4,
- & NUMATR4, MKMAP4, IERR4)
+ CALL EXPCLB4 (IDEXO4, IDELB, NAMELB, NUMELB, NUMLNK,
+ & NUMATR, MKMAP4, IERR4)
IERR = IERR4
END
@@ -2352,19 +1786,13 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDELB4 ! (R)
- INTEGER*4 NUMELB4 ! (R)
- INTEGER*4 NUMLNK4 ! (R)
- INTEGER*4 NUMATR4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
- IDELB4 = IDELB
- NUMELB4 = NUMELB
- NUMLNK4 = NUMLNK
- NUMATR4 = NUMATR
- CALL EXPELB4 (IDEXO4, IDELB4, NAMELB, NUMELB4, NUMLNK4,
- & NUMATR4, IERR4)
+
+ CALL EXPELB4 (IDEXO4, IDELB, NAMELB, NUMELB, NUMLNK,
+ & NUMATR, IERR4)
+
IERR = IERR4
END
@@ -2380,38 +1808,18 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDELB4 ! (R)
- INTEGER*4 LINK4 (1) ! (NUMLNK,NUMELB) ! (R)
- POINTER (PLINK4, LINK4)
INTEGER*4 IERR4 ! (W)
- CHARACTER* (MXSTLN) NAMELB
- INTEGER*4 NUMELB4
- INTEGER*4 NUMLNK4
- INTEGER*4 NUMATR4
- INTEGER NUMLNK
- INTEGER NUMELB
-
IDEXO4 = IDEXO
- IDELB4 = IDELB
- CALL EXGELB4 (IDEXO4, IDELB4, NAMELB, NUMELB4, NUMLNK4,
- & NUMATR4, IERR4)
- NUMLNK = NUMLNK4
- NUMELB = NUMELB4
-
- IF (NAMELB .EQ. 'NSIDED' .OR. NAMELB .EQ. 'nsided') THEN
- CALL I8I4 (NUMLNK, LINK, PLINK4)
- ELSE
- CALL I8I4 (NUMLNK*NUMELB, LINK, PLINK4)
- ENDIF
- CALL EXPELC4 (IDEXO4, IDELB4, LINK4, IERR4)
- CALL I4FREE (PLINK4)
+
+ CALL EXPELC4 (IDEXO4, IDELB, LINK, IERR4)
+
IERR = IERR4
END
SUBROUTINE EXPECPP (IDEXO, ITYPE, IDELB, COUNTS, IERR)
C
-C WRITE ELEMENT BLOCK CONNECTIVITY
+C WRITE ELEMENT BLOCK ELEMENT COUNT PER POLYHEDRA
C
IMPLICIT NONE
INCLUDE 'exodusII.inc'
@@ -2423,27 +1831,24 @@ C
INTEGER*4 IDEXO4 ! (R)
INTEGER*4 ITYPE4 ! (R)
- INTEGER*4 IDELB4 ! (R)
INTEGER*4 COUNTS4 (1) ! (NUMELB) ! (R)
POINTER (PCOUNTS4, COUNTS4)
INTEGER*4 IERR4 ! (W)
CHARACTER* (MXSTLN) NAMELB
- INTEGER*4 NUMELB4
- INTEGER*4 NUMLNK4
- INTEGER*4 NUMATR4
- INTEGER NUMLNK
INTEGER NUMELB
-
+ INTEGER NUMLNK
+ INTEGER NUMATR
+
IDEXO4 = IDEXO
ITYPE4 = ITYPE
- IDELB4 = IDELB
- CALL EXGELB4 (IDEXO4, IDELB4, NAMELB, NUMELB4, NUMLNK4,
- & NUMATR4, IERR4)
- numelb = numelb4
+
+ CALL EXGELB4 (IDEXO4, IDELB, NAMELB, NUMELB, NUMLNK,
+ & NUMATR, IERR4)
+
CALL I8I4 (NUMELB, COUNTS, PCOUNTS4)
- CALL EXPECPP4 (IDEXO4, ITYPE4, IDELB4, COUNTS4, IERR4)
+ CALL EXPECPP4 (IDEXO4, ITYPE4, IDELB, COUNTS4, IERR4)
CALL I4FREE (PCOUNTS4)
IERR = IERR4
END
@@ -2459,24 +1864,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 MAPEL4 (1) ! (R)
- POINTER (PMAPEL4, MAPEL4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
-
- INTEGER NEXELEM
-
IDEXO4 = IDEXO
- INFREQ4 = EXELEM
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXELEM = INTRET4
- CALL I8I4 (NEXELEM, MAPEL, PMAPEL4)
- CALL EXPENM4 (IDEXO4, MAPEL4, IERR4)
- CALL I4FREE (PMAPEL4)
+ CALL EXPENM4 (IDEXO4, MAPEL, IERR4)
IERR = IERR4
END
@@ -2492,26 +1883,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 MAPID4 ! (R)
- INTEGER*4 MAPEL4 (1) ! (R)
- POINTER (PMAPEL4, MAPEL4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
-
- INTEGER NEXELEM
-
IDEXO4 = IDEXO
- INFREQ4 = EXELEM
- MAPID4 = MAPID
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXELEM = INTRET4
- CALL I8I4 (NEXELEM, MAPEL, PMAPEL4)
- CALL EXPEM4 (IDEXO4, MAPID4, MAPEL4, IERR4)
- CALL I4FREE (PMAPEL4)
+ CALL EXPEM4 (IDEXO4, MAPID, MAPEL, IERR4)
IERR = IERR4
END
@@ -2529,20 +1904,12 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 MAPID4 ! (R)
- INTEGER*4 ISTART4 ! (R)
- INTEGER*4 ICOUNT4 ! (R)
- INTEGER*4 MAPEL4 (1) ! (R)
- POINTER (PMAPEL4, MAPEL4)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
- MAPID4 = MAPID
- ISTART4 = ISTART
- ICOUNT4 = ICOUNT
- CALL I8I4 (ICOUNT, MAPEL, PMAPEL4)
- CALL EXPPEM4 (IDEXO4, MAPID4, ISTART4, ICOUNT4, MAPEL4, IERR4)
- CALL I4FREE (PMAPEL4)
+
+ CALL EXPPEM4 (IDEXO4, MAPID, ISTART, ICOUNT, MAPEL, IERR4)
+
IERR = IERR4
END
@@ -2564,16 +1931,12 @@ C
INTEGER*4 IDEXO4 ! (R)
INTEGER*4 ISTEP4 ! (R)
INTEGER*4 IXELEV4 ! (R)
- INTEGER*4 IDELB4 ! (R)
- INTEGER*4 NUMELB4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
ISTEP4 = ISTEP
IXELEV4 = IXELEV
- IDELB4 = IDELB
- NUMELB4 = NUMELB
- CALL EXPEV4 (IDEXO4, ISTEP4, IXELEV4, IDELB4, NUMELB4,
+ CALL EXPEV4 (IDEXO4, ISTEP4, IXELEV4, IDELB, NUMELB,
& VALEV, IERR4)
IERR = IERR4
END
@@ -2595,16 +1958,12 @@ C
INTEGER*4 IDEXO4 ! (R)
INTEGER*4 ISTEP4 ! (R)
INTEGER*4 IXV4 ! (R)
- INTEGER*4 ID4 ! (R)
- INTEGER*4 NUM4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
ISTEP4 = ISTEP
IXV4 = IXV
- ID4 = ID
- NUM4 = NUM
- CALL EXPNSV4 (IDEXO4, ISTEP4, IXV4, ID4, NUM4, VAL, IERR4)
+ CALL EXPNSV4 (IDEXO4, ISTEP4, IXV4, ID, NUM, VAL, IERR4)
IERR = IERR4
END
@@ -2625,16 +1984,12 @@ C
INTEGER*4 IDEXO4 ! (R)
INTEGER*4 ISTEP4 ! (R)
INTEGER*4 IXV4 ! (R)
- INTEGER*4 ID4 ! (R)
- INTEGER*4 NUM4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
ISTEP4 = ISTEP
IXV4 = IXV
- ID4 = ID
- NUM4 = NUM
- CALL EXPSSV4 (IDEXO4, ISTEP4, IXV4, ID4, NUM4, VAL, IERR4)
+ CALL EXPSSV4 (IDEXO4, ISTEP4, IXV4, ID, NUM, VAL, IERR4)
IERR = IERR4
END
@@ -2701,23 +2056,11 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 NDIM4 ! (R)
- INTEGER*4 NUMNP4 ! (R)
- INTEGER*4 NUMEL4 ! (R)
- INTEGER*4 NELBLK4 ! (R)
- INTEGER*4 NUMNPS4 ! (R)
- INTEGER*4 NUMESS4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
- NDIM4 = NDIM
- NUMNP4 = NUMNP
- NUMEL4 = NUMEL
- NELBLK4 = NELBLK
- NUMNPS4 = NUMNPS
- NUMESS4 = NUMESS
- CALL EXPINI4 (IDEXO4, TITLE, NDIM4, NUMNP4, NUMEL4, NELBLK4,
- & NUMNPS4, NUMESS4, IERR4)
+ CALL EXPINI4 (IDEXO4, TITLE, NDIM, NUMNP, NUMEL, NELBLK,
+ & NUMNPS, NUMESS, IERR4)
IERR = IERR4
END
@@ -2732,24 +2075,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 MAPEL4 (1) ! (R)
- POINTER (PMAPEL4, MAPEL4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
-
- INTEGER NEXELEM
-
IDEXO4 = IDEXO
- INFREQ4 = EXELEM
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXELEM = INTRET4
- CALL I8I4 (NEXELEM, MAPEL, PMAPEL4)
- CALL EXPMAP4 (IDEXO4, MAPEL4, IERR4)
- CALL I4FREE (PMAPEL4)
+ CALL EXPMAP4 (IDEXO4, MAPEL, IERR4)
IERR = IERR4
END
@@ -2764,24 +2093,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 MAPNOD4 (1) ! (R)
- POINTER (PMAPNOD4, MAPNOD4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
-
- INTEGER NEXNODE
-
IDEXO4 = IDEXO
- INFREQ4 = EXNODE
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXNODE = INTRET4
- CALL I8I4 (NEXNODE, MAPNOD, PMAPNOD4)
- CALL EXPNNM4 (IDEXO4, MAPNOD4, IERR4)
- CALL I4FREE (PMAPNOD4)
+ CALL EXPNNM4 (IDEXO4, MAPNOD, IERR4)
IERR = IERR4
END
@@ -2797,26 +2112,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 MAPID4 ! (R)
- INTEGER*4 MAPNOD4 (1) ! (R)
- POINTER (PMAPNOD4, MAPNOD4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
-
- INTEGER NEXNODE
-
IDEXO4 = IDEXO
- INFREQ4 = EXNODE
- MAPID4 = MAPID
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NEXNODE = INTRET4
- CALL I8I4 (NEXNODE, MAPNOD, PMAPNOD4)
- CALL EXPNM4 (IDEXO4, MAPID4, MAPNOD4, IERR4)
- CALL I4FREE (PMAPNOD4)
+ CALL EXPNM4 (IDEXO4, MAPID, MAPNOD, IERR4)
IERR = IERR4
END
@@ -2833,16 +2132,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDNPS4 ! (R)
- INTEGER*4 NNNPS4 ! (R)
- INTEGER*4 NDNPS4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
- IDNPS4 = IDNPS
- NNNPS4 = NNNPS
- NDNPS4 = NDNPS
- CALL EXPNP4 (IDEXO4, IDNPS4, NNNPS4, NDNPS4, IERR4)
+ CALL EXPNP4 (IDEXO4, IDNPS, NNNPS, NDNPS, IERR4)
IERR = IERR4
END
@@ -2858,22 +2151,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDNPS4 ! (R)
- INTEGER*4 LTNNPS4 (1) ! (R)
- POINTER (PLTNNPS4, LTNNPS4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 NNNPS4
- INTEGER*4 NDNPS4
- integer nnnps
-
IDEXO4 = IDEXO
- IDNPS4 = IDNPS
- CALL EXGNP4 (IDEXO4, IDNPS4, NNNPS4, NDNPS4, IERR4)
- nnnps = nnnps4
- CALL I8I4 (NNNPS, LTNNPS, PLTNNPS4)
- CALL EXPNS4 (IDEXO4, IDNPS4, LTNNPS4, IERR4)
- CALL I4FREE (PLTNNPS4)
+ CALL EXPNS4 (IDEXO4, IDNPS, LTNNPS, IERR4)
IERR = IERR4
END
@@ -2889,12 +2170,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDNPS4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
- IDNPS4 = IDNPS
- CALL EXPNSD4 (IDEXO4, IDNPS4, FACNPS, IERR4)
+ CALL EXPNSD4 (IDEXO4, IDNPS, FACNPS, IERR4)
IERR = IERR4
END
@@ -2914,14 +2193,12 @@ C
INTEGER*4 IDEXO4 ! (R)
INTEGER*4 ISTEP4 ! (R)
INTEGER*4 IXNODV4 ! (R)
- INTEGER*4 NUMNP4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
ISTEP4 = ISTEP
IXNODV4 = IXNODV
- NUMNP4 = NUMNP
- CALL EXPNV4 (IDEXO4, ISTEP4, IXNODV4, NUMNP4, VALNV, IERR4)
+ CALL EXPNV4 (IDEXO4, ISTEP4, IXNODV4, NUMNP, VALNV, IERR4)
IERR = IERR4
END
@@ -2940,15 +2217,11 @@ C
INTEGER*4 IDEXO4 ! (R)
INTEGER*4 ITYPE4 ! (R)
- INTEGER*4 ID4 ! (R)
- INTEGER*4 IVAL4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
ITYPE4 = ITYPE
- ID4 = ID
- IVAL4 = IVAL
- CALL EXPP4 (IDEXO4, ITYPE4, ID4, NAMEPR, IVAL4, IERR4)
+ CALL EXPP4 (IDEXO4, ITYPE4, ID, NAMEPR, IVAL, IERR4)
IERR = IERR4
END
@@ -2966,35 +2239,11 @@ C
INTEGER*4 IDEXO4 ! (R)
INTEGER*4 ITYPE4 ! (R)
- INTEGER*4 IVAL4 (1) ! (R)
- POINTER (PIVAL4, IVAL4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 INFREQ4
- INTEGER*4 INTRET4
- REAL*4 RELRET4
- CHARACTER* (4) CHRRET
-
- INTEGER NUMOBJ
-
IDEXO4 = IDEXO
ITYPE4 = ITYPE
- IF (ITYPE4 .EQ. EXEBLK) THEN
- INFREQ4 = EXELBL
- ELSE IF (ITYPE4 .EQ. EXNSET) THEN
- INFREQ4 = EXNODS
- ELSE IF (ITYPE4 .EQ. EXSSET) THEN
- INFREQ4 = EXSIDS
- ELSE IF (ITYPE4 .EQ. EXEMAP) THEN
- INFREQ4 = EXNEM
- ELSE IF (ITYPE4 .EQ. EXNMAP) THEN
- INFREQ4 = EXNNM
- END IF
- CALL EXINQ4 (IDEXO4, INFREQ4, INTRET4, RELRET4, CHRRET, IERR4)
- NUMOBJ = INTRET4
- CALL I8I4 (NUMOBJ, IVAL, PIVAL4)
- CALL EXPPA4 (IDEXO4, ITYPE4, NAMEPR, IVAL4, IERR4)
- CALL I4FREE (PIVAL4)
+ CALL EXPPA4 (IDEXO4, ITYPE4, NAMEPR, IVAL, IERR4)
IERR = IERR4
END
@@ -3056,16 +2305,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDESS4 ! (R)
- INTEGER*4 NSESS4 ! (R)
- INTEGER*4 NDESS4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
- IDESS4 = IDESS
- NSESS4 = NSESS
- NDESS4 = NDESS
- CALL EXPSP4 (IDEXO4, IDESS4, NSESS4, NDESS4, IERR4)
+ CALL EXPSP4 (IDEXO4, IDESS, NSESS, NDESS, IERR4)
IERR = IERR4
END
@@ -3082,26 +2325,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDESS4 ! (R)
- INTEGER*4 LTEESS4 (1) ! (R)
- INTEGER*4 LTSESS4 (1) ! (R)
- POINTER (PLTEESS4, LTEESS4)
- POINTER (PLTSESS4, LTSESS4)
INTEGER*4 IERR4 ! (W)
- INTEGER*4 NSESS4
- INTEGER*4 NDESS4
- integer nsess
-
IDEXO4 = IDEXO
- IDESS4 = IDESS
- CALL EXGSP4 (IDEXO4, IDESS4, NSESS4, NDESS4, IERR4)
- nsess = nsess4
- CALL I8I4 (NSESS, LTEESS, PLTEESS4)
- CALL I8I4 (NSESS, LTSESS, PLTSESS4)
- CALL EXPSS4 (IDEXO4, IDESS4, LTEESS4, LTSESS4, IERR4)
- CALL I4FREE (PLTEESS4)
- CALL I4FREE (PLTSESS4)
+ CALL EXPSS4 (IDEXO4, IDESS, LTEESS, LTSESS, IERR4)
IERR = IERR4
END
@@ -3117,12 +2344,10 @@ C
INTEGER IERR ! (W)
INTEGER*4 IDEXO4 ! (R)
- INTEGER*4 IDESS4 ! (R)
INTEGER*4 IERR4 ! (W)
IDEXO4 = IDEXO
- IDESS4 = IDESS
- CALL EXPSSD4 (IDEXO4, IDESS4, FACESS, IERR4)
+ CALL EXPSSD4 (IDEXO4, IDESS, FACESS, IERR4)
IERR = IERR4
END
@@ -3360,6 +2585,1180 @@ C
END
+C-----------------------------------------------------------------------
+C
+C Get initial information from nemesis file
+C
+ subroutine exgii (idexo, nproc, nproc_in_f, ftype, ierr)
+ implicit none
+ integer idexo
+ integer nproc
+ integer nproc_in_f
+ character*(*) ftype
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 nproc4
+ integer*4 nproc_in_f4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call exgii4 (idexo4, nproc4, nproc_in_f4, ftype, ierr4)
+ nproc = nproc4
+ nproc_in_f = nproc_in_f4
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write initial information from nemesis file
+C
+ subroutine expii (idexo, nproc, nproc_in_f, ftype, ierr)
+ implicit none
+ integer idexo
+ integer nproc
+ integer nproc_in_f
+ character*(*) ftype
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 nproc4
+ integer*4 nproc_in_f4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ nproc4 = nproc
+ nproc_in_f4 = nproc_in_f
+ call expii4 (idexo4, nproc4, nproc_in_f4, ftype, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Read initial global information
+C
+ subroutine exgig (idexo, nnodes_g, nelems_g, nelem_blks_g,
+ $ nnode_sets_g, nside_sets_g, ierr)
+ implicit none
+ integer idexo
+ integer nnodes_g
+ integer nelems_g
+ integer nelem_blks_g
+ integer nnode_sets_g
+ integer nside_sets_g
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call exgig4 (idexo4, nnodes_g, nelems_g, nelem_blks_g,
+ $ nnode_sets_g, nside_sets_g, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write initial global information
+C
+ subroutine expig (idexo, nnodes_g, nelems_g, nelem_blks_g,
+ $ nnode_sets_g, nside_sets_g, ierr)
+ implicit none
+ integer idexo
+ integer nnodes_g
+ integer nelems_g
+ integer nelem_blks_g
+ integer nnode_sets_g
+ integer nside_sets_g
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call expig4 (idexo4, nnodes_g, nelems_g, nelem_blks_g,
+ $ nnode_sets_g, nside_sets_g, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Read load balance parameters
+C
+ subroutine exglbp (idexo, nint_nodes, nbor_nodes, next_nodes,
+ $ nint_elems, nbor_elems, nnode_cmaps, nelem_cmaps,
+ $ processor, ierr)
+ implicit none
+ integer idexo
+ integer nint_nodes
+ integer nbor_nodes
+ integer next_nodes
+ integer nint_elems
+ integer nbor_elems
+ integer nnode_cmaps
+ integer nelem_cmaps
+ integer processor
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 processor4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ processor4 = processor
+ call exglbp4 (idexo4, nint_nodes, nbor_nodes, next_nodes,
+ $ nint_elems, nbor_elems, nnode_cmaps, nelem_cmaps,
+ $ processor4, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write load balance parameters
+C
+ subroutine explbp (idexo, nint_nodes, nbor_nodes, next_nodes,
+ $ nint_elems, nbor_elems, nnode_cmaps, nelem_cmaps,
+ $ processor, ierr)
+ implicit none
+ integer idexo
+ integer nint_nodes
+ integer nbor_nodes
+ integer next_nodes
+ integer nint_elems
+ integer nbor_elems
+ integer nnode_cmaps
+ integer nelem_cmaps
+ integer processor
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 processor4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ processor4 = processor
+ call explbp4 (idexo4, nint_nodes, nbor_nodes, next_nodes,
+ $ nint_elems, nbor_elems, nnode_cmaps, nelem_cmaps,
+ $ processor4, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write concatenated load balance parameters
+C
+ subroutine explbpc (idexo, nint_nodes, nbor_nodes, next_nodes,
+ $ nint_elems, nbor_elems, nnode_cmaps, nelem_cmaps, ierr)
+ implicit none
+ integer idexo
+ integer nint_nodes(*)
+ integer nbor_nodes(*)
+ integer next_nodes(*)
+ integer nint_elems(*)
+ integer nbor_elems(*)
+ integer nnode_cmaps(*)
+ integer nelem_cmaps(*)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call explbpc4 (idexo4, nint_nodes, nbor_nodes, next_nodes,
+ $ nint_elems, nbor_elems, nnode_cmaps, nelem_cmaps,
+ $ ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Read global node set parameters
+C
+ subroutine exgnspg (idexo, ns_ids_glob, ns_n_cnt_glob,
+ $ ns_df_cnt_glob, ierr)
+ implicit none
+ integer idexo
+ integer ns_ids_glob(*)
+ integer ns_n_cnt_glob(*)
+ integer ns_df_cnt_glob(*)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call exgnspg4 (idexo4, ns_ids_glob, ns_n_cnt_glob,
+ $ ns_df_cnt_glob, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write global node set parameters
+C
+ subroutine expnspg (idexo, global_ids, global_n_cnts,
+ $ global_df_cnts, ierr)
+ integer idexo
+ integer global_ids(*)
+ integer global_n_cnts(*)
+ integer global_df_cnts(*)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call expnspg4 (idexo4, global_ids, global_n_cnts,
+ $ global_df_cnts, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Read global side set parameters
+C
+ subroutine exgsspg (idexo, ss_ids_glob, ss_n_cnt_glob,
+ $ ss_df_cnt_glob, ierr)
+ implicit none
+ integer idexo
+ integer ss_ids_glob(*)
+ integer ss_n_cnt_glob(*)
+ integer ss_df_cnt_glob(*)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call exgsspg4 (idexo4, ss_ids_glob, ss_n_cnt_glob,
+ $ ss_df_cnt_glob, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write global side set parameters
+C
+ subroutine expsspg (idexo, global_ids, global_el_cnts,
+ $ global_df_cnts, ierr)
+ implicit none
+ integer idexo
+ integer global_ids(*)
+ integer global_el_cnts(*)
+ integer global_df_cnts(*)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call expsspg4 (idexo4, global_ids, global_el_cnts,
+ $ global_df_cnts, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Read global element block information
+C
+ subroutine exgebig (idexo, el_blk_ids, el_blk_cnts, ierr)
+ implicit none
+ integer idexo
+ integer el_blk_ids(*)
+ integer el_blk_cnts(*)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call exgebig4 (idexo4, el_blk_ids, el_blk_cnts, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write global element block information
+C
+ subroutine expebig (idexo, el_blk_ids, el_blk_cnts, ierr)
+ implicit none
+ integer idexo
+ integer el_blk_ids(*)
+ integer el_blk_cnts(*)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call expebig4 (idexo4, el_blk_ids, el_blk_cnts, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Read side set element list and side set side list
+C
+ subroutine exgnss (idexo, ss_id, start_side_num, num_sides,
+ $ ss_elem_list, ss_side_list, ierr)
+ implicit none
+ integer idexo
+ integer ss_id
+ integer start_side_num
+ integer num_sides
+ integer ss_elem_list(num_sides)
+ integer ss_side_list(num_sides)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call exgnss4 (idexo4, ss_id, start_side_num, num_sides,
+ $ ss_elem_list, ss_side_list, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write side set element list and side set side list
+C
+ subroutine expnss (idexo, ss_id, start_side_num, num_sides,
+ $ ss_elem_list, ss_side_list, ierr)
+ implicit none
+ integer idexo
+ integer ss_id
+ integer start_side_num
+ integer num_sides
+ integer ss_elem_list(num_sides)
+ integer ss_side_list(num_sides)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call expnss4 (idexo4, ss_id, start_side_num, num_sides,
+ $ ss_elem_list, ss_side_list, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Read side set distribution factor
+C
+ subroutine exgnssd (idexo, ss_id, start_num, num_df_to_get,
+ $ ss_df, ierr)
+ implicit none
+ integer idexo
+ integer ss_id
+ integer start_num
+ integer num_df_to_get
+ real ss_df(num_df_to_get)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call exgnssd4 (idexo4, ss_id, start_num, num_df_to_get,
+ $ ss_df, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write side set distribution factor
+C
+ subroutine expnssd (idexo, ss_id, start_num, num_df_to_get,
+ $ ss_df, ierr)
+ implicit none
+ integer idexo
+ integer ss_id
+ integer start_num
+ integer num_df_to_get
+ real ss_df(num_df_to_get)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call expnssd4 (idexo4, ss_id, start_num, num_df_to_get,
+ $ ss_df, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Read node set list for a single node set
+C
+ subroutine exgnns (idexo, ns_id, start_node_num, num_node,
+ $ ns_node_list, ierr)
+ implicit none
+ integer idexo
+ integer ns_id
+ integer start_node_num
+ integer num_node
+ integer ns_node_list(num_node)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call exgnns4 (idexo4, ns_id, start_node_num, num_node,
+ $ ns_node_list, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write node set list for a single node set
+C
+ subroutine expnns (idexo, ns_id, start_node_num, num_node,
+ $ ns_node_list, ierr)
+ implicit none
+ integer idexo
+ integer ns_id
+ integer start_node_num
+ integer num_node
+ integer ns_node_list(num_node)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call expnns4 (idexo4, ns_id, start_node_num, num_node,
+ $ ns_node_list, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Read node set distribution factor
+C
+ subroutine exgnnsd (idexo, ns_id, start_num, num_df_to_get,
+ $ ns_df, ierr)
+ implicit none
+ integer idexo
+ integer ns_id
+ integer start_num
+ integer num_df_to_get
+ real ns_df(num_df_to_get)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call exgnnsd4 (idexo4, ns_id, start_num, num_df_to_get,
+ $ ns_df, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write node set distribution factor
+C
+ subroutine expnnsd (idexo, ns_id, start_num, num_df_to_get,
+ $ ns_df, ierr)
+ implicit none
+ integer idexo
+ integer ns_id
+ integer start_num
+ integer num_df_to_get
+ real ns_df(num_df_to_get)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call expnnsd4 (idexo4, ns_id, start_num, num_df_to_get,
+ $ ns_df, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Read coordinates of the nodes
+C
+ subroutine exgncor (idexo, start_node_num, num_nodes, x_coor,
+ $ y_coor, z_coor, ierr)
+ implicit none
+ integer idexo
+ integer start_node_num
+ integer num_nodes
+ real x_coor(num_nodes)
+ real y_coor(num_nodes)
+ real z_coor(num_nodes)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call exgcor4 (idexo4, start_node_num, num_nodes, x_coor,
+ $ y_coor, z_coor, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write coordinates of the nodes
+C
+ subroutine expncor (idexo, start_node_num, num_nodes, x_coor,
+ $ y_coor, z_coor, ierr)
+ implicit none
+ integer idexo
+ integer start_node_num
+ integer num_nodes
+ real x_coor(num_nodes)
+ real y_coor(num_nodes)
+ real z_coor(num_nodes)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call expcor4 (idexo4, start_node_num, num_nodes, x_coor,
+ $ y_coor, z_coor, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Read an element blocks connectivity list
+C
+ subroutine exgnec (idexo, elem_blk_id, start_elem_num,
+ $ num_elems, connect, ierr)
+ implicit none
+ integer idexo
+ integer elem_blk_id
+ integer start_elem_num
+ integer num_elems
+ integer connect(num_elems)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call exgnec4 (idexo4, elem_blk_id, start_elem_num,
+ $ num_elems, connect, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write an element blocks connectivity list
+C
+ subroutine expnec (idexo, elem_blk_id, start_elem_num,
+ $ num_elems, connect, ierr)
+ implicit none
+ integer idexo
+ integer elem_blk_id
+ integer start_elem_num
+ integer num_elems
+ integer connect(num_elems)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call expnec4 (idexo4, elem_blk_id, start_elem_num,
+ $ num_elems, connect, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Read an element blocks attributes
+C
+ subroutine exgneat (idexo, elem_blk_id, start_elem_num,
+ $ num_elems, attrib, ierr)
+ implicit none
+ integer idexo
+ integer elem_blk_id
+ integer start_elem_num
+ integer num_elems
+ real attrib(num_elems)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call exgneat4 (idexo4, elem_blk_id, start_elem_num,
+ $ num_elems, attrib, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write an element blocks attributes
+C
+ subroutine expneat (idexo, elem_blk_id, start_elem_num,
+ $ num_elems, attrib, ierr)
+ implicit none
+ integer idexo
+ integer elem_blk_id
+ integer start_elem_num
+ integer num_elems
+ real attrib(num_elems)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call expneat4 (idexo4, elem_blk_id, start_elem_num,
+ $ num_elems, attrib, ierr4)
+ ierr = ierr4
+C
+ end
+C
+C-----------------------------------------------------------------------
+C Read the element type for a specific element block
+C
+ subroutine exgelt (idexo, elem_blk_id, elem_type, ierr)
+ implicit none
+ integer idexo
+ integer elem_blk_id
+ character*(*) elem_type
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call exgelt4 (idexo4, elem_blk_id, elem_type, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Read a variable for an element block
+C
+ subroutine exgnev (idexo, time_step, elem_var_index,
+ $ elem_blk_id, num_elem_this_blk, start_elem_num,
+ $ num_elem, elem_var_vals, ierr)
+ implicit none
+ integer idexo
+ integer time_step
+ integer elem_var_index
+ integer elem_blk_id
+ integer num_elem_this_blk
+ integer start_elem_num
+ integer num_elem
+ real elem_var_vals(num_elem)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 time_step4
+ integer*4 elem_var_index4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ time_step4 = time_step
+ elem_var_index4 = elem_var_index
+ call exgnev4 (idexo4, time_step4, elem_var_index4,
+ $ elem_blk_id, num_elem_this_blk, start_elem_num,
+ $ num_elem, elem_var_vals, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write a variable slab for an element block
+C
+ subroutine expevs (idexo, time_step, elem_var_index,
+ $ elem_blk_id, start_pos, num_vals, elem_var_vals,
+ $ ierr)
+ implicit none
+ integer idexo
+ integer time_step
+ integer elem_var_index
+ integer elem_blk_id
+ integer start_pos
+ integer num_vals
+ real elem_var_vals(num_vals)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 time_step4
+ integer*4 elem_var_index4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ time_step4 = time_step
+ elem_var_index4 = elem_var_index
+ call expevs4 (idexo4, time_step4, elem_var_index4,
+ $ elem_blk_id, start_pos, num_vals, elem_var_vals,
+ $ ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Read the values of a single nodal variable for a single time step
+C
+ subroutine exgnnv (idexo, time_step, nodal_var_index,
+ $ start_node_num, num_nodes, nodal_vars, ierr)
+ implicit none
+ integer idexo
+ integer time_step
+ integer nodal_var_index
+ integer start_node_num
+ integer num_nodes
+ real nodal_vars(num_nodes)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 time_step4
+ integer*4 nodal_var_index4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ time_step4 = time_step
+ nodal_var_index4 = nodal_var_index
+ call exgnnv4 (idexo4, time_step4, nodal_var_index4,
+ $ start_node_num, num_nodes, nodal_vars, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write nodal variable slab
+C
+ subroutine expnvs (idexo, time_step, nodal_var_index,
+ $ start_pos, num_vals, nodal_var_vals, ierr)
+ implicit none
+ integer idexo
+ integer time_step
+ integer nodal_var_index
+ integer start_pos
+ integer num_vals
+ real nodal_var_vals(num_vals)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 time_step4
+ integer*4 nodal_var_index4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ time_step4 = time_step
+ nodal_var_index4 = nodal_var_index
+ call expnvs4 (idexo4, time_step4, nodal_var_index4,
+ $ start_pos, num_vals, nodal_var_vals, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Read the element numbering map
+C
+ subroutine exgnenm (idexo, starte, num_ent, elem_map, ierr)
+ implicit none
+ integer idexo
+ integer starte
+ integer num_ent
+ integer elem_map(num_ent)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call exgnenm4 (idexo4, starte, num_ent, elem_map, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write the element numbering map
+C
+ subroutine expnenm (idexo, starte, num_ent, elem_map, ierr)
+ implicit none
+ integer idexo
+ integer starte
+ integer num_ent
+ integer elem_map(num_ent)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call expnenm4 (idexo4, starte, num_ent, elem_map, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Read the node numbering map
+C
+ subroutine exgnnnm (idexo, startn, num_ent, node_map, ierr)
+ implicit none
+ integer idexo
+ integer startn
+ integer num_ent
+ integer node_map(num_ent)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call exgnnnm4 (idexo4, startn, num_ent, node_map, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write the node numbering map
+C
+ subroutine expnnnm (idexo, startn, num_ent, node_map, ierr)
+ implicit none
+ integer idexo
+ integer startn
+ integer num_ent
+ integer node_map(num_ent)
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call expnnnm4 (idexo4, startn, num_ent, node_map, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Read the node map for a processor
+C
+ subroutine exgnmp (idexo, node_mapi, node_mapb, node_mape,
+ $ processor, ierr)
+ implicit none
+ integer idexo
+ integer node_mapi(*)
+ integer node_mapb(*)
+ integer node_mape(*)
+ integer processor
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 processor4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ processor4 = processor
+ call exgnmp4 (idexo4, node_mapi, node_mapb, node_mape,
+ $ processor4, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write a node map for a processor
+C
+ subroutine expnmp (idexo, node_mapi, node_mapb, node_mape,
+ $ processor, ierr)
+ implicit none
+ integer idexo
+ integer node_mapi(*)
+ integer node_mapb(*)
+ integer node_mape(*)
+ integer processor
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 processor4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ processor4 = processor
+ call expnmp4 (idexo4, node_mapi, node_mapb, node_mape,
+ $ processor4, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Read the element map for a processor
+C
+ subroutine exgemp (idexo, elem_mapi, elem_mapb, processor, ierr)
+ implicit none
+ integer idexo
+ integer elem_mapi(*)
+ integer elem_mapb(*)
+ integer processor
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 processor4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ processor4 = processor
+ call exgemp4 (idexo4, elem_mapi, elem_mapb, processor4, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write the element map for a processor
+C
+ subroutine expemp (idexo, elem_mapi, elem_mapb, processor, ierr)
+ implicit none
+ integer idexo
+ integer elem_mapi(*)
+ integer elem_mapb(*)
+ integer processor
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 processor4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ processor4 = processor
+ call expemp4 (idexo4, elem_mapi, elem_mapb, processor4, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Read the communications map parameters for a single processor
+C
+ subroutine exgcmp (idexo, ncmap_ids, ncmap_node_cnts,
+ $ ecmap_ids, ecmap_elem_cnts, processor, ierr)
+ implicit none
+ integer idexo
+ integer ncmap_ids(*)
+ integer ncmap_node_cnts(*)
+ integer ecmap_ids(*)
+ integer ecmap_elem_cnts(*)
+ integer processor
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 processor4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ processor4 = processor
+ call exgcmp4 (idexo4, ncmap_ids, ncmap_node_cnts,
+ $ ecmap_ids, ecmap_elem_cnts, processor4, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write the communications map parameters for a single processor
+C
+ subroutine expcmp (idexo, nmap_ids, nmap_node_cnts, emap_ids,
+ $ emap_elem_cnts, processor, ierr)
+ implicit none
+ integer idexo
+ integer nmap_ids(*)
+ integer nmap_node_cnts(*)
+ integer emap_ids(*)
+ integer emap_elem_cnts(*)
+ integer processor
+ integer ierr
+
+ integer*4 idexo4
+ integer*4 processor4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ processor4 = processor
+ call expcmp4 (idexo4, nmap_ids, nmap_node_cnts, emap_ids,
+ $ emap_elem_cnts, processor4, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write the communications map parameters for all processors
+C
+ subroutine expcmpc (idexo, nmap_ids, nmap_node_cnts,
+ $ nproc_ptrs, emap_ids, emap_elem_cnts, eproc_ptrs, ierr)
+ implicit none
+ integer idexo
+ integer nmap_ids(*)
+ integer nmap_node_cnts(*)
+ integer nproc_ptrs(*)
+ integer emap_ids(*)
+ integer emap_elem_cnts(*)
+ integer eproc_ptrs(*)
+ integer ierr
+
+ integer*4 idexo4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ call expcmpc4 (idexo4, nmap_ids, nmap_node_cnts,
+ $ nproc_ptrs, emap_ids, emap_elem_cnts, eproc_ptrs, ierr4)
+ ierr = ierr4
+
+ end
+
+C-----------------------------------------------------------------------
+C
+C Read the nodal communications map for a single processor
+C
+ subroutine exgncm (idexo, map_id, node_ids, proc_ids,
+ $ processor, ierr)
+ implicit none
+ integer idexo
+ integer map_id
+ integer node_ids(*)
+ integer proc_ids(*)
+ integer processor
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 processor4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ processor4 = processor
+ call exgncm4 (idexo4, map_id, node_ids, proc_ids,
+ $ processor4, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write the nodal communications map for a single processor
+C
+ subroutine expncm (idexo, map_id, node_ids, proc_ids,
+ $ processor, ierr)
+ implicit none
+ integer idexo
+ integer map_id
+ integer node_ids(*)
+ integer proc_ids(*)
+ integer processor
+ integer ierr
+C
+ integer*4 idexo4
+ integer*4 processor4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ processor4 = processor
+ call expncm4 (idexo4, map_id, node_ids, proc_ids,
+ $ processor4, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Read the elemental communications map for a single processor
+C
+ subroutine exgecm (idexo, map_id, elem_ids, side_ids,
+ $ proc_ids, processor, ierr)
+ implicit none
+ integer idexo
+ integer map_id
+ integer elem_ids(*)
+ integer side_ids(*)
+ integer proc_ids(*)
+ integer processor
+ integer ierr
+
+ integer*4 idexo4
+ integer*4 processor4
+ integer*4 ierr4
+C
+ idexo4 = idexo
+ processor4 = processor
+ call exgecm4 (idexo4, map_id, elem_ids, side_ids,
+ $ proc_ids, processor4, ierr4)
+ ierr = ierr4
+C
+ end
+
+C-----------------------------------------------------------------------
+C
+C Write the elemental communications map for a single processor
+C
+ subroutine expecm (idexo, map_id, elem_ids, side_ids,
+ $ proc_ids, processor, ierr)
+ implicit none
+ integer idexo
+ integer map_id
+ integer elem_ids(*)
+ integer side_ids(*)
+ integer proc_ids(*)
+ integer processor
+ integer ierr
+
+ integer*4 idexo4
+ integer*4 processor4
+ integer*4 ierr4
+
+ idexo4 = idexo
+ processor4 = processor
+ call expecm4 (idexo4, map_id, elem_ids, side_ids,
+ $ proc_ids, processor4, ierr4)
+ ierr = ierr4
+
+ end
+C-----------------------------------------------------------------------
+
SUBROUTINE I8I4 (N, I8, PI4)
C
C CREATE I4 ARRAY AND COPY I8 ARRAY CONTENTS TO I4
diff --git a/exodus/forbind/test/CMakeLists.txt b/exodus/forbind/test/CMakeLists.txt
index 771ce3a..5d66147 100644
--- a/exodus/forbind/test/CMakeLists.txt
+++ b/exodus/forbind/test/CMakeLists.txt
@@ -1,37 +1,21 @@
-INCLUDE(PackageAddExecutable)
-INCLUDE(PackageAddTest)
-INCLUDE(PackageAddAdvancedTest)
-
ADD_DEFINITIONS(-DUSING_CMAKE)
-find_program (${PACKAGE_NAME}_Netcdf_EXECUTABLE_NCDUMP
- NAME ncdump
- PATHS
- $ENV{ACCESS}/bin
- $ENV{NETCDF_DIR}/bin
- $ENV{NETCDF_DIR}/ncdump
- ENV PATH
- )
-
-# ===============================================
-
-
-IF (${PACKAGE_NAME}_Netcdf_EXECUTABLE_NCDUMP)
- SET( forbind_OLDTESTS
- testwt
- testwtd
- testrd
- testrd1
- testrdd
- testwt1
- testwt2
- testwtm
- testcp
- testcpnl
- testcpln
- testwt_nsid
- testrd_nsid
- )
+SET( forbind_OLDTESTS
+ testwt
+ testwtd
+ testrd
+ testrd1
+ testrdd
+ testwt1
+ testwt2
+ testwtm
+ testcp
+ testcpnl
+ testcpln
+ testwt_nsid
+ testrd_nsid
+ test_nem
+)
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/testall.in
@@ -44,21 +28,13 @@ IF (${PACKAGE_NAME}_Netcdf_EXECUTABLE_NCDUMP)
# a dependency. These are C++ libraries and result in unresolved depedencies
# when built with shareable libraries on some platforms....
- FOREACH ( testName ${forbind_OLDTESTS} )
- PACKAGE_ADD_EXECUTABLE( f_${testName} NOEXEPREFIX LINKER_LANGUAGE Fortran SOURCES ${testName}.f DEPLIBS exodus_for)
- ENDFOREACH ( testName )
+FOREACH ( testName ${forbind_OLDTESTS} )
+ ADD_EXECUTABLE( f_${testName} ${testName}.f )
+ TARGET_LINK_LIBRARIES( f_${testName} exoIIv2for )
+ SET_TARGET_PROPERTIES(f_${testName} PROPERTIES LINKER_LANGUAGE Fortran)
+ENDFOREACH ( testName )
- PACKAGE_ADD_ADVANCED_TEST(
- exodus_unit_tests
- TEST_0 CMND /bin/csh ARGS ${CMAKE_CURRENT_BINARY_DIR}/testall
- OUTPUT_FILE exodus_unit_tests.out
- PASS_ANY
- TEST_1 CMND diff ARGS ${CMAKE_CURRENT_SOURCE_DIR}/exodus_unit_tests.gold
- ${CMAKE_CURRENT_BINARY_DIR}/exodus_unit_tests.out
- COMM serial
- FINAL_PASS_REGULAR_EXPRESSION
- )
-ELSE()
- MESSAGE(STATUS
- "WARNING: ${PACKAGE_NAME}: Exodus unit tests will not be run due to failure finding ncdump executable.")
-ENDIF()
+ADD_CUSTOM_TARGET( f_check
+ COMMAND /bin/csh ${CMAKE_CURRENT_BINARY_DIR}/testall
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+)
diff --git a/exodus/forbind/test/Imakefile b/exodus/forbind/test/Imakefile
index 8ff4223..a79e6ae 100644
--- a/exodus/forbind/test/Imakefile
+++ b/exodus/forbind/test/Imakefile
@@ -45,7 +45,7 @@ LOCALEXO = ../../libexoIIv2for.a ../../libexodus.a
LIBS = $(LOCALEXO) -L$(USRLIBDIR) $(NETCDF)
-PROGS = testwt testwtd testrd testrd1 testrdd testwt1 testwt2 testwtm testcp testcpnl testcpln testwt_nsid testrd_nsid
+PROGS = testwt testwtd testrd testrd1 testrdd testwt1 testwt2 testwtm testcp testcpnl testcpln testwt_nsid testrd_nsid test_nem
all:: check
@@ -62,6 +62,7 @@ NormalFortranTarget(testcpnl, testcpnl.o, $(LOCALEXO), /**/, $(LIBS))
NormalFortranTarget(testcpln, testcpln.o, $(LOCALEXO), /**/, $(LIBS))
NormalFortranTarget(testwt_nsid, testwt_nsid.o, $(LOCALEXO), /**/, $(LIBS))
NormalFortranTarget(testrd_nsid, testrd_nsid.o, $(LOCALEXO), /**/, $(LIBS))
+NormalFortranTarget(test_nem, test_nem.o, $(LOCALEXO), /**/, $(LIBS))
testall: testall.in1 $(CONFIGDIR)/$(MACROFILE)
rm -f testall
diff --git a/exodus/forbind/test/Makefile.standalone b/exodus/forbind/test/Makefile.standalone
index bc9da68..6ae26a4 100644
--- a/exodus/forbind/test/Makefile.standalone
+++ b/exodus/forbind/test/Makefile.standalone
@@ -32,70 +32,119 @@
#
-EXOIITEST = -L../.. -lexoIIv2for -lexodus
+NETCDF = /Users/gdsjaar/src/seacas-nopar
+NETCDF_LIB = -L$(NETCDF)/lib -lnetcdf -lhdf5_hl -lhdf5 -lm -lz
+NCDUMP = $(NETCDF)/bin/ncdump
+
+# Use libexoIIv2for32.a if not using -fdefault-real-8 -fdefault-integer-8
LOCALEXO = ../../libexoIIv2for.a ../../libexodus.a
+
LIBS = $(LOCALEXO) $(NETCDF_LIB)
+FC = /opt/local/bin/gfortran-mp-4.8
+FFLAGS = -I../include -O -fno-range-check -fcray-pointer
-PROGS = testwt testwtd testrd testrd1 testrdd testwt1 testwt2 testwtm testcp
-PROGS = testwt testwtd testrd testrd1 testrdd testwt1 testwt2 testwtm testcp testcpnl testcpln testwt_nsid testrd_nsid
+PROGS = testwt testwtd testrd testrd1 testrdd testwt1 testwt2 testwtm testcp testcpnl testcpln testwt_nsid testrd_nsid test_nem
all:: check
all:: testwt
testwt:: testwt.o $(LOCALEXO)
- $(FC) $(FFLAGS) -o $@ testwt.o $(LDFLAGS) $(LIBS)
+ $(FC) -o $@ $(LDOPTIONS) testwt.o $(LIBPATH) $(LDLIBS) $(LIBS) $(EXTRA_LOAD_FLAGS)
+
+clean::
+ $(RM) testwt
all:: testwtd
testwtd:: testwtd.o $(LOCALEXO)
- $(FC) $(FFLAGS) -o $@ testwtd.o $(LDFLAGS) $(LIBS)
+ $(FC) -o $@ $(LDOPTIONS) testwtd.o $(LIBPATH) $(LDLIBS) $(LIBS) $(EXTRA_LOAD_FLAGS)
+
+clean::
+ $(RM) testwtd
all:: testrd
testrd:: testrd.o $(LOCALEXO)
- $(FC) $(FFLAGS) -o $@ testrd.o $(LDFLAGS) $(LIBS)
+ $(FC) -o $@ $(LDOPTIONS) testrd.o $(LIBPATH) $(LDLIBS) $(LIBS) $(EXTRA_LOAD_FLAGS)
+
+clean::
+ $(RM) testrd
all:: testrd1
testrd1:: testrd1.o $(LOCALEXO)
- $(FC) $(FFLAGS) -o $@ testrd1.o $(LDFLAGS) $(LIBS)
+ $(FC) -o $@ $(LDOPTIONS) testrd1.o $(LIBPATH) $(LDLIBS) $(LIBS) $(EXTRA_LOAD_FLAGS)
+
+clean::
+ $(RM) testrd1
all:: testrdd
testrdd:: testrdd.o $(LOCALEXO)
- $(FC) $(FFLAGS) -o $@ testrdd.o $(LDFLAGS) $(LIBS)
+ $(FC) -o $@ $(LDOPTIONS) testrdd.o $(LIBPATH) $(LDLIBS) $(LIBS) $(EXTRA_LOAD_FLAGS)
+
+clean::
+ $(RM) testrdd
all:: testwt1
testwt1:: testwt1.o $(LOCALEXO)
- $(FC) $(FFLAGS) -o $@ testwt1.o $(LDFLAGS) $(LIBS)
+ $(FC) -o $@ $(LDOPTIONS) testwt1.o $(LIBPATH) $(LDLIBS) $(LIBS) $(EXTRA_LOAD_FLAGS)
+
+clean::
+ $(RM) testwt1
all:: testwt2
testwt2:: testwt2.o $(LOCALEXO)
- $(FC) $(FFLAGS) -o $@ testwt2.o $(LDFLAGS) $(LIBS)
+ $(FC) -o $@ $(LDOPTIONS) testwt2.o $(LIBPATH) $(LDLIBS) $(LIBS) $(EXTRA_LOAD_FLAGS)
+
+clean::
+ $(RM) testwt2
all:: testwtm
testwtm:: testwtm.o $(LOCALEXO)
- $(FC) $(FFLAGS) -o $@ testwtm.o $(LDFLAGS) $(LIBS)
+ $(FC) -o $@ $(LDOPTIONS) testwtm.o $(LIBPATH) $(LDLIBS) $(LIBS) $(EXTRA_LOAD_FLAGS)
+
+clean::
+ $(RM) testwtm
all:: testcp
testcp:: testcp.o $(LOCALEXO)
- $(FC) $(FFLAGS) -o $@ testcp.o $(LDFLAGS) $(LIBS)
+ $(FC) -o $@ $(LDOPTIONS) testcp.o $(LIBPATH) $(LDLIBS) $(LIBS) $(EXTRA_LOAD_FLAGS)
+
+clean::
+ $(RM) testcp
all:: testcpnl
-testcpnl:: testcpnl.o $(LOCALEXO)
- $(FC) $(FFLAGS) -o $@ testcpnl.o $(LDFLAGS) $(LIBS)
+testcpnl:: testcpnl.o $(LOCALEXO)
+ $(FC) -o $@ $(LDOPTIONS) testcpnl.o $(LIBPATH) $(LDLIBS) $(LIBS) $(EXTRA_LOAD_FLAGS)
+
+clean::
+ $(RM) testcpnl
all:: testcpln
-testcpln:: testcpln.o $(LOCALEXO)
- $(FC) $(FFLAGS) -o $@ testcpln.o $(LDFLAGS) $(LIBS)
+testcpln:: testcpln.o $(LOCALEXO)
+ $(FC) -o $@ $(LDOPTIONS) testcpln.o $(LIBPATH) $(LDLIBS) $(LIBS) $(EXTRA_LOAD_FLAGS)
+
+clean::
+ $(RM) testcpln
all:: testwt_nsid
-testwt_nsid:: testwt_nsid.o $(LOCALEXO)
- $(FC) $(FFLAGS) -o $@ testwt_nsid.o $(LDFLAGS) $(LIBS)
+testwt_nsid:: testwt_nsid.o $(LOCALEXO)
+ $(FC) -o $@ $(LDOPTIONS) testwt_nsid.o $(LIBPATH) $(LDLIBS) $(LIBS) $(EXTRA_LOAD_FLAGS)
+
+clean::
+ $(RM) testwt_nsid
all:: testrd_nsid
-testrd_nsid:: testrd_nsid.o $(LOCALEXO)
- $(FC) $(FFLAGS) -o $@ testrd_nsid.o $(LDFLAGS) $(LIBS)
+testrd_nsid:: testrd_nsid.o $(LOCALEXO)
+ $(FC) -o $@ $(LDOPTIONS) testrd_nsid.o $(LIBPATH) $(LDLIBS) $(LIBS) $(EXTRA_LOAD_FLAGS)
+
+clean::
+ $(RM) testrd_nsid
+
+all:: test_nem
+test_nem:: test_nem.o $(LOCALEXO)
+ $(FC) -o $@ $(LDOPTIONS) test_nem.o $(LIBPATH) $(LDLIBS) $(LIBS) $(EXTRA_LOAD_FLAGS)
test: check
check: $(PROGS)
- csh ./testall
+ csh ./testall.standalone $(NCDUMP)
clean::
rm -f *.res $(PROGS)
diff --git a/exodus/forbind/test/makedmp b/exodus/forbind/test/makedmp
deleted file mode 100644
index f0d13d0..0000000
--- a/exodus/forbind/test/makedmp
+++ /dev/null
@@ -1,104 +0,0 @@
-# Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
-# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
-# retains certain rights in this software.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided
-# with the distribution.
-#
-# * Neither the name of Sandia Corporation nor the names of its
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-
-# script to save dump files.
-#
-# testwt - single precision write test
-echo "testwt ..."
-echo "begin testwt" >> test.output
-testwt >> test.output
-echo "end testwt" >> test.output
-ncdump -d5,5 test.exo > test.dmp
-
-# testrd - single precision read test
-echo "testrd ..."
-testrd > testrd.dmp
-
-# testcp_ss - single-to-single precision copy test
-echo "testcp_ss ..."
-echo "begin testcp_ss" >> test.output
-testcp >> test.output
-echo "end testcp_ss" >> test.output
-ncdump -d5,5 testcp.exo > testcp_ss.dmp
-
-# testcp_sd - single-to-double precision copy test
-echo "testcp_sd ..."
-echo "begin testcp_sd" >> test.output
-testcpd >> test.output
-echo "end testcp_sd" >> test.output
-ncdump -d5,5 testcpd.exo > testcp_sd.dmp
-
-# testwt1 - single precision write test with multiple side sets
-echo "testwt1 ..."
-echo "begin testwt1" >> test.output
-testwt1 >> test.output
-echo "end testwt1" >> test.output
-ncdump -d5,5 test.exo > test1.dmp
-
-# testrd1 - single precision read test with multiple side sets
-echo "testrd1 ..."
-testrd1 > testrd1.dmp
-
-# testwtd - double precision write test
-echo "testwtd ..."
-echo "begin testwtd" >> test.output
-testwtd >> test.output
-echo "end testwtd" >> test.output
-ncdump -d5,5 test.exo > testd.dmp
-
-# testrdd - double precision read test
-echo "testrdd ..."
-testrdd > testrdd.dmp
-
-# testcp_dd - double-to-double precision copy test
-echo "testcp_dd ..."
-echo "begin testcp_dd" >> test.output
-testcpd >> test.output
-echo "end testcp_dd" >> test.output
-ncdump -d5,5 testcpd.exo > testcp_dd.dmp
-
-# testcp_ds - double-to-single precision copy test
-echo "testcp_ds ..."
-echo "begin testcp_ds" >> test.output
-testcp >> test.output
-echo "end testcp_ds" >> test.output
-ncdump -d5,5 testcp.exo > testcp_ds.dmp
-
-# testwt2 - single precision write 2 files (simultaneously open) test
-echo "testwt2 ..."
-echo "begin testwt2" >> test.output
-testwt2 >> test.output
-echo "end testwt2" >> test.output
-ncdump -d5,5 test.exo > test2-1.dmp
-ncdump -d5,5 test2.exo > test2-2.dmp
-
diff --git a/exodus/forbind/test/t.f.tmp b/exodus/forbind/test/t.f.tmp
deleted file mode 100644
index 1f1ac40..0000000
--- a/exodus/forbind/test/t.f.tmp
+++ /dev/null
@@ -1,924 +0,0 @@
- program testwt
-c
-c This is a test program for the Fortran binding of the EXODUS II
-c database write routines.
-c
-
-c history -
-c Original L.A. Schoof
-c 02/25/93 V.R. Yarberry - Added error checks for file creation.
-c 03/04/93 V.R. Yarberry - Fixed bug in expvtt test, ebids was not passed
-c 08/31/93 VRY - updated to match API version 2.00
-c
- include 'exodusII.inc'
-
- integer iin, iout, exoid1
- integer exoid, num_dim,num_nodes,elem_map(5),num_elem,num_elem_blk
- integer num_elem_in_block(10), num_nodes_per_elem(10),numattr(10)
- integer num_node_sets, num_side_sets
- integer i, j, k, m, connect(10)
- integer node_list(100), elem_list(100), side_list(100)
- integer ebids(10),ids(10), num_nodes_per_set(10)
- integer num_elem_per_set(10), num_df_per_set(10)
- integer df_ind(10), node_ind(10), elem_ind(10)
- integer num_qa_rec, num_info
- integer num_glo_vars, num_nod_vars, num_ele_vars
- integer truth_tab(3,5)
- integer whole_time_step, num_time_steps
- integer cpu_word_size, io_word_size
- integer prop_array(2)
-
- real glob_var_vals(100), nodal_var_vals(100)
- real time_value, elem_var_vals(100)
- real x(100), y(100), z(100)
- real attrib(100), dist_fact(100)
-
- character*(MXSTLN) coord_names(3)
- character*(MXSTLN) cname
- character*(MXSTLN) var_names(3)
- character*(MXSTLN) qa_record(4,2)
- character*(MXLNLN) inform(30)
- character*(MXSTLN) prop_names(2)
-
- data iin /5/, iout /6/
-
- call exopts (EXABRT, ierr)
- cpu_word_size = 0
- io_word_size = 0
-c
-c create EXODUS II files
-c
- exoid = excre ("junk.exo",
- 1 EXCLOB, cpu_word_size, io_word_size, ierr)
- write (iout,'("after excre for test.exo, id: ", i4)') exoid
- write (iout,'(" cpu word size: ",i4," io word size: ",i4)')
- 1 cpu_word_size, io_word_size
- write (iout,'("after excre, error = ", i4)') ierr
-
- exoid1 = excre ("junk1.exo",
- 1 EXCLOB, cpu_word_size, io_word_size, ierr)
- write (iout,'("after excre for junk1.exo, id: ", i4)') exoid1
- write (iout,'(" cpu word size: ",i4," io word size: ",i4)')
- 1 cpu_word_size, io_word_size
- write (iout,'("after excre, error = ", i4)') ierr
-c
-c initialize file with parameters
-c
-
- num_dim = 3
- num_nodes = 26
- num_elem = 5
- num_elem_blk = 5
- num_node_sets = 2
- num_side_sets = 5
-
- call expini (exoid, "This is a test", num_dim, num_nodes,
- 1 num_elem, num_elem_blk, num_node_sets,
- 2 num_side_sets, ierr)
-
- call expini (exoid1, "This is a test", num_dim, num_nodes,
- 1 num_elem, num_elem_blk, num_node_sets,
- 2 num_side_sets, ierr)
-
- write (iout, '("after expini, error = ", i4)' ) ierr
-
-c
-c write nodal coordinates values and names to database
-c
-c Quad #1
- x(1) = 0.0
- x(2) = 1.0
- x(3) = 1.0
- x(4) = 0.0
-
- y(1) = 0.0
- y(2) = 0.0
- y(3) = 1.0
- y(4) = 1.0
-
- z(1) = 0.0
- z(2) = 0.0
- z(3) = 0.0
- z(4) = 0.0
-
-c Quad #2
- x(5) = 1.0
- x(6) = 2.0
- x(7) = 2.0
- x(8) = 1.0
-
- y(5) = 0.0
- y(6) = 0.0
- y(7) = 1.0
- y(8) = 1.0
-
- z(5) = 0.0
- z(6) = 0.0
- z(7) = 0.0
- z(8) = 0.0
-
-c Hex #1
- x(9) = 0.0
- x(10) = 10.0
- x(11) = 10.0
- x(12) = 1.0
- x(13) = 1.0
- x(14) = 10.0
- x(15) = 10.0
- x(16) = 1.0
-
- y(9) = 0.0
- y(10) = 0.0
- y(11) = 0.0
- y(12) = 0.0
- y(13) = 10.0
- y(14) = 10.0
- y(15) = 10.0
- y(16) = 10.0
-
- z(9) = 0.0
- z(10) = 0.0
- z(11) =-10.0
- z(12) =-10.0
- z(13) = 0.0
- z(14) = 0.0
- z(15) =-10.0
- z(16) =-10.0
-
-c Tetra #1
- x(17) = 0.0
- x(18) = 1.0
- x(19) = 10.0
- x(20) = 7.0
-
- y(17) = 0.0
- y(18) = 0.0
- y(19) = 0.0
- y(20) = 5.0
-
- z(17) = 0.0
- z(18) = 5.0
- z(19) = 2.0
- z(20) = 3.0
-
-c Wedge #1
- x(21) = 3.0
- x(22) = 6.0
- x(23) = 0.0
- x(24) = 3.0
- x(25) = 6.0
- x(26) = 0.0
-
- y(21) = 0.0
- y(22) = 0.0
- y(23) = 0.0
- y(24) = 2.0
- y(25) = 2.0
- y(26) = 2.0
-
- z(21) = 6.0
- z(22) = 0.0
- z(23) = 0.0
- z(24) = 6.0
- z(25) = 2.0
- z(26) = 0.0
- call expcor (exoid, x, y, z, ierr)
- write (iout, '("after expcor, error = ", i4)' ) ierr
-
- coord_names(1) = "xcoor"
- coord_names(2) = "ycoor"
- coord_names(3) = "zcoor"
-
- call expcon (exoid, coord_names, ierr)
- write (iout, '("after expcon, error = ", i4)' ) ierr
-
-
-c
-c write element order map
-c
-
- do 10 i = 1, num_elem
- elem_map(i) = i
-10 continue
-
- call expmap (exoid, elem_map, ierr)
- write (iout, '("after expmap, error = ", i4)' ) ierr
-
-c
-c write element block parameters
-c
-
- num_elem_in_block(1) = 1
- num_elem_in_block(2) = 1
- num_elem_in_block(3) = 1
- num_elem_in_block(4) = 1
- num_elem_in_block(5) = 1
-
- num_nodes_per_elem(1) = 4
- num_nodes_per_elem(2) = 4
- num_nodes_per_elem(3) = 8
- num_nodes_per_elem(4) = 4
- num_nodes_per_elem(5) = 6
-
- ebids(1) = 10
- ebids(2) = 11
- ebids(3) = 12
- ebids(4) = 13
- ebids(5) = 14
-
- numattr(1) = 1
- numattr(2) = 1
- numattr(3) = 1
- numattr(4) = 1
- numattr(5) = 1
-
- cname = "quad"
- call expelb (exoid,ebids(1),cname,num_elem_in_block(1),
- 1 num_nodes_per_elem(1),numattr(1),ierr)
- write (iout, '("after expelb, error = ", i4)' ) ierr
-
- call expelb (exoid,ebids(2),cname,num_elem_in_block(2),
- 1 num_nodes_per_elem(2),numattr(2),ierr)
- write (iout, '("after expelb, error = ", i4)' ) ierr
-
- cname = "hex"
- call expelb (exoid,ebids(3),cname,num_elem_in_block(3),
- 1 num_nodes_per_elem(3),numattr(3),ierr)
- write (iout, '("after expelb, error = ", i4)' ) ierr
-
- cname = "tetra"
- call expelb (exoid,ebids(4),cname,num_elem_in_block(4),
- 1 num_nodes_per_elem(4),numattr(4),ierr)
- write (iout, '("after expelb, error = ", i4)' ) ierr
-
- cname = "wedge"
- call expelb (exoid,ebids(5),cname,num_elem_in_block(5),
- 1 num_nodes_per_elem(5),numattr(5),ierr)
- write (iout, '("after expelb, error = ", i4)' ) ierr
-
-c write element block properties
-
- prop_names(1) = "MATL"
- prop_names(2) = "DENSITY"
- call exppn(exoid,EXEBLK,2,prop_names,ierr)
- write (iout, '("after exppn, error = ", i4)' ) ierr
-
- call expp(exoid, EXEBLK, ebids(1), "MATL", 10, ierr)
- write (iout, '("after expp, error = ", i4)' ) ierr
- call expp(exoid, EXEBLK, ebids(2), "MATL", 20, ierr)
- write (iout, '("after expp, error = ", i4)' ) ierr
- call expp(exoid, EXEBLK, ebids(3), "MATL", 30, ierr)
- write (iout, '("after expp, error = ", i4)' ) ierr
- call expp(exoid, EXEBLK, ebids(4), "MATL", 40, ierr)
- write (iout, '("after expp, error = ", i4)' ) ierr
- call expp(exoid, EXEBLK, ebids(5), "MATL", 50, ierr)
- write (iout, '("after expp, error = ", i4)' ) ierr
-
-c
-c write element connectivity
-c
-
- connect(1) = 1
- connect(2) = 2
- connect(3) = 3
- connect(4) = 4
-
- call expelc (exoid, ebids(1), connect, ierr)
- write (iout, '("after expelc, error = ", i4)' ) ierr
-
- connect(1) = 5
- connect(2) = 6
- connect(3) = 7
- connect(4) = 8
-
- call expelc (exoid, ebids(2), connect, ierr)
- write (iout, '("after expelc, error = ", i4)' ) ierr
-
- connect(1) = 9
- connect(2) = 10
- connect(3) = 11
- connect(4) = 12
- connect(5) = 13
- connect(6) = 14
- connect(7) = 15
- connect(8) = 16
-
- call expelc (exoid, ebids(3), connect, ierr)
- write (iout, '("after expelc, error = ", i4)' ) ierr
-
- connect(1) = 17
- connect(2) = 18
- connect(3) = 19
- connect(4) = 20
-
- call expelc (exoid, ebids(4), connect, ierr)
- write (iout, '("after expelc, error = ", i4)' ) ierr
-
- connect(1) = 21
- connect(2) = 22
- connect(3) = 23
- connect(4) = 24
- connect(5) = 25
- connect(6) = 26
-
- call expelc (exoid, ebids(5), connect, ierr)
- write (iout, '("after expelc, error = ", i4)' ) ierr
-
-c
-c write element block attributes
-c
- attrib(1) = 3.14159
- call expeat (exoid, ebids(1), attrib, ierr)
- write (iout, '("after expeat, error = ", i4)' ) ierr
-
- attrib(1) = 6.14159
- call expeat (exoid, ebids(2), attrib, ierr)
- write (iout, '("after expeat, error = ", i4)' ) ierr
-
- call expeat (exoid, ebids(3), attrib, ierr)
- write (iout, '("after expeat, error = ", i4)' ) ierr
-
- call expeat (exoid, ebids(4), attrib, ierr)
- write (iout, '("after expeat, error = ", i4)' ) ierr
-
- call expeat (exoid, ebids(5), attrib, ierr)
- write (iout, '("after expeat, error = ", i4)' ) ierr
-
-c
-c write individual node sets
-c
-
- node_list(1) = 100
- node_list(2) = 101
- node_list(3) = 102
- node_list(4) = 103
- node_list(5) = 104
-
- dist_fact(1) = 1.0
- dist_fact(2) = 2.0
- dist_fact(3) = 3.0
- dist_fact(4) = 4.0
- dist_fact(5) = 5.0
-
- call expnp (exoid, 20, 5, 5, ierr)
- write (iout, '("after expnp, error = ", i4)' ) ierr
- call expns (exoid, 20, node_list, ierr)
- write (iout, '("after expns, error = ", i4)' ) ierr
- call expnsd (exoid, 20, dist_fact, ierr)
- write (iout, '("after expnsd, error = ", i4)' ) ierr
-
- node_list(1) = 200
- node_list(2) = 201
- node_list(3) = 202
-
- dist_fact(1) = 1.1
- dist_fact(2) = 2.1
- dist_fact(3) = 3.1
-
- call expnp (exoid, 21, 3, 3, ierr)
- write (iout, '("after expnp, error = ", i4)' ) ierr
- call expns (exoid, 21, node_list, ierr)
- write (iout, '("after expns, error = ", i4)' ) ierr
- call expnsd (exoid, 21, dist_fact, ierr)
- write (iout, '("after expnsd, error = ", i4)' ) ierr
-
-c
-c write concatenated node sets; this produces the same information as
-c the above code which writes individual node sets
-c
-
- ids(1) = 20
- ids(2) = 21
-
- num_nodes_per_set(1) = 5
- num_nodes_per_set(2) = 3
-
- num_df_per_set(1) = 5
- num_df_per_set(2) = 3
-
- node_ind(1) = 1
- node_ind(2) = 6
-
- df_ind(1) = 1
- df_ind(2) = 6
-
- node_list(1) = 100
- node_list(2) = 101
- node_list(3) = 102
- node_list(4) = 103
- node_list(5) = 104
- node_list(6) = 200
- node_list(7) = 201
- node_list(8) = 202
-
- dist_fact(1) = 1.0
- dist_fact(2) = 2.0
- dist_fact(3) = 3.0
- dist_fact(4) = 4.0
- dist_fact(5) = 5.0
- dist_fact(6) = 1.1
- dist_fact(7) = 2.1
- dist_fact(8) = 3.1
-
-c call expcns (exoid, ids, num_nodes_per_set, num_df_per_set,
-c 1 node_ind, df_ind, node_list, dist_fact, ierr)
-c write (iout, '("after expcns, error = ", i4)' ) ierr
-
-c write node set properties
-
- prop_names(1) = "FACE"
- call expp(exoid, EXNSET, 20, prop_names(1), 4, ierr)
- write (iout, '("after expp, error = ", i4)' ) ierr
-
- call expp(exoid, EXNSET, 21, prop_names(1), 5, ierr)
- write (iout, '("after expp, error = ", i4)' ) ierr
-
- prop_array(1) = 1000
- prop_array(2) = 2000
-
- prop_names(1) = "VELOCITY"
- call exppa(exoid, EXNSET, prop_names(1), prop_array, ierr)
- write (iout, '("after exppa, error = ", i4)' ) ierr
-
-c
-c write individual side sets
-c
-
-c side set #1 - quad
-
- elem_list(1) = 2
- elem_list(2) = 2
-
- side_list(1) = 4
- side_list(2) = 2
-
- dist_fact(1) = 30.0
- dist_fact(2) = 30.1
- dist_fact(3) = 30.2
- dist_fact(4) = 30.3
-
- call expsp (exoid, 30, 2, 4, ierr)
- write (iout, '("after expsp, error = ", i4)' ) ierr
-
- call expss (exoid, 30, elem_list, side_list, ierr)
- write (iout, '("after expss, error = ", i4)' ) ierr
-
- call expssd (exoid, 30, dist_fact, ierr)
- write (iout, '("after expssd, error = ", i4)' ) ierr
-
-c side set #2 - quad, spanning 2 elements
-
- elem_list(1) = 1
- elem_list(2) = 2
-
- side_list(1) = 2
- side_list(2) = 3
-
- dist_fact(1) = 31.0
- dist_fact(2) = 31.1
- dist_fact(3) = 31.2
- dist_fact(4) = 31.3
-
- call expsp (exoid, 31, 2, 4, ierr)
- write (iout, '("after expsp, error = ", i4)' ) ierr
-
- call expss (exoid, 31, elem_list, side_list, ierr)
- write (iout, '("after expss, error = ", i4)' ) ierr
-
- call expssd (exoid, 31, dist_fact, ierr)
- write (iout, '("after expssd, error = ", i4)' ) ierr
-
-c side set #3 - hex
-
- elem_list(1) = 3
- elem_list(2) = 3
- elem_list(3) = 3
- elem_list(4) = 3
- elem_list(5) = 3
- elem_list(6) = 3
- elem_list(7) = 3
-
- side_list(1) = 5
- side_list(2) = 3
- side_list(3) = 3
- side_list(4) = 2
- side_list(5) = 4
- side_list(6) = 1
- side_list(7) = 6
-
- call expsp (exoid, 32, 7, 0, ierr)
- write (iout, '("after expsp, error = ", i4)' ) ierr
-
- call expss (exoid, 32, elem_list, side_list, ierr)
- write (iout, '("after expss, error = ", i4)' ) ierr
-
-c side set #4 - tetras
-
- elem_list(1) = 4
- elem_list(2) = 4
- elem_list(3) = 4
- elem_list(4) = 4
-
- side_list(1) = 1
- side_list(2) = 2
- side_list(3) = 3
- side_list(4) = 4
-
- call expsp (exoid, 33, 4, 0, ierr)
- write (iout, '("after expsp, error = ", i4)' ) ierr
-
- call expss (exoid, 33, elem_list, side_list, ierr)
- write (iout, '("after expss, error = ", i4)' ) ierr
-
-c side set #5 - wedges
-
- elem_list(1) = 5
- elem_list(2) = 5
- elem_list(3) = 5
- elem_list(4) = 5
- elem_list(5) = 5
-
- side_list(1) = 1
- side_list(2) = 2
- side_list(3) = 3
- side_list(4) = 4
- side_list(5) = 5
-
- call expsp (exoid, 34, 5, 0, ierr)
- write (iout, '("after expsp, error = ", i4)' ) ierr
-
- call expss (exoid, 34, elem_list, side_list, ierr)
- write (iout, '("after expss, error = ", i4)' ) ierr
-
-
-c write concatenated side sets; this produces the same information as
-c the above code which writes individual side sets
-c
-
- ids(1) = 30
- ids(2) = 31
- ids(3) = 32
- ids(4) = 33
- ids(5) = 34
-
-c side set #1
- node_list(1) = 8
- node_list(2) = 5
- node_list(3) = 6
- node_list(4) = 7
-
-c side set #2
- node_list(5) = 2
- node_list(6) = 3
- node_list(7) = 7
- node_list(8) = 8
-
-c side set #3
- node_list(9) = 9
- node_list(10) = 12
- node_list(11) = 11
- node_list(12) = 10
-
- node_list(13) = 11
- node_list(14) = 12
- node_list(15) = 16
- node_list(16) = 15
-
- node_list(17) = 16
- node_list(18) = 15
- node_list(19) = 11
- node_list(20) = 12
-
- node_list(21) = 10
- node_list(22) = 11
- node_list(23) = 15
- node_list(24) = 14
-
- node_list(25) = 13
- node_list(26) = 16
- node_list(27) = 12
- node_list(28) = 9
-
- node_list(29) = 14
- node_list(30) = 13
- node_list(31) = 9
- node_list(32) = 10
-
- node_list(33) = 16
- node_list(34) = 13
- node_list(35) = 14
- node_list(36) = 15
-
-c side set #4
- node_list(37) = 17
- node_list(38) = 18
- node_list(39) = 20
-
- node_list(40) = 18
- node_list(41) = 19
- node_list(42) = 20
-
- node_list(43) = 20
- node_list(44) = 19
- node_list(45) = 17
-
- node_list(46) = 19
- node_list(47) = 18
- node_list(48) = 17
-
-c side set #5
- node_list(49) = 25
- node_list(50) = 24
- node_list(51) = 21
- node_list(52) = 22
-
- node_list(53) = 26
- node_list(54) = 25
- node_list(55) = 22
- node_list(56) = 23
-
- node_list(57) = 26
- node_list(58) = 23
- node_list(59) = 21
- node_list(60) = 24
-
- node_list(61) = 23
- node_list(62) = 22
- node_list(63) = 21
-
- node_list(64) = 24
- node_list(65) = 25
- node_list(66) = 26
-
- num_elem_per_set(1) = 2
- num_elem_per_set(2) = 2
- num_elem_per_set(3) = 7
- num_elem_per_set(4) = 4
- num_elem_per_set(5) = 5
-
- num_nodes_per_set(1) = 4
- num_nodes_per_set(2) = 4
- num_nodes_per_set(3) = 28
- num_nodes_per_set(4) = 12
- num_nodes_per_set(5) = 20
-
- elem_ind(1) = 1
- elem_ind(2) = 3
- elem_ind(3) = 5
- elem_ind(4) = 12
- elem_ind(5) = 16
-
- node_ind(1) = 1
- node_ind(2) = 5
- node_ind(3) = 9
- node_ind(4) = 37
- node_ind(5) = 48
-
- elem_list(1) = 3
- elem_list(2) = 3
- elem_list(3) = 1
- elem_list(4) = 3
- elem_list(5) = 4
- elem_list(6) = 4
- elem_list(7) = 4
- elem_list(8) = 4
- elem_list(9) = 4
- elem_list(10) = 4
- elem_list(11) = 4
- elem_list(12) = 5
- elem_list(13) = 5
- elem_list(14) = 5
- elem_list(15) = 5
- elem_list(16) = 6
- elem_list(17) = 6
- elem_list(18) = 6
- elem_list(19) = 6
- elem_list(20) = 6
-
-c side_list(1) = 1
-c side_list(2) = 2
-c side_list(3) = 3
-c side_list(4) = 4
-
-c call excn2s(exoid, num_elem_per_set, num_nodes_per_set, elem_ind,
-c 1 node_ind, elem_list, node_list, side_list, ierr)
-c write (iout, '("after excn2s, error = ", i4)' ) ierr
-
-
- num_df_per_set(1) = 4
- num_df_per_set(2) = 4
- num_df_per_set(3) = 0
- num_df_per_set(4) = 0
- num_df_per_set(5) = 0
-
- df_ind(1) = 1
- df_ind(2) = 5
-
- dist_fact(1) = 30.0
- dist_fact(2) = 30.1
- dist_fact(3) = 30.2
- dist_fact(4) = 30.3
- dist_fact(5) = 31.0
- dist_fact(6) = 31.1
- dist_fact(7) = 31.2
- dist_fact(8) = 31.3
-
-c call expcss (exoid, ids, num_elem_per_set, num_df_per_set,
-c 1 elem_ind, df_ind, elem_list, side_list, dist_fact,
-c 2 ierr)
-c write (iout, '("after expcss, error = ", i4)' ) ierr
-
- prop_names(1) = "COLOR"
- call expp(exoid, EXSSET, 30, prop_names(1), 100, ierr)
- write (iout, '("after expp, error = ", i4)' ) ierr
-
- call expp(exoid, EXSSET, 31, prop_names(1), 101, ierr)
- write (iout, '("after expp, error = ", i4)' ) ierr
-c
-c
-c write QA records
-c
-
- num_qa_rec = 2
-
- qa_record(1,1) = "TESTWT fortran version"
- qa_record(2,1) = "testwt"
- qa_record(3,1) = "07/07/93"
- qa_record(4,1) = "15:41:33"
- qa_record(1,2) = "FASTQ"
- qa_record(2,2) = "fastq"
- qa_record(3,2) = "07/07/93"
- qa_record(4,2) = "16:41:33"
-
- call expqa (exoid, num_qa_rec, qa_record, ierr)
- write (iout, '("after expqa, error = ", i4)' ) ierr
-
-
-c
-c write information records
-c
-
- num_info = 13
-
- inform(2) = "This is the first information record."
- inform(3) = "This is the second information record."
- inform(4) = "This is the second information record."
- inform(5) = "This is the second information record."
- inform(6) = "This is the second information record."
- inform(7) = "This is the second information record."
- inform(8) = "This is the second information record."
- inform(9) = "This is the second information record."
- inform(10) = "This is the second information record."
- inform(11) = "This is the second information record."
- inform(12) = "This is the second information record."
- inform(13) = "This is the second information record."
- inform(1) = ""
-
- call expinf (exoid, num_info, inform, ierr)
- write (iout, '("after expinf, error = ", i4)' ) ierr
-
- call expinf (exoid1, num_info, inform, ierr)
- write (iout, '("after expinf, error = ", i4)' ) ierr
-
- call exclos (exoid,ierr)
- call exclos (exoid1,ierr)
- stop
-
-
-c write results variables parameters and names
-
- num_glo_vars = 1
-
- var_names(1) = "glo_vars"
-
- call expvp (exoid, "g", num_glo_vars, ierr)
- write (iout, '("after expvp, error = ", i4)' ) ierr
- call expvan (exoid, "g", num_glo_vars, var_names, ierr)
- write (iout, '("after expvan, error = ", i4)' ) ierr
-
-
- num_nod_vars = 2
-
- var_names(1) = "nod_var0"
- var_names(2) = "nod_var1"
-
- call expvp (exoid, "n", num_nod_vars, ierr)
- write (iout, '("after expvp, error = ", i4)' ) ierr
- call expvan (exoid, "n", num_nod_vars, var_names, ierr)
- write (iout, '("after expvan, error = ", i4)' ) ierr
-
-
- num_ele_vars = 3
-
- var_names(1) = "ele_var0"
- var_names(2) = "ele_var1"
- var_names(3) = "ele_var2"
-
- call expvp (exoid, "e", num_ele_vars, ierr)
- write (iout, '("after expvp, error = ", i4)' ) ierr
- call expvan (exoid, "e", num_ele_vars, var_names, ierr)
- write (iout, '("after expvan, error = ", i4)' ) ierr
-
-c
-c write element variable truth table
-c
-
- k = 0
-
- do 30 i = 1,num_elem_blk
- do 20 j = 1,num_ele_vars
- truth_tab(j,i) = 1
-20 continue
-30 continue
-
- call expvtt (exoid, num_elem_blk, num_ele_vars, truth_tab, ierr)
- write (iout, '("after expvtt, error = ", i4)' ) ierr
-
-c
-c for each time step, write the analysis results;
-c the code below fills the arrays glob_var_vals,
-c nodal_var_vals, and elem_var_vals with values for debugging purposes;
-c obviously the analysis code will populate these arrays
-c
-
- whole_time_step = 1
- num_time_steps = 10
-
- do 110 i = 1, num_time_steps
- time_value = real(i)/100.
-c
-c write time value
-c
-
- call exptim (exoid, whole_time_step, time_value, ierr)
- write (iout, '("after exptim, error = ", i4)' ) ierr
-
-c
-c write global variables
-c
-
- do 50 j = 1, num_glo_vars
- glob_var_vals(j) = real(j+1) * time_value
-50 continue
-
- call expgv (exoid, whole_time_step, num_glo_vars,
- 1 glob_var_vals, ierr)
- write (iout, '("after expgv, error = ", i4)' ) ierr
-
-c
-c write nodal variables
-c
-
- do 70 k = 1, num_nod_vars
- do 60 j = 1, num_nodes
-
- nodal_var_vals(j) = real(k) + (real(j) * time_value)
-
-60 continue
-
- call expnv (exoid, whole_time_step, k, num_nodes,
- 1 nodal_var_vals, ierr)
- write (iout, '("after expnv, error = ", i4)' ) ierr
-
-70 continue
-
-c
-c write element variables
-c
-
- do 100 k = 1, num_ele_vars
- do 90 j = 1, num_elem_blk
- do 80 m = 1, num_elem_in_block(j)
-
- elem_var_vals(m) = real(k+1) + real(j+1) +
- 1 (real(m)*time_value)
-c write(iout,*)'elem_var_val(',m,'): ',elem_var_vals(m)
-
-80 continue
-
- call expev (exoid, whole_time_step, k, ebids(j),
- 1 num_elem_in_block(j), elem_var_vals, ierr)
- write (iout, '("after expev, error = ", i4)' ) ierr
-
-90 continue
-100 continue
-
- whole_time_step = whole_time_step + 1
-
-c
-c update the data file; this should be done at the end of every time
-c step to ensure that no data is lost if the analysis dies
-c
- call exupda (exoid, ierr)
- write (iout, '("after exupda, error = ", i4)' ) ierr
-
-110 continue
-
-c
-c close the EXODUS files
-c
- call exclos (exoid, ierr)
- write (iout, '("after exclos, error = ", i4)' ) ierr
-
- stop
- end
diff --git a/exodus/forbind/test/test-nsided.dmp b/exodus/forbind/test/test-nsided.dmp
index 36f4533..077ccdf 100644
--- a/exodus/forbind/test/test-nsided.dmp
+++ b/exodus/forbind/test/test-nsided.dmp
@@ -40,6 +40,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
diff --git a/exodus/forbind/test/test.dmp b/exodus/forbind/test/test.dmp
index 65445e6..b8f70b4 100644
--- a/exodus/forbind/test/test.dmp
+++ b/exodus/forbind/test/test.dmp
@@ -137,6 +137,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
diff --git a/exodus/forbind/test/test.exo_f b/exodus/forbind/test/test.exo_f
deleted file mode 100644
index 2a772c1..0000000
--- a/exodus/forbind/test/test.exo_f
+++ /dev/null
@@ -1 +0,0 @@
-Binary file test.exo_f matches
diff --git a/exodus/forbind/test/test1.dmp b/exodus/forbind/test/test1.dmp
index 050a03c..d33865f 100644
--- a/exodus/forbind/test/test1.dmp
+++ b/exodus/forbind/test/test1.dmp
@@ -174,6 +174,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is testwt1" ;
:maximum_name_length = 32 ;
data:
diff --git a/exodus/forbind/test/test2-1.dmp b/exodus/forbind/test/test2-1.dmp
index 25a44e0..e0f60db 100644
--- a/exodus/forbind/test/test2-1.dmp
+++ b/exodus/forbind/test/test2-1.dmp
@@ -137,6 +137,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is test 2" ;
:maximum_name_length = 32 ;
data:
diff --git a/exodus/forbind/test/test2-2.dmp b/exodus/forbind/test/test2-2.dmp
index 60c1e02..794c6f6 100644
--- a/exodus/forbind/test/test2-2.dmp
+++ b/exodus/forbind/test/test2-2.dmp
@@ -137,6 +137,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is test 2" ;
:maximum_name_length = 32 ;
data:
diff --git a/exodus/forbind/test/test_nem.dmp b/exodus/forbind/test/test_nem.dmp
new file mode 100644
index 0000000..d355a4c
--- /dev/null
+++ b/exodus/forbind/test/test_nem.dmp
@@ -0,0 +1,54 @@
+ ******************Output Tests*****************
+ creating ExodusII file...
+ ...successful
+ testing init info output...
+ ...successful
+ testing global init info output...
+ ...successful
+ testing global element block ID output...
+ ...successful
+ testing global node-set params output...
+ ...successful
+ testing global side-set params output...
+ ...successful
+ testing concatenated load balance info output...
+ ...successful
+ testing node map output...
+ ...successful
+ testing element map output...
+ ...successful
+ testing concatenated communication map params output...
+ ...successful
+ testing nodal communication map output...
+ ...successful
+ testing elemental communication map output...
+ ...successful
+ closing ExodusII file...
+ ...successful
+ ******************Input Tests******************
+ reopening ExodusII file...
+ ...successful
+ testing init info input...
+ ...successful
+ testing global init info input...
+ ...successful
+ testing global element block IDs input...
+ ...successful
+ testing global node-set params input...
+ ...successful
+ testing global side-set params input...
+ ...successful
+ testing load-balance params input...
+ ...successful
+ testing node map input...
+ ...successful
+ testing element map input...
+ ...successful
+ testing nodal communication map input...
+ ...successful
+ testing elemental communication map input...
+ ...successful
+ closing ExodusII file...
+ ...successful
+ Tests Passed: 25
+ Tests Failed: 0
diff --git a/nemesis/forbind/ne_test.F b/exodus/forbind/test/test_nem.f
similarity index 86%
copy from nemesis/forbind/ne_test.F
copy to exodus/forbind/test/test_nem.f
index 1c5dde0..beaeba9 100644
--- a/nemesis/forbind/ne_test.F
+++ b/exodus/forbind/test/test_nem.f
@@ -43,7 +43,7 @@ C=================================================================
PROGRAM NETEST
C=================================================================
INCLUDE 'exodusII.inc'
- INCLUDE 'ne_test.inc'
+ INCLUDE 'test_nem.inc'
C local variables
INTEGER NEID, IO_WS, CPU_WS, T_PASS, T_FAIL, DBG_FLAG, IERR
@@ -59,8 +59,8 @@ C local variables
C now let's get going...
-C I don't care about input arguements, so the file name will be ne_test.nemI
- FNAME = 'ne_test.nemI'
+C I don't care about input arguments, so the file name will be ne_test.nemI
+ FNAME = 'test_nem.exo'
C and set the debug flag to 0
DBG_FLAG = 0
@@ -80,7 +80,7 @@ C create the exodus II file
C Test the output of initial information
PRINT*, 'testing init info output...'
- CALL NEPII(NEID, NPROC, NPROCF, 'S', IERR)
+ CALL EXPII(NEID, NPROC, NPROCF, 'S', IERR)
IF (IERR.NE.0) THEN
PRINT*, '...FAILED'
T_FAIL = T_FAIL + 1
@@ -94,7 +94,7 @@ C Test the output of initial information
C Test the output of initial global information
PRINT*, 'testing global init info output...'
- CALL NEPIG(NEID, NNG, NEG, NEBG, NNSG, NSSG, IERR)
+ CALL EXPIG(NEID, NNG, NEG, NEBG, NNSG, NSSG, IERR)
IF (IERR.NE.0) THEN
PRINT*, '...FAILED'
T_FAIL = T_FAIL + 1
@@ -108,7 +108,7 @@ C Test the output of initial global information
C Test the output of the global element block IDs
PRINT*, 'testing global element block ID output...'
- CALL NETPEBI(NEID, IERR)
+ CALL EXTPEBI(NEID, IERR)
IF (IERR.NE.0) THEN
PRINT*, '...FAILED'
T_FAIL = T_FAIL + 1
@@ -122,7 +122,7 @@ C Test the output of the global element block IDs
C Test the output of the global node-set info
PRINT*, 'testing global node-set params output...'
- CALL NETPNSP(NEID, IERR)
+ CALL EXTPNSP(NEID, IERR)
IF (IERR.NE.0) THEN
PRINT*, '...FAILED'
T_FAIL = T_FAIL + 1
@@ -136,7 +136,7 @@ C Test the output of the global node-set info
C Test the output of the global side-set info
PRINT*, 'testing global side-set params output...'
- CALL NETPSSP(NEID, IERR)
+ CALL EXTPSSP(NEID, IERR)
IF (IERR.NE.0) THEN
PRINT*, '...FAILED'
T_FAIL = T_FAIL + 1
@@ -150,7 +150,7 @@ C Test the output of the global side-set info
C Test the output of the concatenated load-balance parameters
PRINT*, 'testing concatenated load balance info output...'
- CALL NETPLBPC(NEID, IERR)
+ CALL EXTPLBPC(NEID, IERR)
IF (IERR.NE.0) THEN
PRINT*, '...FAILED'
T_FAIL = T_FAIL + 1
@@ -164,7 +164,7 @@ C Test the output of the concatenated load-balance parameters
C Test the output of the node map
PRINT*, 'testing node map output...'
- CALL NETPNM(NEID, IERR)
+ CALL EXTPNM(NEID, IERR)
IF (IERR.NE.0) THEN
PRINT*, '...FAILED'
T_FAIL = T_FAIL + 1
@@ -178,7 +178,7 @@ C Test the output of the node map
C Test the output of the element map
PRINT*, 'testing element map output...'
- CALL NETPEM(NEID, IERR)
+ CALL EXTPEM(NEID, IERR)
IF (IERR.NE.0) THEN
PRINT*, '...FAILED'
T_FAIL = T_FAIL + 1
@@ -191,9 +191,8 @@ C Test the output of the element map
END IF
C Test the output of the concatenated communication map params
-#ifndef Build64
PRINT*, 'testing concatenated communication map params output...'
- CALL NETPCMPC(NEID, IERR)
+ CALL EXTPCMPC(NEID, IERR)
IF (IERR.NE.0) THEN
PRINT*, '...FAILED'
T_FAIL = T_FAIL + 1
@@ -204,11 +203,10 @@ C Test the output of the concatenated communication map params
PRINT*, '...successful'
T_PASS = T_PASS + 1
END IF
-#endif
C Test nodal communication map output
PRINT*, 'testing nodal communication map output...'
- CALL NETPNCM(NEID, IERR)
+ CALL EXTPNCM(NEID, IERR)
IF (IERR.NE.0) THEN
PRINT*, '...FAILED'
T_FAIL = T_FAIL + 1
@@ -222,7 +220,7 @@ C Test nodal communication map output
C Test elemental communication map output
PRINT*, 'testing elemental communication map output...'
- CALL NETPECM(NEID, IERR)
+ CALL EXTPECM(NEID, IERR)
IF (IERR.NE.0) THEN
PRINT*, '...FAILED'
T_FAIL = T_FAIL + 1
@@ -268,7 +266,7 @@ C Re-open the ExodusII/NemesisI file
C Test read of of the initial information
PRINT*, 'testing init info input...'
- CALL NETGII(NEID, IERR)
+ CALL EXTGII(NEID, IERR)
IF (IERR.NE.0) THEN
PRINT*, '...FAILED'
T_FAIL = T_FAIL + 1
@@ -282,7 +280,7 @@ C Test read of of the initial information
C Test read of initial global information
PRINT*, 'testing global init info input...'
- CALL NETGIG(NEID, IERR)
+ CALL EXTGIG(NEID, IERR)
IF (IERR.NE.0) THEN
PRINT*, '...FAILED'
T_FAIL = T_FAIL + 1
@@ -296,7 +294,7 @@ C Test read of initial global information
C Test read of global element block IDs
PRINT*, 'testing global element block IDs input...'
- CALL NETGEBI(NEID, IERR)
+ CALL EXTGEBI(NEID, IERR)
IF (IERR.NE.0) THEN
PRINT*, '...FAILED'
T_FAIL = T_FAIL + 1
@@ -310,7 +308,7 @@ C Test read of global element block IDs
C Test read of global node-set params
PRINT*, 'testing global node-set params input...'
- CALL NETGNSP(NEID, IERR)
+ CALL EXTGNSP(NEID, IERR)
IF (IERR.NE.0) THEN
PRINT*, '...FAILED'
T_FAIL = T_FAIL + 1
@@ -324,7 +322,7 @@ C Test read of global node-set params
C Test read of global side-set params
PRINT*, 'testing global side-set params input...'
- CALL NETGSSP(NEID, IERR)
+ CALL EXTGSSP(NEID, IERR)
IF (IERR.NE.0) THEN
PRINT*, '...FAILED'
T_FAIL = T_FAIL + 1
@@ -338,7 +336,7 @@ C Test read of global side-set params
C Test read of load-balance params
PRINT*, 'testing load-balance params input...'
- CALL NETGLBP(NEID, IERR)
+ CALL EXTGLBP(NEID, IERR)
IF (IERR.NE.0) THEN
PRINT*, '...FAILED'
T_FAIL = T_FAIL + 1
@@ -352,7 +350,7 @@ C Test read of load-balance params
C Test read of the node map
PRINT*, 'testing node map input...'
- CALL NETGNM(NEID, IERR)
+ CALL EXTGNM(NEID, IERR)
IF (IERR.NE.0) THEN
PRINT*, '...FAILED'
T_FAIL = T_FAIL + 1
@@ -366,7 +364,7 @@ C Test read of the node map
C Test read of the element map
PRINT*, 'testing element map input...'
- CALL NETGEM(NEID, IERR)
+ CALL EXTGEM(NEID, IERR)
IF (IERR.NE.0) THEN
PRINT*, '...FAILED'
T_FAIL = T_FAIL + 1
@@ -380,7 +378,7 @@ C Test read of the element map
C Test read of nodal communication maps
PRINT*, 'testing nodal communication map input...'
- CALL NETGNCM(NEID, IERR)
+ CALL EXTGNCM(NEID, IERR)
IF (IERR.NE.0) THEN
PRINT*, '...FAILED'
T_FAIL = T_FAIL + 1
@@ -394,7 +392,7 @@ C Test read of nodal communication maps
C Test read of elemental communication maps
PRINT*, 'testing elemental communication map input...'
- CALL NETGECM(NEID, IERR)
+ CALL EXTGECM(NEID, IERR)
IF (IERR.NE.0) THEN
PRINT*, '...FAILED'
T_FAIL = T_FAIL + 1
@@ -426,10 +424,10 @@ C Close the ExodusII/Nemesis test file
END
C=================================================================
- SUBROUTINE NETPEBI(NEID, IERR)
+ SUBROUTINE EXTPEBI(NEID, IERR)
C=================================================================
- INCLUDE 'ne_test.inc'
+ INCLUDE 'test_nem.inc'
INTEGER I, EBLK_IDS(NEBG)
INTEGER EBLK_CNTS(NEBG)
@@ -439,15 +437,15 @@ C=================================================================
EBLK_CNTS(I) = 10
110 CONTINUE
- CALL NEPEBIG(NEID, EBLK_IDS, EBLK_CNTS, IERR)
+ CALL EXPEBIG(NEID, EBLK_IDS, EBLK_CNTS, IERR)
END
C=================================================================
- SUBROUTINE NETPNSP(NEID, IERR)
+ SUBROUTINE EXTPNSP(NEID, IERR)
C=================================================================
- INCLUDE 'ne_test.inc'
+ INCLUDE 'test_nem.inc'
INTEGER I, GLBL_IDS(NNSG), GLBL_NC(NNSG), GLBL_DFC(NNSG)
@@ -457,15 +455,15 @@ C=================================================================
GLBL_DFC(I) = 1
120 CONTINUE
- CALL NEPNSPG(NEID, GLBL_IDS, GLBL_NC, GLBL_DFC, IERR)
+ CALL EXPNSPG(NEID, GLBL_IDS, GLBL_NC, GLBL_DFC, IERR)
END
C=================================================================
- SUBROUTINE NETPSSP(NEID, IERR)
+ SUBROUTINE EXTPSSP(NEID, IERR)
C=================================================================
- INCLUDE 'ne_test.inc'
+ INCLUDE 'test_nem.inc'
INTEGER I, GLBL_IDS(NSSG), GLBL_ELC(NSSG), GLBL_DFC(NSSG)
@@ -475,15 +473,15 @@ C=================================================================
GLBL_DFC(I) = 1
130 CONTINUE
- CALL NEPSSPG(NEID, GLBL_IDS, GLBL_ELC, GLBL_DFC, IERR)
+ CALL EXPSSPG(NEID, GLBL_IDS, GLBL_ELC, GLBL_DFC, IERR)
END
C=================================================================
- SUBROUTINE NETPLBPC(NEID, IERR)
+ SUBROUTINE EXTPLBPC(NEID, IERR)
C=================================================================
- INCLUDE 'ne_test.inc'
+ INCLUDE 'test_nem.inc'
INTEGER IPROC, NUM_IN(NPROCF), NUM_BN(NPROCF), NUM_EN(NPROCF),
1 NUM_IE(NPROCF), NUM_BE(NPROCF), NUM_NCM(NPROCF), NUM_ECM(NPROCF)
@@ -500,16 +498,16 @@ C=================================================================
NUM_ECM(IPROC) = NECMAP
140 CONTINUE
- CALL NEPLBPC(NEID, NUM_IN, NUM_BN, NUM_EN, NUM_IE, NUM_BE,
+ CALL EXPLBPC(NEID, NUM_IN, NUM_BN, NUM_EN, NUM_IE, NUM_BE,
1 NUM_NCM, NUM_ECM, IERR)
END
C=================================================================
- SUBROUTINE NETPNM(NEID, IERR)
+ SUBROUTINE EXTPNM(NEID, IERR)
C=================================================================
- INCLUDE 'ne_test.inc'
+ INCLUDE 'test_nem.inc'
INTEGER IPROC, I, J, NMAPI(NINTN), NMAPB(NBORN), NMAPE(NEXTN)
@@ -530,7 +528,7 @@ C=================================================================
I = 0
- CALL NEPNM(NEID, NMAPI, NMAPB, NMAPE, IPROC, IERR)
+ CALL EXPNMP(NEID, NMAPI, NMAPB, NMAPE, IPROC, IERR)
IF (IERR.NE.0) GOTO 210
200 CONTINUE
@@ -539,10 +537,10 @@ C=================================================================
END
C=================================================================
- SUBROUTINE NETPEM(NEID, IERR)
+ SUBROUTINE EXTPEM(NEID, IERR)
C=================================================================
- INCLUDE 'ne_test.inc'
+ INCLUDE 'test_nem.inc'
INTEGER IPROC, I, J, EMAPI(NINTE), EMAPB(NBORE)
@@ -559,7 +557,7 @@ C=================================================================
I = 0
- CALL NEPEM(NEID, EMAPI, EMAPB, IPROC, IERR)
+ CALL EXPEMP(NEID, EMAPI, EMAPB, IPROC, IERR)
IF (IERR.NE.0) GOTO 210
200 CONTINUE
@@ -568,10 +566,10 @@ C=================================================================
END
C=================================================================
- SUBROUTINE NETPCMPC(NEID, IERR)
+ SUBROUTINE EXTPCMPC(NEID, IERR)
C=================================================================
- INCLUDE 'ne_test.inc'
+ INCLUDE 'test_nem.inc'
INTEGER IPROC, I, NCNTR, ECNTR, NMAPIDS(NNCXNPF),
1 NMAPCNT(NNCXNPF), NMAPPROC(NPROCF+1), EMAPIDS(NECXNPF),
@@ -598,16 +596,16 @@ C=================================================================
200 CONTINUE
- CALL NEPCMPC(NEID, NMAPIDS, NMAPCNT, NMAPPROC, EMAPIDS, EMAPCNT,
+ CALL EXPCMPC(NEID, NMAPIDS, NMAPCNT, NMAPPROC, EMAPIDS, EMAPCNT,
1 EMAPPROC, IERR)
END
C=================================================================
- SUBROUTINE NETPNCM(NEID, IERR)
+ SUBROUTINE EXTPNCM(NEID, IERR)
C=================================================================
- INCLUDE 'ne_test.inc'
+ INCLUDE 'test_nem.inc'
INTEGER IPROC, I, NMAPIDS(NNCMAP), NIDS(NCNTCM), PIDS(NCNTCM)
@@ -621,7 +619,7 @@ C=================================================================
160 CONTINUE
DO 170 I=1,NNCMAP
- CALL NEPNCM(NEID, NMAPIDS(I), NIDS, PIDS, IPROC, IERR)
+ CALL EXPNCM(NEID, NMAPIDS(I), NIDS, PIDS, IPROC, IERR)
IF (IERR.NE.0) GOTO 210
170 CONTINUE
@@ -631,10 +629,10 @@ C=================================================================
END
C=================================================================
- SUBROUTINE NETPECM(NEID, IERR)
+ SUBROUTINE EXTPECM(NEID, IERR)
C=================================================================
- INCLUDE 'ne_test.inc'
+ INCLUDE 'test_nem.inc'
INTEGER IPROC, I, EMAPIDS(NECMAP), EIDS(ECNTCM), PIDS(ECNTCM),
1 SIDS(ECNTCM)
@@ -650,7 +648,7 @@ C=================================================================
160 CONTINUE
DO 170 I=1,NECMAP
- CALL NEPECM(NEID, EMAPIDS(I), EIDS, SIDS, PIDS, IPROC, IERR)
+ CALL EXPECM(NEID, EMAPIDS(I), EIDS, SIDS, PIDS, IPROC, IERR)
IF (IERR.NE.0) GOTO 210
170 CONTINUE
@@ -660,15 +658,15 @@ C=================================================================
END
C=================================================================
- SUBROUTINE NETGII(NEID, IERR)
+ SUBROUTINE EXTGII(NEID, IERR)
C=================================================================
- INCLUDE 'ne_test.inc'
+ INCLUDE 'test_nem.inc'
INTEGER NP, NPF
CHARACTER FTYPE*2
- CALL NEGII(NEID, NP, NPF, FTYPE, IERR)
+ CALL EXGII(NEID, NP, NPF, FTYPE, IERR)
IF (IERR.NE.0) GOTO 210
@@ -680,14 +678,14 @@ C=================================================================
END
C=================================================================
- SUBROUTINE NETGIG(NEID, IERR)
+ SUBROUTINE EXTGIG(NEID, IERR)
C=================================================================
- INCLUDE 'ne_test.inc'
+ INCLUDE 'test_nem.inc'
INTEGER NUMNG, NUMEG, NUMEBG, NUMNSG, NUMSSG
- CALL NEGIG(NEID, NUMNG, NUMEG, NUMEBG, NUMNSG, NUMSSG, IERR)
+ CALL EXGIG(NEID, NUMNG, NUMEG, NUMEBG, NUMNSG, NUMSSG, IERR)
IF (IERR.NE.0) GOTO 210
@@ -701,15 +699,15 @@ C=================================================================
END
C=================================================================
- SUBROUTINE NETGEBI(NEID, IERR)
+ SUBROUTINE EXTGEBI(NEID, IERR)
C=================================================================
- INCLUDE 'ne_test.inc'
+ INCLUDE 'test_nem.inc'
INTEGER I, EBLK_IDS(NEBG)
INTEGER EBLK_CNTS(NEBG)
- CALL NEGEBIG(NEID, EBLK_IDS, EBLK_CNTS, IERR)
+ CALL EXGEBIG(NEID, EBLK_IDS, EBLK_CNTS, IERR)
IF (IERR.NE.0) GOTO 210
@@ -722,14 +720,14 @@ C=================================================================
END
C=================================================================
- SUBROUTINE NETGNSP(NEID, IERR)
+ SUBROUTINE EXTGNSP(NEID, IERR)
C=================================================================
- INCLUDE 'ne_test.inc'
+ INCLUDE 'test_nem.inc'
INTEGER I, GLBL_IDS(NNSG), GLBL_NC(NNSG), GLBL_DFC(NNSG)
- CALL NEGNSPG(NEID, GLBL_IDS, GLBL_NC, GLBL_DFC, IERR)
+ CALL EXGNSPG(NEID, GLBL_IDS, GLBL_NC, GLBL_DFC, IERR)
IF (IERR.NE.0) GOTO 210
@@ -743,14 +741,14 @@ C=================================================================
END
C=================================================================
- SUBROUTINE NETGSSP(NEID, IERR)
+ SUBROUTINE EXTGSSP(NEID, IERR)
C=================================================================
- INCLUDE 'ne_test.inc'
+ INCLUDE 'test_nem.inc'
INTEGER I, GLBL_IDS(NSSG), GLBL_EC(NSSG), GLBL_DFC(NSSG)
- CALL NEGSSPG(NEID, GLBL_IDS, GLBL_EC, GLBL_DFC, IERR)
+ CALL EXGSSPG(NEID, GLBL_IDS, GLBL_EC, GLBL_DFC, IERR)
IF (IERR.NE.0) GOTO 210
@@ -764,16 +762,16 @@ C=================================================================
END
C=================================================================
- SUBROUTINE NETGLBP(NEID, IERR)
+ SUBROUTINE EXTGLBP(NEID, IERR)
C=================================================================
- INCLUDE 'ne_test.inc'
+ INCLUDE 'test_nem.inc'
INTEGER IPROC, NUM_IN, NUM_BN, NUM_EN, NUM_IE, NUM_BE,
* NUM_NCM, NUM_ECM
DO 150 IPROC = 0,(NPROCF-1)
- CALL NEGLBP(NEID, NUM_IN, NUM_BN, NUM_EN, NUM_IE, NUM_BE,
+ CALL EXGLBP(NEID, NUM_IN, NUM_BN, NUM_EN, NUM_IE, NUM_BE,
1 NUM_NCM, NUM_ECM, IPROC, IERR)
IF (IERR.NE.0) GOTO 210
@@ -791,17 +789,17 @@ C=================================================================
END
C=================================================================
- SUBROUTINE NETGNM(NEID, IERR)
+ SUBROUTINE EXTGNM(NEID, IERR)
C=================================================================
- INCLUDE 'ne_test.inc'
+ INCLUDE 'test_nem.inc'
INTEGER IPROC, I, J, NMAPI(NINTN), NMAPB(NBORN), NMAPE(NEXTN)
I = 0
DO 200 IPROC = 0,(NPROCF-1)
- CALL NEGNM(NEID, NMAPI, NMAPB, NMAPE, IPROC, IERR)
+ CALL EXGNMP(NEID, NMAPI, NMAPB, NMAPE, IPROC, IERR)
IF (IERR.NE.0) GOTO 210
@@ -828,16 +826,16 @@ C=================================================================
END
C=================================================================
- SUBROUTINE NETGEM(NEID, IERR)
+ SUBROUTINE EXTGEM(NEID, IERR)
C=================================================================
- INCLUDE 'ne_test.inc'
+ INCLUDE 'test_nem.inc'
INTEGER IPROC, I, J, EMAPI(NINTE), EMAPB(NBORE)
I = 0
DO 200 IPROC = 0,(NPROCF-1)
- CALL NEGEM(NEID, EMAPI, EMAPB, IPROC, IERR)
+ CALL EXGEMP(NEID, EMAPI, EMAPB, IPROC, IERR)
IF (IERR.NE.0) GOTO 210
@@ -860,22 +858,22 @@ C=================================================================
END
C=================================================================
- SUBROUTINE NETGNCM(NEID, IERR)
+ SUBROUTINE EXTGNCM(NEID, IERR)
C=================================================================
- INCLUDE 'ne_test.inc'
+ INCLUDE 'test_nem.inc'
INTEGER IPROC, I, J, NMAPIDS(NNCMAP), NMAPCNT(NNCMAP),
1 NIDS(NCNTCM), PIDS(NCNTCM), EMAPIDS(NECMAP), EMAPCNT(NECMAP)
DO 200 IPROC = 0,(NPROCF-1)
- CALL NEGCMP(NEID, NMAPIDS, NMAPCNT, EMAPIDS, EMAPCNT,
+ CALL EXGCMP(NEID, NMAPIDS, NMAPCNT, EMAPIDS, EMAPCNT,
1 IPROC, IERR)
IF (IERR.NE.0) GOTO 210
DO 170 I = 1,NNCMAP
- CALL NEGNCM(NEID, NMAPIDS(I), NIDS, PIDS, IPROC, IERR)
+ CALL EXGNCM(NEID, NMAPIDS(I), NIDS, PIDS, IPROC, IERR)
IF (IERR.NE.0) GOTO 210
@@ -894,22 +892,22 @@ C=================================================================
END
C=================================================================
- SUBROUTINE NETGECM(NEID, IERR)
+ SUBROUTINE EXTGECM(NEID, IERR)
C=================================================================
- INCLUDE 'ne_test.inc'
+ INCLUDE 'test_nem.inc'
INTEGER IPROC, I, EMAPIDS(NECMAP), EMAPCNT(NECMAP), EIDS(ECNTCM),
1 PIDS(ECNTCM), SIDS(ECNTCM), NMAPIDS(NNCMAP), NMAPCNT(NNCMAP)
DO 200 IPROC = 0,(NPROCF-1)
- CALL NEGCMP(NEID, NMAPIDS, NMAPCNT, EMAPIDS, EMAPCNT,
+ CALL EXGCMP(NEID, NMAPIDS, NMAPCNT, EMAPIDS, EMAPCNT,
1 IPROC, IERR)
IF (IERR.NE.0) GOTO 210
DO 170 I = 1,NECMAP
- CALL NEGECM(NEID, EMAPIDS(I), EIDS, SIDS, PIDS, IPROC, IERR)
+ CALL EXGECM(NEID, EMAPIDS(I), EIDS, SIDS, PIDS, IPROC, IERR)
IF (IERR.NE.0) GOTO 210
diff --git a/exodus/forbind/test/test_nem.inc b/exodus/forbind/test/test_nem.inc
new file mode 100644
index 0000000..0f033a1
--- /dev/null
+++ b/exodus/forbind/test/test_nem.inc
@@ -0,0 +1,66 @@
+C Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
+C DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
+C retains certain rights in this software.
+C
+C Redistribution and use in source and binary forms, with or without
+C modification, are permitted provided that the following conditions are
+C met:
+C
+C * Redistributions of source code must retain the above copyright
+C notice, this list of conditions and the following disclaimer.
+C
+C * Redistributions in binary form must reproduce the above
+C copyright notice, this list of conditions and the following
+C disclaimer in the documentation and/or other materials provided
+C with the distribution.
+C
+C * Neither the name of Sandia Corporation nor the names of its
+C contributors may be used to endorse or promote products derived
+C from this software without specific prior written permission.
+C
+C THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+C "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+C LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+C A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+C OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+C SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+C LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+C DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+C THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+C (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+C OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+C
+C==================================================
+C Parameters for the NE_TEST fortran interface test
+C program
+C==================================================
+
+C Constants for init_global functions
+ PARAMETER (NNG = 100)
+ PARAMETER (NEG = 50)
+ PARAMETER (NEBG = 5)
+ PARAMETER (NNSG = 2)
+ PARAMETER (NSSG = 3)
+
+C Constants for load-balance functions
+ PARAMETER (NPROC = 10)
+ PARAMETER (NPROCF = NPROC)
+ PARAMETER (NINTN = 200)
+ PARAMETER (NBORN = 10)
+ PARAMETER (NEXTN = 5)
+ PARAMETER (NINTE = 100)
+ PARAMETER (NBORE = 20)
+ INTEGER NNCMAP, NECMAP
+ PARAMETER (NNCMAP = 4)
+ PARAMETER (NECMAP = 2)
+
+C Constants for communication map
+ PARAMETER (NCNTCM = 20)
+ INTEGER ECNTCM
+ PARAMETER (ECNTCM = 17)
+
+C Some multiplied values
+C NNCMAP * NPROCF
+ PARAMETER (NNCXNPF = 40)
+C NECMAP * NPROCF
+ PARAMETER (NECXNPF = 20)
diff --git a/exodus/forbind/test/testall.in b/exodus/forbind/test/testall.in
index 4569236..02594f8 100644
--- a/exodus/forbind/test/testall.in
+++ b/exodus/forbind/test/testall.in
@@ -38,7 +38,7 @@
#set PREFIX = "valgrind --tool=memcheck"
set PREFIX = ""
-set SUFFIX = ".exe"
+set SUFFIX = ""
set BINDIR = @CMAKE_CURRENT_BINARY_DIR@
set SRCDIR = @CMAKE_CURRENT_SOURCE_DIR@
set NCDUMP = @NETCDF_NCDUMP@
@@ -120,6 +120,10 @@ ${NCDUMP} -d5,5 test-nsided.exo | grep -v version | diff - ${SRCDIR}/test-nsided
echo "testrd_nsid ..."
${PREFIX} ${BINDIR}/f_testrd_nsid${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd_nsid.dmp | tee testrd_nsid.res
+# test_nem - nemesis routines
+echo "test_nem ..."
+${PREFIX} ${BINDIR}/f_test_nem
+
echo "************************************************************************"
echo "************************************************************************"
diff --git a/exodus/forbind/test/testall.in1 b/exodus/forbind/test/testall.in1
index 92050d3..551b902 100644
--- a/exodus/forbind/test/testall.in1
+++ b/exodus/forbind/test/testall.in1
@@ -118,6 +118,10 @@ ${NCDUMP} -d5,5 test-nsided.exo | grep -v version | diff - test-nsided.dmp | tee
echo "testrd_nsid ..."
${PREFIX} ${SRCDIR}/testrd_nsid | grep -v version | diff - testrd_nsid.dmp | tee testrd_nsid.res
+# test_nem - nemesis routines
+echo "test_nem ..."
+${PREFIX} ${SRCDIR}/test_nem | diff - test_nem.dmp | tee test_nem.res
+
echo "************************************************************************"
echo "************************************************************************"
diff --git a/exodus/forbind/test/testall b/exodus/forbind/test/testall.standalone
old mode 100644
new mode 100755
similarity index 66%
rename from exodus/forbind/test/testall
rename to exodus/forbind/test/testall.standalone
index 7233ad2..cd8b364
--- a/exodus/forbind/test/testall
+++ b/exodus/forbind/test/testall.standalone
@@ -36,89 +36,96 @@
# To run the tests with valgrind checking, uncomment the next line and comment the
# following line. Can also define other prefixes if wanted.
+if ($#argv == 0) then
+ set NCDUMP = `which ncdump`
+else
+ set NCDUMP = $1
+endif
+
#set PREFIX = "valgrind --tool=memcheck"
set PREFIX = ""
-set SUFFIX = ""
-set BINDIR = /Users/gdsjaar/src/exodusii-sf/exodus/forbind/test
-set SRCDIR = /Users/gdsjaar/src/exodusii-sf/exodus/forbind/test
-set NCDUMP = /Users/gdsjaar/src/SEACAS.git/bin/ncdump
+set SRCDIR = .
# testwt - single precision write test
echo "************************************************************************"
echo "************************************************************************"
echo "testwt ..."
echo "begin testwt" > test.output
-${PREFIX} ${BINDIR}/testwt${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testwt >> test.output
echo "end testwt" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test.dmp | tee testwt.res
+${NCDUMP} -d5,5 test.exo | grep -v version | diff - test.dmp | tee testwt.res
# testrd - single precision read test
echo "testrd ..."
echo "testrd ... [Expect ex_create NOCLOBBER error from this test]"
-${PREFIX} ${BINDIR}/testrd${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd.dmp | tee testrd.res
+${PREFIX} ${SRCDIR}/testrd | grep -v version | diff - testrd.dmp | tee testrd.res
# testcp_ss - single-to-single precision copy test
echo "testcp_ss ..."
echo "begin testcp_ss" >> test.output
-${PREFIX} ${BINDIR}/testcp${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testcp >> test.output
echo "end testcp_ss" >> test.output
-${NCDUMP} -d5,5 testcp.exo | grep -v version | diff - ${SRCDIR}/testcp_ss.dmp | tee testcp_ss.res
+${NCDUMP} -d5,5 testcp.exo | grep -v version | diff - testcp_ss.dmp | tee testcp_ss.res
# testcpln - single-to-single, large to normal copy test
echo "testcpln ..."
echo "begin testcpln" >> test.output
-${PREFIX} ${BINDIR}/testcpln${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testcpln >> test.output
echo "end testcpln" >> test.output
-${NCDUMP} -d5,5 testcp.exo | grep -v version | diff - ${SRCDIR}/testcpln.dmp | tee testcpln.res
+${NCDUMP} -d5,5 testcp.exo | grep -v version | diff - testcpln.dmp | tee testcpln.res
# testcpnl - single-to-single, normal to large copy test
echo "testcpnl ..."
echo "begin testcpnl" >> test.output
-${PREFIX} ${BINDIR}/testcpnl${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testcpnl >> test.output
echo "end testcpnl" >> test.output
-${NCDUMP} -d5,5 testcpnl.exo | grep -v version | diff - ${SRCDIR}/testcpnl.dmp | tee testcpnl.res
+${NCDUMP} -d5,5 testcpnl.exo | grep -v version | diff - testcpnl.dmp | tee testcpnl.res
# testwt1 - single precision write test with multiple side sets
echo "testwt1 ..."
echo "testwt1 ... [Expect WEDGE6 warning from this test]"
echo "begin testwt1" >> test.output
-${PREFIX} ${BINDIR}/testwt1${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testwt1 >> test.output
echo "end testwt1" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test1.dmp | tee testwt1.res
+${NCDUMP} -d5,5 test.exo | grep -v version | diff - test1.dmp | tee testwt1.res
# testrd1 - single precision read test with multiple side sets
echo "testrd1 ..."
echo "testrd1 ... [Expect failure locating elem var 1 for elem block 12]"
-${PREFIX} ${BINDIR}/testrd1${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd1.dmp | tee testrd1.res
+${PREFIX} ${SRCDIR}/testrd1 | grep -v version | diff - testrd1.dmp | tee testrd1.res
# testwtd - double precision write test
echo "testwtd ..."
echo "begin testwtd" >> test.output
-${PREFIX} ${BINDIR}/testwtd${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testwtd >> test.output
echo "end testwtd" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/testd.dmp | tee testwtd.res
+${NCDUMP} -d5,5 test.exo | grep -v version | diff - testd.dmp | tee testwtd.res
# testrdd - double precision read test
echo "testrdd ..."
-${PREFIX} ${BINDIR}/testrdd${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrdd.dmp | tee testrdd.res
+${PREFIX} ${SRCDIR}/testrdd | grep -v version | diff - testrdd.dmp | tee testrdd.res
# testwt2 - single precision write 2 files (simultaneously open) test
echo "testwt2 ..."
echo "begin testwt2" >> test.output
-${PREFIX} ${BINDIR}/testwt2${SUFFIX} >> test.output |&grep -v "property name string"
+${PREFIX} ${SRCDIR}/testwt2 >> test.output |&grep -v "property name string"
echo "end testwt2" >> test.output
-${NCDUMP} -d5,5 test.exo | grep -v version | diff - ${SRCDIR}/test2-1.dmp | tee testwt2-1.res
-${NCDUMP} -d5,5 test2.exo | grep -v version | diff - ${SRCDIR}/test2-2.dmp | tee testwt2-2.res
+${NCDUMP} -d5,5 test.exo | grep -v version | diff - test2-1.dmp | tee testwt2-1.res
+${NCDUMP} -d5,5 test2.exo | grep -v version | diff - test2-2.dmp | tee testwt2-2.res
echo "testwt_nsid ..."
echo "begin testwt_nsid" > test.output
-${PREFIX} ${BINDIR}/testwt_nsid${SUFFIX} >> test.output
+${PREFIX} ${SRCDIR}/testwt_nsid >> test.output
echo "end testwt_nsid" >> test.output
-${NCDUMP} -d5,5 test-nsided.exo | grep -v version | diff - ${SRCDIR}/test-nsided.dmp | tee testwt_nsid.res
+${NCDUMP} -d5,5 test-nsided.exo | grep -v version | diff - test-nsided.dmp | tee testwt_nsid.res
# testrd_nsid - single precision read test
echo "testrd_nsid ..."
-${PREFIX} ${BINDIR}/testrd_nsid${SUFFIX} | grep -v version | diff - ${SRCDIR}/testrd_nsid.dmp | tee testrd_nsid.res
+${PREFIX} ${SRCDIR}/testrd_nsid | grep -v version | diff - testrd_nsid.dmp | tee testrd_nsid.res
+
+# test_nem - nemesis routines
+echo "test_nem ..."
+${PREFIX} ${SRCDIR}/test_nem | diff - test_nem.dmp | tee test_nem.res
echo "************************************************************************"
echo "************************************************************************"
diff --git a/exodus/forbind/test/testcp.f b/exodus/forbind/test/testcp.f
index 2ef47e4..1e39902 100644
--- a/exodus/forbind/test/testcp.f
+++ b/exodus/forbind/test/testcp.f
@@ -43,7 +43,7 @@ c conversion routines
exoid1 = excre ("testcp.exo",
1 EXCLOB, cpu_ws, io_ws, ierr)
- write (iout,'("after excre, id = ", i3, ", error = ",i3)')
+ write (iout,'("after excre, id = ", i6, ", error = ",i4)')
1 exoid1, ierr
write (iout,'(" I/O word size: ",i4)') io_ws
diff --git a/exodus/forbind/test/testcp_dd.dmp b/exodus/forbind/test/testcp_dd.dmp
index a6b1eb0..e69de29 100644
--- a/exodus/forbind/test/testcp_dd.dmp
+++ b/exodus/forbind/test/testcp_dd.dmp
@@ -1,139 +0,0 @@
-netcdf testcpd {
-dimensions:
- len_string = 33 ;
- len_line = 81 ;
- four = 4 ;
- time_step = UNLIMITED ; // (0 currently)
- len_name = 33 ;
- num_dim = 2 ;
- num_nodes = 8 ;
- num_elem = 2 ;
- num_el_blk = 2 ;
- num_node_sets = 2 ;
- num_side_sets = 2 ;
- num_el_in_blk1 = 1 ;
- num_nod_per_el1 = 4 ;
- num_att_in_blk1 = 1 ;
- num_el_in_blk2 = 1 ;
- num_nod_per_el2 = 4 ;
- num_att_in_blk2 = 1 ;
- num_nod_ns1 = 5 ;
- num_nod_ns2 = 3 ;
- num_side_ss1 = 2 ;
- num_df_ss1 = 4 ;
- num_side_ss2 = 2 ;
- num_df_ss2 = 4 ;
-variables:
- double time_whole(time_step) ;
- int eb_status(num_el_blk) ;
- int eb_prop1(num_el_blk) ;
- eb_prop1:name = "ID" ;
- int ns_status(num_node_sets) ;
- int ns_prop1(num_node_sets) ;
- ns_prop1:name = "ID" ;
- int ss_status(num_side_sets) ;
- int ss_prop1(num_side_sets) ;
- ss_prop1:name = "ID" ;
- double coord(num_dim, num_nodes) ;
- char coor_names(num_dim, len_name) ;
- int elem_map(num_elem) ;
- double attrib1(num_el_in_blk1, num_att_in_blk1) ;
- int connect1(num_el_in_blk1, num_nod_per_el1) ;
- connect1:elem_type = "quad" ;
- double attrib2(num_el_in_blk2, num_att_in_blk2) ;
- int connect2(num_el_in_blk2, num_nod_per_el2) ;
- connect2:elem_type = "quad" ;
- int eb_prop2(num_el_blk) ;
- eb_prop2:name = "MATL" ;
- eb_prop2:_FillValue = 0 ;
- int eb_prop3(num_el_blk) ;
- eb_prop3:name = "DENSITY" ;
- eb_prop3:_FillValue = 0 ;
- int node_ns1(num_nod_ns1) ;
- double dist_fact_ns1(num_nod_ns1) ;
- int node_ns2(num_nod_ns2) ;
- double dist_fact_ns2(num_nod_ns2) ;
- int ns_prop2(num_node_sets) ;
- ns_prop2:name = "FACE" ;
- int ns_prop3(num_node_sets) ;
- ns_prop3:name = "VELOCITY" ;
- int elem_ss1(num_side_ss1) ;
- int side_ss1(num_side_ss1) ;
- double dist_fact_ss1(num_df_ss1) ;
- int elem_ss2(num_side_ss2) ;
- int side_ss2(num_side_ss2) ;
- double dist_fact_ss2(num_df_ss2) ;
- int ss_prop2(num_side_sets) ;
- ss_prop2:name = "COLOR" ;
-
-// global attributes:
- :floating_point_word_size = 8 ;
- :file_size = 0 ;
- :title = "This is a test" ;
- :maximum_name_length = 9 ;
-data:
-
- eb_status = 1, 1 ;
-
- eb_prop1 = 10, 11 ;
-
- ns_status = 1, 1 ;
-
- ns_prop1 = 20, 21 ;
-
- ss_status = 1, 1 ;
-
- ss_prop1 = 30, 31 ;
-
- coord =
- 0, 1, 1, 0, 1, 2, 2, 1,
- 0, 0, 1, 1, 0, 0, 1, 1 ;
-
- coor_names =
- "xcoor",
- "ycoor" ;
-
- elem_map = 1, 2 ;
-
- attrib1 =
- 3.1416 ;
-
- connect1 =
- 1, 2, 3, 4 ;
-
- attrib2 =
- 6.1416 ;
-
- connect2 =
- 5, 6, 7, 8 ;
-
- eb_prop2 = 10, 20 ;
-
- eb_prop3 = _, _ ;
-
- node_ns1 = 100, 101, 102, 103, 104 ;
-
- dist_fact_ns1 = 1, 2, 3, 4, 5 ;
-
- node_ns2 = 200, 201, 202 ;
-
- dist_fact_ns2 = 1.1, 2.1, 3.1 ;
-
- ns_prop2 = 4, 5 ;
-
- ns_prop3 = 1000, 2000 ;
-
- elem_ss1 = 11, 12 ;
-
- side_ss1 = 1, 2 ;
-
- dist_fact_ss1 = 30, 30.1, 30.2, 30.3 ;
-
- elem_ss2 = 13, 14 ;
-
- side_ss2 = 3, 4 ;
-
- dist_fact_ss2 = 31, 31.1, 31.2, 31.3 ;
-
- ss_prop2 = 100, 101 ;
-}
diff --git a/exodus/forbind/test/testcp_ds.dmp b/exodus/forbind/test/testcp_ds.dmp
index 89a80d1..04d4c51 100644
--- a/exodus/forbind/test/testcp_ds.dmp
+++ b/exodus/forbind/test/testcp_ds.dmp
@@ -5,24 +5,36 @@ dimensions:
four = 4 ;
time_step = UNLIMITED ; // (0 currently)
len_name = 33 ;
- num_dim = 2 ;
- num_nodes = 8 ;
- num_elem = 2 ;
- num_el_blk = 2 ;
+ num_dim = 3 ;
+ num_nodes = 26 ;
+ num_elem = 5 ;
+ num_el_blk = 5 ;
num_node_sets = 2 ;
- num_side_sets = 2 ;
+ num_side_sets = 5 ;
num_el_in_blk1 = 1 ;
num_nod_per_el1 = 4 ;
num_att_in_blk1 = 1 ;
num_el_in_blk2 = 1 ;
num_nod_per_el2 = 4 ;
num_att_in_blk2 = 1 ;
+ num_el_in_blk3 = 1 ;
+ num_nod_per_el3 = 8 ;
+ num_att_in_blk3 = 1 ;
+ num_el_in_blk4 = 1 ;
+ num_nod_per_el4 = 4 ;
+ num_att_in_blk4 = 1 ;
+ num_el_in_blk5 = 1 ;
+ num_nod_per_el5 = 6 ;
+ num_att_in_blk5 = 1 ;
num_nod_ns1 = 5 ;
num_nod_ns2 = 3 ;
num_side_ss1 = 2 ;
num_df_ss1 = 4 ;
num_side_ss2 = 2 ;
num_df_ss2 = 4 ;
+ num_side_ss3 = 7 ;
+ num_side_ss4 = 4 ;
+ num_side_ss5 = 5 ;
variables:
float time_whole(time_step) ;
int eb_status(num_el_blk) ;
@@ -35,25 +47,43 @@ variables:
int ss_prop1(num_side_sets) ;
ss_prop1:name = "ID" ;
float coord(num_dim, num_nodes) ;
+ char eb_names(num_el_blk, len_name) ;
+ char ns_names(num_node_sets, len_name) ;
+ char ss_names(num_side_sets, len_name) ;
char coor_names(num_dim, len_name) ;
int elem_map(num_elem) ;
float attrib1(num_el_in_blk1, num_att_in_blk1) ;
+ char attrib_name1(num_att_in_blk1, len_name) ;
int connect1(num_el_in_blk1, num_nod_per_el1) ;
connect1:elem_type = "quad" ;
float attrib2(num_el_in_blk2, num_att_in_blk2) ;
+ char attrib_name2(num_att_in_blk2, len_name) ;
int connect2(num_el_in_blk2, num_nod_per_el2) ;
connect2:elem_type = "quad" ;
+ float attrib3(num_el_in_blk3, num_att_in_blk3) ;
+ char attrib_name3(num_att_in_blk3, len_name) ;
+ int connect3(num_el_in_blk3, num_nod_per_el3) ;
+ connect3:elem_type = "hex" ;
+ float attrib4(num_el_in_blk4, num_att_in_blk4) ;
+ char attrib_name4(num_att_in_blk4, len_name) ;
+ int connect4(num_el_in_blk4, num_nod_per_el4) ;
+ connect4:elem_type = "tetra" ;
+ float attrib5(num_el_in_blk5, num_att_in_blk5) ;
+ char attrib_name5(num_att_in_blk5, len_name) ;
+ int connect5(num_el_in_blk5, num_nod_per_el5) ;
+ connect5:elem_type = "wedge" ;
int eb_prop2(num_el_blk) ;
- eb_prop2:name = "MATL" ;
eb_prop2:_FillValue = 0 ;
+ eb_prop2:name = "MATL" ;
int eb_prop3(num_el_blk) ;
- eb_prop3:name = "DENSITY" ;
eb_prop3:_FillValue = 0 ;
+ eb_prop3:name = "DENSITY" ;
int node_ns1(num_nod_ns1) ;
float dist_fact_ns1(num_nod_ns1) ;
int node_ns2(num_nod_ns2) ;
float dist_fact_ns2(num_nod_ns2) ;
int ns_prop2(num_node_sets) ;
+ ns_prop2:_FillValue = 0 ;
ns_prop2:name = "FACE" ;
int ns_prop3(num_node_sets) ;
ns_prop3:name = "VELOCITY" ;
@@ -63,77 +93,152 @@ variables:
int elem_ss2(num_side_ss2) ;
int side_ss2(num_side_ss2) ;
float dist_fact_ss2(num_df_ss2) ;
+ int elem_ss3(num_side_ss3) ;
+ int side_ss3(num_side_ss3) ;
+ int elem_ss4(num_side_ss4) ;
+ int side_ss4(num_side_ss4) ;
+ int elem_ss5(num_side_ss5) ;
+ int side_ss5(num_side_ss5) ;
int ss_prop2(num_side_sets) ;
+ ss_prop2:_FillValue = 0 ;
ss_prop2:name = "COLOR" ;
// global attributes:
+ :api_version = 5.15f ;
+ :version = 5.15f ;
:floating_point_word_size = 4 ;
:file_size = 0 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
- :maximum_name_length = 9 ;
+ :maximum_name_length = 32 ;
data:
- eb_status = 1, 1 ;
+ eb_status = 0, 0, 0, 0, 0 ;
- eb_prop1 = 10, 11 ;
+ eb_prop1 = 0, 0, 0, 0, 0 ;
- ns_status = 1, 1 ;
+ ns_status = 0, 0 ;
- ns_prop1 = 20, 21 ;
+ ns_prop1 = 0, 0 ;
- ss_status = 1, 1 ;
+ ss_status = 0, 0, 0, 0, 0 ;
- ss_prop1 = 30, 31 ;
+ ss_prop1 = 0, 0, 0, 0, 0 ;
coord =
- 0, 1, 1, 0, 1, 2, 2, 1,
- 0, 0, 1, 1, 0, 0, 1, 1 ;
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ;
+
+ eb_names =
+ "",
+ "",
+ "",
+ "",
+ "" ;
+
+ ns_names =
+ "",
+ "" ;
+
+ ss_names =
+ "",
+ "",
+ "",
+ "",
+ "" ;
coor_names =
- "xcoor",
- "ycoor" ;
+ "",
+ "",
+ "" ;
- elem_map = 1, 2 ;
+ elem_map = 0, 0, 0, 0, 0 ;
attrib1 =
- 3.1416 ;
+ 0 ;
+
+ attrib_name1 =
+ "" ;
connect1 =
- 1, 2, 3, 4 ;
+ 0, 0, 0, 0 ;
attrib2 =
- 6.1416 ;
+ 0 ;
+
+ attrib_name2 =
+ "" ;
connect2 =
- 5, 6, 7, 8 ;
+ 0, 0, 0, 0 ;
+
+ attrib3 =
+ 0 ;
+
+ attrib_name3 =
+ "" ;
+
+ connect3 =
+ 0, 0, 0, 0, 0, 0, 0, 0 ;
+
+ attrib4 =
+ 0 ;
+
+ attrib_name4 =
+ "" ;
+
+ connect4 =
+ 0, 0, 0, 0 ;
+
+ attrib5 =
+ 0 ;
+
+ attrib_name5 =
+ "" ;
+
+ connect5 =
+ 0, 0, 0, 0, 0, 0 ;
+
+ eb_prop2 = _, _, _, _, _ ;
+
+ eb_prop3 = _, _, _, _, _ ;
+
+ node_ns1 = 0, 0, 0, 0, 0 ;
+
+ dist_fact_ns1 = 0, 0, 0, 0, 0 ;
+
+ node_ns2 = 0, 0, 0 ;
+
+ dist_fact_ns2 = 0, 0, 0 ;
- eb_prop2 = 10, 20 ;
+ ns_prop2 = _, _ ;
- eb_prop3 = _, _ ;
+ ns_prop3 = 0, 0 ;
- node_ns1 = 100, 101, 102, 103, 104 ;
+ elem_ss1 = 0, 0 ;
- dist_fact_ns1 = 1, 2, 3, 4, 5 ;
+ side_ss1 = 0, 0 ;
- node_ns2 = 200, 201, 202 ;
+ dist_fact_ss1 = 0, 0, 0, 0 ;
- dist_fact_ns2 = 1.1, 2.1, 3.1 ;
+ elem_ss2 = 0, 0 ;
- ns_prop2 = 4, 5 ;
+ side_ss2 = 0, 0 ;
- ns_prop3 = 1000, 2000 ;
+ dist_fact_ss2 = 0, 0, 0, 0 ;
- elem_ss1 = 11, 12 ;
+ elem_ss3 = 0, 0, 0, 0, 0, 0, 0 ;
- side_ss1 = 1, 2 ;
+ side_ss3 = 0, 0, 0, 0, 0, 0, 0 ;
- dist_fact_ss1 = 30, 30.1, 30.2, 30.3 ;
+ elem_ss4 = 0, 0, 0, 0 ;
- elem_ss2 = 13, 14 ;
+ side_ss4 = 0, 0, 0, 0 ;
- side_ss2 = 3, 4 ;
+ elem_ss5 = 0, 0, 0, 0, 0 ;
- dist_fact_ss2 = 31, 31.1, 31.2, 31.3 ;
+ side_ss5 = 0, 0, 0, 0, 0 ;
- ss_prop2 = 100, 101 ;
+ ss_prop2 = _, _, _, _, _ ;
}
diff --git a/exodus/forbind/test/testcp_sd.dmp b/exodus/forbind/test/testcp_sd.dmp
index f155d88..e69de29 100644
--- a/exodus/forbind/test/testcp_sd.dmp
+++ b/exodus/forbind/test/testcp_sd.dmp
@@ -1,201 +0,0 @@
-netcdf testcpd {
-dimensions:
- len_string = 33 ;
- len_line = 81 ;
- four = 4 ;
- time_step = UNLIMITED ; // (0 currently)
- len_name = 33 ;
- num_dim = 3 ;
- num_nodes = 26 ;
- num_elem = 5 ;
- num_el_blk = 5 ;
- num_node_sets = 2 ;
- num_side_sets = 5 ;
- num_el_in_blk1 = 1 ;
- num_nod_per_el1 = 4 ;
- num_att_in_blk1 = 1 ;
- num_el_in_blk2 = 1 ;
- num_nod_per_el2 = 4 ;
- num_att_in_blk2 = 1 ;
- num_el_in_blk3 = 1 ;
- num_nod_per_el3 = 8 ;
- num_att_in_blk3 = 1 ;
- num_el_in_blk4 = 1 ;
- num_nod_per_el4 = 4 ;
- num_att_in_blk4 = 1 ;
- num_el_in_blk5 = 1 ;
- num_nod_per_el5 = 6 ;
- num_att_in_blk5 = 1 ;
- num_nod_ns1 = 5 ;
- num_nod_ns2 = 3 ;
- num_side_ss1 = 2 ;
- num_df_ss1 = 4 ;
- num_side_ss2 = 2 ;
- num_df_ss2 = 4 ;
- num_side_ss3 = 7 ;
- num_side_ss4 = 4 ;
- num_side_ss5 = 5 ;
-variables:
- double time_whole(time_step) ;
- int eb_status(num_el_blk) ;
- int eb_prop1(num_el_blk) ;
- eb_prop1:name = "ID" ;
- int ns_status(num_node_sets) ;
- int ns_prop1(num_node_sets) ;
- ns_prop1:name = "ID" ;
- int ss_status(num_side_sets) ;
- int ss_prop1(num_side_sets) ;
- ss_prop1:name = "ID" ;
- double coord(num_dim, num_nodes) ;
- char coor_names(num_dim, len_name) ;
- int elem_map(num_elem) ;
- double attrib1(num_el_in_blk1, num_att_in_blk1) ;
- int connect1(num_el_in_blk1, num_nod_per_el1) ;
- connect1:elem_type = "quad" ;
- double attrib2(num_el_in_blk2, num_att_in_blk2) ;
- int connect2(num_el_in_blk2, num_nod_per_el2) ;
- connect2:elem_type = "quad" ;
- double attrib3(num_el_in_blk3, num_att_in_blk3) ;
- int connect3(num_el_in_blk3, num_nod_per_el3) ;
- connect3:elem_type = "hex" ;
- double attrib4(num_el_in_blk4, num_att_in_blk4) ;
- int connect4(num_el_in_blk4, num_nod_per_el4) ;
- connect4:elem_type = "tetra" ;
- double attrib5(num_el_in_blk5, num_att_in_blk5) ;
- int connect5(num_el_in_blk5, num_nod_per_el5) ;
- connect5:elem_type = "wedge" ;
- int eb_prop2(num_el_blk) ;
- eb_prop2:name = "MATL" ;
- eb_prop2:_FillValue = 0 ;
- int eb_prop3(num_el_blk) ;
- eb_prop3:name = "DENSITY" ;
- eb_prop3:_FillValue = 0 ;
- int node_ns1(num_nod_ns1) ;
- double dist_fact_ns1(num_nod_ns1) ;
- int node_ns2(num_nod_ns2) ;
- double dist_fact_ns2(num_nod_ns2) ;
- int ns_prop2(num_node_sets) ;
- ns_prop2:name = "FACE" ;
- int ns_prop3(num_node_sets) ;
- ns_prop3:name = "VELOCITY" ;
- int elem_ss1(num_side_ss1) ;
- int side_ss1(num_side_ss1) ;
- double dist_fact_ss1(num_df_ss1) ;
- int elem_ss2(num_side_ss2) ;
- int side_ss2(num_side_ss2) ;
- double dist_fact_ss2(num_df_ss2) ;
- int elem_ss3(num_side_ss3) ;
- int side_ss3(num_side_ss3) ;
- int elem_ss4(num_side_ss4) ;
- int side_ss4(num_side_ss4) ;
- int elem_ss5(num_side_ss5) ;
- int side_ss5(num_side_ss5) ;
- int ss_prop2(num_side_sets) ;
- ss_prop2:name = "COLOR" ;
-
-// global attributes:
- :floating_point_word_size = 8 ;
- :file_size = 0 ;
- :title = "This is a test" ;
- :maximum_name_length = 9 ;
-data:
-
- eb_status = 1, 1, 1, 1, 1 ;
-
- eb_prop1 = 10, 11, 12, 13, 14 ;
-
- ns_status = 1, 1 ;
-
- ns_prop1 = 20, 21 ;
-
- ss_status = 1, 1, 1, 1, 1 ;
-
- ss_prop1 = 30, 31, 32, 33, 34 ;
-
- coord =
- 0, 1, 1, 0, 1, 2, 2, 1, 0, 10, 10, 1, 1, 10, 10, 1, 0, 1, 10, 7, 3, 6, 0,
- 3, 6, 0,
- 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 10, 10, 10, 10, 0, 0, 0, 5, 0, 0, 0, 2,
- 2, 2,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10, -10, 0, 0, -10, -10, 0, 5, 2, 3, 6, 0,
- 0, 6, 2, 0 ;
-
- coor_names =
- "xcoor",
- "ycoor",
- "zcoor" ;
-
- elem_map = 1, 2, 3, 4, 5 ;
-
- attrib1 =
- 3.1416 ;
-
- connect1 =
- 1, 2, 3, 4 ;
-
- attrib2 =
- 6.1416 ;
-
- connect2 =
- 5, 6, 7, 8 ;
-
- attrib3 =
- 6.1416 ;
-
- connect3 =
- 9, 10, 11, 12, 13, 14, 15, 16 ;
-
- attrib4 =
- 6.1416 ;
-
- connect4 =
- 17, 18, 19, 20 ;
-
- attrib5 =
- 6.1416 ;
-
- connect5 =
- 21, 22, 23, 24, 25, 26 ;
-
- eb_prop2 = 10, 20, 30, 40, 50 ;
-
- eb_prop3 = _, _, _, _, _ ;
-
- node_ns1 = 100, 101, 102, 103, 104 ;
-
- dist_fact_ns1 = 1, 2, 3, 4, 5 ;
-
- node_ns2 = 200, 201, 202 ;
-
- dist_fact_ns2 = 1.1, 2.1, 3.1 ;
-
- ns_prop2 = 4, 5 ;
-
- ns_prop3 = 1000, 2000 ;
-
- elem_ss1 = 2, 2 ;
-
- side_ss1 = 4, 2 ;
-
- dist_fact_ss1 = 30, 30.1, 30.2, 30.3 ;
-
- elem_ss2 = 1, 2 ;
-
- side_ss2 = 2, 3 ;
-
- dist_fact_ss2 = 31, 31.1, 31.2, 31.3 ;
-
- elem_ss3 = 3, 3, 3, 3, 3, 3, 3 ;
-
- side_ss3 = 5, 3, 3, 2, 4, 1, 6 ;
-
- elem_ss4 = 4, 4, 4, 4 ;
-
- side_ss4 = 1, 2, 3, 4 ;
-
- elem_ss5 = 5, 5, 5, 5, 5 ;
-
- side_ss5 = 1, 2, 3, 4, 5 ;
-
- ss_prop2 = 100, 101, 0, 0, 0 ;
-}
diff --git a/exodus/forbind/test/testcp_ss.dmp b/exodus/forbind/test/testcp_ss.dmp
index dd831ee..96162c1 100644
--- a/exodus/forbind/test/testcp_ss.dmp
+++ b/exodus/forbind/test/testcp_ss.dmp
@@ -108,6 +108,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
diff --git a/exodus/forbind/test/testcpln.dmp b/exodus/forbind/test/testcpln.dmp
index 27eb951..0781404 100644
--- a/exodus/forbind/test/testcpln.dmp
+++ b/exodus/forbind/test/testcpln.dmp
@@ -106,26 +106,30 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 0 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
- eb_status = 0, 0, 0, 0, 0 ;
+ eb_status = 1, 1, 1, 1, 1 ;
- eb_prop1 = 0, 0, 0, 0, 0 ;
+ eb_prop1 = 10, 11, 12, 13, 14 ;
- ns_status = 0, 0 ;
+ ns_status = 1, 1 ;
- ns_prop1 = 0, 0 ;
+ ns_prop1 = 20, 21 ;
- ss_status = 0, 0, 0, 0, 0 ;
+ ss_status = 1, 1, 1, 1, 1 ;
- ss_prop1 = 0, 0, 0, 0, 0 ;
+ ss_prop1 = 30, 31, 32, 33, 34 ;
coord =
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ;
+ 0, 1, 1, 0, 1, 2, 2, 1, 0, 10, 10, 1, 1, 10, 10, 1, 0, 1, 10, 7, 3, 6, 0,
+ 3, 6, 0,
+ 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 10, 10, 10, 10, 0, 0, 0, 5, 0, 0, 0, 2,
+ 2, 2,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10, -10, 0, 0, -10, -10, 0, 5, 2, 3, 6, 0,
+ 0, 6, 2, 0 ;
eb_names =
"",
@@ -146,96 +150,96 @@ data:
"" ;
coor_names =
- "",
- "",
- "" ;
+ "xcoor",
+ "ycoor",
+ "zcoor" ;
- elem_map = 0, 0, 0, 0, 0 ;
+ elem_map = 1, 2, 3, 4, 5 ;
attrib1 =
- 0 ;
+ 3.1416 ;
attrib_name1 =
- "" ;
+ "THICKNESS" ;
connect1 =
- 0, 0, 0, 0 ;
+ 1, 2, 3, 4 ;
attrib2 =
- 0 ;
+ 6.1416 ;
attrib_name2 =
- "" ;
+ "THICKNESS" ;
connect2 =
- 0, 0, 0, 0 ;
+ 5, 6, 7, 8 ;
attrib3 =
- 0 ;
+ 6.1416 ;
attrib_name3 =
- "" ;
+ "THICKNESS" ;
connect3 =
- 0, 0, 0, 0, 0, 0, 0, 0 ;
+ 9, 10, 11, 12, 13, 14, 15, 16 ;
attrib4 =
- 0 ;
+ 6.1416 ;
attrib_name4 =
- "" ;
+ "THICKNESS" ;
connect4 =
- 0, 0, 0, 0 ;
+ 17, 18, 19, 20 ;
attrib5 =
- 0 ;
+ 6.1416 ;
attrib_name5 =
- "" ;
+ "THICKNESS" ;
connect5 =
- 0, 0, 0, 0, 0, 0 ;
+ 21, 22, 23, 24, 25, 26 ;
- eb_prop2 = _, _, _, _, _ ;
+ eb_prop2 = 10, 20, 30, 40, 50 ;
eb_prop3 = _, _, _, _, _ ;
- node_ns1 = 0, 0, 0, 0, 0 ;
+ node_ns1 = 100, 101, 102, 103, 104 ;
- dist_fact_ns1 = 0, 0, 0, 0, 0 ;
+ dist_fact_ns1 = 1, 2, 3, 4, 5 ;
- node_ns2 = 0, 0, 0 ;
+ node_ns2 = 200, 201, 202 ;
- dist_fact_ns2 = 0, 0, 0 ;
+ dist_fact_ns2 = 1.1, 2.1, 3.1 ;
- ns_prop2 = _, _ ;
+ ns_prop2 = 4, 5 ;
- ns_prop3 = 0, 0 ;
+ ns_prop3 = 1000, 2000 ;
- elem_ss1 = 0, 0 ;
+ elem_ss1 = 2, 2 ;
- side_ss1 = 0, 0 ;
+ side_ss1 = 4, 2 ;
- dist_fact_ss1 = 0, 0, 0, 0 ;
+ dist_fact_ss1 = 30, 30.1, 30.2, 30.3 ;
- elem_ss2 = 0, 0 ;
+ elem_ss2 = 1, 2 ;
- side_ss2 = 0, 0 ;
+ side_ss2 = 2, 3 ;
- dist_fact_ss2 = 0, 0, 0, 0 ;
+ dist_fact_ss2 = 31, 31.1, 31.2, 31.3 ;
- elem_ss3 = 0, 0, 0, 0, 0, 0, 0 ;
+ elem_ss3 = 3, 3, 3, 3, 3, 3, 3 ;
- side_ss3 = 0, 0, 0, 0, 0, 0, 0 ;
+ side_ss3 = 5, 3, 3, 2, 4, 1, 6 ;
- elem_ss4 = 0, 0, 0, 0 ;
+ elem_ss4 = 4, 4, 4, 4 ;
- side_ss4 = 0, 0, 0, 0 ;
+ side_ss4 = 1, 2, 3, 4 ;
- elem_ss5 = 0, 0, 0, 0, 0 ;
+ elem_ss5 = 5, 5, 5, 5, 5 ;
- side_ss5 = 0, 0, 0, 0, 0 ;
+ side_ss5 = 1, 2, 3, 4, 5 ;
- ss_prop2 = _, _, _, _, _ ;
+ ss_prop2 = 100, 101, _, _, _ ;
}
diff --git a/exodus/forbind/test/testcpln.f b/exodus/forbind/test/testcpln.f
index 29b5d8a..58b60e5 100644
--- a/exodus/forbind/test/testcpln.f
+++ b/exodus/forbind/test/testcpln.f
@@ -24,7 +24,7 @@ c conversion routines
cpu_ws = 8
io_ws = 4
- exoid = exopen ("testcp.exo", EXREAD, cpu_ws, io_ws, vers, ierr)
+ exoid = exopen ("test.exo", EXREAD, cpu_ws, io_ws, vers, ierr)
write (iout, '(/"after exopen, error = ",i3)')
1 ierr
@@ -45,7 +45,7 @@ c conversion routines
exoid1 = excre ("testcp.exo",
1 EXCLOB+EXNORM, cpu_ws, io_ws, ierr)
- write (iout,'("after excre, id = ", i3, ", error = ",i3)')
+ write (iout,'("after excre, id = ", i6, ", error = ",i4)')
1 exoid1, ierr
write (iout,'(" I/O word size: ",i4)') io_ws
diff --git a/exodus/forbind/test/testcpnl.dmp b/exodus/forbind/test/testcpnl.dmp
index c852d32..efd19ac 100644
--- a/exodus/forbind/test/testcpnl.dmp
+++ b/exodus/forbind/test/testcpnl.dmp
@@ -108,6 +108,7 @@ variables:
// global attributes:
:floating_point_word_size = 4 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
diff --git a/exodus/forbind/test/testd.dmp b/exodus/forbind/test/testd.dmp
index fff4f18..7e73d48 100644
--- a/exodus/forbind/test/testd.dmp
+++ b/exodus/forbind/test/testd.dmp
@@ -97,6 +97,7 @@ variables:
// global attributes:
:floating_point_word_size = 8 ;
:file_size = 1 ;
+ :int64_status = 0 ;
:title = "This is a test" ;
:maximum_name_length = 32 ;
data:
diff --git a/exodus/forbind/test/testrd.f b/exodus/forbind/test/testrd.f
index d70fab8..b861d26 100644
--- a/exodus/forbind/test/testrd.f
+++ b/exodus/forbind/test/testrd.f
@@ -506,8 +506,6 @@ c
270 continue
endif
-275 continue
-
c
c read QA records
c
diff --git a/exodus/forbind/test/testrd1.f b/exodus/forbind/test/testrd1.f
index 5f64198..22def25 100644
--- a/exodus/forbind/test/testrd1.f
+++ b/exodus/forbind/test/testrd1.f
@@ -31,7 +31,6 @@ c 09/07/93 V.R. Yarberry - Modified for API 2.00
integer cpu_ws,io_ws
integer num_props, prop_value, n_node_map, n_elem_map
integer ival
- integer ioff
real time_value, time_values(100), var_values(100)
real x(100), y(100), z(100)
@@ -593,8 +592,6 @@ c
270 continue
endif
-275 continue
-
c
c read QA records
c
diff --git a/exodus/forbind/test/testrd_nsid.f b/exodus/forbind/test/testrd_nsid.f
index 114d73f..ce6f53e 100644
--- a/exodus/forbind/test/testrd_nsid.f
+++ b/exodus/forbind/test/testrd_nsid.f
@@ -15,33 +15,16 @@ c 09/07/93 V.R. Yarberry - Modified for API 2.00
integer num_side_sets
integer i, j, k, elem_map(100), connect(100), nnpe(10)
integer ids(10)
- integer num_elem_per_set(10), num_nodes_per_set(10)
- integer num_df_per_set(10)
- integer num_df_in_set, num_sides_in_set
- integer df_ind(10),node_ind(10),elem_ind(10),num_qa_rec,num_info
- integer num_glo_vars, num_nod_vars, num_ele_vars
- integer truth_tab(3,5)
- integer num_time_steps
integer num_elem_in_block(10), num_nodes_per_elem(10)
- integer num_attr(10), node_ctr_list(10), node_ctr
- integer num_nodes_in_set, num_elem_in_set
- integer df_list_len, list_len, elem_list_len, node_list_len
- integer node_num, time_step, var_index, beg_time, end_time
- integer elem_num
+ integer num_attr(10)
integer cpu_ws,io_ws, mod_sz
- integer num_props, prop_value
- real time_value, time_values(100), var_values(100)
real x(100), y(100), z(100)
- real attrib(100), dist_fact(100)
- real vers, fdum
+ real vers
- character*(MXSTLN) coord_names(3), qa_record(4,2), var_names(3)
- character*(MXLNLN) inform(3), titl
+ character*(MXSTLN) coord_names(3)
+ character*(MXLNLN) titl
character*(MXSTLN) eltype(10)
- character cdum*1
- character*(MXSTLN) prop_names(3)
- character*(MXSTLN) attrib_names(100)
data iin /5/, iout /6/
diff --git a/exodus/forbind/test/testrdd.f b/exodus/forbind/test/testrdd.f
index a409dec..df9df9d 100644
--- a/exodus/forbind/test/testrdd.f
+++ b/exodus/forbind/test/testrdd.f
@@ -457,8 +457,6 @@ c
270 continue
endif
-275 continue
-
c
c read QA records
c
diff --git a/exodus/forbind/test/testwt1.f b/exodus/forbind/test/testwt1.f
index 91448e1..f36eada 100644
--- a/exodus/forbind/test/testwt1.f
+++ b/exodus/forbind/test/testwt1.f
@@ -726,7 +726,7 @@ c side set #6 - Wedges
num_elem_per_set(3) = 7
num_elem_per_set(4) = 4
num_elem_per_set(5) = 2
- num_elem_per_set(6) = 6
+ num_elem_per_set(6) = 5
c Uncomment following line to test NULL side sets
c num_elem_per_set(6) = 0
@@ -783,7 +783,6 @@ c side_list(4) = 4
1 node_ind, elem_list, node_list, side_list, ierr)
write (iout, '("after excn2s, error = ", i4)' ) ierr
-
num_df_per_set(1) = 4
num_df_per_set(2) = 4
num_df_per_set(3) = 0
diff --git a/exodus/forbind/test/testwt_nsid.f b/exodus/forbind/test/testwt_nsid.f
index 44ce236..3d17fa3 100644
--- a/exodus/forbind/test/testwt_nsid.f
+++ b/exodus/forbind/test/testwt_nsid.f
@@ -9,30 +9,17 @@ c
integer exoid, num_dim,num_nodes,elem_map(5),num_elem,num_elem_blk
integer num_elem_in_block(10), num_nodes_per_elem(10),numattr(10)
integer num_node_sets, num_side_sets
- integer i, j, k, m, connect(37), nnpe(10)
- integer node_list(100), elem_list(100), side_list(100)
- integer ebids(10),ids(10), num_nodes_per_set(10)
- integer num_elem_per_set(10), num_df_per_set(10)
- integer df_ind(10), node_ind(10), elem_ind(10)
+ integer i, connect(37), nnpe(10)
+ integer ebids(10)
integer num_qa_rec, num_info
- integer num_glo_vars, num_nod_vars, num_ele_vars
- integer truth_tab(3,5)
- integer whole_time_step, num_time_steps
integer cpu_word_size, io_word_size
- integer prop_array(2)
- real glob_var_vals(100), nodal_var_vals(100)
- real time_value, elem_var_vals(100)
real x(100), y(100), z(100)
- real attrib(100), dist_fact(100)
character*(MXSTLN) coord_names(3)
character*(MXSTLN) cname
- character*(MXSTLN) var_names(3)
character*(MXSTLN) qa_record(4,2)
character*(MXLNLN) inform(3)
- character*(MXSTLN) prop_names(2)
- character*(MXSTLN) attrib_names(1)
data iin /5/, iout /6/
diff --git a/nemesis/CMakeLists.txt b/nemesis/CMakeLists.txt
index a50efde..64aff5d 100644
--- a/nemesis/CMakeLists.txt
+++ b/nemesis/CMakeLists.txt
@@ -1,22 +1,20 @@
cmake_minimum_required(VERSION 2.6)
-PROJECT(Nemesis)
-
-SET(NEMESIS_VERSION_MAJOR "3")
-SET(NEMESIS_VERSION_MINOR "09")
+SET(NEMESIS_VERSION_MAJOR "5")
+SET(NEMESIS_VERSION_MINOR "15")
SET(NEMESIS_VERSION_PATCH "0")
SET(NEMESIS_VERSION "${NEMESIS_VERSION_MAJOR}.${NEMESIS_VERSION_MINOR}")
SET(NEMESIS_VERSION_FULL "${NEMESIS_VERSION}.${NEMESIS_VERSION_PATCH}")
SET(NEMESIS_BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS}")
-
SET(HEADERS "ne_nemesisI.h")
+
find_path( NETCDF_INCLUDE_DIR netcdf.h
$ENV{ACCESS}/inc
$ENV{NETCDF_DIR}/inc
$ENV{NETCDF_DIR}/include
$ENV{NETCDF_DIR}/libsrc
- )
+ )
find_library( NETCDF_LIBRARY netcdf
$ENV{ACCESS}/lib/shared
@@ -63,76 +61,26 @@ find_library(MATH_LIBRARY
/usr/lib
)
-INCLUDE(CheckIncludeFile)
-CHECK_INCLUDE_FILE( malloc.h EX_HAVE_MALLOC_H )
-
INCLUDE_DIRECTORIES(
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_BINARY_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/../exodusii/cbind/include/"
"${CMAKE_CURRENT_BINARY_DIR}/../exodusii/cbind/include/"
- "${NETCDF_INCLUDE_DIR}"
-)
+ "${NETCDF_INCLUDE_DIR}")
SET(SOURCES
-ne_gcmp.c
-ne_gebig.c
-ne_gelcm.c
-ne_gelm.c
-ne_gelt.c
-ne_gennm.c
-ne_genv.c
-ne_giinf.c
-ne_ginig.c
-ne_glbp.c
-ne_gncm.c
-ne_gncor.c
-ne_gneat.c
-ne_gnelc.c
-ne_gnm.c
-ne_gnnnm.c
-ne_gnns.c
-ne_gnnsd.c
-ne_gnnv.c
-ne_gnspg.c
-ne_gnss.c
-ne_gnssd.c
-ne_gsspg.c
-ne_pcmp.c
-ne_pcmpc.c
-ne_pebig.c
-ne_pelcm.c
-ne_pelm.c
-ne_pevs.c
-ne_pennm.c
-ne_piinf.c
-ne_pinig.c
-ne_plbp.c
-ne_plbpc.c
-ne_pncm.c
-ne_pncor.c
-ne_pneat.c
-ne_pnelc.c
-ne_pnm.c
-ne_pnnnm.c
-ne_pnns.c
-ne_pnnsd.c
-ne_pnspg.c
-ne_pnss.c
-ne_pnssd.c
-ne_pnvs.c
-ne_psspg.c
-ne_util.c
+nemesis_wrapper.c
)
ADD_LIBRARY(nemesis ${SOURCES})
TARGET_LINK_LIBRARIES(nemesis ${EXODUS_LIBRARY} ${NETCDF_LIBRARY} ${HDF5HL_LIBRARY} ${HDF5_LIBRARY} ${Z_LIBRARY} ${MATH_LIBRARY})
-ADD_EXECUTABLE(ne_test ne_test.c)
+ADD_EXECUTABLE(ne_test ne_ctest_wrap.c)
TARGET_LINK_LIBRARIES( ne_test nemesis ${EXODUS_LIBRARY} ${NETCDF_LIBRARY} ${HDF5HL_LIBRARY} ${HDF5_LIBRARY} ${Z_LIBRARY} ${MATH_LIBRARY})
-
+
INSTALL(TARGETS nemesis
RUNTIME DESTINATION lib COMPONENT Runtime
LIBRARY DESTINATION lib COMPONENT Runtime
ARCHIVE DESTINATION lib COMPONENT Development)
INSTALL(FILES ${HEADERS} DESTINATION include COMPONENT Development)
+
diff --git a/nemesis/Imakefile b/nemesis/Imakefile
index d19db30..6435610 100644
--- a/nemesis/Imakefile
+++ b/nemesis/Imakefile
@@ -76,18 +76,9 @@ LIBDIR = $(PLIBDIR)
DEFINES = $(PICFLAGS)
SUBDIRS = forbind
-INCLIST1 = ne_nemesisI.h ne_nemesisI_int.h
-INCLIST2 = ne_nemesis_int.inc
-
-SRCS = \
-ne_gcmp.c ne_gebig.c ne_gelcm.c ne_gelm.c ne_gelt.c ne_gennm.c \
-ne_genv.c ne_giinf.c ne_ginig.c ne_glbp.c ne_gncm.c ne_gncor.c \
-ne_gneat.c ne_gnelc.c ne_gnm.c ne_gnnnm.c ne_gnns.c ne_gnnsd.c \
-ne_gnnv.c ne_gnspg.c ne_gnss.c ne_gnssd.c ne_gsspg.c ne_pcmp.c \
-ne_pcmpc.c ne_pebig.c ne_pelcm.c ne_pelm.c ne_pennm.c ne_pevs.c \
-ne_piinf.c ne_pinig.c ne_plbp.c ne_plbpc.c ne_pncm.c ne_pncor.c \
-ne_pneat.c ne_pnelc.c ne_pnm.c ne_pnnnm.c ne_pnns.c ne_pnnsd.c \
-ne_pnspg.c ne_pnss.c ne_pnssd.c ne_pnvs.c ne_psspg.c ne_util.c
+INCLIST = ne_nemesisI.h ne_nemesisI_int.h
+
+SRCS = nemesis_wrapper.c
OBJS = ${SRCS:.c=.o}
@@ -102,10 +93,8 @@ AllTarget(libnemesis.a libnemIf.a libnemIf32.a)
AllTarget(libnemesis.a libnemIf.a)
#endif
-InstallIncludeList(makeincludes,$(INCLIST1),$(INCDIR))
-InstallIncludeList(install,$(INCLIST1),$(INCDIR))
-
-InstallSubdirIncludeList(makeincludes,forbind,$(INCLIST2),$(INCDIR))
+InstallIncludeList(makeincludes,$(INCLIST),$(INCDIR))
+InstallIncludeList(install,$(INCLIST),$(INCDIR))
/* Directory for nemesis c library */
NormalLibraryTarget(nemesis,$(OBJS))
@@ -139,13 +128,15 @@ InstallParallelLibrary(nemIf32,$(PLIBDIR))
CTESTLIBS = $(EXOIIV2C) $(NETCDF) -lm
FTESTLIBS = $(EXOIIV2FOR) $(EXOIIV2C) $(NETCDF) -lm
-test: libnemesis.a libnemIf.a ne_test.c forbind/ne_test.F
- $(CC) -c $(CFLAGS) ne_test.c
- $(CC) $(LDOPTIONS) -o ne_ctest ne_test.o libnemesis.a $(LIBPATH) $(CTESTLIBS)
- $(FC) -c $(FFLAGS) $(STD_DEFINES) -I./forbind forbind/ne_test.F
- $(FC) $(LDOPTIONS) -o ne_ftest ne_test.o libnemIf.a libnemesis.a $(LIBPATH) $(FTESTLIBS)
+test: libnemesis.a libnemIf.a ne_ctest_wrap.c forbind/ne_ftest.F
+ $(CC) -c $(CFLAGS) ne_ctest_wrap.c
+ $(CC) $(LDOPTIONS) -o ne_ctest_wrap ne_ctest_wrap.o libnemesis.a $(LIBPATH) $(CTESTLIBS)
+ $(FC) -c $(FFLAGS) $(STD_DEFINES) -I./forbind forbind/ne_ftest.F
+ $(FC) $(LDOPTIONS) -o ne_ftest ne_ftest.o libnemIf.a $(LIBPATH) $(FTESTLIBS)
+
+ExtraStuffToClean(ne_ctest_wrap ne_ftest ne_test.exoII ne_test.nemI)
-ExtraStuffToClean(ne_ctest ne_ftest ne_test.exoII ne_test.nemI)
+$(OBJS): ne_nemesisI.h
DependTarget()
LibraryObjectRule()
diff --git a/nemesis/Makefile.standalone b/nemesis/Makefile.standalone
index de0f998..3e44075 100644
--- a/nemesis/Makefile.standalone
+++ b/nemesis/Makefile.standalone
@@ -200,14 +200,7 @@ EXT_FLIBS = $(EXODUS_FLIB)
SUBDIRS = forbind
-SRCS = ne_gcmp.c ne_gebig.c ne_gelcm.c ne_gelm.c ne_gelt.c ne_gennm.c \
- ne_genv.c ne_giinf.c ne_ginig.c ne_glbp.c ne_gncm.c ne_gncor.c \
- ne_gneat.c ne_gnelc.c ne_gnm.c ne_gnnnm.c ne_gnns.c ne_gnnsd.c \
- ne_gnnv.c ne_gnspg.c ne_gnss.c ne_gnssd.c ne_gsspg.c ne_pcmp.c \
- ne_pcmpc.c ne_pebig.c ne_pelcm.c ne_pelm.c ne_pennm.c ne_pevs.c \
- ne_piinf.c ne_pinig.c ne_plbp.c ne_plbpc.c ne_pncm.c ne_pncor.c \
- ne_pneat.c ne_pnelc.c ne_pnm.c ne_pnnnm.c ne_pnns.c ne_pnnsd.c \
- ne_pnspg.c ne_pnss.c ne_pnssd.c ne_pnvs.c ne_psspg.c ne_util.c \
+SRCS = nemesis_wrapper.c
OBJS = ${SRCS:.c=.o}
diff --git a/nemesis/forbind/Makefile b/nemesis/forbind/Makefile
new file mode 100644
index 0000000..212c74d
--- /dev/null
+++ b/nemesis/forbind/Makefile
@@ -0,0 +1,585 @@
+# Makefile generated by imake - do not edit!
+# $XConsortium: imake.c /main/90 1996/11/13 14:43:23 lehors $
+
+# ----------------------------------------------------------------------
+# Makefile generated from "Imake.tmpl" and </tmp/IIf.hQ1HOM>
+# $XConsortium: Imake.tmpl /main/243 1996/11/13 14:42:56 lehors $
+#
+
+all::
+
+.SUFFIXES: .i
+
+# $XConsortium: Imake.cf /main/26 1996/09/28 16:05:09 rws $
+
+# -----------------------------------------------------------------------
+# site-specific configuration parameters that need to come before
+# the platform-specific parameters - edit site.def to change
+
+# site.def file for SNL ACCESS System
+
+# ----------------------------------------------------------------------
+# platform-specific configuration parameters - edit darwin.cf to change
+
+#
+# NOTE: This was copied from the X11 distribution and modified.
+# It includes several symbols that are not used in ACCESS.
+#
+# NOTE: The default flags do not do very aggressive optimization;
+# You can change this if you want (possibly) faster execution.
+#
+# Contact seacas at sandia.gov if you have any questions
+#
+
+# operating system: Darwin (10.8.0)
+
+# $XFree86: xc/config/cf/darwinLib.rules,v 1.8 2003/10/09 22:43:18 herrb Exp $
+
+# ----------------------------------------------------------------------
+# site-specific configuration parameters that go after
+# the platform-specific parameters - edit site.def to change
+
+# site.def file for SNL ACCESS Darwin
+
+# ---------------------------------------------------------------------
+# Imake rules for building libraries, programs, scripts, and data files
+# rules: $XConsortium: Imake.rules /main/217 1996/12/05 09:48:26 kaleb $
+
+ _NULLCMD_ = @ echo -n
+
+ PATHSEP = /
+ SHELL = /bin/sh
+
+ SYSTEM = Darwin
+ LSYSTEM = `echo $(SYSTEM) | tr "[A-Z]" "[a-z]"`
+
+ TOP = ../../..
+ CURRENT_DIR = libraries/nemesis/forbind
+ DESTDIR =
+ SERIALDEBUGCMD = "dbx"
+ PARDEBUGCMDSNGL = "mpirun -dbx"
+ PARDEBUGCMDMULT = "mpirun -dbx"
+
+ IMAKE = $(ETCDIR)/imake
+ DEPEND = $(ETCDIR)/makedepend
+ MKDIRHIER = mkdir -p
+ EXPORTLISTGEN =
+ CONFIGSRC = $(TOP)/config
+ IMAKESRC = $(CONFIGSRC)/imake
+ DEPENDSRC = $(CONFIGSRC)/makedepend
+
+ INCROOT = /Users/gdsjaar/src/SEACAS-SF-INSTALL/inc
+ USRLIBDIR = /Users/gdsjaar/src/SEACAS-SF-INSTALL/lib
+ SHLIBDIR = /Users/gdsjaar/src/SEACAS-SF-INSTALL/lib/shared
+ LINTLIBDIR = $(USRLIBDIR)/lint
+ MANPATH = /Users/gdsjaar/src/SEACAS-SF-INSTALL/man
+ MANSOURCEPATH = $(MANPATH)/man
+ MANDIR = $(MANSOURCEPATH)$(MANSUFFIX)
+ LIBMANDIR = $(MANSOURCEPATH)$(LIBMANSUFFIX)
+ FILEMANDIR = $(MANSOURCEPATH)$(FILEMANSUFFIX)
+
+ AR = ar cr
+ ARFLAGS = cru
+ BOOTSTRAPCFLAGS =
+ CC = /opt/local/bin/clang-mp-3.1
+ FC = /opt/local/bin/gfortran-mp-4.8
+ F90C = /opt/local/bin/gfortran-mp-4.8
+ CCPAR = /opt/local/bin/clang-mp-3.1
+ FCPAR = /opt/local/bin/gfortran-mp-4.8
+ F90CPAR = /opt/local/bin/gfortran-mp-4.8
+ AS = as
+ TEST = /bin/test
+ M2C = /bin/true
+
+.SUFFIXES: .cxx
+
+ CXX = /opt/local/bin/clang++-mp-3.1
+ CXXFILT = c++filt
+ CXXLIB =
+ CXXDEBUGFLAGS =
+CXXDEPENDINCLUDES =
+ CXXEXTRA_DEFINES =
+CXXEXTRA_INCLUDES =
+ CXXSTD_DEFINES = -DBuild64 -DADDC_ $(CXXPROJECT_DEFINES)
+ CXXOPTIONS =
+ CXXINCLUDES = $(CXXEXTRA_INCLUDES) $(INCLUDES) $(TOP_INCLUDES)
+ CXXDEFINES = $(CXXINCLUDES) $(CXXSTD_DEFINES) $(THREADS_CXXDEFINES) $(CXXEXTRA_DEFINES) $(DEFINES)
+ CXXFLAGS = $(CXXDEBUGFLAGS) $(DEBUG) $(CXXOPTIONS) $(THREADS_CXXFLAGS) $(CXXDEFINES) $(PROJECT_INCLUDES)
+
+ COMPRESS = compress
+ CPP = /usr/bin/cpp $(STD_CPP_DEFINES)
+ PREPROCESSCMD = /usr/bin/cpp -P $(STD_CPP_DEFINES)
+ INSTALL = install
+ INSTALLFLAGS = -c
+ LD = ld
+ LEX = lex
+ LEXLIB = -ll
+ YACC = yacc
+ CCYACC = yacc
+ LINT = lint
+ LINTLIBFLAG = -C
+ LINTOPTS = -axz
+ LN = ln -s
+ MAKE = make
+ MV = mv
+ CP = cp
+
+ RANLIB = ranlib
+ RANLIBINSTFLAGS =
+
+ RM = rm -f
+ MANSUFFIX = n
+ LIBMANSUFFIX = 3
+ FILEMANSUFFIX = 5
+ TROFF = psroff
+ NROFF = nroff
+ MSMACROS = -ms
+ MANMACROS = -man
+ TBL = tbl
+ EQN = eqn
+ NEQN = neqn
+ COL = col
+
+ PICFLAGS = -fPIC
+
+ SHAREDCODEDEF =
+ SHLIBDEF =
+
+ SHLIBLDFLAGS = -dynamiclib -headerpad_max_install_names
+
+ PICFLAGS = -fPIC
+
+ CXXPICFLAGS = -fPIC
+
+ INSTPGMFLAGS =
+
+ INSTETCFLAGS = -m 775 -o gdsjaar -g _developer
+ INSTBINFLAGS = -m 775 -o gdsjaar -g _developer
+ INSTUIDFLAGS = -m InstAccUid -o gdsjaar -g _developer
+ INSTLIBFLAGS = -m 775 -o gdsjaar -g _developer
+ INSTINCFLAGS = -m 775 -o gdsjaar -g _developer
+ INSTMANFLAGS = -m 765 -o gdsjaar -g _developer
+ INSTDATFLAGS = -m 765 -o gdsjaar -g _developer
+ INSTKMEMFLAGS = -m InstAccUid -o gdsjaar -g _developer
+
+ PROJECTROOT = /Users/gdsjaar/src/SEACAS-SF-INSTALL
+
+ STD_INCLUDES =
+ STD_CPP_DEFINES = -DBuild64 -DADDC_ $(PROJECT_DEFINES)
+ STD_DEFINES = -DBuild64 -DADDC_ $(PROJECT_DEFINES)
+ EXTRA_LOAD_FLAGS =
+ EXTRA_LDOPTIONS =
+ EXTRA_LIBRARIES =
+F90EXTRALIBRARIES =
+ TAGS = ctags
+
+ ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
+ ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(THREADS_DEFINES) $(DEFINES)
+
+ DEBUG = -O
+ CDEBUGFLAGS =
+ CCOPTIONS =
+ PARCCOPTIONS =
+ CCEXTRAOPTIONS =
+ CFLAGS = $(CDEBUGFLAGS) $(DEBUG) $(CCOPTIONS) $(CCEXTRAOPTIONS) $(THREADS_CFLAGS) $(ALLDEFINES) $(PROJECT_INCLUDES)
+ LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES) $(DEPEND_DEFINES)
+
+ F77DEBUGFLAGS =
+ F77OPTIONS = -fno-range-check -fcray-pointer -fdefault-real-8 -fdefault-integer-8
+ F77EXTRAOPTIONS =
+ F77PRECOPTIONS =
+ PARF77OPTIONS = -fno-range-check -fcray-pointer -fdefault-real-8 -fdefault-integer-8
+ F77STATICFLAGS =
+ F77CPPFLAGS = -D$(SYSTEM)
+ FFLAGS = $(F77DEBUGFLAGS) $(DEBUG) $(F77OPTIONS) $(F77PRECOPTIONS) $(F77EXTRAOPTIONS) $(PROJECT_INCLUDES)
+
+ F90DEBUGFLAGS =
+ F90OPTIONS = -fno-range-check
+ F90EXTRAOPTIONS =
+ PARF90OPTIONS = -fno-range-check
+ F90STATICFLAGS =
+ F90CPPFLAGS = -D$(SYSTEM) $(STD_CPP_DEFINES)
+ F90PRECOPTIONS =
+F90EXTRALDOPTIONS =
+ F90FLAGS = $(F90DEBUGFLAGS) $(DEBUG) $(F90OPTIONS) $(F90EXTRAOPTIONS) $(F90PRECOPTIONS) $(PROJECT_INCLUDES)
+
+ LDPRELIB = -L$(USRLIBDIR)
+ LDPOSTLIB =
+ LDOPTIONS = $(EXTRA_LDOPTIONS) $(THREADS_LDFLAGS) $(LOCAL_LDFLAGS) $(LDPRELIBS)
+ PARLDOPTIONS =
+ LDLIBS = $(LDPOSTLIBS) $(THREADS_LIBS) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
+ CXXLDOPTIONS = $(CXXOPTIONS) $(EXTRA_LDOPTIONS) $(THREADS_CXXLDFLAGS) $(LOCAL_LDFLAGS) $(LDPRELIBS)
+
+ CCLINK = $(CC)
+
+ NATIVECC = /opt/local/bin/clang-mp-3.1
+ NATIVEF77 = /opt/local/bin/gfortran-mp-4.8
+ CROSSCC = /opt/local/bin/clang-mp-3.1
+ CROSSACCESSROOT = /Net/projects/seacas/janus/current
+ CROSSACCESSSRC = $(CROSSACCESSROOT)/ACCESS
+ CROSSALLDEFINES = -I$(CROSSACCESSROOT)/inc -Dcouar -DADDC_ -Usun
+ CROSSLIBPATH = -L./ -L$(CROSSACCESSROOT)/lib
+ CROSSPLIBPATH = -L./ -L$(CROSSACCESSROOT)/plib
+ CROSSLIBDIR = $(CROSSACCESSROOT)/lib
+ CROSSPLIBDIR = $(CROSSACCESSROOT)/plib
+ CROSSPROJECTINCS = -I./ -I$(CROSSACCESSROOT)/inc
+
+ CXXLINK = $(CXX)
+
+ LDSTRIPFLAGS = -x
+ LDCOMBINEFLAGS = -r
+ DEPENDFLAGS =
+
+ MACROFILE = darwin.cf
+ RM_CMD = $(RM)
+
+ IMAKE_DEFINES =
+ ITOOLS_DEFINES = -DUseSfmakedepend=0
+
+ IRULESRC = $(CONFIGDIR)
+ IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
+
+# ----------------------------------------------------------------------
+# ACCESS Darwin Build Parameters and Rules
+# ACCESS.tmpl
+
+ TEMPDIR = /tmp
+
+# PROJECTNAME : name of project
+# PROJECTRELEASE : release number of ACCESS distribution
+# ACCESSSRC : location of ACCESS source code
+# ACCESSDIR : location of ACCESS installation directories
+# Set in site.def : "SNLA ACCESS", "1.0", /Users/gdsjaar/src/SEACAS-SF, /Users/gdsjaar/src/SEACAS-SF-INSTALL
+ PROJECTNAME = "SNLA ACCESS"
+ PROJECTRELEASE = "1.0"
+ ACCESSSRC = /Users/gdsjaar/src/SEACAS-SF/ACCESS
+ ACCESSDIR = /Users/gdsjaar/src/SEACAS-SF-INSTALL
+
+ TFLOPROOT = TflopAccessRoot
+ CPLANTROOT = CplantAccessRoot
+
+# Used to specify location of hdf5 libraries for use with netcdf-4
+ HDF5ROOT = /Users/gdsjaar/src/SEACAS-SF
+
+# Source code for the ACCESS Darwin
+ ITOOLSSRC = itools
+ GRAPHICSSRC = graphics
+ SVDISRC = svdi
+ LIBRARIESSRC = libraries
+ NETCDFSRC = netcdf
+ HDF5SRC = hdf5
+ SERIALMPISRC = serial_mpi
+ APPLICATIONSRC = applications
+ SCRIPTSSRC = scripts
+ TESTPROBS = test
+ PARLIBRARIESSRC = parallellibraries
+ PARNETCDFSRC = parallelnetcdf
+
+# Translator Subdirectories
+ ALGEBRASRC = algebra
+ ALGEBRA2SRC = algebra2
+ CONCATSRC = concat
+ CONEXSRC = conex
+ CONEX2SRC = conex2
+ CONJOINSRC = conjoin
+ EJOINSRC = ejoin
+ EMERGESRC = emerge
+ EXOCTHSRC = exocth
+ EXOEXOSRC = exoexo
+ EXOPATSRC = exopat
+ EXOSYMSRC = exosym
+ EXOTRCSRC = exotrc
+ EXOTEC2SRC = exotec2
+ EXOTXTSRC = exotxt
+ EXOTXT2SRC = exotxt2
+ PATEXOSRC = patexo
+ SEAEXOSRC = seaexo
+ SPHGEN2DSRC = sphgen2d
+ SPHGEN3DSRC = sphgen3d
+ SPHGEN3D2SRC = sphgen3d2
+ TXTEXOSRC = txtexo
+ TXTEXO2SRC = txtexo2
+ EXO2VISSRC = exo2vis
+ EXOMATLABSRC = exomatlab
+ EXOMATSRC = exomat
+ EXO2MATSRC = exo2mat
+
+ EX1EX2V2SRC = ex1ex2v2
+ EX2EX1V2SRC = ex2ex1v2
+ EXODIFFSRC = exodiff
+ EPUSRC = epu
+ ABAEXOSRC = abaexo
+ NEM_JOINSRC = nem_join
+ NEM_SLICESRC = nem_slice
+ NEM_SPREADSRC = nem_spread
+ WTO3DSRC = wto3d
+
+# Graphics Subdirectories
+ BLOTSRC = blot
+ BLOTII2SRC = blotII2
+ FASTQSRC = fastq
+ FONTSSRC = fonts
+ GRAPHSRC = graph
+
+# Library Subdirectories
+ SUPESSRC = supes
+ SUPESDPSRC = supesdp
+ SUPLIBSRC = suplib
+ LEGACYSRC = legacy
+ MAPVARLIBSRC = mapvarlib
+ EXODUSSRC = exodus
+ PLTSRC = plt
+ VDI_DRIVERSSRC = vdi_drivers
+ IOSSSRC = ioss
+ ZOLTANSRC = zoltan
+ CHACOSRC = chaco
+ NEMESISSRC = nemesis
+ APREPROLIBSRC = aprepro
+ XHELPSRC = xhelp
+# Library Subdirectories for svdi
+ CGISRC = cgi
+ CDRSRC = cdr
+ POSTSRC = post
+ TESTSRC = test
+
+# Pre- and Post-processing Subdirectories
+ APREPROSRC = aprepro
+ FAILPROBSRC = failprob
+ GEN3DSRC = gen3d
+ GEN3D2SRC = gen3d2
+ GENSHELLSRC = genshell
+ GENSHELL2SRC = genshell2
+ GENHXSHLSRC = genhxshl
+ GJOINSRC = gjoin
+ GJOIN1SRC = gjoin1
+ GJOIN2SRC = gjoin2
+ GREPOSSRC = grepos
+ GREPOS2SRC = grepos2
+ GROPESRC = grope
+ MAPVARSRC = mapvar
+ MAPVARKDSRC = mapvar-kd
+ NUMBERSSRC = numbers
+ NUMBERS2SRC = numbers2
+ EX_JOINSRC = ex_join
+ SPIFFSRC = spiff
+
+# ACCESS installation directories
+ BINDIR = $(ACCESSDIR)/bin
+ CONFIGDIR = $(ACCESSDIR)/config
+ ETCDIR = $(ACCESSDIR)/etc
+ INCDIR = $(ACCESSDIR)/inc
+ LIBDIR = $(ACCESSDIR)/lib
+ PLIBDIR = $(ACCESSDIR)/plib
+ MATLABDIR = $(ACCESSDIR)/matlab
+ SVDIDIR = $(ACCESSDIR)/svdi
+ SVDITESTDIR = $(ACCESSDIR)/svdi/test
+ BUILDINCDIR = $(ACCESSDIR)/inc
+ BUILDINCTOP = ..
+ BUILDLIBDIR = $(TOP)/usrlib
+
+# Override Include directories
+ INCREF =
+ ALTINC =
+ INCLUDESRC = ./
+ PROJECT_INCLUDES = -I$(INCLUDESRC) $(ALTINC) -I$(INCDIR)
+
+# Override Library directories
+ LIBREF =
+ ALTLIBPATH =
+ LIBPATH = -L$(INCLUDESRC) $(ALTLIBPATH) -L$(LIBDIR)
+ PLIBPATH = -L$(INCLUDESRC) $(ALTLIBPATH) -L$(PLIBDIR)
+
+# Libraries
+ IOSS = -lIonit -lIoex -lIogn -lIotr -lIohb -lIoss
+ HDF5 = -lhdf5
+ HDF5_HL = -lhdf5_hl
+ SUPES = -lsupes
+ SUPESDP = -lsupesdp
+ SUPLIB = -lsuplib
+ LEGACY = -llegacy
+ MAPVARLIB = -lmapvarlib
+ PLT = -lplt
+ RPCLIB =
+ EXTRANETCDFLIB = -L$(HDF5ROOT)/lib -lhdf5_hl -lhdf5 -lm -lz
+ LCLIB = -lLegacyContact
+ NETCDF = -lnetcdf $(EXTRANETCDFLIB)
+ EXOIIV2C = -lexodus
+ EXODUS = -lexodus
+ EXOIIV2FOR = -lexoIIv2for
+ EXOIIV2FOR32 = -lexoIIv2for32
+ ABALIB =
+ CGI = -lcgi
+ CDR = -lcdr
+ NEMESIS = -lnemesis
+ NEMESISC = -lnemesis
+ NEMESISF = -lnemIf
+ NEMESISF32 = -lnemIf32
+ CHACO = -lchaco
+ ZOLTAN = -lzoltan
+ MATIO = -lmatio -lz
+
+# Libraries and include path used for building parallel executables
+ PARFLIBS = -lmpi
+ PARCLIBS = -lmpi
+ PARINCPATH =
+
+# Perl command and includes needed for sfmakedepend
+ PERLCMD = /usr/bin/perl
+ DEPENDINC = -I /usr/include -I $(INCDIR)
+
+# X11 includes and libraries
+ X11INCLUDES = -I/usr/X11R6/include
+ X11 = -L/usr/X11R6/lib -lX11
+
+# Definitions used for running parallel executables
+ PARALLEL = Parallel
+ NUM_PROCS = 1
+ PARRUNCMD = mpirun
+ NPCMD = -np
+ HFCMD = -p4pg
+
+# Imake flag used in the parallel directories
+
+PARALLELIMAKEFLAG = ParallelImakeFlag
+
+ ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/ACCESS.tmpl $(IRULESRC)/site.def $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
+
+ CONFIGDIR = $(ACCESSDIR)/config
+
+ USRLIBDIRPATH = /Users/gdsjaar/src/SEACAS-SF-INSTALL/lib
+ LDPRELIBS =
+ LDPOSTLIBS =
+ TOP_INCLUDES = -I$(INCROOT)
+ PROJECT_DEFINES =
+
+CXXPROJECT_DEFINES =
+
+# ----------------------------------------------------------------------
+# start of Imakefile
+
+# Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
+# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
+# retains certain rights in this software.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+#
+# * Neither the name of Sandia Corporation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN 0 EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+ALTINC = -I../
+
+F77CPPFLAGS = -D$(SYSTEM)
+
+SRCS = ne_jack.c
+SRCSF = addrwrpn.F
+
+OBJS = ${SRCS:.c=.o} ${SRCSF:.F=.o}
+
+all:: libnemIf.a
+libnemIf.a: $(OBJS)
+ $(AR) $@ $?
+ $(RANLIB) $@
+ $(_NULLCMD_)
+ $(CP) libnemIf.a ../
+
+ne_jack32.o: ne_jack.c
+ $(CC) -o ne_jack32.o -c $(CFLAGS) -DDEFAULT_REAL_INT ne_jack.c
+
+all:: libnemIf32.a
+libnemIf32.a: ne_jack32.o
+ $(AR) $@ $?
+ $(_NULLCMD_)
+ $(_NULLCMD_)
+ $(CP) $@ ../
+
+depend::
+ $(DEPEND) $(DEPENDFLAGS) -- $(ALLDEFINES) $(DEPEND_DEFINES) -- $(SRCS)
+
+# ----------------------------------------------------------------------
+# common rules for all Makefiles - do not edit
+
+.c.i:
+ $(RM) $@
+ $(CC) -E $(CFLAGS) $(_NOOP_) $*.c > $@
+
+emptyrule::
+
+clean::
+ $(RM) *.CKP *.ln *.BAK *.bak *.o *.M *.mod core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut "#"*
+
+Makefile::
+ - at if [ -f Makefile ]; then set -x; \
+ $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
+ else exit 0; fi
+ $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
+
+tags::
+ $(TAGS) -w *.[ch]
+ $(TAGS) -xw *.[ch] > TAGS
+
+man_keywords::
+
+# ----------------------------------------------------------------------
+# empty rules for directories that do not have SUBDIRS - do not edit
+
+install::
+ @echo "install in $(CURRENT_DIR) done"
+
+install.man::
+ @echo "install.man in $(CURRENT_DIR) done"
+
+install.linkkit::
+ @echo "install.linkkit in $(CURRENT_DIR) done"
+
+Makefiles::
+
+includes::
+
+depend::
+
+# ----------------------------------------------------------------------
+
+.SUFFIXES: .F .f .f90 .c .C .cpp
+.c.o:
+ $(CC) -c $(CFLAGS) $*.c
+.C.o:
+ $(CXX) -c $(CXXFLAGS) $*.C
+.cpp.o:
+ $(CXX) -c $(CXXFLAGS) $*.cpp
+.f.o:
+ $(FC) -c $(STATICFLAGS) $(FFLAGS) $*.f
+.f90.o:
+ $(F90C) -c $(STATICFLAGS) $(F90FLAGS) $*.f90
+.f90.mod:
+ $(F90C) -c $(STATICFLAGS) $(F90FLAGS) $*.f90
+.mod.o:
+.F.o:
+ $(FC) -c $(STD_CPP_DEFINES) $(F77CPPFLAGS) $(DEFINES) $(STATICFLAGS) $(FFLAGS) $*.F
+
+# ----------------------------------------------------------------------
+# dependencies generated by makedepend or sfmakedepend
+
diff --git a/nemesis/forbind/addrwrpn.F b/nemesis/forbind/addrwrpn.F
index 78aebd1..ed6dddc 100644
--- a/nemesis/forbind/addrwrpn.F
+++ b/nemesis/forbind/addrwrpn.F
@@ -101,21 +101,11 @@ C
integer ierr
C
integer*4 idne4
- integer*4 nnodes_g4
- integer*4 nelems_g4
- integer*4 nelem_blks_g4
- integer*4 nnode_sets_g4
- integer*4 nside_sets_g4
integer*4 ierr4
C
idne4 = idne
- call negig4 (idne4, nnodes_g4, nelems_g4, nelem_blks_g4,
- $ nnode_sets_g4, nside_sets_g4, ierr4)
- nnodes_g = nnodes_g4
- nelems_g = nelems_g4
- nelem_blks_g = nelem_blks_g4
- nnode_sets_g = nnode_sets_g4
- nside_sets_g = nside_sets_g4
+ call negig4 (idne4, nnodes_g, nelems_g, nelem_blks_g,
+ $ nnode_sets_g, nside_sets_g, ierr4)
ierr = ierr4
C
end
@@ -136,21 +126,11 @@ C
integer ierr
C
integer*4 idne4
- integer*4 nnodes_g4
- integer*4 nelems_g4
- integer*4 nelem_blks_g4
- integer*4 nnode_sets_g4
- integer*4 nside_sets_g4
integer*4 ierr4
C
idne4 = idne
- nnodes_g4 = nnodes_g
- nelems_g4 = nelems_g
- nelem_blks_g4 = nelem_blks_g
- nnode_sets_g4 = nnode_sets_g
- nside_sets_g4 = nside_sets_g
- call nepig4 (idne4, nnodes_g4, nelems_g4, nelem_blks_g4,
- $ nnode_sets_g4, nside_sets_g4, ierr4)
+ call nepig4 (idne4, nnodes_g, nelems_g, nelem_blks_g,
+ $ nnode_sets_g, nside_sets_g, ierr4)
ierr = ierr4
C
end
@@ -175,28 +155,14 @@ C
integer ierr
C
integer*4 idne4
- integer*4 nint_nodes4
- integer*4 nbor_nodes4
- integer*4 next_nodes4
- integer*4 nint_elems4
- integer*4 nbor_elems4
- integer*4 nnode_cmaps4
- integer*4 nelem_cmaps4
integer*4 processor4
integer*4 ierr4
C
idne4 = idne
processor4 = processor
- call neglbp4 (idne4, nint_nodes4, nbor_nodes4, next_nodes4,
- $ nint_elems4, nbor_elems4, nnode_cmaps4, nelem_cmaps4,
+ call neglbp4 (idne4, nint_nodes, nbor_nodes, next_nodes,
+ $ nint_elems, nbor_elems, nnode_cmaps, nelem_cmaps,
$ processor4, ierr4)
- nint_nodes = nint_nodes4
- nbor_nodes = nbor_nodes4
- next_nodes = next_nodes4
- nint_elems = nint_elems4
- nbor_elems = nbor_elems4
- nnode_cmaps = nnode_cmaps4
- nelem_cmaps = nelem_cmaps4
ierr = ierr4
C
end
@@ -221,27 +187,13 @@ C
integer ierr
C
integer*4 idne4
- integer*4 nint_nodes4
- integer*4 nbor_nodes4
- integer*4 next_nodes4
- integer*4 nint_elems4
- integer*4 nbor_elems4
- integer*4 nnode_cmaps4
- integer*4 nelem_cmaps4
integer*4 processor4
integer*4 ierr4
C
idne4 = idne
- nint_nodes4 = nint_nodes
- nbor_nodes4 = nbor_nodes
- next_nodes4 = next_nodes
- nint_elems4 = nint_elems
- nbor_elems4 = nbor_elems
- nnode_cmaps4 = nnode_cmaps
- nelem_cmaps4 = nelem_cmaps
processor4 = processor
- call neplbp4 (idne4, nint_nodes4, nbor_nodes4, next_nodes4,
- $ nint_elems4, nbor_elems4, nnode_cmaps4, nelem_cmaps4,
+ call neplbp4 (idne4, nint_nodes, nbor_nodes, next_nodes,
+ $ nint_elems, nbor_elems, nnode_cmaps, nelem_cmaps,
$ processor4, ierr4)
ierr = ierr4
C
@@ -264,56 +216,12 @@ C
integer nelem_cmaps(*)
integer ierr
C
- integer nproc
- integer nproc_in_f
- character*(80) ftype
-C
- call negii (idne, nproc, nproc_in_f, ftype, ierr)
- if (ierr.ne.0) return
- call neplbpc2 (idne, nint_nodes, nbor_nodes, next_nodes,
- $ nint_elems, nbor_elems, nnode_cmaps, nelem_cmaps, ierr,
- $ nproc_in_f)
-C
- end
-C
- subroutine neplbpc2 (idne, nint_nodes, nbor_nodes, next_nodes,
- $ nint_elems, nbor_elems, nnode_cmaps, nelem_cmaps, ierr,
- $ nproc_in_f)
- implicit none
- integer idne
- integer nproc_in_f
- integer nint_nodes(nproc_in_f)
- integer nbor_nodes(nproc_in_f)
- integer next_nodes(nproc_in_f)
- integer nint_elems(nproc_in_f)
- integer nbor_elems(nproc_in_f)
- integer nnode_cmaps(nproc_in_f)
- integer nelem_cmaps(nproc_in_f)
- integer ierr
-C
integer*4 idne4
- integer*4 nint_nodes4(nproc_in_f)
- integer*4 nbor_nodes4(nproc_in_f)
- integer*4 next_nodes4(nproc_in_f)
- integer*4 nint_elems4(nproc_in_f)
- integer*4 nbor_elems4(nproc_in_f)
- integer*4 nnode_cmaps4(nproc_in_f)
- integer*4 nelem_cmaps4(nproc_in_f)
integer*4 ierr4
C
- INTEGER J1X
idne4 = idne
- DO J1X = 1, NPROC_IN_F
- NINT_NODES4(J1X) = NINT_NODES(J1X)
- NBOR_NODES4(J1X) = NBOR_NODES(J1X)
- NEXT_NODES4(J1X) = NEXT_NODES(J1X)
- NINT_ELEMS4(J1X) = NINT_ELEMS(J1X)
- NBOR_ELEMS4(J1X) = NBOR_ELEMS(J1X)
- NNODE_CMAPS4(J1X) = NNODE_CMAPS(J1X)
- NELEM_CMAPS4(J1X) = NELEM_CMAPS(J1X)
- END DO
- call neplbpc4 (idne4, nint_nodes4, nbor_nodes4, next_nodes4,
- $ nint_elems4, nbor_elems4, nnode_cmaps4, nelem_cmaps4,
+ call neplbpc4 (idne4, nint_nodes, nbor_nodes, next_nodes,
+ $ nint_elems, nbor_elems, nnode_cmaps, nelem_cmaps,
$ ierr4)
ierr = ierr4
C
@@ -332,44 +240,12 @@ C
integer ns_df_cnt_glob(*)
integer ierr
C
- integer nnodes_g
- integer nelems_g
- integer nelem_blks_g
- integer nnode_sets_g
- integer nside_sets_g
- call negig (idne, nnodes_g, nelems_g, nelem_blks_g,
- $ nnode_sets_g, nside_sets_g, ierr)
- if (ierr.ne.0) return
- call negnspg2 (idne, ns_ids_glob, ns_n_cnt_glob,
- $ ns_df_cnt_glob, ierr, nnode_sets_g)
-C
- end
-C
- subroutine negnspg2 (idne, ns_ids_glob, ns_n_cnt_glob,
- $ ns_df_cnt_glob, ierr, nnode_sets_g)
- implicit none
- integer idne
- integer nnode_sets_g
- integer ns_ids_glob(nnode_sets_g)
- integer ns_n_cnt_glob(nnode_sets_g)
- integer ns_df_cnt_glob(nnode_sets_g)
- integer ierr
-C
integer*4 idne4
- integer*4 ns_ids_glob4(nnode_sets_g)
- integer*4 ns_n_cnt_glob4(nnode_sets_g)
- integer*4 ns_df_cnt_glob4(nnode_sets_g)
integer*4 ierr4
C
- INTEGER J1X
idne4 = idne
- call negnspg4 (idne4, ns_ids_glob4, ns_n_cnt_glob4,
- $ ns_df_cnt_glob4, ierr4)
- DO J1X = 1, NNODE_SETS_G
- NS_IDS_GLOB(J1X) = NS_IDS_GLOB4(J1X)
- NS_N_CNT_GLOB(J1X) = NS_N_CNT_GLOB4(J1X)
- NS_DF_CNT_GLOB(J1X) = NS_DF_CNT_GLOB4(J1X)
- END DO
+ call negnspg4 (idne4, ns_ids_glob, ns_n_cnt_glob,
+ $ ns_df_cnt_glob, ierr4)
ierr = ierr4
C
end
@@ -386,44 +262,12 @@ C
integer global_df_cnts(*)
integer ierr
C
- integer nnodes_g
- integer nelems_g
- integer nelem_blks_g
- integer nnode_sets_g
- integer nside_sets_g
- call negig (idne, nnodes_g, nelems_g, nelem_blks_g,
- $ nnode_sets_g, nside_sets_g, ierr)
- if (ierr.ne.0) return
- call nepnspg2 (idne, global_ids, global_n_cnts,
- $ global_df_cnts, ierr, nnode_sets_g)
-C
- end
-C
- subroutine nepnspg2 (idne, global_ids, global_n_cnts,
- $ global_df_cnts, ierr, nnode_sets_g)
- implicit none
- integer idne
- integer nnode_sets_g
- integer global_ids(nnode_sets_g)
- integer global_n_cnts(nnode_sets_g)
- integer global_df_cnts(nnode_sets_g)
- integer ierr
-C
integer*4 idne4
- integer*4 global_ids4(nnode_sets_g)
- integer*4 global_n_cnts4(nnode_sets_g)
- integer*4 global_df_cnts4(nnode_sets_g)
integer*4 ierr4
C
- INTEGER J1X
idne4 = idne
- DO J1X = 1, NNODE_SETS_G
- GLOBAL_IDS4(J1X) = GLOBAL_IDS(J1X)
- GLOBAL_N_CNTS4(J1X) = GLOBAL_N_CNTS(J1X)
- GLOBAL_DF_CNTS4(J1X) = GLOBAL_DF_CNTS(J1X)
- END DO
- call nepnspg4 (idne4, global_ids4, global_n_cnts4,
- $ global_df_cnts4, ierr4)
+ call nepnspg4 (idne4, global_ids, global_n_cnts,
+ $ global_df_cnts, ierr4)
ierr = ierr4
C
end
@@ -441,45 +285,12 @@ C
integer ss_df_cnt_glob(*)
integer ierr
C
- integer nnodes_g
- integer nelems_g
- integer nelem_blks_g
- integer nnode_sets_g
- integer nside_sets_g
-C
- call negig (idne, nnodes_g, nelems_g, nelem_blks_g,
- $ nnode_sets_g, nside_sets_g, ierr)
- if (ierr.ne.0) return
- call negsspg2 (idne, ss_ids_glob, ss_n_cnt_glob,
- $ ss_df_cnt_glob, ierr, nside_sets_g)
-C
- end
-C
- subroutine negsspg2 (idne, ss_ids_glob, ss_n_cnt_glob,
- $ ss_df_cnt_glob, ierr, nside_sets_g)
- implicit none
- integer idne
- integer nside_sets_g
- integer ss_ids_glob(nside_sets_g)
- integer ss_n_cnt_glob(nside_sets_g)
- integer ss_df_cnt_glob(nside_sets_g)
- integer ierr
-C
integer*4 idne4
- integer*4 ss_ids_glob4(nside_sets_g)
- integer*4 ss_n_cnt_glob4(nside_sets_g)
- integer*4 ss_df_cnt_glob4(nside_sets_g)
integer*4 ierr4
C
- INTEGER J1X
idne4 = idne
- call negsspg4 (idne4, ss_ids_glob4, ss_n_cnt_glob4,
- $ ss_df_cnt_glob4, ierr4)
- DO J1X = 1, NSIDE_SETS_G
- SS_IDS_GLOB(J1X) = SS_IDS_GLOB4(J1X)
- SS_N_CNT_GLOB(J1X) = SS_N_CNT_GLOB4(J1X)
- SS_DF_CNT_GLOB(J1X) = SS_DF_CNT_GLOB4(J1X)
- END DO
+ call negsspg4 (idne4, ss_ids_glob, ss_n_cnt_glob,
+ $ ss_df_cnt_glob, ierr4)
ierr = ierr4
C
end
@@ -497,45 +308,12 @@ C
integer global_df_cnts(*)
integer ierr
C
- integer nnodes_g
- integer nelems_g
- integer nelem_blks_g
- integer nnode_sets_g
- integer nside_sets_g
-C
- call negig (idne, nnodes_g, nelems_g, nelem_blks_g,
- $ nnode_sets_g, nside_sets_g, ierr)
- if (ierr.ne.0) return
- call nepsspg2 (idne, global_ids, global_el_cnts,
- $ global_df_cnts, ierr, nside_sets_g)
-C
- end
-C
- subroutine nepsspg2 (idne, global_ids, global_el_cnts,
- $ global_df_cnts, ierr, nside_sets_g)
- implicit none
- integer idne
- integer nside_sets_g
- integer global_ids(nside_sets_g)
- integer global_el_cnts(nside_sets_g)
- integer global_df_cnts(nside_sets_g)
- integer ierr
-C
integer*4 idne4
- integer*4 global_ids4(nside_sets_g)
- integer*4 global_el_cnts4(nside_sets_g)
- integer*4 global_df_cnts4(nside_sets_g)
integer*4 ierr4
C
- INTEGER J1X
idne4 = idne
- DO J1X = 1, NSIDE_SETS_G
- GLOBAL_IDS4(J1X) = GLOBAL_IDS(J1X)
- GLOBAL_EL_CNTS4(J1X) = GLOBAL_EL_CNTS(J1X)
- GLOBAL_DF_CNTS4(J1X) = GLOBAL_DF_CNTS(J1X)
- END DO
- call nepsspg4 (idne4, global_ids4, global_el_cnts4,
- $ global_df_cnts4, ierr4)
+ call nepsspg4 (idne4, global_ids, global_el_cnts,
+ $ global_df_cnts, ierr4)
ierr = ierr4
C
end
@@ -551,41 +329,11 @@ C
integer el_blk_cnts(*)
integer ierr
C
- integer nnodes_g
- integer nelems_g
- integer nelem_blks_g
- integer nnode_sets_g
- integer nside_sets_g
-C
- call negig (idne, nnodes_g, nelems_g, nelem_blks_g,
- $ nnode_sets_g, nside_sets_g, ierr)
- if (ierr.ne.0) return
- call negebig2 (idne, el_blk_ids, el_blk_cnts, ierr,
- $ nelem_blks_g)
-C
- end
-C
- subroutine negebig2 (idne, el_blk_ids, el_blk_cnts, ierr,
- $ nelem_blks_g)
- implicit none
- integer idne
- integer nelem_blks_g
- integer el_blk_ids(nelem_blks_g)
- integer el_blk_cnts(nelem_blks_g)
- integer ierr
-C
integer*4 idne4
- integer*4 el_blk_ids4(nelem_blks_g)
- integer*4 el_blk_cnts4(nelem_blks_g)
integer*4 ierr4
C
- INTEGER J1X
idne4 = idne
- call negebig4 (idne4, el_blk_ids4, el_blk_cnts4, ierr4)
- DO J1X = 1, NELEM_BLKS_G
- EL_BLK_IDS(J1X) = EL_BLK_IDS4(J1X)
- EL_BLK_CNTS(J1X) = EL_BLK_CNTS4(J1X)
- END DO
+ call negebig4 (idne4, el_blk_ids, el_blk_cnts, ierr4)
ierr = ierr4
C
end
@@ -601,38 +349,11 @@ C
integer el_blk_cnts(*)
integer ierr
C
- integer nnodes_g
- integer nelems_g
- integer nelem_blks_g
- integer nnode_sets_g
- integer nside_sets_g
-C
- call negig (idne, nnodes_g, nelems_g, nelem_blks_g,
- $ nnode_sets_g, nside_sets_g, ierr)
- if (ierr.ne.0) return
- call nepebig2 (idne, el_blk_ids, el_blk_cnts, ierr,
- $ nelem_blks_g)
-C
- end
-C
- subroutine nepebig2 (idne, el_blk_ids, el_blk_cnts, ierr,
- $ nelem_blks_g)
- implicit none
- integer idne
- integer nelem_blks_g
- integer el_blk_ids(nelem_blks_g)
- integer el_blk_cnts(nelem_blks_g)
- integer ierr
-C
integer*4 idne4
- integer*4 el_blk_ids4(nelem_blks_g)
- integer*4 el_blk_cnts4(nelem_blks_g)
integer*4 ierr4
C
idne4 = idne
- el_blk_ids4(nelem_blks_g) = el_blk_ids(nelem_blks_g)
- el_blk_cnts4(nelem_blks_g) = el_blk_cnts(nelem_blks_g)
- call nepebig4 (idne4, el_blk_ids4, el_blk_cnts4, ierr4)
+ call nepebig4 (idne4, el_blk_ids, el_blk_cnts, ierr4)
ierr = ierr4
C
end
@@ -653,24 +374,11 @@ C
integer ierr
C
integer*4 idne4
- integer*4 ss_id4
- integer*4 start_side_num4
- integer*4 num_sides4
- integer*4 ss_elem_list4(num_sides)
- integer*4 ss_side_list4(num_sides)
integer*4 ierr4
C
- INTEGER J1X
idne4 = idne
- ss_id4 = ss_id
- start_side_num4 = start_side_num
- num_sides4 = num_sides
- call negnss4 (idne4, ss_id4, start_side_num4, num_sides4,
- $ ss_elem_list4, ss_side_list4, ierr4)
- DO J1X = 1, NUM_SIDES
- SS_ELEM_LIST(J1X) = SS_ELEM_LIST4(J1X)
- SS_SIDE_LIST(J1X) = SS_SIDE_LIST4(J1X)
- END DO
+ call negnss4 (idne4, ss_id, start_side_num, num_sides,
+ $ ss_elem_list, ss_side_list, ierr4)
ierr = ierr4
C
end
@@ -691,24 +399,11 @@ C
integer ierr
C
integer*4 idne4
- integer*4 ss_id4
- integer*4 start_side_num4
- integer*4 num_sides4
- integer*4 ss_elem_list4(num_sides)
- integer*4 ss_side_list4(num_sides)
integer*4 ierr4
C
- INTEGER J1X
idne4 = idne
- ss_id4 = ss_id
- start_side_num4 = start_side_num
- num_sides4 = num_sides
- DO J1X = 1, NUM_SIDES
- SS_ELEM_LIST4(J1X) = SS_ELEM_LIST(J1X)
- SS_SIDE_LIST4(J1X) = SS_SIDE_LIST(J1X)
- END DO
- call nepnss4 (idne4, ss_id4, start_side_num4, num_sides4,
- $ ss_elem_list4, ss_side_list4, ierr4)
+ call nepnss4 (idne4, ss_id, start_side_num, num_sides,
+ $ ss_elem_list, ss_side_list, ierr4)
ierr = ierr4
C
end
@@ -728,16 +423,10 @@ C
integer ierr
C
integer*4 idne4
- integer*4 ss_id4
- integer*4 start_num4
- integer*4 num_df_to_get4
integer*4 ierr4
C
idne4 = idne
- ss_id4 = ss_id
- start_num4 = start_num
- num_df_to_get4 = num_df_to_get
- call negnssd4 (idne4, ss_id4, start_num4, num_df_to_get4,
+ call negnssd4 (idne4, ss_id, start_num, num_df_to_get,
$ ss_df, ierr4)
ierr = ierr4
C
@@ -758,16 +447,10 @@ C
integer ierr
C
integer*4 idne4
- integer*4 ss_id4
- integer*4 start_num4
- integer*4 num_df_to_get4
integer*4 ierr4
C
idne4 = idne
- ss_id4 = ss_id
- start_num4 = start_num
- num_df_to_get4 = num_df_to_get
- call nepnssd4 (idne4, ss_id4, start_num4, num_df_to_get4,
+ call nepnssd4 (idne4, ss_id, start_num, num_df_to_get,
$ ss_df, ierr4)
ierr = ierr4
C
@@ -788,22 +471,11 @@ C
integer ierr
C
integer*4 idne4
- integer*4 ns_id4
- integer*4 start_node_num4
- integer*4 num_node4
- integer*4 ns_node_list4(num_node)
integer*4 ierr4
C
- INTEGER J1X
idne4 = idne
- ns_id4 = ns_id
- start_node_num4 = start_node_num
- num_node4 = num_node
- call negnns4 (idne4, ns_id4, start_node_num4, num_node4,
- $ ns_node_list4, ierr4)
- DO J1X = 1, NUM_NODE
- NS_NODE_LIST(J1X) = NS_NODE_LIST4(J1X)
- END DO
+ call negnns4 (idne4, ns_id, start_node_num, num_node,
+ $ ns_node_list, ierr4)
ierr = ierr4
C
end
@@ -823,22 +495,11 @@ C
integer ierr
C
integer*4 idne4
- integer*4 ns_id4
- integer*4 start_node_num4
- integer*4 num_node4
- integer*4 ns_node_list4(num_node)
integer*4 ierr4
C
- INTEGER J1X
idne4 = idne
- ns_id4 = ns_id
- start_node_num4 = start_node_num
- num_node4 = num_node
- DO J1X = 1, NUM_NODE
- NS_NODE_LIST4(J1X) = NS_NODE_LIST(J1X)
- END DO
- call nepnns4 (idne4, ns_id4, start_node_num4, num_node4,
- $ ns_node_list4, ierr4)
+ call nepnns4 (idne4, ns_id, start_node_num, num_node,
+ $ ns_node_list, ierr4)
ierr = ierr4
C
end
@@ -858,16 +519,10 @@ C
integer ierr
C
integer*4 idne4
- integer*4 ns_id4
- integer*4 start_num4
- integer*4 num_df_to_get4
integer*4 ierr4
C
idne4 = idne
- ns_id4 = ns_id
- start_num4 = start_num
- num_df_to_get4 = num_df_to_get
- call negnnsd4 (idne4, ns_id4, start_num4, num_df_to_get4,
+ call negnnsd4 (idne4, ns_id, start_num, num_df_to_get,
$ ns_df, ierr4)
ierr = ierr4
C
@@ -888,16 +543,10 @@ C
integer ierr
C
integer*4 idne4
- integer*4 ns_id4
- integer*4 start_num4
- integer*4 num_df_to_get4
integer*4 ierr4
C
idne4 = idne
- ns_id4 = ns_id
- start_num4 = start_num
- num_df_to_get4 = num_df_to_get
- call nepnnsd4 (idne4, ns_id4, start_num4, num_df_to_get4,
+ call nepnnsd4 (idne4, ns_id, start_num, num_df_to_get,
$ ns_df, ierr4)
ierr = ierr4
C
@@ -919,14 +568,10 @@ C
integer ierr
C
integer*4 idne4
- integer*4 start_node_num4
- integer*4 num_nodes4
integer*4 ierr4
C
idne4 = idne
- start_node_num4 = start_node_num
- num_nodes4 = num_nodes
- call negcor4 (idne4, start_node_num4, num_nodes4, x_coor,
+ call negcor4 (idne4, start_node_num, num_nodes, x_coor,
$ y_coor, z_coor, ierr4)
ierr = ierr4
C
@@ -948,14 +593,10 @@ C
integer ierr
C
integer*4 idne4
- integer*4 start_node_num4
- integer*4 num_nodes4
integer*4 ierr4
C
idne4 = idne
- start_node_num4 = start_node_num
- num_nodes4 = num_nodes
- call nepcor4 (idne4, start_node_num4, num_nodes4, x_coor,
+ call nepcor4 (idne4, start_node_num, num_nodes, x_coor,
$ y_coor, z_coor, ierr4)
ierr = ierr4
C
@@ -976,22 +617,11 @@ C
integer ierr
C
integer*4 idne4
- integer*4 elem_blk_id4
- integer*4 start_elem_num4
- integer*4 num_elems4
- integer*4 connect4(num_elems)
integer*4 ierr4
C
- INTEGER J1X
idne4 = idne
- elem_blk_id4 = elem_blk_id
- start_elem_num4 = start_elem_num
- num_elems4 = num_elems
- call negnec4 (idne4, elem_blk_id4, start_elem_num4,
- $ num_elems4, connect4, ierr4)
- DO J1X = 1, NUM_ELEMS
- CONNECT(J1X) = CONNECT4(J1X)
- END DO
+ call negnec4 (idne4, elem_blk_id, start_elem_num,
+ $ num_elems, connect, ierr4)
ierr = ierr4
C
end
@@ -1011,22 +641,11 @@ C
integer ierr
C
integer*4 idne4
- integer*4 elem_blk_id4
- integer*4 start_elem_num4
- integer*4 num_elems4
- integer*4 connect4(num_elems)
integer*4 ierr4
C
- INTEGER J1X
idne4 = idne
- elem_blk_id4 = elem_blk_id
- start_elem_num4 = start_elem_num
- num_elems4 = num_elems
- DO J1X = 1, NUM_ELEMS
- CONNECT4(J1X) = CONNECT(J1X)
- END DO
- call nepnec4 (idne4, elem_blk_id4, start_elem_num4,
- $ num_elems4, connect4, ierr4)
+ call nepnec4 (idne4, elem_blk_id, start_elem_num,
+ $ num_elems, connect, ierr4)
ierr = ierr4
C
end
@@ -1046,17 +665,11 @@ C
integer ierr
C
integer*4 idne4
- integer*4 elem_blk_id4
- integer*4 start_elem_num4
- integer*4 num_elems4
integer*4 ierr4
C
idne4 = idne
- elem_blk_id4 = elem_blk_id
- start_elem_num4 = start_elem_num
- num_elems4 = num_elems
- call negneat4 (idne4, elem_blk_id4, start_elem_num4,
- $ num_elems4, attrib, ierr4)
+ call negneat4 (idne4, elem_blk_id, start_elem_num,
+ $ num_elems, attrib, ierr4)
ierr = ierr4
C
end
@@ -1076,17 +689,11 @@ C
integer ierr
C
integer*4 idne4
- integer*4 elem_blk_id4
- integer*4 start_elem_num4
- integer*4 num_elems4
integer*4 ierr4
C
idne4 = idne
- elem_blk_id4 = elem_blk_id
- start_elem_num4 = start_elem_num
- num_elems4 = num_elems
- call nepneat4 (idne4, elem_blk_id4, start_elem_num4,
- $ num_elems4, attrib, ierr4)
+ call nepneat4 (idne4, elem_blk_id, start_elem_num,
+ $ num_elems, attrib, ierr4)
ierr = ierr4
C
end
@@ -1102,12 +709,10 @@ C
integer ierr
C
integer*4 idne4
- integer*4 elem_blk_id4
integer*4 ierr4
C
idne4 = idne
- elem_blk_id4 = elem_blk_id
- call negelt4 (idne4, elem_blk_id4, elem_type, ierr4)
+ call negelt4 (idne4, elem_blk_id, elem_type, ierr4)
ierr = ierr4
C
end
@@ -1133,22 +738,14 @@ C
integer*4 idne4
integer*4 time_step4
integer*4 elem_var_index4
- integer*4 elem_blk_id4
- integer*4 num_elem_this_blk4
- integer*4 start_elem_num4
- integer*4 num_elem4
integer*4 ierr4
C
idne4 = idne
time_step4 = time_step
elem_var_index4 = elem_var_index
- elem_blk_id4 = elem_blk_id
- num_elem_this_blk4 = num_elem_this_blk
- start_elem_num4 = start_elem_num
- num_elem4 = num_elem
call negnev4 (idne4, time_step4, elem_var_index4,
- $ elem_blk_id4, num_elem_this_blk4, start_elem_num4,
- $ num_elem4, elem_var_vals, ierr4)
+ $ elem_blk_id, num_elem_this_blk, start_elem_num,
+ $ num_elem, elem_var_vals, ierr4)
ierr = ierr4
C
end
@@ -1173,19 +770,13 @@ C
integer*4 idne4
integer*4 time_step4
integer*4 elem_var_index4
- integer*4 elem_blk_id4
- integer*4 start_pos4
- integer*4 num_vals4
integer*4 ierr4
C
idne4 = idne
time_step4 = time_step
elem_var_index4 = elem_var_index
- elem_blk_id4 = elem_blk_id
- start_pos4 = start_pos
- num_vals4 = num_vals
call nepevs4 (idne4, time_step4, elem_var_index4,
- $ elem_blk_id4, start_pos4, num_vals4, elem_var_vals,
+ $ elem_blk_id, start_pos, num_vals, elem_var_vals,
$ ierr4)
ierr = ierr4
C
@@ -1209,17 +800,13 @@ C
integer*4 idne4
integer*4 time_step4
integer*4 nodal_var_index4
- integer*4 start_node_num4
- integer*4 num_nodes4
integer*4 ierr4
C
idne4 = idne
time_step4 = time_step
nodal_var_index4 = nodal_var_index
- start_node_num4 = start_node_num
- num_nodes4 = num_nodes
call negnnv4 (idne4, time_step4, nodal_var_index4,
- $ start_node_num4, num_nodes4, nodal_vars, ierr4)
+ $ start_node_num, num_nodes, nodal_vars, ierr4)
ierr = ierr4
C
end
@@ -1238,22 +825,17 @@ C
integer num_vals
real nodal_var_vals(num_vals)
integer ierr
- integer i
C
integer*4 idne4
integer*4 time_step4
integer*4 nodal_var_index4
- integer*4 start_pos4
- integer*4 num_vals4
integer*4 ierr4
C
idne4 = idne
time_step4 = time_step
nodal_var_index4 = nodal_var_index
- start_pos4 = start_pos
- num_vals4 = num_vals
call nepnvs4 (idne4, time_step4, nodal_var_index4,
- $ start_pos4, num_vals4, nodal_var_vals, ierr4)
+ $ start_pos, num_vals, nodal_var_vals, ierr4)
ierr = ierr4
C
end
@@ -1269,21 +851,12 @@ C
integer num_ent
integer elem_map(num_ent)
integer ierr
- integer i
C
integer*4 idne4
- integer*4 starte4
- integer*4 num_ent4
- integer*4 elem_map4(num_ent)
integer*4 ierr4
C
idne4 = idne
- starte4 = starte
- num_ent4 = num_ent
- call negnenm4 (idne4, starte4, num_ent4, elem_map4, ierr4)
- do i = 1, num_ent
- elem_map(i) = elem_map4(i)
- enddo
+ call negnenm4 (idne4, starte, num_ent, elem_map, ierr4)
ierr = ierr4
C
end
@@ -1299,21 +872,12 @@ C
integer num_ent
integer elem_map(num_ent)
integer ierr
- integer i
C
integer*4 idne4
- integer*4 starte4
- integer*4 num_ent4
- integer*4 elem_map4(num_ent)
integer*4 ierr4
C
idne4 = idne
- starte4 = starte
- num_ent4 = num_ent
- do i = 1, num_ent
- elem_map4(i) = elem_map(i)
- enddo
- call nepnenm4 (idne4, starte4, num_ent4, elem_map4, ierr4)
+ call nepnenm4 (idne4, starte, num_ent, elem_map, ierr4)
ierr = ierr4
C
end
@@ -1329,21 +893,12 @@ C
integer num_ent
integer node_map(num_ent)
integer ierr
- integer i
C
integer*4 idne4
- integer*4 startn4
- integer*4 num_ent4
- integer*4 node_map4(num_ent)
integer*4 ierr4
C
idne4 = idne
- startn4 = startn
- num_ent4 = num_ent
- call negnnnm4 (idne4, startn4, num_ent4, node_map4, ierr4)
- do i = 1, num_ent
- node_map(i) = node_map4(i)
- enddo
+ call negnnnm4 (idne4, startn, num_ent, node_map, ierr4)
ierr = ierr4
C
end
@@ -1359,21 +914,12 @@ C
integer num_ent
integer node_map(num_ent)
integer ierr
- integer i
C
integer*4 idne4
- integer*4 startn4
- integer*4 num_ent4
- integer*4 node_map4(num_ent)
integer*4 ierr4
C
idne4 = idne
- startn4 = startn
- num_ent4 = num_ent
- do i = 1, num_ent
- node_map4(i) = node_map(i)
- enddo
- call nepnnnm4 (idne4, startn4, num_ent4, node_map4, ierr4)
+ call nepnnnm4 (idne4, startn, num_ent, node_map, ierr4)
ierr = ierr4
C
end
@@ -1392,58 +938,14 @@ C
integer processor
integer ierr
C
- integer nint_nodes
- integer nbor_nodes
- integer next_nodes
- integer nint_elems
- integer nbor_elems
- integer nnode_cmaps
- integer nelem_cmaps
- call neglbp (idne, nint_nodes, nbor_nodes, next_nodes,
- $ nint_elems, nbor_elems, nnode_cmaps, nelem_cmaps,
- $ processor, ierr)
- if (ierr.ne.0) return
- call negnm2 (idne, node_mapi, node_mapb, node_mape,
- $ processor, ierr,
- $ nint_nodes, nbor_nodes, next_nodes)
-C
- end
-C
- subroutine negnm2 (idne, node_mapi, node_mapb, node_mape,
- $ processor, ierr,
- $ nint_nodes, nbor_nodes, next_nodes)
- implicit none
- integer idne
- integer nint_nodes
- integer nbor_nodes
- integer next_nodes
- integer node_mapi(nint_nodes)
- integer node_mapb(nbor_nodes)
- integer node_mape(next_nodes)
- integer processor
- integer ierr
- integer i
-C
integer*4 idne4
- integer*4 node_mapi4(nint_nodes)
- integer*4 node_mapb4(nbor_nodes)
- integer*4 node_mape4(next_nodes)
integer*4 processor4
integer*4 ierr4
C
idne4 = idne
processor4 = processor
- call negnm4 (idne4, node_mapi4, node_mapb4, node_mape4,
+ call negnm4 (idne4, node_mapi, node_mapb, node_mape,
$ processor4, ierr4)
- do i = 1, nint_nodes
- node_mapi(i) = node_mapi4(i)
- enddo
- do i = 1, nbor_nodes
- node_mapb(i) = node_mapb4(i)
- enddo
- do i = 1, next_nodes
- node_mape(i) = node_mape4(i)
- enddo
ierr = ierr4
C
end
@@ -1462,57 +964,13 @@ C
integer processor
integer ierr
C
- integer nint_nodes
- integer nbor_nodes
- integer next_nodes
- integer nint_elems
- integer nbor_elems
- integer nnode_cmaps
- integer nelem_cmaps
- call neglbp (idne, nint_nodes, nbor_nodes, next_nodes,
- $ nint_elems, nbor_elems, nnode_cmaps, nelem_cmaps,
- $ processor, ierr)
- if (ierr.ne.0) return
- call nepnm2 (idne, node_mapi, node_mapb, node_mape,
- $ processor, ierr,
- $ nint_nodes, nbor_nodes, next_nodes)
-C
- end
-C
- subroutine nepnm2 (idne, node_mapi, node_mapb, node_mape,
- $ processor, ierr,
- $ nint_nodes, nbor_nodes, next_nodes)
- implicit none
- integer idne
- integer nint_nodes
- integer nbor_nodes
- integer next_nodes
- integer node_mapi(nint_nodes)
- integer node_mapb(nbor_nodes)
- integer node_mape(next_nodes)
- integer processor
- integer ierr
-C
integer*4 idne4
- integer*4 node_mapi4(nint_nodes)
- integer*4 node_mapb4(nbor_nodes)
- integer*4 node_mape4(next_nodes)
integer*4 processor4
integer*4 ierr4
C
- INTEGER J1X
idne4 = idne
- DO J1X = 1, NINT_NODES
- NODE_MAPI4(J1X) = NODE_MAPI(J1X)
- END DO
- DO J1X = 1, NBOR_NODES
- NODE_MAPB4(J1X) = NODE_MAPB(J1X)
- END DO
- DO J1X = 1, NEXT_NODES
- NODE_MAPE4(J1X) = NODE_MAPE(J1X)
- END DO
processor4 = processor
- call nepnm4 (idne4, node_mapi4, node_mapb4, node_mape4,
+ call nepnm4 (idne4, node_mapi, node_mapb, node_mape,
$ processor4, ierr4)
ierr = ierr4
C
@@ -1530,49 +988,13 @@ C
integer processor
integer ierr
C
- integer nint_nodes
- integer nbor_nodes
- integer next_nodes
- integer nint_elems
- integer nbor_elems
- integer nnode_cmaps
- integer nelem_cmaps
- call neglbp (idne, nint_nodes, nbor_nodes, next_nodes,
- $ nint_elems, nbor_elems, nnode_cmaps, nelem_cmaps,
- $ processor, ierr)
- if (ierr.ne.0) return
- call negem2 (idne, elem_mapi, elem_mapb, processor, ierr,
- $ nint_elems, nbor_elems)
-C
- end
-C
- subroutine negem2 (idne, elem_mapi, elem_mapb, processor, ierr,
- $ nint_elems, nbor_elems)
- implicit none
- integer idne
- integer nint_elems
- integer nbor_elems
- integer elem_mapi(nint_elems)
- integer elem_mapb(nbor_elems)
- integer processor
- integer ierr
-C
integer*4 idne4
- integer*4 elem_mapi4(nint_elems)
- integer*4 elem_mapb4(nbor_elems)
integer*4 processor4
integer*4 ierr4
C
- INTEGER J1X
idne4 = idne
processor4 = processor
- call negem4 (idne4, elem_mapi4, elem_mapb4, processor4, ierr4)
- DO J1X = 1, NINT_ELEMS
- ELEM_MAPI(J1X) = ELEM_MAPI4(J1X)
- END DO
- DO J1X = 1, NBOR_ELEMS
- ELEM_MAPB(J1X) = ELEM_MAPB4(J1X)
- END DO
+ call negem4 (idne4, elem_mapi, elem_mapb, processor4, ierr4)
ierr = ierr4
C
end
@@ -1589,49 +1011,13 @@ C
integer processor
integer ierr
C
- integer nint_nodes
- integer nbor_nodes
- integer next_nodes
- integer nint_elems
- integer nbor_elems
- integer nnode_cmaps
- integer nelem_cmaps
- call neglbp (idne, nint_nodes, nbor_nodes, next_nodes,
- $ nint_elems, nbor_elems, nnode_cmaps, nelem_cmaps,
- $ processor, ierr)
- if (ierr.ne.0) return
- call nepem2 (idne, elem_mapi, elem_mapb, processor, ierr,
- $ nint_elems, nbor_elems)
-C
- end
-C
- subroutine nepem2 (idne, elem_mapi, elem_mapb, processor, ierr,
- $ nint_elems, nbor_elems)
- implicit none
- integer idne
- integer nint_elems
- integer nbor_elems
- integer elem_mapi(nint_elems)
- integer elem_mapb(nbor_elems)
- integer processor
- integer ierr
-C
integer*4 idne4
- integer*4 elem_mapi4(nint_elems)
- integer*4 elem_mapb4(nbor_elems)
integer*4 processor4
integer*4 ierr4
C
- INTEGER J1X
idne4 = idne
- DO J1X = 1, NINT_ELEMS
- ELEM_MAPI4(J1X) = ELEM_MAPI(J1X)
- END DO
- DO J1X = 1, NBOR_ELEMS
- ELEM_MAPB4(J1X) = ELEM_MAPB(J1X)
- END DO
processor4 = processor
- call nepem4 (idne4, elem_mapi4, elem_mapb4, processor4, ierr4)
+ call nepem4 (idne4, elem_mapi, elem_mapb, processor4, ierr4)
ierr = ierr4
C
end
@@ -1651,58 +1037,14 @@ C
integer processor
integer ierr
C
- integer nint_nodes
- integer nbor_nodes
- integer next_nodes
- integer nint_elems
- integer nbor_elems
- integer nnode_cmaps
- integer nelem_cmaps
- call neglbp (idne, nint_nodes, nbor_nodes, next_nodes,
- $ nint_elems, nbor_elems, nnode_cmaps, nelem_cmaps,
- $ processor, ierr)
- if (ierr.ne.0) return
- call negcmp2 (idne, ncmap_ids, ncmap_node_cnts,
- $ ecmap_ids, ecmap_elem_cnts, processor, ierr,
- $ nnode_cmaps, nelem_cmaps)
-C
- end
-C
- subroutine negcmp2 (idne, ncmap_ids, ncmap_node_cnts,
- $ ecmap_ids, ecmap_elem_cnts, processor, ierr,
- $ nnode_cmaps, nelem_cmaps)
- implicit none
- integer idne
- integer nnode_cmaps
- integer nelem_cmaps
- integer ncmap_ids(nnode_cmaps)
- integer ncmap_node_cnts(nnode_cmaps)
- integer ecmap_ids(nelem_cmaps)
- integer ecmap_elem_cnts(nelem_cmaps)
- integer processor
- integer ierr
-C
integer*4 idne4
- integer*4 ncmap_ids4(nnode_cmaps)
- integer*4 ncmap_node_cnts4(nnode_cmaps)
- integer*4 ecmap_ids4(nelem_cmaps)
- integer*4 ecmap_elem_cnts4(nelem_cmaps)
integer*4 processor4
integer*4 ierr4
C
- INTEGER J1X
idne4 = idne
processor4 = processor
- call negcmp4 (idne4, ncmap_ids4, ncmap_node_cnts4,
- $ ecmap_ids4, ecmap_elem_cnts4, processor4, ierr4)
- DO J1X = 1, NNODE_CMAPS
- NCMAP_IDS(J1X) = NCMAP_IDS4(J1X)
- NCMAP_NODE_CNTS(J1X) = NCMAP_NODE_CNTS4(J1X)
- END DO
- DO J1X = 1, NELEM_CMAPS
- ECMAP_IDS(J1X) = ECMAP_IDS4(J1X)
- ECMAP_ELEM_CNTS(J1X) = ECMAP_ELEM_CNTS4(J1X)
- END DO
+ call negcmp4 (idne4, ncmap_ids, ncmap_node_cnts,
+ $ ecmap_ids, ecmap_elem_cnts, processor4, ierr4)
ierr = ierr4
C
end
@@ -1721,59 +1063,15 @@ C
integer emap_elem_cnts(*)
integer processor
integer ierr
-C
- integer nint_nodes
- integer nbor_nodes
- integer next_nodes
- integer nint_elems
- integer nbor_elems
- integer nnode_cmaps
- integer nelem_cmaps
- call neglbp (idne, nint_nodes, nbor_nodes, next_nodes,
- $ nint_elems, nbor_elems, nnode_cmaps, nelem_cmaps,
- $ processor, ierr)
- if (ierr.ne.0) return
- call nepcmp2 (idne, nmap_ids, nmap_node_cnts, emap_ids,
- $ emap_elem_cnts, processor, ierr,
- $ nnode_cmaps, nelem_cmaps)
-C
- end
-C
- subroutine nepcmp2 (idne, nmap_ids, nmap_node_cnts, emap_ids,
- $ emap_elem_cnts, processor, ierr,
- $ nnode_cmaps, nelem_cmaps)
- implicit none
- integer idne
- integer nnode_cmaps
- integer nelem_cmaps
- integer nmap_ids(nnode_cmaps)
- integer nmap_node_cnts(nnode_cmaps)
- integer emap_ids(nelem_cmaps)
- integer emap_elem_cnts(nelem_cmaps)
- integer processor
- integer ierr
-C
+
integer*4 idne4
- integer*4 nmap_ids4(nnode_cmaps)
- integer*4 nmap_node_cnts4(nnode_cmaps)
- integer*4 emap_ids4(nelem_cmaps)
- integer*4 emap_elem_cnts4(nelem_cmaps)
integer*4 processor4
integer*4 ierr4
C
- INTEGER J1X
idne4 = idne
- DO J1X = 1, NNODE_CMAPS
- NMAP_IDS4(J1X) = NMAP_IDS(J1X)
- NMAP_NODE_CNTS4(J1X) = NMAP_NODE_CNTS(J1X)
- END DO
- DO J1X = 1, NELEM_CMAPS
- EMAP_IDS4(J1X) = EMAP_IDS(J1X)
- EMAP_ELEM_CNTS4(J1X) = EMAP_ELEM_CNTS(J1X)
- END DO
processor4 = processor
- call nepcmp4 (idne4, nmap_ids4, nmap_node_cnts4, emap_ids4,
- $ emap_elem_cnts4, processor4, ierr4)
+ call nepcmp4 (idne4, nmap_ids, nmap_node_cnts, emap_ids,
+ $ emap_elem_cnts, processor4, ierr4)
ierr = ierr4
C
end
@@ -1794,8 +1092,14 @@ C
integer eproc_ptrs(*)
integer ierr
- write (0,*) 'nepcmpc: addrwrap not implemented'
- stop
+ integer*4 idne4
+ integer*4 ierr4
+C
+ idne4 = idne
+ call nepcmpc4 (idne4, nmap_ids, nmap_node_cnts,
+ $ nproc_ptrs, emap_ids, emap_elem_cnts, eproc_ptrs, ierr4)
+ ierr = ierr4
+
end
C-----------------------------------------------------------------------
@@ -1812,90 +1116,17 @@ C
integer processor
integer ierr
C
- integer nint_nodes
- integer nbor_nodes
- integer next_nodes
- integer nint_elems
- integer nbor_elems
- integer nnode_cmaps
- integer nelem_cmaps
- call neglbp (idne, nint_nodes, nbor_nodes, next_nodes,
- $ nint_elems, nbor_elems, nnode_cmaps, nelem_cmaps,
- $ processor, ierr)
- if (ierr.ne.0) return
- call negncm2 (idne, map_id, node_ids, proc_ids,
- $ processor, ierr, nnode_cmaps, nelem_cmaps)
-C
- end
-C
- subroutine negncm2 (idne, map_id, node_ids, proc_ids,
- $ processor, ierr, nnode_cmaps, nelem_cmaps)
- implicit none
- integer idne
- integer map_id
- integer node_ids(*)
- integer proc_ids(*)
- integer processor
- integer nnode_cmaps
- integer nelem_cmaps
- integer ierr
-C
- integer ncmap_ids(nnode_cmaps)
- integer ncmap_node_cnts(nnode_cmaps)
- integer ecmap_ids(nelem_cmaps)
- integer ecmap_elem_cnts(nelem_cmaps)
- integer node_cnt, i
-C
- call negcmp2 (idne, ncmap_ids, ncmap_node_cnts,
- $ ecmap_ids, ecmap_elem_cnts, processor, ierr,
- $ nnode_cmaps, nelem_cmaps)
- if (ierr.ne.0) return
- node_cnt = -1
- do i = 1, nnode_cmaps
- if (ncmap_ids(i) .eq. map_id) then
- node_cnt = ncmap_node_cnts(i)
- end if
- end do
- if (node_cnt .eq. -1) then
- ierr = -1
- return
- end if
- call negncm3 (idne, map_id, node_ids, proc_ids,
- $ processor, ierr, node_cnt)
-C
- end
-C
- subroutine negncm3 (idne, map_id, node_ids, proc_ids,
- $ processor, ierr, node_cnt)
- implicit none
- integer idne
- integer map_id
- integer node_cnt
- integer node_ids(node_cnt)
- integer proc_ids(node_cnt)
- integer processor
- integer ierr
-C
integer*4 idne4
- integer*4 map_id4
- integer*4 node_ids4(node_cnt)
- integer*4 proc_ids4(node_cnt)
integer*4 processor4
integer*4 ierr4
C
- INTEGER J1X
idne4 = idne
- map_id4 = map_id
- processor4 = processor
- call negncm4 (idne4, map_id4, node_ids4, proc_ids4,
- $ processor4, ierr4)
- DO J1X = 1, NODE_CNT
- NODE_IDS(J1X) = NODE_IDS4(J1X)
- PROC_IDS(J1X) = PROC_IDS4(J1X)
- END DO
- ierr = ierr4
+ processor4 = processor
+ call negncm4 (idne4, map_id, node_ids, proc_ids,
+ $ processor4, ierr4)
+ ierr = ierr4
C
- end
+ end
C-----------------------------------------------------------------------
C
@@ -1911,103 +1142,17 @@ C
integer processor
integer ierr
C
- integer nint_nodes
- integer nbor_nodes
- integer next_nodes
- integer nint_elems
- integer nbor_elems
- integer nnode_cmaps
- integer nelem_cmaps
- call neglbp (idne, nint_nodes, nbor_nodes, next_nodes,
- $ nint_elems, nbor_elems, nnode_cmaps, nelem_cmaps,
- $ processor, ierr)
- if (ierr.ne.0) return
- call nepncm2 (idne, map_id, node_ids, proc_ids,
- $ processor, ierr, nnode_cmaps, nelem_cmaps)
-C
- end
-C
- subroutine nepncm2 (idne, map_id, node_ids, proc_ids,
- $ processor, ierr, nnode_cmaps, nelem_cmaps)
- implicit none
-
-
-
-
-
-
-
-
-
-
-
-
-
- integer idne
- integer map_id
- integer node_ids(*)
- integer proc_ids(*)
- integer processor
- integer nnode_cmaps
- integer nelem_cmaps
- integer ierr
-C
- integer ncmap_ids(nnode_cmaps)
- integer ncmap_node_cnts(nnode_cmaps)
- integer ecmap_ids(nelem_cmaps)
- integer ecmap_elem_cnts(nelem_cmaps)
- integer node_cnt, i
-C
- call negcmp2 (idne, ncmap_ids, ncmap_node_cnts,
- $ ecmap_ids, ecmap_elem_cnts, processor, ierr,
- $ nnode_cmaps, nelem_cmaps)
- if (ierr.ne.0) return
- node_cnt = -1
- do i = 1, nnode_cmaps
- if (ncmap_ids(i) .eq. map_id) then
- node_cnt = ncmap_node_cnts(i)
- end if
- end do
- if (node_cnt .eq. -1) then
- ierr = -1
- return
- end if
- call nepncm3 (idne, map_id, node_ids, proc_ids,
- $ processor, ierr, node_cnt)
-C
- end
-C
- subroutine nepncm3 (idne, map_id, node_ids, proc_ids,
- $ processor, ierr, node_cnt)
- implicit none
- integer idne
- integer map_id
- integer node_cnt
- integer node_ids(node_cnt)
- integer proc_ids(node_cnt)
- integer processor
- integer ierr
-C
integer*4 idne4
- integer*4 map_id4
- integer*4 node_ids4(node_cnt)
- integer*4 proc_ids4(node_cnt)
integer*4 processor4
integer*4 ierr4
C
- INTEGER J1X
idne4 = idne
- map_id4 = map_id
- DO J1X = 1, NODE_CNT
- NODE_IDS4(J1X) = NODE_IDS(J1X)
- PROC_IDS4(J1X) = PROC_IDS(J1X)
- END DO
- processor4 = processor
- call nepncm4 (idne4, map_id4, node_ids4, proc_ids4,
- $ processor4, ierr4)
- ierr = ierr4
+ processor4 = processor
+ call nepncm4 (idne4, map_id, node_ids, proc_ids,
+ $ processor4, ierr4)
+ ierr = ierr4
C
- end
+ end
C-----------------------------------------------------------------------
C
@@ -2023,95 +1168,18 @@ C
integer proc_ids(*)
integer processor
integer ierr
-C
- integer nint_nodes
- integer nbor_nodes
- integer next_nodes
- integer nint_elems
- integer nbor_elems
- integer nnode_cmaps
- integer nelem_cmaps
- call neglbp (idne, nint_nodes, nbor_nodes, next_nodes,
- $ nint_elems, nbor_elems, nnode_cmaps, nelem_cmaps,
- $ processor, ierr)
- if (ierr.ne.0) return
- call negecm2 (idne, map_id, elem_ids, side_ids,
- $ proc_ids, processor, ierr, nnode_cmaps, nelem_cmaps)
-C
- end
-C
- subroutine negecm2 (idne, map_id, elem_ids, side_ids,
- $ proc_ids, processor, ierr, nnode_cmaps, nelem_cmaps)
- implicit none
- integer idne
- integer map_id
- integer elem_ids(*)
- integer side_ids(*)
- integer proc_ids(*)
- integer processor
- integer nnode_cmaps
- integer nelem_cmaps
- integer ierr
-C
- integer ncmap_ids(nnode_cmaps)
- integer ncmap_node_cnts(nnode_cmaps)
- integer ecmap_ids(nelem_cmaps)
- integer ecmap_elem_cnts(nelem_cmaps)
- integer elem_cnt,i
-C
- call negcmp2 (idne, ncmap_ids, ncmap_node_cnts,
- $ ecmap_ids, ecmap_elem_cnts, processor, ierr,
- $ nnode_cmaps, nelem_cmaps)
- if (ierr.ne.0) return
- elem_cnt = -1
- do i = 1, nelem_cmaps
- if (ecmap_ids(i) .eq. map_id) then
- elem_cnt = ecmap_elem_cnts(i)
- end if
- end do
- if (elem_cnt .eq. -1) then
- ierr = -1
- return
- end if
- call negecm3 (idne, map_id, elem_ids, side_ids,
- $ proc_ids, processor, ierr, elem_cnt)
-C
- end
-C
- subroutine negecm3 (idne, map_id, elem_ids, side_ids,
- $ proc_ids, processor, ierr, elem_cnt)
- implicit none
- integer idne
- integer map_id
- integer elem_cnt
- integer elem_ids(elem_cnt)
- integer side_ids(elem_cnt)
- integer proc_ids(elem_cnt)
- integer processor
- integer ierr
-C
+
integer*4 idne4
- integer*4 map_id4
- integer*4 elem_ids4(elem_cnt)
- integer*4 side_ids4(elem_cnt)
- integer*4 proc_ids4(elem_cnt)
integer*4 processor4
integer*4 ierr4
C
- INTEGER J1X
idne4 = idne
- map_id4 = map_id
- processor4 = processor
- call negecm4 (idne4, map_id4, elem_ids4, side_ids4,
- $ proc_ids4, processor4, ierr4)
- DO J1X = 1, ELEM_CNT
- ELEM_IDS(J1X) = ELEM_IDS4(J1X)
- SIDE_IDS(J1X) = SIDE_IDS4(J1X)
- PROC_IDS(J1X) = PROC_IDS4(J1X)
- END DO
- ierr = ierr4
+ processor4 = processor
+ call negecm4 (idne4, map_id, elem_ids, side_ids,
+ $ proc_ids, processor4, ierr4)
+ ierr = ierr4
C
- end
+ end
C-----------------------------------------------------------------------
C
@@ -2127,94 +1195,17 @@ C
integer proc_ids(*)
integer processor
integer ierr
-C
- integer nint_nodes
- integer nbor_nodes
- integer next_nodes
- integer nint_elems
- integer nbor_elems
- integer nnode_cmaps
- integer nelem_cmaps
- call neglbp (idne, nint_nodes, nbor_nodes, next_nodes,
- $ nint_elems, nbor_elems, nnode_cmaps, nelem_cmaps,
- $ processor, ierr)
- if (ierr.ne.0) return
- call nepecm2 (idne, map_id, elem_ids, side_ids,
- $ proc_ids, processor, ierr, nnode_cmaps, nelem_cmaps)
-C
- end
-C
- subroutine nepecm2 (idne, map_id, elem_ids, side_ids,
- $ proc_ids, processor, ierr, nnode_cmaps, nelem_cmaps)
- implicit none
- integer idne
- integer map_id
- integer elem_ids(*)
- integer side_ids(*)
- integer proc_ids(*)
- integer processor
- integer nnode_cmaps
- integer nelem_cmaps
- integer ierr
-C
- integer ncmap_ids(nnode_cmaps)
- integer ncmap_node_cnts(nnode_cmaps)
- integer ecmap_ids(nelem_cmaps)
- integer ecmap_elem_cnts(nelem_cmaps)
- integer elem_cnt,i
-C
- call negcmp2 (idne, ncmap_ids, ncmap_node_cnts,
- $ ecmap_ids, ecmap_elem_cnts, processor, ierr,
- $ nnode_cmaps, nelem_cmaps)
- if (ierr.ne.0) return
- elem_cnt = -1
- do i = 1, nelem_cmaps
- if (ecmap_ids(i) .eq. map_id) then
- elem_cnt = ecmap_elem_cnts(i)
- end if
- end do
- if (elem_cnt .eq. -1) then
- ierr = -1
- return
- end if
- call nepecm3 (idne, map_id, elem_ids, side_ids,
- $ proc_ids, processor, ierr, elem_cnt)
-C
- end
-C
- subroutine nepecm3 (idne, map_id, elem_ids, side_ids,
- $ proc_ids, processor, ierr, elem_cnt)
- implicit none
- integer idne
- integer map_id
- integer elem_cnt
- integer elem_ids(elem_cnt)
- integer side_ids(elem_cnt)
- integer proc_ids(elem_cnt)
- integer processor
- integer ierr
-C
+
integer*4 idne4
- integer*4 map_id4
- integer*4 elem_ids4(elem_cnt)
- integer*4 side_ids4(elem_cnt)
- integer*4 proc_ids4(elem_cnt)
integer*4 processor4
integer*4 ierr4
-C
- INTEGER J1X
+
idne4 = idne
- map_id4 = map_id
- DO J1X = 1, ELEM_CNT
- ELEM_IDS4(J1X) = ELEM_IDS(J1X)
- SIDE_IDS4(J1X) = SIDE_IDS(J1X)
- PROC_IDS4(J1X) = PROC_IDS(J1X)
- END DO
- processor4 = processor
- call nepecm4 (idne4, map_id4, elem_ids4, side_ids4,
- $ proc_ids4, processor4, ierr4)
- ierr = ierr4
-C
+ processor4 = processor
+ call nepecm4 (idne4, map_id, elem_ids, side_ids,
+ $ proc_ids, processor4, ierr4)
+ ierr = ierr4
+
end
C-----------------------------------------------------------------------
#endif
diff --git a/nemesis/forbind/ne_test.F b/nemesis/forbind/ne_ftest.F
similarity index 99%
rename from nemesis/forbind/ne_test.F
rename to nemesis/forbind/ne_ftest.F
index 1c5dde0..08c3330 100644
--- a/nemesis/forbind/ne_test.F
+++ b/nemesis/forbind/ne_ftest.F
@@ -191,7 +191,6 @@ C Test the output of the element map
END IF
C Test the output of the concatenated communication map params
-#ifndef Build64
PRINT*, 'testing concatenated communication map params output...'
CALL NETPCMPC(NEID, IERR)
IF (IERR.NE.0) THEN
@@ -204,7 +203,6 @@ C Test the output of the concatenated communication map params
PRINT*, '...successful'
T_PASS = T_PASS + 1
END IF
-#endif
C Test nodal communication map output
PRINT*, 'testing nodal communication map output...'
diff --git a/nemesis/forbind/ne_jack.src b/nemesis/forbind/ne_jack.src
deleted file mode 100644
index 6e28b75..0000000
--- a/nemesis/forbind/ne_jack.src
+++ /dev/null
@@ -1,1498 +0,0 @@
-/*
- * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*====================================================================
- * ------------------------
- * | CVS File Information |
- * ------------------------
- *
- * $RCSfile: ne_jack.src,v $
- *
- * $Author: gdsjaar $
- *
- * $Date: 2007/10/31 21:39:17 $
- *
- * $Revision: 1.14 $
- *
- *====================================================================*/
-%*
-%* Meta-source for various versions of NemesisI FORTRAN jacket library.
-%*
-%* Patterned after the exo_jack.src ExodusII library.
-%*
-%* 02/03/97 M.M. St. John
-%*
-%* After minor preprocessing via a sed script, this file becomes source
-%* to the m4 macro processor for a C library to be called from FORTRAN.
-%* The main differences between this source and C are the way function
-%* prototypes are declared. All such declarations occur in lines beginning
-%* with the "%" character. A sed script converts these into calls to m4
-%* macros for handling the various conventions for calling C functions from
-%* FORTRAN. Formal parameters corresponding to FORTRAN character strings
-%* must be declared using the pseudo type "string". Appending "len" to the
-%* name of such variables is the convention used for variables representing
-%* the FORTRAN length of string parameters.
-%*
-%* For example, the following input
-%*
-%* % void
-%* % ncadel (
-%* % int *cdfid, /* netCDF ID */
-%* % int *varid, /* variable ID */
-%* % string attname, /* attribute name */
-%* % int *rcode /* returned error code */
-%* % )
-%* % {
-%*
-%* will be converted to the following m4 macro calls:
-%*
-%* void`'M4__dnl
-%* M4__PROTO(`ncadel',
-%* `INTSTAR(cdfid)',
-%* `INTSTAR(varid)',
-%* `STRING(attname)',
-%* `INTSTAR(rcode)'
-%* )
-%* {M4__LOCALS
-%*
-%* which may be converted to the following C, using sun.m4 and common.m4
-%*
-%* void
-%* ncadel_ (cdfid, varid, attname, rcode, attnamelen)
-%* int *cdfid;
-%* int *varid;
-%* char *attname;
-%* int attnamelen;
-%* int *rcode;
-%* {
-%*
-/*
- * OVERVIEW
- *
- * This file contains jacket routines written in C for interfacing Fortran
- * NemesisI function calls to the actual C binding for NemsisI. This code
- * is written explicitly for M4__SYSTEM. In general, these functions handle
- * character-string parameter conventions, convert between
- * column-major-order arrays and row-major-order arrays, and map between
- * array indices beginning at one and array indices beginning at zero.
- *
- */
-
-/* LINTLIBRARY */
-#include <ctype.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "netcdf.h"
-#include "exodusII.h"
-#include "exodusII_int.h"
-#include "ne_nemesisI.h"
-#include "ne_nemesisI_int.h"
-
-M4__STRING_DESCRIPTOR_INCLUDES
-
-M4__FORTRAN_DEFINES
-extern int ncopts; /* default is (NC_FATAL | NC_VERBOSE) */
-extern int exerrval; /* global int that contains a Exodus-specific error code */
-
-/* blank fill C string to make FORTRAN string */
-void
-ne_fcdcpy (fstring, fslen, sstring)
- char *fstring; /* output string to be blank-filled */
- int fslen; /* length of output string */
- char *sstring; /* input string, null-terminated */
-{
- int i, len = strlen(sstring);
-
- for (i = 0; i < len; i++)
- *(fstring + i) = *(sstring + i);
- for (i = len; i < fslen; i++)
- *(fstring + i) = ' ';
-}
-
-/* ne_lenstr - string length (w/o trailing blanks) */
-int ne_lenstr (char *string)
-{
- char *ptr;
-
- ptr=string+strlen(string); /* start at end of string including blanks */
- while (*(--ptr) == ' '); /* skip blanks */
- return(ptr-string+1); /* return trimmed length of string */
-}
-
-/* copy function used to copy strings and strip trailing blanks */
-void
-ne_fstrncpy (target, source, maxlen)
- char *target; /* space to be copied into */
- char *source; /* string to be copied */
- int maxlen; /* maximum length of *source */
-{
- while (maxlen-- && *source != '\0')
- *target++ = *source++;
- while (*(--target) == ' '); /* strip blanks */
- *(++target) = '\0'; /* insert new EOS marker */
-}
-
-/*
- * NOTE: there were some other helper functions in exo_jack.src
- * that might be needed for future functions in the NEMESIS API.
- * However, in the interest of saving space I am removing these
- * for now. The functions are:
- * nstrncpy - copy string terminated with blanks
- * fstra2cstra - copy 1D Fortran string arrays into C string arrays
- * cstra2fstra - copy 1D C string arrays into Fortran string arrays
- * fstra2cstra2d - copy 2D Fortran string arrays into C string arrays
- * cstra2fstra2d - copy 2D C string arrays into Fortran string arrays
- * dimprod - Compute product of dimensions
- * itob - convert array of bytes stored in ints to array of bytes
- * itos - convert array of shorts stored in ints to array of shorts
- *
- * any of these functions can be copied from exo_jack.src in the future
- * if they are needed.
- */
-
-/* ------------ M4__SYSTEM FORTRAN jackets for NEMESIS I Functions ---------- */
-
-/*
- * Get initial information from nemesis file
- */
-% void
-% negii (
-% int *idne, /* NEMESIS file ID */
-% int *nproc, /* Number of processors */
-% int *nproc_in_f, /* Number of procs in this file */
-% string ftype, /* NEMESIS file type (parallel or scaler) */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- int slen;
- char *file_type;
-
- /* WARNING: ftypelen SHOULD be 1, but may not be depending on how
- the Fortran programmer passed it. It is best at
- this time to hard code it per NEPII spec. */
- slen = 1;
- if (ftypelen != 1)
- {
- slen = ftypelen;
-#if defined(EXODUS_STRING_LENGTH_WARNING)
- sprintf(errmsg,"Warning: file type string length is %d in file id %d\n",
- ftypelen, *idne);
- ex_err("negii",errmsg,EX_MSG);
-#endif
- }
-
- file_type = (char *) malloc((slen+1)*sizeof(char));
-
- if ((*ierr = ne_get_init_info(*idne, nproc, nproc_in_f, file_type)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to get initial information from file id %d",
- *idne);
- ex_err("negii",errmsg,EX_MSG);
- }
-
- if (*ierr == 0)
- ne_fcdcpy (ftype, slen, file_type);
-
- free(file_type);
-}
-
-/*
- * Write initial information from nemesis file
- */
-% void
-% nepii (
-% int *idne, /* NEMESIS file ID */
-% int *nproc, /* Number of processors */
-% int *nproc_in_f, /* Number of procs in this file */
-% string ftype, /* NEMESIS file type (parallel or scaler) */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- int slen;
- char *file_type;
-
- /* WARNING: ftypelen SHOULD be 1, but may not be depending on how
- the Fortran programmer passed it. It is best at
- this time to hard code it per NEPII spec. */
- slen = 1;
- if (ftypelen != 1)
- {
- slen = ftypelen;
-#if defined(EXODUS_STRING_LENGTH_WARNING)
- sprintf(errmsg,"Warning: file type string length is %d in file id %d\n",
- ftypelen, *idne);
- ex_err("nepii",errmsg,EX_MSG);
-#endif
- }
-
- file_type = (char *) malloc((slen+1)*sizeof(char));
-
- (void) ne_fstrncpy (file_type, ftype, slen);
-
- if ((*ierr = ne_put_init_info(*idne, *nproc, *nproc_in_f, file_type)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to put initial information in file id %d",
- *idne);
- ex_err("nepii",errmsg,EX_MSG);
- }
-
- free(file_type);
-}
-
-/*
- * Read initial global information
- */
-% void
-% negig (
-% int *idne, /* NEMESIS file ID */
-% int *nnodes_g, /* Number of global FEM nodes */
-% int *nelems_g, /* Number of global FEM elements */
-% int *nelem_blks_g, /* Number of global elem blocks */
-% int *nnode_sets_g, /* Number of global node sets */
-% int *nside_sets_g, /* Number of global side sets */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_get_init_global(*idne, nnodes_g, nelems_g, nelem_blks_g,
- nnode_sets_g, nside_sets_g)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to read initial global information from file id %d",
- *idne);
- ex_err("negig",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write initial global information
- */
-% void
-% nepig (
-% int *idne, /* NEMESIS file ID */
-% int *nnodes_g, /* Number of global FEM nodes */
-% int *nelems_g, /* Number of global FEM elements */
-% int *nelem_blks_g, /* Number of global elem blocks */
-% int *nnode_sets_g, /* Number of global node sets */
-% int *nside_sets_g, /* Number of global side sets */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_init_global(*idne, *nnodes_g, *nelems_g, *nelem_blks_g,
- *nnode_sets_g, *nside_sets_g)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to store initial global information in file id %d",
- *idne);
- ex_err("nepig",errmsg,EX_MSG);
- }
-}
-
-/*
- * Read load balance parameters
- */
-% void
-% neglbp (
-% int *idne, /* NEMESIS file ID */
-% int *nint_nodes, /* Number of internal FEM nodes */
-% int *nbor_nodes, /* Number of border FEM nodes */
-% int *next_nodes, /* Number of external FEM nodes */
-% int *nint_elems, /* Number of internal FEM elems */
-% int *nbor_elems, /* Number of border FEM elems */
-% int *nnode_cmaps, /* Number of nodal comm maps */
-% int *nelem_cmaps, /* Number of elemental comm maps */
-% int *processor, /* Processor ID */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_get_loadbal_param(*idne, nint_nodes, nbor_nodes,
- next_nodes, nint_elems, nbor_elems,
- nnode_cmaps, nelem_cmaps, *processor)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to read load balance parameters from file id %d",
- *idne);
- ex_err("neglbp",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write load balance parameters
- */
-% void
-% neplbp (
-% int *idne, /* NEMESIS file ID */
-% int *nint_nodes, /* Number of internal FEM nodes */
-% int *nbor_nodes, /* Number of border FEM nodes */
-% int *next_nodes, /* Number of external FEM nodes */
-% int *nint_elems, /* Number of internal FEM elems */
-% int *nbor_elems, /* Number of border FEM elems */
-% int *nnode_cmaps, /* Number of nodal comm maps */
-% int *nelem_cmaps, /* Number of elemental comm maps */
-% int *processor, /* Processor ID */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_loadbal_param(*idne, *nint_nodes, *nbor_nodes,
- *next_nodes, *nint_elems, *nbor_elems,
- *nnode_cmaps, *nelem_cmaps,
- *processor)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to store load balance parameters in file id %d",
- *idne);
- ex_err("neplbp",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write concatenated load balance parameters
- */
-% void
-% neplbpc (
-% int *idne, /* NEMESIS file ID */
-% int *nint_nodes, /* Number of internal node IDs */
-% int *nbor_nodes, /* Number of border node IDs */
-% int *next_nodes, /* Number of external node IDs */
-% int *nint_elems, /* Number of internal elem IDs */
-% int *nbor_elems, /* Number of border elem IDs */
-% int *nnode_cmaps, /* Number of nodal comm maps */
-% int *nelem_cmaps, /* Number of elem comm maps */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_loadbal_param_cc(*idne, nint_nodes, nbor_nodes,
- next_nodes, nint_elems, nbor_elems,
- nnode_cmaps, nelem_cmaps)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to store load balance parameters in file id %d",
- *idne);
- ex_err("neplbpc",errmsg,EX_MSG);
- }
-}
-
-/*
- * Read global node set parameters
- */
-% void
-% negnspg (
-% int *idne, /* NEMESIS file ID */
-% int *ns_ids_glob, /* Global IDs of node sets */
-% int *ns_n_cnt_glob, /* Count of nodes in node sets */
-% int *ns_df_cnt_glob, /* Count of dist. factors in ns */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_get_ns_param_global(*idne, ns_ids_glob, ns_n_cnt_glob,
- ns_df_cnt_glob)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to read global node set parameters from file id %d",
- *idne);
- ex_err("negnspg",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write global node set parameters
- */
-% void
-% nepnspg (
-% int *idne, /* NEMESIS file ID */
-% int *global_ids, /* Vector of global node-set IDs */
-% int *global_n_cnts, /* Vector of node counts in node-sets */
-% int *global_df_cnts, /* Vector of dist factor counts in node-sets */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_ns_param_global(*idne, global_ids, global_n_cnts,
- global_df_cnts)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to store global node set parameters in file id %d",
- *idne);
- ex_err("nepnspg",errmsg,EX_MSG);
- }
-}
-
-/*
- * Read global side set parameters
- */
-% void
-% negsspg (
-% int *idne, /* NEMESIS file ID */
-% int *ss_ids_glob, /* Global IDs of side sets */
-% int *ss_n_cnt_glob, /* Count of nodes in side sets */
-% int *ss_df_cnt_glob, /* Count of dist. factors in ss */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_get_ss_param_global(*idne, ss_ids_glob, ss_n_cnt_glob,
- ss_df_cnt_glob)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to read global side set parameters from file id %d",
- *idne);
- ex_err("negsspg",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write global side set parameters
- */
-% void
-% nepsspg (
-% int *idne, /* NEMESIS file ID */
-% int *global_ids, /* Vector of global side-set IDs */
-% int *global_el_cnts, /* Vector of element/side counts in each side set */
-% int *global_df_cnts, /* Vector of dist. factor counts in each side set */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_ss_param_global(*idne, global_ids, global_el_cnts,
- global_df_cnts)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to store global side set parameters in file id %d",
- *idne);
- ex_err("nepsspg",errmsg,EX_MSG);
- }
-}
-
-/*
- * Read global element block information
- */
-% void
-% negebig (
-% int *idne, /* NEMESIS file ID */
-% int *el_blk_ids, /* Vector of global element IDs */
-% int *el_blk_cnts, /* Vector of global element counts */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_get_eb_info_global(*idne, el_blk_ids, el_blk_cnts)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to read global element block info from file id %d",
- *idne);
- ex_err("negebig",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write global element block information
- */
-% void
-% nepebig (
-% int *idne, /* NEMESIS file ID */
-% int *el_blk_ids, /* Vector of global element IDs */
-% int *el_blk_cnts, /* Vector of global element counts */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_eb_info_global(*idne, el_blk_ids, el_blk_cnts)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to store global element block info in file id %d",
- *idne);
- ex_err("nepebig",errmsg,EX_MSG);
- }
-}
-
-/*
- * Read side set element list and side set side list
- */
-% void
-% negnss (
-% int *idne, /* NEMESIS file ID */
-% int *ss_id, /* Side-set ID to read */
-% int *start_side_num, /* Starting element number */
-% int *num_sides, /* Number of sides to read */
-% int *ss_elem_list, /* List of element IDs */
-% int *ss_side_list, /* List of side IDs */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_get_n_side_set(*idne, *ss_id, *start_side_num, *num_sides,
- ss_elem_list, ss_side_list)) != 0)
-
- {
- sprintf(errmsg,
- "Error: failed to read side set element list from file id %d",
- *idne);
- ex_err("negnss",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write side set element list and side set side list
- */
-% void
-% nepnss (
-% int *idne, /* NEMESIS file ID */
-% int *ss_id, /* Side-set ID to write */
-% int *start_side_num, /* Starting element number */
-% int *num_sides, /* Number of sides to write */
-% int *ss_elem_list, /* List of element IDs */
-% int *ss_side_list, /* List of side IDs */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_n_side_set(*idne, *ss_id, *start_side_num, *num_sides,
- ss_elem_list, ss_side_list)) != 0)
-
- {
- sprintf(errmsg,
- "Error: failed to write side set element list to file id %d",
- *idne);
- ex_err("nepnss",errmsg,EX_MSG);
- }
-}
-
-/*
- * Read side set distribution factor
- */
-% void
-% negnssd (
-% int *idne, /* NEMESIS file ID */
-% int *ss_id, /* Side-set ID */
-% int *start_num, /* Starting df number */
-% int *num_df_to_get /* Number of df's to read */
-% real *ss_df, /* Distribution factors */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_get_n_side_set_df(*idne, *ss_id, *start_num,
- *num_df_to_get, ss_df)) != 0)
-
- {
- sprintf(errmsg,
- "Error: failed to read side set dist factor from file id %d",
- *idne);
- ex_err("negnssd",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write side set distribution factor
- */
-% void
-% nepnssd (
-% int *idne, /* NEMESIS file ID */
-% int *ss_id, /* Side-set ID */
-% int *start_num, /* Starting df number */
-% int *num_df_to_get /* Number of df's to write */
-% real *ss_df, /* Distribution factors */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_n_side_set_df(*idne, *ss_id, *start_num,
- *num_df_to_get, ss_df)) != 0)
-
- {
- sprintf(errmsg,
- "Error: failed to write side set dist factor to file id %d",
- *idne);
- ex_err("nepnssd",errmsg,EX_MSG);
- }
-}
-
-/*
- * Read node set list for a single node set
- */
-% void
-% negnns (
-% int *idne, /* NEMESIS file ID */
-% int *ns_id, /* Node set ID */
-% int *start_node_num, /* Node index to start reading at */
-% int *num_node, /* Number of nodes to read */
-% int *ns_node_list, /* List of nodes in node set */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_get_n_node_set(*idne, *ns_id, *start_node_num,
- *num_node, ns_node_list)) != 0)
-
- {
- sprintf(errmsg,
- "Error: failed to read node set node list from file id %d",
- *idne);
- ex_err("negnns",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write node set list for a single node set
- */
-% void
-% nepnns (
-% int *idne, /* NEMESIS file ID */
-% int *ns_id, /* Node set ID */
-% int *start_node_num, /* Node index to start writing at */
-% int *num_node, /* Number of nodes to write */
-% int *ns_node_list, /* List of nodes in node set */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_n_node_set(*idne, *ns_id, *start_node_num,
- *num_node, ns_node_list)) != 0)
-
- {
- sprintf(errmsg,
- "Error: failed to write node set node list to file id %d",
- *idne);
- ex_err("nepnns",errmsg,EX_MSG);
- }
-}
-
-/*
- * Read node set distribution factor
- */
-% void
-% negnnsd (
-% int *idne, /* NEMESIS file ID */
-% int *ns_id, /* Node-set ID */
-% int *start_num, /* Starting df number */
-% int *num_df_to_get /* Number of df's to read */
-% real *ns_df, /* Distribution factors */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_get_n_node_set_df(*idne, *ns_id, *start_num,
- *num_df_to_get, ns_df)) != 0)
-
- {
- sprintf(errmsg,
- "Error: failed to read node set dist factor from file id %d",
- *idne);
- ex_err("negnnsd",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write node set distribution factor
- */
-% void
-% nepnnsd (
-% int *idne, /* NEMESIS file ID */
-% int *ns_id, /* Node-set ID */
-% int *start_num, /* Starting df number */
-% int *num_df_to_get /* Number of df's to write */
-% real *ns_df, /* Distribution factors */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_n_node_set_df(*idne, *ns_id, *start_num,
- *num_df_to_get, ns_df)) != 0)
-
- {
- sprintf(errmsg,
- "Error: failed to write node set dist factor to file id %d",
- *idne);
- ex_err("nepnnsd",errmsg,EX_MSG);
- }
-}
-
-/*
- * Read coordinates of the nodes
- */
-% void
-% negcor (
-% int *idne, /* NEMESIS file ID */
-% int *start_node_num, /* Starting position to read from */
-% int *num_nodes, /* Number of coords to read */
-% real *x_coor, /* Vector of X coordinates */
-% real *y_coor, /* Vector of Y coordinates */
-% real *z_coor, /* Vector of Z coordinates */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_get_n_coord(*idne, *start_node_num, *num_nodes,
- x_coor, y_coor, z_coor)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to read node coordinates from file id %d",
- *idne);
- ex_err("negcor",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write coordinates of the nodes
- */
-% void
-% nepcor (
-% int *idne, /* NEMESIS file ID */
-% int *start_node_num, /* Starting position to read from */
-% int *num_nodes, /* Number of coords to read */
-% real *x_coor, /* Vector of X coordinates */
-% real *y_coor, /* Vector of Y coordinates */
-% real *z_coor, /* Vector of Z coordinates */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_n_coord(*idne, *start_node_num, *num_nodes,
- x_coor, y_coor, z_coor)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to write node coordinates to file id %d",
- *idne);
- ex_err("nepcor",errmsg,EX_MSG);
- }
-}
-
-/*
- * Read an element block's connectivity list
- */
-% void
-% negnec (
-% int *idne, /* NEMESIS file ID */
-% int *elem_blk_id, /* Element block ID */
-% int *start_elem_num, /* Starting position to read from */
-% int *num_elems, /* Number of elements to read */
-% int *connect, /* Connectivity vector */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_get_n_elem_conn(*idne, *elem_blk_id, *start_elem_num,
- *num_elems, connect)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to read element block connectivity from file id %d",
- *idne);
- ex_err("negnec",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write an element block's connectivity list
- */
-% void
-% nepnec (
-% int *idne, /* NEMESIS file ID */
-% int *elem_blk_id, /* Element block ID */
-% int *start_elem_num, /* Starting position to write to */
-% int *num_elems, /* Number of elements to write */
-% int *connect, /* Connectivity vector */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_n_elem_conn(*idne, *elem_blk_id, *start_elem_num,
- *num_elems, connect)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to write element block connectivity to file id %d",
- *idne);
- ex_err("negnec",errmsg,EX_MSG);
- }
-}
-
-/*
- * Read an element block's attributes
- */
-% void
-% negneat (
-% int *idne, /* NEMESIS file ID */
-% int *elem_blk_id, /* Element block ID */
-% int *start_elem_num, /* Starting position to read from */
-% int *num_elems, /* Number of elements to read */
-% real *attrib, /* Attribute */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_get_n_elem_attr(*idne, *elem_blk_id, *start_elem_num,
- *num_elems, attrib)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to read element block attribute from file id %d",
- *idne);
- ex_err("negneat",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write an element block's attributes
- */
-% void
-% nepneat (
-% int *idne, /* NEMESIS file ID */
-% int *elem_blk_id, /* Element block ID */
-% int *start_elem_num, /* Starting position to write to */
-% int *num_elems, /* Number of elements to write */
-% real *attrib, /* Attribute */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_n_elem_attr(*idne, *elem_blk_id, *start_elem_num,
- *num_elems, attrib)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to write element block attribute to file id %d",
- *idne);
- ex_err("nepneat",errmsg,EX_MSG);
- }
-}
-
-/*
- * Read the element type for a specific element block
- */
-% void
-% negelt (
-% int *idne, /* NEMESIS file ID */
-% int *elem_blk_id, /* Element block ID */
-% string elem_type, /* The name of the element type */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- int slen;
- char *etype;
-
- /* WARNING: ftypelen SHOULD be MAX_STR_LENGTH, but may not be depending
- on how the Fortran programmer passed it. It is best at
- this time to hard code it per NEMESIS spec. */
- slen = MAX_STR_LENGTH;
- if (elem_typelen != MAX_STR_LENGTH)
- {
- slen = elem_typelen;
-#if defined(EXODUS_STRING_LENGTH_WARNING)
- sprintf(errmsg,"Warning: element type string length is %d in file id %d\n",
- elem_typelen, *idne);
- ex_err("negelt",errmsg,EX_MSG);
-#endif
- }
-
- etype = (char *) malloc((slen+1)*sizeof(char));
-
- if ((*ierr = ne_get_elem_type(*idne, *elem_blk_id, etype)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to read element block type from file id %d",
- *idne);
- ex_err("negelt",errmsg,EX_MSG);
- }
-
- if (*ierr == 0)
- ne_fcdcpy (elem_type, slen, etype);
-
- free(etype);
-}
-
-/*
- * Read a variable for an element block
- */
-% void
-% negnev (
-% int *idne, /* NEMESIS file ID */
-% int *time_step, /* time index */
-% int *elem_var_index, /* elemental variable index */
-% int *elem_blk_id, /* elemental block id */
-% int *num_elem_this_blk, /* number of elements in block */
-% int *start_elem_num, /* Starting position to read from */
-% int *num_elem, /* Number of elements to read */
-% real *elem_var_vals, /* variable values */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_get_n_elem_var(*idne, *time_step, *elem_var_index,
- *elem_blk_id, *num_elem_this_blk,
- *start_elem_num, *num_elem,
- elem_var_vals)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to read element block variable from file id %d",
- *idne);
- ex_err("negnec",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write a variable slab for an element block
- */
-% void
-% nepevs (
-% int *idne, /* NEMESIS file ID */
-% int *time_step, /* time index */
-% int *elem_var_index, /* elemental variable index */
-% int *elem_blk_id, /* elemental block id */
-% int *start_pos, /* Starting position to read from */
-% int *num_vals, /* Number of elements to read */
-% real *elem_var_vals, /* variable values */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_elem_var_slab(*idne, *time_step, *elem_var_index,
- *elem_blk_id, *start_pos, *num_vals,
- elem_var_vals)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to write elem block variable slab to file id %d",
- *idne);
- ex_err("negnec",errmsg,EX_MSG);
- }
-}
-
-/*
- * Read the values of a single nodal variable for a single time step
- */
-% void
-% negnnv (
-% int *idne, /* NEMESIS file ID */
-% int *time_step, /* whole time step number */
-% int *nodal_var_index, /* index of desired nodal var */
-% int *start_node_num, /* starting node number */
-% int *num_nodes, /* number of nodes to read */
-% real *nodal_vars, /* array of nodal var values */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_get_n_nodal_var(*idne, *time_step, *nodal_var_index,
- *start_node_num, *num_nodes,
- nodal_vars)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to read nodal variable from file id %d",
- *idne);
- ex_err("negnnv",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write nodal variable slab
- */
-% void
-% nepnvs (
-% int *idne, /* NEMESIS file ID */
-% int *time_step, /* The time step index */
-% int *nodal_var_index, /* Nodal variable index */
-% int *start_pos, /* Start position for write */
-% int *num_vals, /* Number of nodal variables */
-% real *nodal_var_vals, /* Nodal variable values */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_nodal_var_slab(*idne, *time_step, *nodal_var_index,
- *start_pos, *num_vals,
- nodal_var_vals)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to write nodal variable slab to file id %d",
- *idne);
- ex_err("nepnvs",errmsg,EX_MSG);
- }
-}
-
-/*
- * Read the element numbering map
- */
-% void
-% negnenm (
-% int *idne, /* NEMESIS file ID */
-% int *starte, /* starting element number */
-% int *num_ent, /* number of elements to read */
-% int *elem_map, /* vector for element map */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_get_n_elem_num_map(*idne, *starte, *num_ent, elem_map)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to read element numbering map from file id %d",
- *idne);
- ex_err("negnenm",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write the element numbering map
- */
-% void
-% nepnenm (
-% int *idne, /* NEMESIS file ID */
-% int *starte, /* starting element number */
-% int *num_ent, /* number of elements to write */
-% int *elem_map, /* vector for element map */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_n_elem_num_map(*idne, *starte, *num_ent, elem_map)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to write element numbering map to file id %d",
- *idne);
- ex_err("nepnenm",errmsg,EX_MSG);
- }
-}
-
-/*
- * Read the node numbering map
- */
-% void
-% negnnnm (
-% int *idne, /* NEMESIS file ID */
-% int *startn, /* starting node number */
-% int *num_ent, /* number of nodes to read */
-% int *node_map, /* vector for node map */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_get_n_node_num_map(*idne, *startn, *num_ent, node_map)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to read node numbering map from file id %d",
- *idne);
- ex_err("negnnnm",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write the node numbering map
- */
-% void
-% nepnnnm (
-% int *idne, /* NEMESIS file ID */
-% int *startn, /* starting node number */
-% int *num_ent, /* number of nodes to write */
-% int *node_map, /* vector for node map */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_n_node_num_map(*idne, *startn, *num_ent, node_map)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to write node numbering map to file id %d",
- *idne);
- ex_err("nepnnnm",errmsg,EX_MSG);
- }
-}
-
-/*
- * Read the node map for a processor
- */
-% void
-% negnm (
-% int *idne, /* NEMESIS file ID */
-% int *node_mapi, /* Internal FEM node IDs */
-% int *node_mapb, /* Border FEM node IDs */
-% int *node_mape, /* External FEM node IDs */
-% int *processor, /* This processor ID */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_get_node_map(*idne, node_mapi, node_mapb, node_mape,
- *processor)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to read processor node map from file id %d",
- *idne);
- ex_err("negnm",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write a node map for a processor
- */
-% void
-% nepnm (
-% int *idne, /* NEMESIS file ID */
-% int *node_mapi, /* Internal FEM node IDs */
-% int *node_mapb, /* Border FEM node IDs */
-% int *node_mape, /* External FEM node IDs */
-% int *processor, /* This processor ID */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_node_map(*idne, node_mapi, node_mapb, node_mape,
- *processor)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to write processor node map to file id %d",
- *idne);
- ex_err("nepnm",errmsg,EX_MSG);
- }
-}
-
-/*
- * Read the element map for a processor
- */
-% void
-% negem (
-% int *idne, /* NEMESIS file ID */
-% int *elem_mapi, /* Internal FEM element IDs */
-% int *elem_mapb, /* Border FEM element IDs */
-% int *processor, /* This processor ID */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_get_elem_map(*idne, elem_mapi, elem_mapb, *processor)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to read processor element map from file id %d",
- *idne);
- ex_err("negem",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write the element map for a processor
- */
-% void
-% nepem (
-% int *idne, /* NEMESIS file ID */
-% int *elem_mapi, /* Internal FEM element IDs */
-% int *elem_mapb, /* Border FEM element IDs */
-% int *processor, /* This processor ID */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_elem_map(*idne, elem_mapi, elem_mapb, *processor)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to write processor element map to file id %d",
- *idne);
- ex_err("nepem",errmsg,EX_MSG);
- }
-}
-
-/*
- * Read the communications map parameters for a single processor
- */
-% void
-% negcmp (
-% int *idne, /* NEMESIS file ID */
-% int *ncmap_ids, /* Node map IDs */
-% int *ncmap_node_cnts, /* Nodes in nodal comm */
-% int *ecmap_ids, /* Elem map IDs */
-% int *ecmap_elem_cnts, /* Elems in elemental comm */
-% int *processor, /* This processor ID */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_get_cmap_params(*idne, ncmap_ids, ncmap_node_cnts,
- ecmap_ids, ecmap_elem_cnts, *processor)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to read comm map parameters from file id %d",
- *idne);
- ex_err("negcmp",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write the communications map parameters for a single processor
- */
-% void
-% nepcmp (
-% int *idne, /* NEMESIS file ID */
-% int *nmap_ids, /* Node map IDs */
-% int *nmap_node_cnts, /* Nodes in nodal comm */
-% int *emap_ids, /* Elem map IDs */
-% int *emap_elem_cnts, /* Elems in elemental comm */
-% int *processor, /* This processor ID */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_cmap_params(*idne, nmap_ids, nmap_node_cnts,
- emap_ids, emap_elem_cnts, *processor)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to write comm map parameters to file id %d",
- *idne);
- ex_err("nepcmp",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write the communications map parameters for all processors
- */
-% void
-% nepcmpc (
-% int *idne, /* NEMESIS file ID */
-% int *nmap_ids, /* Node map IDs */
-% int *nmap_node_cnts, /* Nodes in nodal comm */
-% int *nproc_ptrs, /* Pointer into array for node maps */
-% int *emap_ids, /* Elem map IDs */
-% int *emap_elem_cnts, /* Elems in elemental comm */
-% int *eproc_ptrs, /* Pointer into array for elem maps */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_cmap_params_cc(*idne, nmap_ids, nmap_node_cnts,
- nproc_ptrs, emap_ids, emap_elem_cnts,
- eproc_ptrs)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to write comm map parameters to file id %d",
- *idne);
- ex_err("nepcmpc",errmsg,EX_MSG);
- }
-}
-
-/*
- * Read the nodal communications map for a single processor
- */
-% void
-% negncm (
-% int *idne, /* NEMESIS file ID */
-% int *map_id, /* Nodal comm map ID */
-% int *node_ids, /* FEM node IDs */
-% int *proc_ids, /* Processor IDs */
-% int *processor, /* This processor ID */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_get_node_cmap(*idne, *map_id, node_ids, proc_ids,
- *processor)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to read nodal communications map from file id %d",
- *idne);
- ex_err("negncm",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write the nodal communications map for a single processor
- */
-% void
-% nepncm (
-% int *idne, /* NEMESIS file ID */
-% int *map_id, /* Nodal comm map ID */
-% int *node_ids, /* FEM node IDs */
-% int *proc_ids, /* Processor IDs */
-% int *processor, /* This processor ID */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_node_cmap(*idne, *map_id, node_ids, proc_ids,
- *processor)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to write nodal communications map to file id %d",
- *idne);
- ex_err("nepncm",errmsg,EX_MSG);
- }
-}
-
-/*
- * Read the elemental communications map for a single processor
- */
-% void
-% negecm (
-% int *idne, /* NEMESIS file ID */
-% int *map_id, /* Nodal comm map ID */
-% int *elem_ids, /* Vector of element IDs */
-% int *side_ids, /* Vector of side IDs */
-% int *proc_ids, /* Vector of processor IDs */
-% int *processor, /* This processor ID */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_get_elem_cmap(*idne, *map_id, elem_ids, side_ids, proc_ids,
- *processor)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to read elemental comm map from file id %d",
- *idne);
- ex_err("negecm",errmsg,EX_MSG);
- }
-}
-
-/*
- * Write the elemental communications map for a single processor
- */
-% void
-% nepecm (
-% int *idne, /* NEMESIS file ID */
-% int *map_id, /* Nodal comm map ID */
-% int *elem_ids, /* Vector of element IDs */
-% int *side_ids, /* Vector of side IDs */
-% int *proc_ids, /* Vector of processor IDs */
-% int *processor, /* This processor ID */
-% int *ierr /* returned error code */
-% )
-% {
-
- char errmsg[MAX_ERR_LENGTH];
-
- if ((*ierr = ne_put_elem_cmap(*idne, *map_id, elem_ids, side_ids, proc_ids,
- *processor)) != 0)
- {
- sprintf(errmsg,
- "Error: failed to write elemental comm map to file id %d",
- *idne);
- ex_err("nepecm",errmsg,EX_MSG);
- }
-}
-
diff --git a/nemesis/forbind/ne_test.inc b/nemesis/forbind/ne_test.inc
new file mode 100644
index 0000000..0f033a1
--- /dev/null
+++ b/nemesis/forbind/ne_test.inc
@@ -0,0 +1,66 @@
+C Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
+C DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
+C retains certain rights in this software.
+C
+C Redistribution and use in source and binary forms, with or without
+C modification, are permitted provided that the following conditions are
+C met:
+C
+C * Redistributions of source code must retain the above copyright
+C notice, this list of conditions and the following disclaimer.
+C
+C * Redistributions in binary form must reproduce the above
+C copyright notice, this list of conditions and the following
+C disclaimer in the documentation and/or other materials provided
+C with the distribution.
+C
+C * Neither the name of Sandia Corporation nor the names of its
+C contributors may be used to endorse or promote products derived
+C from this software without specific prior written permission.
+C
+C THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+C "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+C LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+C A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+C OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+C SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+C LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+C DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+C THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+C (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+C OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+C
+C==================================================
+C Parameters for the NE_TEST fortran interface test
+C program
+C==================================================
+
+C Constants for init_global functions
+ PARAMETER (NNG = 100)
+ PARAMETER (NEG = 50)
+ PARAMETER (NEBG = 5)
+ PARAMETER (NNSG = 2)
+ PARAMETER (NSSG = 3)
+
+C Constants for load-balance functions
+ PARAMETER (NPROC = 10)
+ PARAMETER (NPROCF = NPROC)
+ PARAMETER (NINTN = 200)
+ PARAMETER (NBORN = 10)
+ PARAMETER (NEXTN = 5)
+ PARAMETER (NINTE = 100)
+ PARAMETER (NBORE = 20)
+ INTEGER NNCMAP, NECMAP
+ PARAMETER (NNCMAP = 4)
+ PARAMETER (NECMAP = 2)
+
+C Constants for communication map
+ PARAMETER (NCNTCM = 20)
+ INTEGER ECNTCM
+ PARAMETER (ECNTCM = 17)
+
+C Some multiplied values
+C NNCMAP * NPROCF
+ PARAMETER (NNCXNPF = 40)
+C NECMAP * NPROCF
+ PARAMETER (NECXNPF = 20)
diff --git a/nemesis/ne_test.c b/nemesis/ne_ctest_wrap.c
similarity index 100%
rename from nemesis/ne_test.c
rename to nemesis/ne_ctest_wrap.c
diff --git a/nemesis/ne_gncor.c b/nemesis/ne_gncor.c
deleted file mode 100644
index db2cc86..0000000
--- a/nemesis/ne_gncor.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*****************************************************************************/
-/*****************************************************************************/
-/* Function(s) contained in this file:
- * ne_get_n_coord()
- *****************************************************************************
- * This function retrieves "n" coordinate values.
- *****************************************************************************
- * Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
- * start_node_num - The starting index of the coords to be obtained.
- * num_nodes - The number of FEM nodes to read coords for.
- * x_coor - Pointer to location of X coordinate vector.
- * y_coor - Pointer to location of Y coordinate vector.
- * z_coor - Pointer to location of Z coordinate vector.
- */
-/*****************************************************************************/
-/*****************************************************************************/
-/*****************************************************************************/
-
-#include <stdio.h>
-
-#include <netcdf.h>
-
-#include "exodusII.h"
-#include "exodusII_int.h"
-
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-/*
- * reads the coordinates of the nodes
- */
-
-int ne_get_n_coord (int neid,
- int start_node_num,
- int num_nodes,
- void *x_coor,
- void *y_coor,
- void *z_coor)
-{
- int coordidx, coordidy, coordidz;
- int coordid;
- int status;
- char *which = NULL;
-
- int ndimdim, i;
- size_t num_dim, start[2], count[2];
- char errmsg[MAX_ERR_LENGTH];
-
- exerrval = 0;
-
- if ((status = nc_inq_dimid(neid, DIM_NUM_DIM, &ndimdim)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to find dimension ID for \"%s\" in file id %d",
- DIM_NUM_DIM, neid);
- ex_err("ne_get_n_coord",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- if ((status = nc_inq_dimlen(neid, ndimdim, &num_dim)) != NC_NOERR) {
- sprintf(errmsg,
- "Error: failed to get number of dimensions in file id %d",
- neid);
- ex_err("ne_get_n_coord",errmsg,exerrval);
- return (EX_FATAL);
- }
-
-
- /* read in the coordinates */
- if (ex_large_model(neid) == 0) {
- if ((status = nc_inq_varid (neid, VAR_COORD, &coordid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate nodal coordinates in file id %d", neid);
- ex_err("ne_get_n_coord",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- start_node_num--; /* do this here so it is only decremented once */
- for (i=0; i<num_dim; i++) {
- start[0] = i;
- start[1] = start_node_num;
-
- count[0] = 1;
- count[1] = num_nodes;
-
- if (i == 0 && x_coor != NULL) {
- which = "X";
- if (ex_comp_ws(neid) == 4) {
- status = nc_get_vara_float(neid, coordid, start, count, x_coor);
- } else {
- status = nc_get_vara_double(neid, coordid, start, count, x_coor);
- }
- }
- else if (i == 1 && y_coor != NULL) {
- which = "Y";
- if (ex_comp_ws(neid) == 4) {
- status = nc_get_vara_float(neid, coordid, start, count, y_coor);
- } else {
- status = nc_get_vara_double(neid, coordid, start, count, y_coor);
- }
- }
- else if (i == 2 && z_coor != NULL) {
- which = "Z";
- if (ex_comp_ws(neid) == 4) {
- status = nc_get_vara_float(neid, coordid, start, count, z_coor);
- } else {
- status = nc_get_vara_double(neid, coordid, start, count, z_coor);
- }
- }
- if (status != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get %s coord array in file id %d", which, neid);
- ex_err("ne_get_n_coord",errmsg,exerrval);
- return (EX_FATAL);
- }
- }
- } else {
-
- start_node_num--; /* do this here so it is only decremented once */
- for (i=0; i<num_dim; i++) {
- start[0] = start_node_num;
- count[0] = num_nodes;
-
- if (i == 0 && x_coor != NULL) {
- which = "X";
- if ((status = nc_inq_varid (neid, VAR_COORD_X, &coordidx)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Warning: failed to locate %s-nodal coordinates in file id %d", which , neid);
- ex_err("ne_get_n_coord",errmsg,exerrval);
- return (EX_WARN);
- }
- if (ex_comp_ws(neid) == 4) {
- status = nc_get_vara_float(neid, coordidx, start, count, x_coor);
- } else {
- status = nc_get_vara_double(neid, coordidx, start, count, x_coor);
- }
- }
- else if (i == 1 && y_coor != NULL) {
- which = "Y";
- if ((status = nc_inq_varid (neid, VAR_COORD_Y, &coordidy)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Warning: failed to locate %s-nodal coordinates in file id %d", which , neid);
- ex_err("ne_get_n_coord",errmsg,exerrval);
- return (EX_WARN);
- }
- if (ex_comp_ws(neid) == 4) {
- status = nc_get_vara_float(neid, coordidy, start, count, y_coor);
- } else {
- status = nc_get_vara_double(neid, coordidy, start, count, y_coor);
- }
- }
- else if (i == 2 && z_coor != NULL) {
- which = "Z";
- if ((status = nc_inq_varid (neid, VAR_COORD_Z, &coordidz)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Warning: failed to locate %s-nodal coordinates in file id %d", which , neid);
- ex_err("ne_get_n_coord",errmsg,exerrval);
- return (EX_WARN);
- }
- if (ex_comp_ws(neid) == 4) {
- status = nc_get_vara_float(neid, coordidz, start, count, z_coor);
- } else {
- status = nc_get_vara_double(neid, coordidz, start, count, z_coor);
- }
- }
- if (status != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get %s coord array in file id %d", which, neid);
- ex_err("ne_get_n_coord",errmsg,exerrval);
- return (EX_FATAL);
- }
- }
- }
- return (EX_NOERR);
-}
diff --git a/nemesis/ne_gnelc.c b/nemesis/ne_gnelc.c
deleted file mode 100644
index 9fe6429..0000000
--- a/nemesis/ne_gnelc.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*****************************************************************************/
-/*****************************************************************************/
-/* Function(s) contained in this file:
- *
- * ne_get_n_elem_conn()
- *
- *****************************************************************************
- *
- * Variable Index:
- *
- * neid - The NetCDF ID of an already open NemesisI file.
- * elem_blk_id - The element block ID.
- * start_elem_num - The starting index of the elements to be
- * obtained.
- * num_elems - The number of FEM elements to read coords for.
- * connect - Pointer to the connectivity vector.
- *
- */
-/*****************************************************************************/
-/*****************************************************************************/
-/*****************************************************************************/
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "exodusII.h"
-#include "exodusII_int.h"
-
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-/*
- * reads the connectivity array for an element block
- */
-
-int ne_get_n_elem_conn (int neid,
- int elem_blk_id,
- int start_elem_num,
- int num_elems,
- int *connect)
-{
- int numelbdim, nelnoddim, connid, elem_blk_id_ndx, status;
- size_t num_elem_this_blk, num_nod_per_elem, start[2], count[2];
- char errmsg[MAX_ERR_LENGTH];
-
- exerrval = 0; /* clear error code */
-
-/* Locate index of element block id in VAR_ID_EL_BLK array */
-
- if ((elem_blk_id_ndx = ex_id_lkup(neid, EX_ELEM_BLOCK, elem_blk_id)) < 0) {
- if (exerrval == EX_NULLENTITY) {
- sprintf(errmsg,
- "Warning: no connectivity array for NULL block %d in file id %d",
- elem_blk_id,neid);
- ex_err("ne_get_n_elem_conn",errmsg,EX_MSG);
- return (EX_WARN); /* no connectivity array for this element block */
- } else {
- sprintf(errmsg,
- "Error: failed to locate element block id %d in %s array in file id %d",
- elem_blk_id,VAR_ID_EL_BLK,neid);
- ex_err("ne_get_n_elem_conn",errmsg,exerrval);
- return (EX_FATAL);
- }
- }
-
- /* inquire id's of previously defined dimensions */
-
- if ((status = nc_inq_dimid (neid, DIM_NUM_EL_IN_BLK(elem_blk_id_ndx), &numelbdim)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate number of elements in block %d in file id %d",
- elem_blk_id,neid);
- ex_err("ne_get_n_elem_conn",errmsg, exerrval);
- return(EX_FATAL);
- }
-
- if ((status = nc_inq_dimlen(neid, numelbdim, &num_elem_this_blk)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get number of elements in block %d in file id %d",
- elem_blk_id,neid);
- ex_err("ne_get_n_elem_conn",errmsg,exerrval);
- return(EX_FATAL);
- }
-
-
- if ((status = nc_inq_dimid(neid, DIM_NUM_NOD_PER_EL(elem_blk_id_ndx), &nelnoddim)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate number of nodes/elem for block %d in file id %d",
- elem_blk_id,neid);
- ex_err("ne_get_n_elem_conn",errmsg,exerrval);
- return(EX_FATAL);
- }
-
- if ((status = nc_inq_dimlen(neid, nelnoddim, &num_nod_per_elem)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get number of nodes/elem for block %d in file id %d",
- elem_blk_id,neid);
- ex_err("ne_get_n_elem_conn",errmsg, exerrval);
- return(EX_FATAL);
- }
-
-
- if ((status = nc_inq_varid(neid, VAR_CONN(elem_blk_id_ndx), &connid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate connectivity array for block %d in file id %d",
- elem_blk_id,neid);
- ex_err("ne_get_n_elem_conn",errmsg, exerrval);
- return(EX_FATAL);
- }
-
- /* do some error checking */
- if (num_elem_this_blk < (start_elem_num + num_elems - 1)) {
- exerrval = status;
- sprintf(errmsg,
- "Error: requested connectivity from too many elements in this block, %d",
- elem_blk_id);
- ex_err("ne_get_n_elem_conn",errmsg, exerrval);
- return(EX_FATAL);
- }
-
- /* read in the connectivity array */
- start[0] = --start_elem_num;
- start[1] = 0;
-
- count[0] = num_elems;
- count[1] = num_nod_per_elem;
-
- status = nc_get_vara_int(neid, connid, start, count, connect);
-
- if (status != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get connectivity array for block %d in file id %d",
- elem_blk_id,neid);
- ex_err("ne_get_n_elem_conn",errmsg, exerrval);
- return(EX_FATAL);
- }
- return (EX_NOERR);
-}
diff --git a/nemesis/ne_nemesisI.h b/nemesis/ne_nemesisI.h
index a3ca8ca..cbd5b87 100644
--- a/nemesis/ne_nemesisI.h
+++ b/nemesis/ne_nemesisI.h
@@ -33,22 +33,6 @@
*
*/
-/*====================================================================
- * ------------------------
- * | CVS File Information |
- * ------------------------
- *
- * $RCSfile: ne_nemesisI.h,v $
- *
- * $Author: gdsjaar $
- *
- * $Date: 2008/02/07 13:40:50 $
- *
- * $Revision: 1.17 $
- *
- * $Name: $
- *====================================================================*/
-
/****************************************************************************
* This file contains prototypes for the functions found in the NEMESIS
* library.
@@ -61,9 +45,19 @@
extern "C" {
#endif
-#define NEMESIS_API_VERSION 3.12
-#define NEMESIS_API_VERSION_NODOT 312
-
+#ifndef EXODUS_II_HDR
+#include <stdint.h>
+ /** Specifies that this argument is the id of an entity: element block, nodeset, sideset, ... */
+ typedef int64_t ex_entity_id;
+
+ /** The mechanism for passing double/float and int/int64_t both use a
+ void*; to avoid some confusion as to whether a function takes an
+ integer or a float/double, the following typedef is used for the
+ integer argument
+ */
+ typedef void void_int;
+#endif
+
/*=============================================================================
* Initial Information Routines
*===========================================================================*/
@@ -83,104 +77,105 @@ ne_put_init_info(int neid, /* NemesisI file ID */
extern int
ne_get_init_global(int neid, /* NemesisI file ID */
- int *num_nodes_g, /* Number of global FEM nodes */
- int *num_elems_g, /* Number of global FEM elements */
- int *num_elem_blks_g, /* Number of global elem blocks */
- int *num_node_sets_g, /* Number of global node sets */
- int *num_side_sets_g /* Number of global side sets */
+ void_int *num_nodes_g, /* Number of global FEM nodes */
+ void_int *num_elems_g, /* Number of global FEM elements */
+ void_int *num_elem_blks_g, /* Number of global elem blocks */
+ void_int *num_node_sets_g, /* Number of global node sets */
+ void_int *num_side_sets_g /* Number of global side sets */
);
extern int
ne_put_init_global(int neid, /* NemesisI file ID */
- int num_nodes_g, /* Number of global FEM nodes */
- int num_elems_g, /* Number of global FEM elements */
- int num_elem_blks_g, /* Number of global elem blocks */
- int num_node_sets_g, /* Number of global node sets */
- int num_side_sets_g /* Number of global side sets */
+ int64_t num_nodes_g, /* Number of global FEM nodes */
+ int64_t num_elems_g, /* Number of global FEM elements */
+ int64_t num_elem_blks_g, /* Number of global elem blocks */
+ int64_t num_node_sets_g, /* Number of global node sets */
+ int64_t num_side_sets_g /* Number of global side sets */
);
+extern int
+ne_put_version(int neid);
+
/*=============================================================================
* Loadbalance Parameter Routines
*===========================================================================*/
extern int
ne_get_loadbal_param(int neid, /* NetCDF/Exodus file ID */
- int *num_int_nodes, /* Number of internal FEM nodes */
- int *num_bor_nodes, /* Number of border FEM nodes */
- int *num_ext_nodes, /* Number of external FEM nodes */
- int *num_int_elems, /* Number of internal FEM elems */
- int *num_bor_elems, /* Number of border FEM elems */
- int *num_node_cmaps, /* Number of nodal comm maps */
- int *num_elem_cmaps, /* Number of elemental comm maps */
+ void_int *num_int_nodes, /* Number of internal FEM nodes */
+ void_int *num_bor_nodes, /* Number of border FEM nodes */
+ void_int *num_ext_nodes, /* Number of external FEM nodes */
+ void_int *num_int_elems, /* Number of internal FEM elems */
+ void_int *num_bor_elems, /* Number of border FEM elems */
+ void_int *num_node_cmaps, /* Number of nodal comm maps */
+ void_int *num_elem_cmaps, /* Number of elemental comm maps */
int processor /* Processor ID */
);
extern int
ne_put_loadbal_param(int neid, /* NemesisI file ID */
- int num_int_nodes, /* Number of internal FEM nodes */
- int num_bor_nodes, /* Number of border FEM nodes */
- int num_ext_nodes, /* Number of external FEM nodes */
- int num_int_elems, /* Number of internal FEM elems */
- int num_bor_elems, /* Number of border FEM elems */
- int num_node_cmaps,/* Number of nodal comm maps */
- int num_elem_cmaps,/* Number of elemental comm maps */
- int processor /* Processor ID */
+ int64_t num_int_nodes, /* Number of internal FEM nodes */
+ int64_t num_bor_nodes, /* Number of border FEM nodes */
+ int64_t num_ext_nodes, /* Number of external FEM nodes */
+ int64_t num_int_elems, /* Number of internal FEM elems */
+ int64_t num_bor_elems, /* Number of border FEM elems */
+ int64_t num_node_cmaps,/* Number of nodal comm maps */
+ int64_t num_elem_cmaps,/* Number of elemental comm maps */
+ int processor /* Processor ID */
);
extern int
ne_put_loadbal_param_cc(int neid, /* NetCDF/Exodus file ID */
- int *num_int_nodes, /* Number of internal node IDs */
- int *num_bor_nodes, /* Number of border node IDs */
- int *num_ext_nodes, /* Number of external node IDs */
- int *num_int_elems, /* Number of internal elem IDs */
- int *num_bor_elems, /* Number of border elem IDs */
- int *num_node_cmaps, /* Number of nodal comm maps */
- int *num_elem_cmaps /* Number of elem comm maps */
+ void_int *num_int_nodes, /* Number of internal node IDs */
+ void_int *num_bor_nodes, /* Number of border node IDs */
+ void_int *num_ext_nodes, /* Number of external node IDs */
+ void_int *num_int_elems, /* Number of internal elem IDs */
+ void_int *num_bor_elems, /* Number of border elem IDs */
+ void_int *num_node_cmaps, /* Number of nodal comm maps */
+ void_int *num_elem_cmaps /* Number of elem comm maps */
);
/*=============================================================================
* NS, SS & EB Global Parameter Routines
*===========================================================================*/
extern int
-ne_get_ns_param_global(int neid, /* NetCDF/Exodus file ID */
- int *ns_ids_glob, /* Global IDs of node sets */
- int *ns_n_cnt_glob, /* Count of nodes in node sets */
- int *ns_df_cnt_glob /* Count of dist. factors in ns */
+ne_get_ns_param_global(int neid, /* NetCDF/Exodus file ID */
+ void_int *ns_ids_glob, /* Global IDs of node sets */
+ void_int *ns_n_cnt_glob, /* Count of nodes in node sets */
+ void_int *ns_df_cnt_glob /* Count of dist. factors in ns */
);
extern int
-ne_put_ns_param_global(int neid, /* NemesisI file ID */
- int *global_ids, /* Vector of global node-set IDs */
- int *global_n_cnts, /* Vector of node counts in */
- /* node-sets */
- int *global_df_cnts /* Vector of dist factor */
- /* counts in node-sets */
+ne_put_ns_param_global(int neid, /* NemesisI file ID */
+ void_int *global_ids, /* Vector of global node-set IDs */
+ void_int *global_n_cnts, /* Vector of node counts in node-sets */
+ void_int *global_df_cnts /* Vector of dist factor counts in node-sets */
);
extern int
ne_get_ss_param_global(int neid, /* NetCDF/Exodus file ID */
- int *ss_ids_glob, /* Global side-set IDs */
- int *ss_s_cnt_glob, /* Global side count */
- int *ss_df_cnt_glob /* Global dist. factor count */
+ void_int *ss_ids_glob, /* Global side-set IDs */
+ void_int *ss_s_cnt_glob, /* Global side count */
+ void_int *ss_df_cnt_glob /* Global dist. factor count */
);
extern int
ne_put_ss_param_global(int neid, /* NemesisI file ID */
- int *global_ids, /* Vector of global side-set IDs */
- int *global_el_cnts, /* Vector of element/side */
+ void_int *global_ids, /* Vector of global side-set IDs */
+ void_int *global_el_cnts, /* Vector of element/side */
/* counts in each side set */
- int *global_df_cnts /* Vector of dist. factor */
+ void_int *global_df_cnts /* Vector of dist. factor */
/* counts in each side set */
);
extern int
ne_get_eb_info_global(int neid, /* NemesisI file ID */
- int *el_blk_ids, /* Vector of global element IDs */
- int *el_blk_cnts /* Vector of global element counts */
+ void_int *el_blk_ids, /* Vector of global element IDs */
+ void_int *el_blk_cnts /* Vector of global element counts */
);
extern int
ne_put_eb_info_global(int neid, /* NemesisI file ID */
- int *el_blk_ids, /* Vector of global element IDs */
- int *el_blk_cnts /* Vector of global element counts */
+ void_int *el_blk_ids, /* Vector of global element IDs */
+ void_int *el_blk_cnts /* Vector of global element counts */
);
/*=============================================================================
@@ -188,74 +183,74 @@ ne_put_eb_info_global(int neid, /* NemesisI file ID */
*===========================================================================*/
extern int
ne_get_n_side_set(int neid, /* NetCDF/Exodus file ID */
- int side_set_id, /* Side-set ID to read */
- int start_side_num, /* Starting element number */
- int num_sides, /* Number of sides to read */
- int *side_set_elem_list, /* List of element IDs */
- int *side_set_side_list /* List of side IDs */
+ ex_entity_id side_set_id, /* Side-set ID to read */
+ int64_t start_side_num, /* Starting element number */
+ int64_t num_sides, /* Number of sides to read */
+ void_int *side_set_elem_list, /* List of element IDs */
+ void_int *side_set_side_list /* List of side IDs */
);
extern int
ne_put_n_side_set(int neid, /* NetCDF/Exodus file ID */
- int side_set_id, /* Side-set ID to write */
- int start_side_num, /* Starting element number */
- int num_sides, /* Number of sides to write */
- int *side_set_elem_list, /* List of element IDs */
- int *side_set_side_list /* List of side IDs */
+ ex_entity_id side_set_id, /* Side-set ID to write */
+ int64_t start_side_num, /* Starting element number */
+ int64_t num_sides, /* Number of sides to write */
+ const void_int *side_set_elem_list, /* List of element IDs */
+ const void_int *side_set_side_list /* List of side IDs */
);
extern int
ne_get_n_side_set_df(int neid, /* NetCDF/Exodus file ID */
- int side_set_id, /* Side-set ID */
- int start_num, /* Starting df number */
- int num_df_to_get, /* Number of df's to read */
+ ex_entity_id side_set_id, /* Side-set ID */
+ int64_t start_num, /* Starting df number */
+ int64_t num_df_to_get, /* Number of df's to read */
void *side_set_df /* Distribution factors */
);
extern int
ne_put_n_side_set_df(int neid, /* NetCDF/Exodus file ID */
- int side_set_id, /* Side-set ID */
- int start_num, /* Starting df number */
- int num_df_to_get, /* Number of df's to write */
+ ex_entity_id side_set_id, /* Side-set ID */
+ int64_t start_num, /* Starting df number */
+ int64_t num_df_to_get, /* Number of df's to write */
void *side_set_df /* Distribution factors */
);
extern int
ne_get_n_node_set(int neid, /* NetCDF/Exodus file ID */
- int node_set_id, /* Node set ID */
- int start_node_num, /* Node index to start reading at */
- int num_node, /* Number of nodes to read */
- int *node_set_node_list /* List of nodes in node set */
+ ex_entity_id node_set_id, /* Node set ID */
+ int64_t start_node_num, /* Node index to start reading at */
+ int64_t num_node, /* Number of nodes to read */
+ void_int *node_set_node_list /* List of nodes in node set */
);
extern int
ne_put_n_node_set(int neid, /* NetCDF/Exodus file ID */
- int node_set_id, /* Node set ID */
- int start_node_num, /* Node index to start writing at */
- int num_node, /* Number of nodes to write */
- int *node_set_node_list /* List of nodes in node set */
+ ex_entity_id node_set_id, /* Node set ID */
+ int64_t start_node_num, /* Node index to start writing at */
+ int64_t num_node, /* Number of nodes to write */
+ const void_int *node_set_node_list /* List of nodes in node set */
);
extern int
ne_get_n_node_set_df(int neid, /* NetCDF/Exodus file ID */
- int node_set_id, /* Node-set ID */
- int start_num, /* Starting df number */
- int num_df_to_get, /* Number of df's to read */
+ ex_entity_id node_set_id, /* Node-set ID */
+ int64_t start_num, /* Starting df number */
+ int64_t num_df_to_get, /* Number of df's to read */
void *node_set_df /* Distribution factors */
);
extern int
ne_put_n_node_set_df(int neid, /* NetCDF/Exodus file ID */
- int node_set_id, /* Node-set ID */
- int start_num, /* Starting df number */
- int num_df_to_get, /* Number of df's to write */
+ ex_entity_id node_set_id, /* Node-set ID */
+ int64_t start_num, /* Starting df number */
+ int64_t num_df_to_get, /* Number of df's to write */
void *node_set_df /* Distribution factors */
);
extern int
ne_get_n_coord(int neid, /* NetCDF/Exodus file ID */
- int start_node_num, /* Starting position to read from */
- int num_nodes, /* Number of coords to read */
+ int64_t start_node_num, /* Starting position to read from */
+ int64_t num_nodes, /* Number of coords to read */
void *x_coor, /* Vector of X coordinates */
void *y_coor, /* Vector of Y coordinates */
void *z_coor /* Vector of Z coordinates */
@@ -263,8 +258,8 @@ ne_get_n_coord(int neid, /* NetCDF/Exodus file ID */
extern int
ne_put_n_coord(int neid, /* NetCDF/Exodus file ID */
- int start_node_num, /* Starting position to write to */
- int num_nodes, /* Number of coords to write */
+ int64_t start_node_num, /* Starting position to write to */
+ int64_t num_nodes, /* Number of coords to write */
void *x_coor, /* Vector of X coordinates */
void *y_coor, /* Vector of Y coordinates */
void *z_coor /* Vector of Z coordinates */
@@ -272,39 +267,39 @@ ne_put_n_coord(int neid, /* NetCDF/Exodus file ID */
extern int
ne_get_n_elem_conn (int neid, /* NetCDF/Exodus file ID */
- int elem_blk_id, /* Element block ID */
- int start_elem_num, /* Starting position to read from */
- int num_elems, /* Number of elements to read */
- int *connect /* Connectivity vector */
+ ex_entity_id elem_blk_id, /* Element block ID */
+ int64_t start_elem_num, /* Starting position to read from */
+ int64_t num_elems, /* Number of elements to read */
+ void_int *connect /* Connectivity vector */
);
extern int
ne_put_n_elem_conn (int neid, /* NetCDF/Exodus file ID */
- int elem_blk_id, /* Element block ID */
- int start_elem_num, /* Starting position to write to */
- int num_elems, /* Number of elements to write */
- int *connect /* Connectivity vector */
+ ex_entity_id elem_blk_id, /* Element block ID */
+ int64_t start_elem_num, /* Starting position to write to */
+ int64_t num_elems, /* Number of elements to write */
+ const void_int *connect /* Connectivity vector */
);
extern int
ne_get_n_elem_attr (int neid, /* NetCDF/Exodus file ID */
- int elem_blk_id, /* Element block ID */
- int start_elem_num, /* Starting position to read from */
- int num_elems, /* Number of elements to read */
+ ex_entity_id elem_blk_id, /* Element block ID */
+ int64_t start_elem_num, /* Starting position to read from */
+ int64_t num_elems, /* Number of elements to read */
void *attrib /* Attribute */
);
extern int
ne_put_n_elem_attr (int neid, /* NetCDF/Exodus file ID */
- int elem_blk_id, /* Element block ID */
- int start_elem_num, /* Starting position to write to */
- int num_elems, /* Number of elements to write */
+ ex_entity_id elem_blk_id, /* Element block ID */
+ int64_t start_elem_num, /* Starting position to write to */
+ int64_t num_elems, /* Number of elements to write */
void *attrib /* Attribute */
);
extern int
ne_get_elem_type(int neid, /* NetCDF/Exodus file ID */
- int elem_blk_id, /* Element block ID */
+ ex_entity_id elem_blk_id, /* Element block ID */
char *elem_type /* The name of the element type */
);
@@ -315,10 +310,10 @@ extern int
ne_get_n_elem_var (int neid, /* NetCDF/Exodus file ID */
int time_step, /* time index */
int elem_var_index, /* elemental variable index */
- int elem_blk_id, /* elemental block id */
- int num_elem_this_blk, /* number of elements in block */
- int start_elem_num, /* Starting position for read */
- int num_elem, /* Number of elements to read */
+ ex_entity_id elem_blk_id, /* elemental block id */
+ int64_t num_elem_this_blk, /* number of elements in block */
+ int64_t start_elem_num, /* Starting position for read */
+ int64_t num_elem, /* Number of elements to read */
void *elem_var_vals /* variable values */
);
@@ -326,9 +321,9 @@ extern int
ne_put_elem_var_slab (int neid, /* NetCDF/Exodus file ID */
int time_step, /* time index */
int elem_var_index, /* elemental variable index */
- int elem_blk_id, /* elemental block id */
- int start_pos, /* Starting position to write to */
- int num_vals, /* Number of elements to write */
+ ex_entity_id elem_blk_id, /* elemental block id */
+ int64_t start_pos, /* Starting position to write to */
+ int64_t num_vals, /* Number of elements to write */
void *elem_var_vals /* variable values */
);
@@ -336,8 +331,8 @@ extern int
ne_get_n_nodal_var(int neid, /* NetCDF/Exodus file ID */
int time_step, /* whole time step number */
int nodal_var_index, /* index of desired nodal var */
- int start_node_num, /* starting node number */
- int num_nodes, /* number of nodes to read */
+ int64_t start_node_num, /* starting node number */
+ int64_t num_nodes, /* number of nodes to read */
void *nodal_vars /* array of nodal var values */
);
@@ -345,8 +340,8 @@ extern int
ne_put_nodal_var_slab(int neid, /* NetCDF/Exodus file ID */
int time_step, /* The time step index */
int nodal_var_index, /* Nodal variable index */
- int start_pos, /* Start position for write */
- int num_vals, /* Number of nodal variables */
+ int64_t start_pos, /* Start position for write */
+ int64_t num_vals, /* Number of nodal variables */
void *nodal_var_vals /* Nodal variable values */
);
@@ -355,59 +350,59 @@ ne_put_nodal_var_slab(int neid, /* NetCDF/Exodus file ID */
*===========================================================================*/
extern int
ne_get_n_elem_num_map (int neid, /* NetCDF/Exodus file ID */
- int start_ent, /* Starting position to read from */
- int num_ents, /* Number of elements to read */
- int *elem_map /* element map numbers */
+ int64_t start_ent, /* Starting position to read from */
+ int64_t num_ents, /* Number of elements to read */
+ void_int *elem_map /* element map numbers */
);
extern int
ne_put_n_elem_num_map (int neid, /* NetCDF/Exodus file ID */
- int start_ent, /* Starting position to read from */
- int num_ents, /* Number of elements to read */
- int *elem_map /* element map numbers */
+ int64_t start_ent, /* Starting position to read from */
+ int64_t num_ents, /* Number of elements to read */
+ const void_int *elem_map /* element map numbers */
);
extern int
ne_get_n_node_num_map(int neid, /* NetCDF/Exodus file ID */
- int start_ent, /* starting node number */
- int num_ents, /* number of nodes to read */
- int *node_map /* vector for node map */
+ int64_t start_ent, /* starting node number */
+ int64_t num_ents, /* number of nodes to read */
+ void_int *node_map /* vector for node map */
);
extern int
ne_put_n_node_num_map(int neid, /* NetCDF/Exodus file ID */
- int start_ent, /* starting node number */
- int num_ents, /* number of nodes to read */
- int *node_map /* vector for node map */
+ int64_t start_ent, /* starting node number */
+ int64_t num_ents, /* number of nodes to read */
+ const void_int *node_map /* vector for node map */
);
extern int
ne_get_node_map(int neid, /* NetCDF/Exodus file ID */
- int *node_mapi, /* Internal FEM node IDs */
- int *node_mapb, /* Border FEM node IDs */
- int *node_mape, /* External FEM node IDs */
+ void_int *node_mapi, /* Internal FEM node IDs */
+ void_int *node_mapb, /* Border FEM node IDs */
+ void_int *node_mape, /* External FEM node IDs */
int processor /* Processor IDs */
);
extern int
ne_put_node_map(int neid, /* NetCDF/Exodus file ID */
- int *node_mapi, /* Internal FEM node IDs */
- int *node_mapb, /* Border FEM node IDs */
- int *node_mape, /* External FEM node IDs */
+ void_int *node_mapi, /* Internal FEM node IDs */
+ void_int *node_mapb, /* Border FEM node IDs */
+ void_int *node_mape, /* External FEM node IDs */
int processor /* This processor ID */
);
extern int
ne_get_elem_map(int neid, /* NetCDF/Exodus file ID */
- int *elem_mapi, /* Internal element IDs */
- int *elem_mapb, /* Border element IDs */
+ void_int *elem_mapi, /* Internal element IDs */
+ void_int *elem_mapb, /* Border element IDs */
int processor /* Processor ID */
);
extern int
ne_put_elem_map(int neid, /* NetCDF/Exodus file ID */
- int *elem_mapi, /* Internal FEM element IDs */
- int *elem_mapb, /* Border FEM element IDs */
+ void_int *elem_mapi, /* Internal FEM element IDs */
+ void_int *elem_mapb, /* Border FEM element IDs */
int processor /* This processor ID */
);
@@ -418,68 +413,78 @@ ne_put_elem_map(int neid, /* NetCDF/Exodus file ID */
extern int
ne_get_cmap_params(int neid, /* NetCDF/Exodus file ID */
- int *node_cmap_ids, /* Nodal comm. map IDs */
- int *node_cmap_node_cnts, /* Number of nodes in each map */
- int *elem_cmap_ids, /* Elemental comm. map IDs */
- int *elem_cmap_elem_cnts, /* Number of elems in each map */
+ void_int *node_cmap_ids, /* Nodal comm. map IDs */
+ void_int *node_cmap_node_cnts, /* Number of nodes in each map */
+ void_int *elem_cmap_ids, /* Elemental comm. map IDs */
+ void_int *elem_cmap_elem_cnts, /* Number of elems in each map */
int processor /* This processor ID */
);
extern int
ne_put_cmap_params(int neid, /* NetCDF/Exodus file ID */
- int *node_map_ids, /* Node map IDs */
- int *node_map_node_cnts, /* Nodes in nodal comm */
- int *elem_map_ids, /* Elem map IDs */
- int *elem_map_elem_cnts, /* Elems in elemental comm */
- int processor /* This processor ID */
+ void_int *node_map_ids, /* Node map IDs */
+ void_int *node_map_node_cnts,/* Nodes in nodal comm */
+ void_int *elem_map_ids, /* Elem map IDs */
+ void_int *elem_map_elem_cnts,/* Elems in elemental comm */
+ int64_t processor /* This processor ID */
);
extern int
ne_put_cmap_params_cc(int neid, /* NetCDF/Exodus file ID */
- int *node_map_ids, /* Node map IDs */
- int *node_map_node_cnts, /* Nodes in nodal comm */
- int *node_proc_ptrs, /* Pointer into array for */
+ void_int *node_map_ids, /* Node map IDs */
+ void_int *node_map_node_cnts, /* Nodes in nodal comm */
+ void_int *node_proc_ptrs, /* Pointer into array for */
/* node maps */
- int *elem_map_ids, /* Elem map IDs */
- int *elem_map_elem_cnts, /* Elems in elemental comm */
- int *elem_proc_ptrs /* Pointer into array for */
+ void_int *elem_map_ids, /* Elem map IDs */
+ void_int *elem_map_elem_cnts, /* Elems in elemental comm */
+ void_int *elem_proc_ptrs /* Pointer into array for */
/* elem maps */
);
extern int
ne_get_node_cmap(int neid, /* NetCDF/Exodus file ID */
- int map_id, /* Map ID */
- int *node_ids, /* FEM node IDs */
- int *proc_ids, /* Processor IDs */
+ ex_entity_id map_id, /* Map ID */
+ void_int *node_ids, /* FEM node IDs */
+ void_int *proc_ids, /* Processor IDs */
int processor /* This processor ID */
);
extern int
ne_put_node_cmap(int neid, /* NetCDF/Exodus file ID */
- int map_id, /* Nodal comm map ID */
- int *node_ids, /* FEM node IDs */
- int *proc_ids, /* Processor IDs */
+ ex_entity_id map_id, /* Nodal comm map ID */
+ void_int *node_ids, /* FEM node IDs */
+ void_int *proc_ids, /* Processor IDs */
int processor /* This processor ID */
);
extern int
ne_get_elem_cmap(int neid, /* NetCDF/Exodus file ID */
- int map_id, /* Elemental comm map ID */
- int *elem_ids, /* Element IDs */
- int *side_ids, /* Element side IDs */
- int *proc_ids, /* Processor IDs */
+ ex_entity_id map_id, /* Elemental comm map ID */
+ void_int *elem_ids, /* Element IDs */
+ void_int *side_ids, /* Element side IDs */
+ void_int *proc_ids, /* Processor IDs */
int processor /* This processor ID */
);
extern int
ne_put_elem_cmap(int neid, /* NetCDF/Exodus file ID */
- int map_id, /* Elemental comm map ID */
- int *elem_ids, /* Vector of element IDs */
- int *side_ids, /* Vector of side IDs */
- int *proc_ids, /* Vector of processor IDs */
+ ex_entity_id map_id, /* Elemental comm map ID */
+ void_int *elem_ids, /* Vector of element IDs */
+ void_int *side_ids, /* Vector of side IDs */
+ void_int *proc_ids, /* Vector of processor IDs */
int processor /* This processor ID */
);
+ /* Should be internal use only, but was in external include file for
+ nemesis and some codes are using the function
+ */
+ int ne_get_idx(int neid, /* NetCDF/Exodus file ID */
+ const char *ne_var_name, /* Nemesis index variable name */
+ int64_t *index, /* array of length 2 to hold results */
+ int pos /* position of this proc/cmap in index */
+ );
+
+
#ifdef __cplusplus
}
#endif
diff --git a/nemesis/ne_nemesisI_int.h b/nemesis/ne_nemesisI_int.h
index 927a951..23a76ea 100644
--- a/nemesis/ne_nemesisI_int.h
+++ b/nemesis/ne_nemesisI_int.h
@@ -1,156 +1,3 @@
-/*
- * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
+/* Dummy file -- Not needed after integration of nemesis library into exodus. */
-/**********************************************************************
- * This file contains constant definitions used internally NEMESIS.
- **********************************************************************/
-
-#ifndef _NE_NEMESISI_INT_H
-#define _NE_NEMESISI_INT_H
-
-#include <stdint.h>
-
-#define NEMESIS_FILE_VERSION 2.6
-
-#define VAR_ELBLK_IDS_GLOBAL "el_blk_ids_global"
-#define VAR_ELBLK_CNT_GLOBAL "el_blk_cnt_global"
-#define VAR_NS_IDS_GLOBAL "ns_ids_global"
-#define VAR_NS_NODE_CNT_GLOBAL "ns_node_cnt_global"
-#define VAR_NS_DF_CNT_GLOBAL "ns_df_cnt_global"
-#define VAR_SS_IDS_GLOBAL "ss_ids_global"
-#define VAR_SS_SIDE_CNT_GLOBAL "ss_side_cnt_global"
-#define VAR_SS_DF_CNT_GLOBAL "ss_df_cnt_global"
-#define VAR_FILE_TYPE "nem_ftype"
-#define VAR_COMM_MAP "comm_map"
-#define VAR_NODE_MAP_INT "node_mapi"
-#define VAR_NODE_MAP_INT_IDX "node_mapi_idx"
-#define VAR_NODE_MAP_BOR "node_mapb"
-#define VAR_NODE_MAP_BOR_IDX "node_mapb_idx"
-#define VAR_NODE_MAP_EXT "node_mape"
-#define VAR_NODE_MAP_EXT_IDX "node_mape_idx"
-#define VAR_ELEM_MAP_INT "elem_mapi"
-#define VAR_ELEM_MAP_INT_IDX "elem_mapi_idx"
-#define VAR_ELEM_MAP_BOR "elem_mapb"
-#define VAR_ELEM_MAP_BOR_IDX "elem_mapb_idx"
-#define VAR_INT_N_STAT "int_n_stat"
-#define VAR_BOR_N_STAT "bor_n_stat"
-#define VAR_EXT_N_STAT "ext_n_stat"
-#define VAR_INT_E_STAT "int_e_stat"
-#define VAR_BOR_E_STAT "bor_e_stat"
-#define VAR_N_COMM_IDS "n_comm_ids"
-#define VAR_N_COMM_STAT "n_comm_stat"
-#define VAR_N_COMM_INFO_IDX "n_comm_info_idx"
-#define VAR_E_COMM_IDS "e_comm_ids"
-#define VAR_E_COMM_STAT "e_comm_stat"
-#define VAR_E_COMM_INFO_IDX "e_comm_info_idx"
-#define VAR_N_COMM_NIDS "n_comm_nids"
-#define VAR_N_COMM_PROC "n_comm_proc"
-#define VAR_N_COMM_DATA_IDX "n_comm_data_idx"
-#define VAR_E_COMM_EIDS "e_comm_eids"
-#define VAR_E_COMM_SIDS "e_comm_sids"
-#define VAR_E_COMM_PROC "e_comm_proc"
-#define VAR_E_COMM_DATA_IDX "e_comm_data_idx"
-
-#define DIM_NUM_INT_NODES "num_int_node"
-#define DIM_NUM_BOR_NODES "num_bor_node"
-#define DIM_NUM_EXT_NODES "num_ext_node"
-#define DIM_NUM_INT_ELEMS "num_int_elem"
-#define DIM_NUM_BOR_ELEMS "num_bor_elem"
-#define DIM_NUM_PROCS "num_processors"
-#define DIM_NUM_PROCS_F "num_procs_file"
-#define DIM_NUM_NODES_GLOBAL "num_nodes_global"
-#define DIM_NUM_ELEMS_GLOBAL "num_elems_global"
-#define DIM_NUM_NS_GLOBAL "num_ns_global"
-#define DIM_NUM_SS_GLOBAL "num_ss_global"
-#define DIM_NUM_ELBLK_GLOBAL "num_el_blk_global"
-#define DIM_NUM_N_CMAPS "num_n_cmaps"
-#define DIM_NUM_E_CMAPS "num_e_cmaps"
-#define DIM_NCNT_CMAP "ncnt_cmap"
-#define DIM_ECNT_CMAP "ecnt_cmap"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Only used internally by NEMESIS */
-
-extern int
-ne_leavedef(int neid, /* NemesisI file ID */
- char *func_name /* Name of calling function */
- );
-
-extern int
-ne_get_file_type(int neid, /* NetCDF/Exodus file ID */
- char *ftype /* Nemesis file type */
- );
-
-extern int
-ne_get_map_status(int neid,
- char *stat_var,
- int proc_id,
- int *stat);
-
-extern int
-ne_put_version(int neid /* NetCDF/Exodus file ID */
- );
-
-extern int
-ne_check_file_version(int neid /* NetCDF/Exodus file ID */
- );
-extern char *
-ne_catstr2(char *name, /* The name to attach num1 and num2 to */
- int num1, /* First number to tack to name */
- int num2 /* Second number to tack to name */
- );
-
-extern int
-ne_id_lkup(int neid, /* NetCDF/Exodus file ID */
- char *var_name, /* Nemesis variable name */
- int64_t *idx, /* index variable for variable, length 2 */
- int ne_var_id /* NetCDF variable ID */
- );
-
-extern int
-ne_get_idx(int neid, /* NetCDF/Exodus file ID */
- char *ne_var_name, /* Nemesis index variable name */
- int64_t *index, /* array of length 2 to hold results */
- int pos /* position of this proc/cmap in index */
- );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _NE_NEMESISI_INT_H */
+/* Provided in case an application used to include this file in the past. */
diff --git a/nemesis/ne_pennm.c b/nemesis/ne_pennm.c
deleted file mode 100644
index e918f20..0000000
--- a/nemesis/ne_pennm.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-/*****************************************************************************
-*
-* ne_pennm - ne_put_n_elem_num_map
-*
-* environment - UNIX
-*
-* entry conditions -
-* input parameters:
-* int neid exodus file id
-* int start_ent first entry in elem_map
-* int num_ents number of entries in node_map
-* int* elem_map element numbering map array
-*
-* exit conditions -
-*
-* revision history -
-*
-*
-*****************************************************************************/
-
-#include "exodusII.h"
-#include "exodusII_int.h"
-#include "ne_nemesisI.h"
-#include "ne_nemesisI_int.h"
-
-/*
- * writes out a portion of the element numbering map to the database;
- * this allows element numbers to be non-contiguous
- */
-
-int ne_put_n_elem_num_map (int neid,
- int start_ent,
- int num_ents,
- int *elem_map)
-{
- char *func_name="ne_put_n_elem_num_map";
-
- int numelemdim, dims[1], mapid, status;
- size_t num_elem, start[1], count[1];
- char errmsg[MAX_ERR_LENGTH];
-
- exerrval = 0; /* clear error code */
-
- /* inquire id's of previously defined dimensions */
-
- if ((status = nc_inq_dimid (neid, DIM_NUM_ELEM, &numelemdim)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate number of elements in file id %d",
- neid);
- ex_err(func_name,errmsg,exerrval);
- return (EX_FATAL);
- }
-
- if ((status = nc_inq_dimlen (neid, numelemdim, &num_elem)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get number of elements in file id %d",
- neid);
- ex_err(func_name,errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* Check input parameters for a valid range of numbers */
- if (start_ent < 0 || start_ent > num_elem) {
- exerrval = status;
- sprintf(errmsg,
- "Error: Invalid input to function %s!\n", func_name);
- ex_err(func_name,errmsg,exerrval);
- return (EX_FATAL);
- }
-
- if (num_ents < 0) {
- exerrval = status;
- sprintf(errmsg, "Error: Invalid number of entries in map!\n");
- ex_err(func_name,errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* start_ent now starts at 1, not 0 */
- if ((start_ent + num_ents - 1) > num_elem) {
- exerrval = status;
- sprintf(errmsg, "Error: request range invalid!\n");
- ex_err(func_name,errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* check to see if this variable is already defined */
- if ((status = nc_inq_varid (neid, VAR_ELEM_NUM_MAP, &mapid)) != NC_NOERR) {
-
- /* if not, then create it */
-
- /* put netcdf file into define mode */
- if ((status = nc_redef (neid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to put file id %d into define mode",
- neid);
- ex_err(func_name,errmsg,exerrval);
- return (EX_FATAL);
- }
-
- dims[0] = numelemdim;
-
- if ((status = nc_def_var(neid, VAR_ELEM_NUM_MAP, NC_INT, 1, dims, &mapid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to create element numbering map in file id %d",
- neid);
- ex_err(func_name,errmsg,exerrval);
-
- /* Leave define mode before returning */
- ne_leavedef(neid, func_name);
- }
-
-
- /* leave define mode */
- if ((status = nc_enddef (neid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to complete definition in file id %d",
- neid);
- ex_err(func_name,errmsg,exerrval);
- return (EX_FATAL);
- }
-
- } /* End: "if ((mapid = nc_inq_varid (neid, VAR_ELEM_NUM_MAP)) != NC_NOERR)" */
-
-
- /* write out the element numbering map */
- start[0] = --start_ent;
- count[0] = num_ents;
-
- status = nc_put_vara_int(neid, mapid, start, count, elem_map);
-
- if (status != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to store element numbering map in file id %d",
- neid);
- ex_err(func_name,errmsg,exerrval);
- return (EX_FATAL);
- }
-
- return (EX_NOERR);
-
-}
diff --git a/nemesis/ne_pncor.c b/nemesis/ne_pncor.c
deleted file mode 100644
index 3df61ff..0000000
--- a/nemesis/ne_pncor.c
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-/*****************************************************************************/
-/*****************************************************************************/
-/* Function(s) contained in this file:
- * ne_put_n_coord()
- *****************************************************************************
- * This function puts "n" coordinate values.
- *****************************************************************************
- * Variable Index:
- * neid - The NetCDF ID of an already open NemesisI file.
- * start_node_num - The starting index of the coords to be obtained.
- * num_nodes - The number of FEM nodes to read coords for.
- * x_coor - Pointer to location of X coordinate vector.
- * y_coor - Pointer to location of Y coordinate vector.
- * z_coor - Pointer to location of Z coordinate vector.
- */
-/*****************************************************************************/
-/*****************************************************************************/
-/*****************************************************************************/
-
-#include <stdio.h>
-
-#include <netcdf.h>
-
-#include <exodusII.h>
-#include <exodusII_int.h>
-
-#include "ne_nemesisI_int.h"
-#include "ne_nemesisI.h"
-
-/*
- * writes the coordinates of all the nodes in the model
- */
-
-int ne_put_n_coord (int neid,
- int start_node_num,
- int num_nodes,
- void *x_coor,
- void *y_coor,
- void *z_coor)
-{
- int coordidx, coordidy, coordidz;
- int coordid;
-
- int status;
- int ndimdim;
- size_t i, num_dim, start[2], count[2];
- char *which = NULL;
- char errmsg[MAX_ERR_LENGTH];
-
- exerrval = 0; /* clear error code */
-
- /* inquire id's of previously defined dimensions */
-
- if ((status = nc_inq_dimid (neid, DIM_NUM_DIM, &ndimdim)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate number of dimensions in file id %d",
- neid);
- ex_err("ne_put_n_coord",errmsg,exerrval);
- return (EX_FATAL);
- }
-
- if ((status = nc_inq_dimlen(neid, ndimdim, &num_dim)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get number of dimensions in file id %d",
- neid);
- ex_err("ne_put_n_coord",errmsg,exerrval);
- return (EX_FATAL);
- }
-
-
- /* write out the coordinates */
- if (ex_large_model(neid) == 0) {
- if ((status = nc_inq_varid (neid, VAR_COORD, &coordid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Warning: failed to locate nodal coordinates in file id %d", neid);
- ex_err("ne_get_n_coord",errmsg,exerrval);
- return (EX_WARN);
- }
-
- start_node_num--; /* do this here so it is only decremented once */
- for (i=0; i<num_dim; i++) {
- start[0] = i;
- start[1] = start_node_num;
-
- count[0] = 1;
- count[1] = num_nodes;
-
- if (i == 0 && x_coor != NULL) {
- which = "X";
- if (ex_comp_ws(neid) == 4) {
- status = nc_put_vara_float(neid, coordid, start, count, x_coor);
- } else {
- status = nc_put_vara_double(neid, coordid, start, count, x_coor);
- }
- }
- else if (i == 1 && y_coor != NULL) {
- which = "Y";
- if (ex_comp_ws(neid) == 4) {
- status = nc_put_vara_float(neid, coordid, start, count, y_coor);
- } else {
- status = nc_put_vara_double(neid, coordid, start, count, y_coor);
- }
- }
- else if (i == 2 && z_coor != NULL) {
- which = "Z";
- if (ex_comp_ws(neid) == 4) {
- status = nc_put_vara_float(neid, coordid, start, count, z_coor);
- } else {
- status = nc_put_vara_double(neid, coordid, start, count, z_coor);
- }
- }
-
- if (status != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to put %s coord array in file id %d", which, neid);
- ex_err("ne_put_n_coord",errmsg,exerrval);
- return (EX_FATAL);
- }
- }
- } else {
- start_node_num--; /* do this here so it is only decremented once */
- for (i=0; i<num_dim; i++) {
- start[0] = start_node_num;
- count[0] = num_nodes;
-
- if (i == 0 && x_coor != NULL) {
- which = "X";
- if ((status = nc_inq_varid (neid, VAR_COORD_X, &coordidx)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Warning: failed to locate x-nodal coordinates in file id %d", neid);
- ex_err("ne_get_n_coord",errmsg,exerrval);
- return (EX_WARN);
- }
-
- if (ex_comp_ws(neid) == 4) {
- status = nc_put_vara_float(neid, coordidx, start, count, x_coor);
- } else {
- status = nc_put_vara_double(neid, coordidx, start, count, x_coor);
- }
- }
-
- else if (i == 1 && y_coor != NULL) {
- which = "Y";
- if ((status = nc_inq_varid (neid, VAR_COORD_Y, &coordidy)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Warning: failed to locate y-nodal coordinates in file id %d", neid);
- ex_err("ne_get_n_coord",errmsg,exerrval);
- return (EX_WARN);
- }
-
- if (ex_comp_ws(neid) == 4) {
- status = nc_put_vara_float(neid, coordidy, start, count, y_coor);
- } else {
- status = nc_put_vara_double(neid, coordidy, start, count, y_coor);
- }
- }
- else if (i == 2 && z_coor != NULL) {
- which = "Z";
- if ((status = nc_inq_varid (neid, VAR_COORD_Z, &coordidz)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Warning: failed to locate z-nodal coordinates in file id %d", neid);
- ex_err("ne_get_n_coord",errmsg,exerrval);
- return (EX_WARN);
- }
-
- if (ex_comp_ws(neid) == 4) {
- status = nc_put_vara_float(neid, coordidz, start, count, z_coor);
- } else {
- status = nc_put_vara_double(neid, coordidz, start, count, z_coor);
- }
- }
-
- if (status != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to put %s coord array in file id %d", which, neid);
- ex_err("ne_put_n_coord",errmsg,exerrval);
- return (EX_FATAL);
- }
- }
- }
- return (EX_NOERR);
-}
diff --git a/nemesis/ne_pnnnm.c b/nemesis/ne_pnnnm.c
deleted file mode 100644
index 4f4df34..0000000
--- a/nemesis/ne_pnnnm.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (c) 1998 Sandia Corporation. Under the terms of Contract
- * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
- * retains certain rights in this software.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided
- * with the distribution.
- *
- * * Neither the name of Sandia Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-/*****************************************************************************
-*
-* ne_pnnnm - ne_put_n_node_num_map
-*
-* entry conditions -
-* input parameters:
-* int neid exodus file id
-* int start_ent first entry in node_map
-* int num_ents number of entries in node_map
-* int* node_map node numbering map
-*
-* exit conditions -
-*
-* revision history -
-*
-*
-*****************************************************************************/
-
-#include "exodusII.h"
-#include "exodusII_int.h"
-#include "ne_nemesisI.h"
-#include "ne_nemesisI_int.h"
-
-/*
- * writes out the node numbering map to the database; allows node numbers
- * to be non-contiguous
- */
-
-int ne_put_n_node_num_map (int neid,
- int start_ent,
- int num_ents,
- int *node_map)
-{
- char *func_name="ne_put_n_node_num_map";
-
- int numnodedim, dims[1], mapid, status;
- size_t num_nodes, start[1], count[1];
- char errmsg[MAX_ERR_LENGTH];
-
- exerrval = 0; /* clear error code */
-
- /* inquire id's of previously defined dimensions */
-
- if ((status = nc_inq_dimid (neid, DIM_NUM_NODES, &numnodedim)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to locate number of nodes in file id %d",
- neid);
- ex_err(func_name,errmsg,exerrval);
- return (EX_FATAL);
- }
-
- if ((status = nc_inq_dimlen(neid, numnodedim, &num_nodes)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to get number of nodes in file id %d",
- neid);
- ex_err(func_name,errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* Check input parameters for a valid range of numbers */
- if (start_ent < 0 || start_ent > num_nodes) {
- exerrval = status;
- sprintf(errmsg,
- "Error: Invalid input to function %s!\n", func_name);
- ex_err(func_name,errmsg,exerrval);
- return (EX_FATAL);
- }
-
- if (num_ents < 0) {
- exerrval = status;
- sprintf(errmsg, "Error: Invalid number of entries in map!\n");
- ex_err(func_name,errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* start_ent now starts at 1, not 0 */
- if ((start_ent + num_ents - 1) > num_nodes) {
- exerrval = status;
- sprintf(errmsg, "Error: request range invalid!\n");
- ex_err(func_name,errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* check to see if node number map variable is already defined */
- if ((status = nc_inq_varid (neid, VAR_NODE_NUM_MAP, &mapid)) != NC_NOERR) {
- /* if not, then create it */
-
- /* put netcdf file into define mode */
- if ((status = nc_redef (neid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to put file id %d into define mode",
- neid);
- ex_err(func_name,errmsg,exerrval);
- return (EX_FATAL);
- }
-
- /* create a variable array in which to store the node numbering map */
- dims[0] = numnodedim;
- if ((status = nc_def_var(neid, VAR_NODE_NUM_MAP, NC_INT, 1, dims, &mapid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to create node numbering map array in file id %d",
- neid);
- ex_err(func_name,errmsg,exerrval);
-
- /* Leave define mode before returning */
- ne_leavedef(neid, func_name);
-
- return (EX_FATAL);
- }
-
- /* leave define mode */
- if ((status = nc_enddef (neid)) != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to complete definition in file id %d",
- neid);
- ex_err(func_name,errmsg,exerrval);
- return (EX_FATAL);
- }
- }
-
-
- /* write out the node numbering map */
- start[0] = --start_ent;
- count[0] = num_ents;
- status = nc_put_vara_int (neid, mapid, start, count, node_map);
-
- if (status != NC_NOERR) {
- exerrval = status;
- sprintf(errmsg,
- "Error: failed to store node numbering map in file id %d",
- neid);
- ex_err(func_name,errmsg,exerrval);
- return (EX_FATAL);
- }
- return (EX_NOERR);
-}
diff --git a/nemesis/nemesis_cfg.h.in b/nemesis/nemesis_cfg.h.in
new file mode 100755
index 0000000..dd32b4a
--- /dev/null
+++ b/nemesis/nemesis_cfg.h.in
@@ -0,0 +1,25 @@
+#ifndef __nemesis_cfg_h
+#define __nemesis_cfg_h
+
+#define NEMESIS_VERSION_MAJOR @NEMESIS_VERSION_MAJOR@
+#define NEMESIS_VERSION_MINOR @NEMESIS_VERSION_MINOR@
+#define NEMESIS_VERSION_PATCH @NEMESIS_VERSION_PATCH@
+#define NEMESIS_VERSION "@NEMESIS_VERSION_MAJOR at .@NEMESIS_VERSION_MINOR at .@NEMESIS_VERSION_PATCH@"
+
+#if defined(_WIN32) && !defined(WIN32)
+# define WIN32
+#endif
+
+#cmakedefine NEMESIS_BUILD_SHARED_LIBS
+#if defined(WIN32) && defined(NEMESIS_BUILD_SHARED_LIBS)
+# if defined(nemc_EXPORTS)
+# define NEMESIS_EXPORT __declspec( dllexport ) extern
+# else
+# define NEMESIS_EXPORT __declspec( dllimport ) extern
+# endif
+#else
+# define NEMESIS_EXPORT extern
+#endif
+
+#endif
+
diff --git a/nemesis/nemesis_wrapper.c b/nemesis/nemesis_wrapper.c
new file mode 100644
index 0000000..531998a
--- /dev/null
+++ b/nemesis/nemesis_wrapper.c
@@ -0,0 +1,596 @@
+#include <exodusII.h>
+#include <exodusII_int.h>
+#include <ne_nemesisI.h>
+
+/*=============================================================================
+ * Initial Information Routines
+ *===========================================================================*/
+int
+ne_get_init_info(int neid, /* NemesisI file ID */
+ int *num_proc, /* Number of processors */
+ int *num_proc_in_f, /* Number of procs in this file */
+ char *ftype)
+{
+ return ex_get_init_info(neid, num_proc, num_proc_in_f, ftype);
+}
+
+int
+ne_put_init_info(int neid, /* NemesisI file ID */
+ int num_proc, /* Number of processors */
+ int num_proc_in_f, /* Number of procs in this file */
+ char *ftype)
+{
+ return ex_put_init_info(neid, num_proc, num_proc_in_f, ftype);
+}
+
+int
+ne_get_init_global(int neid, /* NemesisI file ID */
+ void_int *num_nodes_g, /* Number of global FEM nodes */
+ void_int *num_elems_g, /* Number of global FEM elements */
+ void_int *num_elem_blks_g, /* Number of global elem blocks */
+ void_int *num_node_sets_g, /* Number of global node sets */
+ void_int *num_side_sets_g /* Number of global side sets */
+ )
+{
+ return ex_get_init_global(neid, num_nodes_g, num_elems_g, num_elem_blks_g, num_node_sets_g, num_side_sets_g);
+}
+
+int
+ne_put_init_global(int neid, /* NemesisI file ID */
+ int64_t num_nodes_g, /* Number of global FEM nodes */
+ int64_t num_elems_g, /* Number of global FEM elements */
+ int64_t num_elem_blks_g, /* Number of global elem blocks */
+ int64_t num_node_sets_g, /* Number of global node sets */
+ int64_t num_side_sets_g /* Number of global side sets */
+ )
+{
+ return ex_put_init_global(neid, num_nodes_g, num_elems_g, num_elem_blks_g, num_node_sets_g, num_side_sets_g);
+}
+
+int ne_put_version(int neid)
+{
+ return ex_put_nemesis_version(neid);
+}
+
+/*=============================================================================
+ * Loadbalance Parameter Routines
+ *===========================================================================*/
+int
+ne_get_loadbal_param(int neid, /* NetCDF/Exodus file ID */
+ void_int *num_int_nodes, /* Number of internal FEM nodes */
+ void_int *num_bor_nodes, /* Number of border FEM nodes */
+ void_int *num_ext_nodes, /* Number of external FEM nodes */
+ void_int *num_int_elems, /* Number of internal FEM elems */
+ void_int *num_bor_elems, /* Number of border FEM elems */
+ void_int *num_node_cmaps, /* Number of nodal comm maps */
+ void_int *num_elem_cmaps, /* Number of elemental comm maps */
+ int processor /* Processor ID */
+ )
+{
+ return ex_get_loadbal_param(neid,
+ num_int_nodes, num_bor_nodes, num_ext_nodes,
+ num_int_elems, num_bor_elems,
+ num_node_cmaps, num_elem_cmaps, processor);
+}
+
+int
+ne_put_loadbal_param(int neid, /* NemesisI file ID */
+ int64_t num_int_nodes, /* Number of internal FEM nodes */
+ int64_t num_bor_nodes, /* Number of border FEM nodes */
+ int64_t num_ext_nodes, /* Number of external FEM nodes */
+ int64_t num_int_elems, /* Number of internal FEM elems */
+ int64_t num_bor_elems, /* Number of border FEM elems */
+ int64_t num_node_cmaps,/* Number of nodal comm maps */
+ int64_t num_elem_cmaps,/* Number of elemental comm maps */
+ int processor /* Processor ID */
+ )
+{
+ return ex_put_loadbal_param(neid,
+ num_int_nodes, num_bor_nodes, num_ext_nodes,
+ num_int_elems, num_bor_elems,
+ num_node_cmaps, num_elem_cmaps, processor);
+}
+
+int
+ne_put_loadbal_param_cc(int neid, /* NetCDF/Exodus file ID */
+ void_int *num_int_nodes, /* Number of internal node IDs */
+ void_int *num_bor_nodes, /* Number of border node IDs */
+ void_int *num_ext_nodes, /* Number of external node IDs */
+ void_int *num_int_elems, /* Number of internal elem IDs */
+ void_int *num_bor_elems, /* Number of border elem IDs */
+ void_int *num_node_cmaps, /* Number of nodal comm maps */
+ void_int *num_elem_cmaps /* Number of elem comm maps */
+ )
+{
+ return ex_put_loadbal_param_cc(neid,
+ num_int_nodes, num_bor_nodes, num_ext_nodes,
+ num_int_elems, num_bor_elems,
+ num_node_cmaps, num_elem_cmaps);
+}
+
+
+/*=============================================================================
+ * NS, SS & EB Global Parameter Routines
+ *===========================================================================*/
+int
+ne_get_ns_param_global(int neid, /* NetCDF/Exodus file ID */
+ void_int *ns_ids_glob, /* Global IDs of node sets */
+ void_int *ns_n_cnt_glob, /* Count of nodes in node sets */
+ void_int *ns_df_cnt_glob /* Count of dist. factors in ns */
+ )
+{
+ return ex_get_ns_param_global(neid, ns_ids_glob, ns_n_cnt_glob, ns_df_cnt_glob);
+}
+
+int
+ne_put_ns_param_global(int neid, /* NemesisI file ID */
+ void_int *global_ids, /* Vector of global node-set IDs */
+ void_int *global_n_cnts, /* Vector of node counts in node-sets */
+ void_int *global_df_cnts /* Vector of dist factor counts in node-sets */
+ )
+{
+ return ex_put_ns_param_global(neid, global_ids, global_n_cnts, global_df_cnts);
+}
+
+int
+ne_get_ss_param_global(int neid, /* NetCDF/Exodus file ID */
+ void_int *ss_ids_glob, /* Global side-set IDs */
+ void_int *ss_s_cnt_glob, /* Global side count */
+ void_int *ss_df_cnt_glob /* Global dist. factor count */
+ )
+{
+ return ex_get_ss_param_global(neid, ss_ids_glob, ss_s_cnt_glob, ss_df_cnt_glob);
+}
+
+int
+ne_put_ss_param_global(int neid, /* NemesisI file ID */
+ void_int *global_ids, /* Vector of global side-set IDs */
+ void_int *global_el_cnts, /* Vector of element/side */
+ /* counts in each side set */
+ void_int *global_df_cnts /* Vector of dist. factor */
+ /* counts in each side set */
+ )
+{
+ return ex_put_ss_param_global(neid, global_ids, global_el_cnts, global_df_cnts);
+}
+
+
+int
+ne_get_eb_info_global(int neid, /* NemesisI file ID */
+ void_int *el_blk_ids, /* Vector of global element IDs */
+ void_int *el_blk_cnts /* Vector of global element counts */
+ )
+{
+ return ex_get_eb_info_global(neid, el_blk_ids, el_blk_cnts);
+}
+
+int
+ne_put_eb_info_global(int neid, /* NemesisI file ID */
+ void_int *el_blk_ids, /* Vector of global element IDs */
+ void_int *el_blk_cnts /* Vector of global element counts */
+ )
+{
+ return ex_put_eb_info_global(neid, el_blk_ids, el_blk_cnts);
+}
+
+
+/*=============================================================================
+ * NS, SS & EB Subset Routines
+ *===========================================================================*/
+int
+ne_get_n_side_set(int neid, /* NetCDF/Exodus file ID */
+ ex_entity_id side_set_id, /* Side-set ID to read */
+ int64_t start_side_num, /* Starting element number */
+ int64_t num_sides, /* Number of sides to read */
+ void_int *side_set_elem_list, /* List of element IDs */
+ void_int *side_set_side_list /* List of side IDs */
+ )
+{
+ return ex_get_n_side_set(neid, side_set_id, start_side_num, num_sides, side_set_elem_list, side_set_side_list);
+}
+
+int
+ne_put_n_side_set(int neid, /* NetCDF/Exodus file ID */
+ ex_entity_id side_set_id, /* Side-set ID to write */
+ int64_t start_side_num, /* Starting element number */
+ int64_t num_sides, /* Number of sides to write */
+ const void_int *side_set_elem_list, /* List of element IDs */
+ const void_int *side_set_side_list /* List of side IDs */
+ )
+{
+ return ex_put_n_side_set(neid, side_set_id, start_side_num, num_sides, side_set_elem_list, side_set_side_list);
+}
+
+
+int
+ne_get_n_side_set_df(int neid, /* NetCDF/Exodus file ID */
+ ex_entity_id side_set_id, /* Side-set ID */
+ int64_t start_num, /* Starting df number */
+ int64_t num_df_to_get, /* Number of df's to read */
+ void *side_set_df /* Distribution factors */
+ )
+{
+ return ex_get_n_side_set_df(neid, side_set_id, start_num, num_df_to_get, side_set_df);
+}
+
+int
+ne_put_n_side_set_df(int neid, /* NetCDF/Exodus file ID */
+ ex_entity_id side_set_id, /* Side-set ID */
+ int64_t start_num, /* Starting df number */
+ int64_t num_df_to_get, /* Number of df's to write */
+ void *side_set_df /* Distribution factors */
+ )
+{
+ return ex_put_n_side_set_df(neid, side_set_id, start_num, num_df_to_get, side_set_df);
+}
+
+
+int
+ne_get_n_node_set(int neid, /* NetCDF/Exodus file ID */
+ ex_entity_id node_set_id, /* Node set ID */
+ int64_t start_node_num, /* Node index to start reading at */
+ int64_t num_node, /* Number of nodes to read */
+ void_int *node_set_node_list /* List of nodes in node set */
+ )
+{
+ return ex_get_n_node_set(neid, node_set_id, start_node_num, num_node, node_set_node_list);
+}
+
+int
+ne_put_n_node_set(int neid, /* NetCDF/Exodus file ID */
+ ex_entity_id node_set_id, /* Node set ID */
+ int64_t start_node_num, /* Node index to start writing at */
+ int64_t num_node, /* Number of nodes to write */
+ const void_int *node_set_node_list /* List of nodes in node set */
+ )
+{
+ return ex_put_n_node_set(neid, node_set_id, start_node_num, num_node, node_set_node_list);
+}
+
+int
+ne_get_n_node_set_df(int neid, /* NetCDF/Exodus file ID */
+ ex_entity_id node_set_id, /* Node-set ID */
+ int64_t start_num, /* Starting df number */
+ int64_t num_df_to_get, /* Number of df's to read */
+ void *node_set_df /* Distribution factors */
+ )
+{
+ return ex_get_n_node_set_df(neid, node_set_id, start_num, num_df_to_get, node_set_df);
+}
+
+int
+ne_put_n_node_set_df(int neid, /* NetCDF/Exodus file ID */
+ ex_entity_id node_set_id, /* Node-set ID */
+ int64_t start_num, /* Starting df number */
+ int64_t num_df_to_get, /* Number of df's to write */
+ void *node_set_df /* Distribution factors */
+ )
+{
+ return ex_put_n_node_set_df(neid, node_set_id, start_num, num_df_to_get, node_set_df);
+}
+
+int
+ne_get_n_coord(int neid, /* NetCDF/Exodus file ID */
+ int64_t start_node_num, /* Starting position to read from */
+ int64_t num_nodes, /* Number of coords to read */
+ void *x_coor, /* Vector of X coordinates */
+ void *y_coor, /* Vector of Y coordinates */
+ void *z_coor /* Vector of Z coordinates */
+ )
+{
+ return ex_get_n_coord(neid, start_node_num, num_nodes, x_coor, y_coor, z_coor);
+}
+
+int
+ne_put_n_coord(int neid, /* NetCDF/Exodus file ID */
+ int64_t start_node_num, /* Starting position to write to */
+ int64_t num_nodes, /* Number of coords to write */
+ void *x_coor, /* Vector of X coordinates */
+ void *y_coor, /* Vector of Y coordinates */
+ void *z_coor /* Vector of Z coordinates */
+ )
+{
+ return ex_put_n_coord(neid, start_node_num, num_nodes, x_coor, y_coor, z_coor);
+}
+
+int
+ne_get_n_elem_conn (int neid, /* NetCDF/Exodus file ID */
+ ex_entity_id elem_blk_id, /* Element block ID */
+ int64_t start_elem_num, /* Starting position to read from */
+ int64_t num_elems, /* Number of elements to read */
+ void_int *connect /* Connectivity vector */
+ )
+{
+ return ex_get_n_elem_conn(neid, elem_blk_id, start_elem_num, num_elems, connect);
+}
+
+int
+ne_put_n_elem_conn (int neid, /* NetCDF/Exodus file ID */
+ ex_entity_id elem_blk_id, /* Element block ID */
+ int64_t start_elem_num, /* Starting position to write to */
+ int64_t num_elems, /* Number of elements to write */
+ const void_int *connect /* Connectivity vector */
+ )
+{
+ return ex_put_n_elem_conn(neid, elem_blk_id, start_elem_num, num_elems, connect);
+}
+
+int
+ne_get_n_elem_attr (int neid, /* NetCDF/Exodus file ID */
+ ex_entity_id elem_blk_id, /* Element block ID */
+ int64_t start_elem_num, /* Starting position to read from */
+ int64_t num_elems, /* Number of elements to read */
+ void *attrib /* Attribute */
+ )
+{
+ return ex_get_n_elem_attr(neid, elem_blk_id, start_elem_num, num_elems, attrib);
+}
+
+int
+ne_put_n_elem_attr (int neid, /* NetCDF/Exodus file ID */
+ ex_entity_id elem_blk_id, /* Element block ID */
+ int64_t start_elem_num, /* Starting position to write to */
+ int64_t num_elems, /* Number of elements to write */
+ void *attrib /* Attribute */
+ )
+{
+ return ex_put_n_elem_attr(neid, elem_blk_id, start_elem_num, num_elems, attrib);
+}
+
+int
+ne_get_elem_type(int neid, /* NetCDF/Exodus file ID */
+ ex_entity_id elem_blk_id, /* Element block ID */
+ char *elem_type /* The name of the element type */
+ )
+{
+ return ex_get_elem_type(neid, elem_blk_id, elem_type);
+}
+
+/*=============================================================================
+ * Variable Routines
+ *===========================================================================*/
+int
+ne_get_n_elem_var (int neid, /* NetCDF/Exodus file ID */
+ int time_step, /* time index */
+ int elem_var_index, /* elemental variable index */
+ ex_entity_id elem_blk_id, /* elemental block id */
+ int64_t num_elem_this_blk, /* number of elements in block */
+ int64_t start_elem_num, /* Starting position for read */
+ int64_t num_elem, /* Number of elements to read */
+ void *elem_var_vals /* variable values */
+ )
+{
+ return ex_get_n_var(neid, time_step, EX_ELEM_BLOCK,
+ elem_var_index, elem_blk_id,
+ start_elem_num, num_elem,
+ elem_var_vals);
+}
+
+int
+ne_put_elem_var_slab (int neid, /* NetCDF/Exodus file ID */
+ int time_step, /* time index */
+ int elem_var_index, /* elemental variable index */
+ ex_entity_id elem_blk_id, /* elemental block id */
+ int64_t start_pos, /* Starting position to write to */
+ int64_t num_vals, /* Number of elements to write */
+ void *elem_var_vals /* variable values */
+ )
+{
+ return ex_put_elem_var_slab(neid, time_step, elem_var_index, elem_blk_id, start_pos, num_vals, elem_var_vals);
+}
+
+int
+ne_get_n_nodal_var(int neid, /* NetCDF/Exodus file ID */
+ int time_step, /* whole time step number */
+ int nodal_var_index, /* index of desired nodal var */
+ int64_t start_node_num, /* starting node number */
+ int64_t num_nodes, /* number of nodes to read */
+ void *nodal_vars /* array of nodal var values */
+ )
+{
+ return ex_get_n_var(neid, time_step, EX_NODAL,
+ nodal_var_index, 1,
+ start_node_num, num_nodes,
+ nodal_vars);
+}
+
+int
+ne_put_nodal_var_slab(int neid, /* NetCDF/Exodus file ID */
+ int time_step, /* The time step index */
+ int nodal_var_index, /* Nodal variable index */
+ int64_t start_pos, /* Start position for write */
+ int64_t num_vals, /* Number of nodal variables */
+ void *nodal_var_vals /* Nodal variable values */
+ )
+{
+ return ex_put_nodal_var_slab(neid, time_step, nodal_var_index, start_pos, num_vals, nodal_var_vals);
+}
+
+/*=============================================================================
+ * Number Map Routines
+ *===========================================================================*/
+int
+ne_get_n_elem_num_map (int neid, /* NetCDF/Exodus file ID */
+ int64_t start_ent, /* Starting position to read from */
+ int64_t num_ents, /* Number of elements to read */
+ void_int *elem_map /* element map numbers */
+ )
+{
+ return ex_get_n_elem_num_map(neid, start_ent, num_ents, elem_map);
+}
+
+int
+ne_put_n_elem_num_map (int neid, /* NetCDF/Exodus file ID */
+ int64_t start_ent, /* Starting position to read from */
+ int64_t num_ents, /* Number of elements to read */
+ const void_int *elem_map /* element map numbers */
+ )
+{
+ return ex_put_partial_id_map(neid, EX_ELEM_MAP, start_ent, num_ents, elem_map);
+}
+
+int
+ne_get_n_node_num_map(int neid, /* NetCDF/Exodus file ID */
+ int64_t start_ent, /* starting node number */
+ int64_t num_ents, /* number of nodes to read */
+ void_int *node_map /* vector for node map */
+ )
+{
+ return ex_get_n_node_num_map(neid, start_ent, num_ents, node_map);
+}
+
+int
+ne_put_n_node_num_map(int neid, /* NetCDF/Exodus file ID */
+ int64_t start_ent, /* starting node number */
+ int64_t num_ents, /* number of nodes to read */
+ const void_int *node_map /* vector for node map */
+ )
+{
+ return ex_put_partial_id_map(neid, EX_NODE_MAP, start_ent, num_ents, node_map);
+}
+
+int
+ne_get_node_map(int neid, /* NetCDF/Exodus file ID */
+ void_int *node_mapi, /* Internal FEM node IDs */
+ void_int *node_mapb, /* Border FEM node IDs */
+ void_int *node_mape, /* External FEM node IDs */
+ int processor /* Processor IDs */
+ )
+{
+ return ex_get_processor_node_maps(neid, node_mapi, node_mapb, node_mape, processor);
+}
+
+int
+ne_put_node_map(int neid, /* NetCDF/Exodus file ID */
+ void_int *node_mapi, /* Internal FEM node IDs */
+ void_int *node_mapb, /* Border FEM node IDs */
+ void_int *node_mape, /* External FEM node IDs */
+ int processor /* This processor ID */
+ )
+{
+ return ex_put_processor_node_maps(neid, node_mapi, node_mapb, node_mape, processor);
+}
+
+int
+ne_get_elem_map(int neid, /* NetCDF/Exodus file ID */
+ void_int *elem_mapi, /* Internal element IDs */
+ void_int *elem_mapb, /* Border element IDs */
+ int processor /* Processor ID */
+ )
+{
+ return ex_get_processor_elem_maps(neid, elem_mapi, elem_mapb, processor);
+}
+
+int
+ne_put_elem_map(int neid, /* NetCDF/Exodus file ID */
+ void_int *elem_mapi, /* Internal FEM element IDs */
+ void_int *elem_mapb, /* Border FEM element IDs */
+ int processor /* This processor ID */
+ )
+{
+ return ex_put_processor_elem_maps(neid, elem_mapi, elem_mapb, processor);
+}
+
+
+/*=============================================================================
+ * Communications Maps Routines
+ *===========================================================================*/
+
+int
+ne_get_cmap_params(int neid, /* NetCDF/Exodus file ID */
+ void_int *node_cmap_ids, /* Nodal comm. map IDs */
+ void_int *node_cmap_node_cnts, /* Number of nodes in each map */
+ void_int *elem_cmap_ids, /* Elemental comm. map IDs */
+ void_int *elem_cmap_elem_cnts, /* Number of elems in each map */
+ int processor /* This processor ID */
+ )
+{
+ return ex_get_cmap_params(neid, node_cmap_ids, node_cmap_node_cnts, elem_cmap_ids, elem_cmap_elem_cnts, processor);
+}
+
+int
+ne_put_cmap_params(int neid, /* NetCDF/Exodus file ID */
+ void_int *node_map_ids, /* Node map IDs */
+ void_int *node_map_node_cnts,/* Nodes in nodal comm */
+ void_int *elem_map_ids, /* Elem map IDs */
+ void_int *elem_map_elem_cnts,/* Elems in elemental comm */
+ int64_t processor /* This processor ID */
+ )
+{
+ return ex_put_cmap_params(neid, node_map_ids, node_map_node_cnts, elem_map_ids, elem_map_elem_cnts, processor);
+}
+
+int
+ne_put_cmap_params_cc(int neid, /* NetCDF/Exodus file ID */
+ void_int *node_map_ids, /* Node map IDs */
+ void_int *node_map_node_cnts, /* Nodes in nodal comm */
+ void_int *node_proc_ptrs, /* Pointer into array for */
+ /* node maps */
+ void_int *elem_map_ids, /* Elem map IDs */
+ void_int *elem_map_elem_cnts, /* Elems in elemental comm */
+ void_int *elem_proc_ptrs /* Pointer into array for */
+ /* elem maps */
+ )
+{
+ return ex_put_cmap_params_cc(neid,
+ node_map_ids, node_map_node_cnts, node_proc_ptrs,
+ elem_map_ids, elem_map_elem_cnts, elem_proc_ptrs);
+}
+
+
+int
+ne_get_node_cmap(int neid, /* NetCDF/Exodus file ID */
+ ex_entity_id map_id, /* Map ID */
+ void_int *node_ids, /* FEM node IDs */
+ void_int *proc_ids, /* Processor IDs */
+ int processor /* This processor ID */
+ )
+{
+ return ex_get_node_cmap(neid, map_id, node_ids, proc_ids, processor);
+}
+
+int
+ne_put_node_cmap(int neid, /* NetCDF/Exodus file ID */
+ ex_entity_id map_id, /* Nodal comm map ID */
+ void_int *node_ids, /* FEM node IDs */
+ void_int *proc_ids, /* Processor IDs */
+ int processor /* This processor ID */
+ )
+{
+ return ex_put_node_cmap(neid, map_id, node_ids, proc_ids, processor);
+}
+
+int
+ne_get_elem_cmap(int neid, /* NetCDF/Exodus file ID */
+ ex_entity_id map_id, /* Elemental comm map ID */
+ void_int *elem_ids, /* Element IDs */
+ void_int *side_ids, /* Element side IDs */
+ void_int *proc_ids, /* Processor IDs */
+ int processor /* This processor ID */
+ )
+{
+ return ex_get_elem_cmap(neid, map_id, elem_ids, side_ids, proc_ids, processor);
+}
+
+
+int
+ne_put_elem_cmap(int neid, /* NetCDF/Exodus file ID */
+ ex_entity_id map_id, /* Elemental comm map ID */
+ void_int *elem_ids, /* Vector of element IDs */
+ void_int *side_ids, /* Vector of side IDs */
+ void_int *proc_ids, /* Vector of processor IDs */
+ int processor /* This processor ID */
+ )
+{
+ return ex_put_elem_cmap(neid, map_id, elem_ids, side_ids, proc_ids, processor);
+}
+
+int ne_get_idx(int neid, /* NetCDF/Exodus file ID */
+ const char *ne_var_name, /* Nemesis index variable name */
+ int64_t *index, /* array of length 2 to hold results */
+ int pos /* position of this proc/cmap in index */
+ )
+{
+ return ex_get_idx(neid, ne_var_name, index, pos);
+}
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/exodus.git
More information about the debian-science-commits
mailing list