[3d993d]: exodus / cbind / test / testrd_par.c Maximize Restore History

Download this file

testrd_par.c    1211 lines (964 with data), 39.0 kB

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
/*
* 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
*
* author - Sandia National Laboratories
* Larry A. Schoof - Original
*
*
* environment - UNIX
*
* entry conditions -
* input parameters:
* int exoid exodus file id
*
* exit conditions -
*
* revision history -
*
*
*****************************************************************************/
#include <mpi.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.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;
int *elem_map, *connect, *node_list, *node_ctr_list, *elem_list, *side_list;
int *ids;
int *num_nodes_per_set = NULL;
int *num_elem_per_set = NULL;
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;
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 *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];
CPU_word_size = 0; /* sizeof(float) */
IO_word_size = 0; /* use what is stored in file */
ex_opts (EX_VERBOSE | EX_ABORT );
/* Initialize MPI. */
MPI_Init(&argc,&argv);
/* open EXODUS II files */
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);
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);
ex_inquire(exoid,EX_INQ_LIB_VERS, &idum, &version, cdum);
printf ("EXODUSII Library API; version %4.2f (%d)\n", version, idum);
/* 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);
/* 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));
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
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]);
}
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");
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);
if (num_dim >= 2)
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]);
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]);
{
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++) {
attrib_names[j] = (char *)calloc ((MAX_STR_LENGTH+1), sizeof(char));
}
error = ex_get_attr_names (exoid, EX_NODAL, 0, attrib_names);
printf (" after ex_get_attr_names, error = %d\n", error);
if (error == 0) {
attrib = (float *) calloc(num_nodes,sizeof(float));
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]);
}
free(attrib_names[j]);
}
free(attrib);
}
}
}
/* 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++) {
printf("Block # %d is id %d\n", i, ids[i]);
block_names[i] = (char *) calloc ((MAX_STR_LENGTH+1), sizeof(char));
}
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, id = %d, error = %d\n", ids[i], 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);
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=1; i<num_props; i++) /* Prop 1 is id; skip that here */
{
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++)
{
if (num_elem_in_block[i] > 0) {
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++)
{
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);
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);
}
}
free (attrib);
for (j=0; j<num_attr[i]; j++)
free (attrib_names[j]);
}
}
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++) {
nset_names[i] = (char *) calloc ((MAX_STR_LENGTH+1), sizeof(char));
}
error = ex_get_names(exoid, EX_NODE_SET, nset_names);
printf ("\nafter ex_get_names, error = %3d\n", error);
for (i=0; i<num_node_sets; i++)
{
ex_get_name(exoid, EX_NODE_SET, ids[i], name);
if (strcmp(name, nset_names[i]) != 0) {
printf ("error in ex_get_name for nodeset id %d\n", ids[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);
printf ("name = '%s'\n", nset_names[i]);
free(nset_names[i]);
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);
{
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++) {
attrib_names[j] = (char *)calloc ((MAX_STR_LENGTH+1), sizeof(char));
}
error = ex_get_attr_names (exoid, EX_NODE_SET, ids[i], attrib_names);
printf (" after ex_get_attr_names, error = %d\n", error);
if (error == 0) {
attrib = (float *) calloc(num_nodes_in_set,sizeof(float));
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]);
}
free(attrib_names[j]);
}
free(attrib);
}
}
}
}
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 (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++) {
sset_names[i] = (char *) calloc ((MAX_STR_LENGTH+1), sizeof(char));
}
error = ex_get_names(exoid, EX_SIDE_SET, sset_names);
printf ("\nafter ex_get_names, error = %3d\n", error);
for (i=0; i<num_side_sets; i++)
{
ex_get_name(exoid, EX_SIDE_SET, ids[i], name);
if (strcmp(name, sset_names[i]) != 0) {
printf ("error in ex_get_name for sideset id %d\n", ids[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 ("name = '%s'\n", sset_names[i]);
printf ("num_sides = %3d\n",num_sides_in_set);
printf ("num_dist_factors = %3d\n", num_df_in_set);
free(sset_names[i]);
/* 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_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]);
}
}
/* 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);
}
}
/* read nodeset variables parameters and names */
num_nset_vars = 0;
if (num_node_sets > 0) {
error = ex_get_var_param (exoid, "m", &num_nset_vars);
printf ("\nafter ex_get_var_param, error = %3d\n", error);
if (num_nset_vars > 0) {
for (i=0; i<num_nset_vars; i++)
{
var_names[i] = (char *) calloc ((MAX_STR_LENGTH+1), sizeof(char));
}
error = ex_get_var_names (exoid, "m", num_nset_vars, var_names);
printf ("\nafter ex_get_var_names, error = %3d\n", error);
printf ("There are %2d nodeset variables; their names are :\n",
num_nset_vars);
for (i=0; i<num_nset_vars; i++)
{
printf (" '%s'\n", var_names[i]);
free(var_names[i]);
}
/* read nodeset variable truth table */
if (num_nset_vars > 0) {
truth_tab = (int *) calloc ((num_node_sets*num_nset_vars), sizeof(int));
error = ex_get_nset_var_tab (exoid, num_node_sets, num_nset_vars, truth_tab);
printf ("\nafter ex_get_nset_var_tab, error = %3d\n", error);
printf ("This is the nodeset variable truth table:\n");
k = 0;
for (i=0; i<num_node_sets*num_nset_vars; i++)
{
printf ("%2d\n", truth_tab[k++]);
}
free (truth_tab);
}
}
}
/* read sideset variables parameters and names */
num_sset_vars = 0;
if (num_side_sets > 0) {
error = ex_get_var_param (exoid, "s", &num_sset_vars);
printf ("\nafter ex_get_var_param, error = %3d\n", error);
if (num_sset_vars > 0) {
for (i=0; i<num_sset_vars; i++)
{
var_names[i] = (char *) calloc ((MAX_STR_LENGTH+1), sizeof(char));
}
error = ex_get_var_names (exoid, "s", num_sset_vars, var_names);
printf ("\nafter ex_get_var_names, error = %3d\n", error);
printf ("There are %2d sideset variables; their names are :\n",
num_sset_vars);
for (i=0; i<num_sset_vars; i++)
{
printf (" '%s'\n", var_names[i]);
free(var_names[i]);
}
/* read sideset variable truth table */
if (num_sset_vars > 0) {
truth_tab = (int *) calloc ((num_side_sets*num_sset_vars), sizeof(int));
error = ex_get_sset_var_tab (exoid, num_side_sets, num_sset_vars, truth_tab);
printf ("\nafter ex_get_sset_var_tab, error = %3d\n", error);
printf ("This is the sideset variable truth table:\n");
k = 0;
for (i=0; i<num_side_sets*num_sset_vars; i++)
{
printf ("%2d\n", truth_tab[k++]);
}
free (truth_tab);
}
}
}
/* 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_var (exoid, time_step, var_index, num_nodes,
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++)
{
if (num_elem_in_block[i] > 0) {
var_values = (float *) calloc (num_elem_in_block[i], sizeof(float));
error = ex_get_elem_var (exoid, time_step, var_index, ids[i],
num_elem_in_block[i], var_values);
printf ("\nafter ex_get_elem_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);
}
/* 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);
}
/* read a sideset variable at one time step */
if (num_sset_vars > 0) {
ids = (int *) calloc(num_side_sets, sizeof(int));
error = ex_get_side_set_ids (exoid, ids);
printf ("\n after ex_get_side_set_ids, error = %3d\n", error);
for (i=0; i<num_side_sets; i++)
{
var_values = (float *) calloc (num_elem_per_set[i], sizeof(float));
error = ex_get_sset_var (exoid, time_step, var_index, ids[i],
num_elem_per_set[i], var_values);
printf ("\nafter ex_get_sset_var, error = %3d\n", error);
if (!error)
{
printf
("sideset variable %2d values of sideset %2d at time step %2d\n",
var_index, ids[i], time_step);
for (j=0; j<num_elem_per_set[i]; j++)
printf ("%5.3f\n", var_values[j]);
}
free (var_values);
}
free (num_elem_per_set);
free(ids);
}
/* read a nodeset variable at one time step */
if (num_nset_vars > 0) {
ids = (int *) calloc(num_node_sets, sizeof(int));
error = ex_get_node_set_ids (exoid, ids);
printf ("\n after ex_get_node_set_ids, error = %3d\n", error);
for (i=0; i<num_node_sets; i++)
{
var_values = (float *) calloc (num_nodes_per_set[i], sizeof(float));
error = ex_get_nset_var (exoid, time_step, var_index, ids[i],
num_nodes_per_set[i], var_values);
printf ("\nafter ex_get_nset_var, error = %3d\n", error);
if (!error)
{
printf
("nodeset variable %2d values of nodeset %2d at time step %2d\n",
var_index, ids[i], time_step);
for (j=0; j<num_nodes_per_set[i]; j++)
printf ("%5.3f\n", var_values[j]);
}
free (var_values);
}
free(ids);
}
if (num_node_sets > 0)
free (num_nodes_per_set);
error = ex_close (exoid);
printf ("\nafter ex_close, error = %3d\n", error);
MPI_Finalize();
return 0;
}