PageRenderTime 43ms CodeModel.GetById 2ms app.highlight 35ms RepoModel.GetById 1ms app.codeStats 0ms

/contrib/exodusii/5.22b/exodus/cbind/test/testwt_ss.c

https://bitbucket.org/vijaysm/libmesh
C | 835 lines | 414 code | 151 blank | 270 comment | 24 complexity | 838ecf97d41fa0753816aa31af244c12 MD5 | raw file
  1/*
  2 * Copyright (c) 2005 Sandia Corporation. Under the terms of Contract
  3 * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Governement
  4 * retains certain rights in this software.
  5 * 
  6 * Redistribution and use in source and binary forms, with or without
  7 * modification, are permitted provided that the following conditions are
  8 * met:
  9 * 
 10 *     * Redistributions of source code must retain the above copyright
 11 *       notice, this list of conditions and the following disclaimer.
 12 * 
 13 *     * Redistributions in binary form must reproduce the above
 14 *       copyright notice, this list of conditions and the following
 15 *       disclaimer in the documentation and/or other materials provided
 16 *       with the distribution.  
 17 * 
 18 *     * Neither the name of Sandia Corporation nor the names of its
 19 *       contributors may be used to endorse or promote products derived
 20 *       from this software without specific prior written permission.
 21 * 
 22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 33 * 
 34 */
 35/*****************************************************************************
 36*
 37* testwt_ss - test write an ExodusII database file
 38*
 39* author - Sandia National Laboratories
 40*          Larry A. Schoof - Original
 41*          Vic Yarberry    - Added headers and error logging
 42*               7/7/93          Modified for use with Exodus 2.00
 43*
 44*          
 45* environment - UNIX
 46*
 47* entry conditions - 
 48*
 49* exit conditions - 
 50*
 51* revision history - 
 52*
 53*  This is a test program for the C binding of the EXODUS II 
 54*  database write routines.
 55*
 56*
 57*****************************************************************************/
 58
 59
 60#include <stdlib.h>
 61#include <stdio.h>
 62/* #include "netcdf.h" */
 63#include "exodusII.h"
 64
 65int main (int argc, char **argv)
 66{
 67   int exoid, num_dim, num_nodes, num_elem, num_elem_blk;
 68   int num_elem_in_block[10], num_nodes_per_elem[10];
 69   int num_node_sets, num_side_sets, error;
 70   int *connect;
 71   int node_list[100],elem_list[100],side_list[100];
 72   int ebids[10], ids[10];
 73   int num_nodes_per_set[10], num_elem_per_set[10];
 74   int num_df_per_set[10];
 75   int df_ind[10], node_ind[10], elem_ind[10]; 
 76   int  num_qa_rec, num_info;
 77   int CPU_word_size,IO_word_size;
 78
 79   float x[100], y[100], z[100];
 80   float dist_fact[100];
 81   char *coord_names[3], *qa_record[2][4], *info[3];
 82
 83   ex_opts (EX_VERBOSE|EX_ABORT); 
 84
 85/* Specify compute and i/o word size */
 86
 87   CPU_word_size = 0;                   /* sizeof(float) */
 88   IO_word_size = 4;                    /* (4 bytes) */
 89
 90/* create EXODUS II file */
 91
 92   exoid = ex_create ("test.exo",       /* filename path */
 93                       EX_CLOBBER,      /* create mode */
 94                       &CPU_word_size,  /* CPU float word size in bytes */
 95                       &IO_word_size);  /* I/O float word size in bytes */
 96   printf ("after ex_create for test.exo, exoid = %d\n", exoid);
 97   printf (" cpu word size: %d io word size: %d\n",CPU_word_size,IO_word_size);
 98
 99   /* ncopts = NC_VERBOSE; */
100
101/* initialize file with parameters */
102
103   num_dim = 3;
104   num_nodes = 33;
105   num_elem = 8;
106   num_elem_blk = 8;
107   num_node_sets = 2;
108   num_side_sets = 9;
109
110   error = ex_put_init (exoid, "This is a test", num_dim, num_nodes, num_elem,
111                        num_elem_blk, num_node_sets, num_side_sets);
112
113   printf ("after ex_put_init, error = %d\n", error);
114
115   if (error) {
116     ex_close (exoid);
117     exit(-1);
118   }
119
120/* write nodal coordinates values and names to database */
121
122/* Quad #1 */
123   x[0] = 0.0; y[0] = 0.0; z[0] = 0.0;
124   x[1] = 1.0; y[1] = 0.0; z[1] = 0.0;
125   x[2] = 1.0; y[2] = 1.0; z[2] = 0.0;
126   x[3] = 0.0; y[3] = 1.0; z[3] = 0.0;
127
128/* Quad #2 */
129   x[4]  =  1.0; y[4]  =  0.0; z[4]  =  0.0;
130   x[5]  =  2.0; y[5]  =  0.0; z[5]  =  0.0;
131   x[6]  =  2.0; y[6]  =  1.0; z[6]  =  0.0;
132   x[7]  =  1.0; y[7]  =  1.0; z[7]  =  0.0;
133
134/* Hex #1 */
135   x[8]  =  0.0; y[8]  =  0.0; z[8]  =  0.0;
136   x[9]  = 10.0; y[9]  =  0.0; z[9]  =  0.0;
137   x[10] = 10.0; y[10] =  0.0; z[10] =-10.0;
138   x[11] =  1.0; y[11] =  0.0; z[11] =-10.0;
139   x[12] =  1.0; y[12] = 10.0; z[12] =  0.0;
140   x[13] = 10.0; y[13] = 10.0; z[13] =  0.0;
141   x[14] = 10.0; y[14] = 10.0; z[14] =-10.0;
142   x[15] =  1.0; y[15] = 10.0; z[15] =-10.0;
143
144/* Tetra #1 */
145   x[16] =  0.0; y[16] =  0.0; z[16] =  0.0;
146   x[17] =  1.0; y[17] =  0.0; z[17] =  5.0;
147   x[18] = 10.0; y[18] =  0.0; z[18] =  2.0;
148   x[19] =  7.0; y[19] =  5.0; z[19] =  3.0;
149
150/* Wedge #1 */
151   x[20] =  3.0; y[20] =  0.0; z[20] =  6.0;
152   x[21] =  6.0; y[21] =  0.0; z[21] =  0.0;
153   x[22] =  0.0; y[22] =  0.0; z[22] =  0.0;
154   x[23] =  3.0; y[23] =  2.0; z[23] =  6.0;
155   x[24] =  6.0; y[24] =  2.0; z[24] =  2.0;
156   x[25] =  0.0; y[25] =  2.0; z[25] =  0.0;
157
158/* Tetra #2 */
159   x[26] =  2.7; y[26] =  1.7; z[26] =  2.7;
160   x[27] =  6.0; y[27] =  1.7; z[27] =  3.3;
161   x[28] =  5.7; y[28] =  1.7; z[28] =  1.7;
162   x[29] =  3.7; y[29] =  0.0; z[29] =  2.3;
163
164/* TriShell #1 */
165   x[30] =  2.7; y[30] =  1.7; z[30] =  2.7;
166   x[31] =  6.0; y[31] =  1.7; z[31] =  3.3;
167   x[32] =  5.7; y[32] =  1.7; z[32] =  1.7;
168
169   error = ex_put_coord (exoid, x, y, z);
170   printf ("after ex_put_coord, error = %d\n", error);
171
172   if (error) {
173     ex_close (exoid);
174     exit(-1);
175   }
176
177   coord_names[0] = "xcoor";
178   coord_names[1] = "ycoor";
179   coord_names[2] = "zcoor";
180
181   error = ex_put_coord_names (exoid, coord_names);
182   printf ("after ex_put_coord_names, error = %d\n", error);
183
184   if (error) {
185     ex_close (exoid);
186     exit(-1);
187   }
188
189/* write element block parameters */
190
191   num_elem_in_block[0] = 1;
192   num_elem_in_block[1] = 1;
193   num_elem_in_block[2] = 1;
194   num_elem_in_block[3] = 1;
195   num_elem_in_block[4] = 1;
196   num_elem_in_block[5] = 1;
197   num_elem_in_block[6] = 1;
198   num_elem_in_block[7] = 1;
199
200   num_nodes_per_elem[0] = 4; /* elements in block #1 are 4-node quads  */
201   num_nodes_per_elem[1] = 4; /* elements in block #2 are 4-node quads  */
202   num_nodes_per_elem[2] = 8; /* elements in block #3 are 8-node hexes  */
203   num_nodes_per_elem[3] = 4; /* elements in block #4 are 4-node tetras */
204   num_nodes_per_elem[4] = 6; /* elements in block #5 are 6-node wedges */
205   num_nodes_per_elem[5] = 8; /* elements in block #6 are 8-node tetras */
206   num_nodes_per_elem[6] = 4; /* elements in block #7 are 4-node shells */
207   num_nodes_per_elem[7] = 3; /* elements in block #8 are 3-node shells */
208
209   ebids[0] = 10;
210   ebids[1] = 11;
211   ebids[2] = 12;
212   ebids[3] = 13;
213   ebids[4] = 14;
214   ebids[5] = 15;
215   ebids[6] = 16;
216   ebids[7] = 17;
217
218   error = ex_put_elem_block (exoid, ebids[0], "quad", num_elem_in_block[0],
219                              num_nodes_per_elem[0], 1);
220   printf ("after ex_put_elem_block, error = %d\n", error);
221
222   if (error) {
223     ex_close (exoid);
224     exit(-1);
225   }
226
227   error = ex_put_elem_block (exoid, ebids[1], "quad", num_elem_in_block[1],
228                               num_nodes_per_elem[1], 1);
229   printf ("after ex_put_elem_block, error = %d\n", error);
230
231   if (error) {
232     ex_close (exoid);
233     exit(-1);
234   }
235
236   error = ex_put_elem_block (exoid, ebids[2], "hex", num_elem_in_block[2],
237                               num_nodes_per_elem[2], 1);
238   printf ("after ex_put_elem_block, error = %d\n", error);
239
240   if (error) {
241     ex_close (exoid);
242     exit(-1);
243   }
244
245   error = ex_put_elem_block (exoid, ebids[3], "tetra", num_elem_in_block[3],
246                               num_nodes_per_elem[3], 1);
247   printf ("after ex_put_elem_block, error = %d\n", error);
248
249   if (error) {
250     ex_close (exoid);
251     exit(-1);
252   }
253
254   error = ex_put_elem_block (exoid, ebids[4], "wedge", num_elem_in_block[4],
255                               num_nodes_per_elem[4], 1);
256   printf ("after ex_put_elem_block, error = %d\n", error);
257
258   if (error) {
259     ex_close (exoid);
260     exit(-1);
261   }
262
263   error = ex_put_elem_block (exoid, ebids[5], "tetra", num_elem_in_block[5],
264                               num_nodes_per_elem[5], 1);
265   printf ("after ex_put_elem_block, error = %d\n", error);
266
267   if (error) {
268     ex_close (exoid);
269     exit(-1);
270   }
271
272   error = ex_put_elem_block (exoid, ebids[6], "shell", num_elem_in_block[6],
273                               num_nodes_per_elem[6], 1);
274   printf ("after ex_put_elem_block, error = %d\n", error);
275
276   if (error) {
277     ex_close (exoid);
278     exit(-1);
279   }
280
281   error = ex_put_elem_block (exoid, ebids[7], "triangle",
282                              num_elem_in_block[7], num_nodes_per_elem[7], 1);
283   printf ("after ex_put_elem_block, error = %d\n", error);
284
285   if (error) {
286     ex_close (exoid);
287     exit(-1);
288   }
289
290/* write element connectivity */
291
292   connect = (int *) calloc(8, sizeof(int));
293   connect[0] = 1; connect[1] = 2; connect[2] = 3; connect[3] = 4;
294
295   error = ex_put_elem_conn (exoid, ebids[0], connect);
296   printf ("after ex_put_elem_conn, error = %d\n", error);
297   if (error) {
298     ex_close (exoid);
299     exit(-1);
300   }
301
302
303   connect[0] = 5; connect[1] = 6; connect[2] = 7; connect[3] = 8;
304
305   error = ex_put_elem_conn (exoid, ebids[1], connect);
306   printf ("after ex_put_elem_conn, error = %d\n", error);
307
308   if (error) {
309     ex_close (exoid);
310     exit(-1);
311   }
312
313   connect[0] = 9; connect[1] = 10; connect[2] = 11; connect[3] = 12;
314   connect[4] = 13; connect[5] = 14; connect[6] = 15; connect[7] = 16;
315
316   error = ex_put_elem_conn (exoid, ebids[2], connect);
317   printf ("after ex_put_elem_conn, error = %d\n", error);
318
319   if (error) {
320     ex_close (exoid);
321     exit(-1);
322   }
323
324   connect[0] = 17; connect[1] = 18; connect[2] = 19; connect[3] = 20;
325
326   error = ex_put_elem_conn (exoid, ebids[3], connect);
327   printf ("after ex_put_elem_conn, error = %d\n", error);
328
329   if (error) {
330     ex_close (exoid);
331     exit(-1);
332   }
333
334   connect[0] = 21; connect[1] = 22; connect[2] = 23;
335   connect[3] = 24; connect[4] = 25; connect[5] = 26;
336
337   error = ex_put_elem_conn (exoid, ebids[4], connect);
338   printf ("after ex_put_elem_conn, error = %d\n", error);
339
340   if (error) {
341     ex_close (exoid);
342     exit(-1);
343   }
344
345   connect[0] = 17; connect[1] = 18; connect[2] = 19; connect[3] = 20;
346   connect[4] = 27; connect[5] = 28; connect[6] = 30; connect[7] = 29;
347
348   error = ex_put_elem_conn (exoid, ebids[5], connect);
349   printf ("after ex_put_elem_conn, error = %d\n", error);
350
351   if (error) {
352     ex_close (exoid);
353     exit(-1);
354   }
355
356   connect[0] = 1; connect[1] = 2; connect[2] = 3; connect[3] = 4;
357
358   error = ex_put_elem_conn (exoid, ebids[6], connect);
359   printf ("after ex_put_elem_conn, error = %d\n", error);
360   if (error) {
361     ex_close (exoid);
362     exit(-1);
363   }
364
365   connect[0] = 30; connect[1] = 31; connect[2] = 32;
366
367   error = ex_put_elem_conn (exoid, ebids[7], connect);
368   printf ("after ex_put_elem_conn, error = %d\n", error);
369   if (error) {
370     ex_close (exoid);
371     exit(-1);
372   }
373
374   free (connect);
375
376
377/* write individual side sets */
378
379   /* side set #1  - quad */
380
381/* THIS SECTION IS COMMENTED OUT
382
383   error = ex_put_side_set_param (exoid, 30, 2, 4);
384   printf ("after ex_put_side_set_param, error = %d\n", error);
385
386   if (error) {
387     ex_close (exoid);
388     exit(-1);
389   }
390
391   elem_list[0] = 2; elem_list[1] = 2;
392
393   side_list[0] = 4; side_list[1] = 2;
394
395   dist_fact[0] = 30.0; dist_fact[1] = 30.1; dist_fact[2] = 30.2;
396   dist_fact[3] = 30.3;
397
398   error = ex_put_side_set (exoid, 30, elem_list, side_list);
399   printf ("after ex_put_side_set, error = %d\n", error);
400
401   if (error) {
402     ex_close (exoid);
403     exit(-1);
404   }
405
406   error = ex_put_side_set_dist_fact (exoid, 30, dist_fact);
407   printf ("after ex_put_side_set_dist_fact, error = %d\n", error);
408
409   if (error) {
410     ex_close (exoid);
411     exit(-1);
412   }
413
414    END COMMENTED OUT SECTION */
415
416   /* side set #2  - quad, spanning 2 elements  */
417
418/* THIS SECTION IS COMMENTED OUT
419
420   error = ex_put_side_set_param (exoid, 31, 2, 4);
421   printf ("after ex_put_side_set_param, error = %d\n", error);
422
423   if (error) {
424     ex_close (exoid);
425     exit(-1);
426   }
427
428   elem_list[0] = 1; elem_list[1] = 2;
429
430   side_list[0] = 2; side_list[1] = 3;
431
432   dist_fact[0] = 31.0; dist_fact[1] = 31.1; dist_fact[2] = 31.2;
433   dist_fact[3] = 31.3;
434
435   error = ex_put_side_set (exoid, 31, elem_list, side_list);
436   printf ("after ex_put_side_set, error = %d\n", error);
437
438   if (error) {
439     ex_close (exoid);
440     exit(-1);
441   }
442
443   error = ex_put_side_set_dist_fact (exoid, 31, dist_fact);
444   printf ("after ex_put_side_set_dist_fact, error = %d\n", error);
445
446   if (error) {
447     ex_close (exoid);
448     exit(-1);
449   }
450
451    END COMMENTED OUT SECTION */
452
453   /* side set #3  - hex */
454
455/* THIS SECTION IS COMMENTED OUT
456
457   error = ex_put_side_set_param (exoid, 32, 7, 0);
458   printf ("after ex_put_side_set_param, error = %d\n", error);
459
460   if (error) {
461     ex_close (exoid);
462     exit(-1);
463   }
464
465   elem_list[0] = 3; elem_list[1] = 3;
466   elem_list[2] = 3; elem_list[3] = 3;
467   elem_list[4] = 3; elem_list[5] = 3;
468   elem_list[6] = 3;
469
470   side_list[0] = 5; side_list[1] = 3;
471   side_list[2] = 3; side_list[3] = 2;
472   side_list[4] = 4; side_list[5] = 1;
473   side_list[6] = 6;
474
475   error = ex_put_side_set (exoid, 32, elem_list, side_list);
476   printf ("after ex_put_side_set, error = %d\n", error);
477
478   if (error) {
479     ex_close (exoid);
480     exit(-1);
481   }
482
483    END COMMENTED OUT SECTION */
484
485   /* side set #4  - 4-node tetras */
486
487/* THIS SECTION IS COMMENTED OUT
488
489   error = ex_put_side_set_param (exoid, 33, 4, 0);
490   printf ("after ex_put_side_set_param, error = %d\n", error);
491
492   if (error) {
493     ex_close (exoid);
494     exit(-1);
495   }
496
497   elem_list[0] = 4; elem_list[1] = 4;
498   elem_list[2] = 4; elem_list[3] = 4;
499
500   side_list[0] = 1; side_list[1] = 2;
501   side_list[2] = 3; side_list[3] = 4;
502
503   error = ex_put_side_set (exoid, 33, elem_list, side_list);
504   printf ("after ex_put_side_set, error = %d\n", error);
505
506   if (error) {
507     ex_close (exoid);
508     exit(-1);
509   }
510
511    END COMMENTED OUT SECTION */
512
513   /* side set #5  - shells; front and back faces */
514
515/* THIS SECTION IS COMMENTED OUT
516
517   error = ex_put_side_set_param (exoid, 34, 2, 0);
518   printf ("after ex_put_side_set_param, error = %d\n", error);
519
520   if (error) {
521     ex_close (exoid);
522     exit(-1);
523   }
524
525   elem_list[0] = 7; elem_list[1] = 7;
526
527   side_list[0] = 1; side_list[1] = 2;
528
529   error = ex_put_side_set (exoid, 34, elem_list, side_list);
530   printf ("after ex_put_side_set, error = %d\n", error);
531
532   if (error) {
533     ex_close (exoid);
534     exit(-1);
535   }
536
537    END COMMENTED OUT SECTION */
538
539   /* side set #6  - shells; edges */
540
541/* THIS SECTION IS COMMENTED OUT
542
543   error = ex_put_side_set_param (exoid, 35, 4, 0);
544   printf ("after ex_put_side_set_param, error = %d\n", error);
545
546   if (error) {
547     ex_close (exoid);
548     exit(-1);
549   }
550
551   elem_list[0] = 7; elem_list[1] = 7;
552   elem_list[2] = 7; elem_list[3] = 7;
553
554   side_list[0] = 3; side_list[1] = 4;
555   side_list[2] = 5; side_list[3] = 6;
556
557   error = ex_put_side_set (exoid, 35, elem_list, side_list);
558   printf ("after ex_put_side_set, error = %d\n", error);
559
560   if (error) {
561     ex_close (exoid);
562     exit(-1);
563   }
564
565    END COMMENTED OUT SECTION */
566
567/* write concatenated side sets; this produces the same information as
568 * the above code which writes individual side sets
569 */
570
571
572   ids[0] = 30;
573   ids[1] = 31;
574   ids[2] = 32;
575   ids[3] = 33;
576   ids[4] = 34;
577   ids[5] = 35;
578   ids[6] = 36;
579   ids[7] = 37;
580   ids[8] = 38;
581
582   /* side set #1  - NULL side set */
583   /* do nothing except set num_elem_per_set to 0 */
584 
585   /* side set #2  - NULL side set */
586   /* do nothing except set num_elem_per_set to 0 */
587 
588   /* side set #3  - quad; 2 sides */
589
590   node_list[0] = 8; node_list[1] = 5;
591   elem_list[0] = 2; 
592
593   node_list[2] = 6; node_list[3] = 7;
594   elem_list[1] = 2;
595
596   /* side set #4  - quad; 2 sides spanning 2 elements  */
597
598   node_list[4] = 2; node_list[5] = 3;
599   elem_list[2] = 1; 
600
601   node_list[6] = 7; node_list[7] = 8;
602   elem_list[3] = 2;
603
604   /* side set #5  - hex; 7 sides */
605
606   node_list[8] = 9; node_list[9] = 12;
607   node_list[10] = 11; node_list[11] = 10;
608   elem_list[4] = 3; 
609
610   node_list[12] = 11; node_list[13] = 12;
611   node_list[14] = 16; node_list[15] = 15;
612   elem_list[5] = 3;
613 
614   node_list[16] = 16; node_list[17] = 15;
615   node_list[18] = 11; node_list[19] = 12;
616   elem_list[6] = 3; 
617
618   node_list[20] = 10; node_list[21] = 11;
619   node_list[22] = 15; node_list[23] = 14;
620   elem_list[7] = 3;
621
622   node_list[24] = 13; node_list[25] = 16;
623   node_list[26] = 12; node_list[27] =  9;
624   elem_list[8] = 3; 
625
626   node_list[28] = 14; node_list[29] = 13;
627   node_list[30] =  9; node_list[31] = 10;
628   elem_list[9] = 3;
629
630   node_list[32] = 16; node_list[33] = 13;
631   node_list[34] = 14; node_list[35] = 15;
632   elem_list[10] = 3; 
633
634   /* side set #6  - 4-node tetras; 4 sides */
635
636   node_list[36] = 17; node_list[37] = 18;
637   node_list[38] = 20;
638   elem_list[11] = 4; 
639
640   node_list[39] = 18; node_list[40] = 19;
641   node_list[41] = 20;
642   elem_list[12] = 4; 
643
644   node_list[42] = 17; node_list[43] = 20;
645   node_list[44] = 19;
646   elem_list[13] = 4; 
647
648   node_list[45] = 17; node_list[46] = 19;
649   node_list[47] = 18;
650   elem_list[14] = 4; 
651
652   /* side set #7  - shells; front and back faces */
653
654   node_list[48] = 1; node_list[49] = 2;
655   node_list[50] = 3; node_list[51] = 4;
656   elem_list[15] = 7; 
657
658   node_list[52] = 4; node_list[53] = 3;
659   node_list[54] = 2; node_list[55] = 1;
660   elem_list[16] = 7; 
661
662   /* side set #8  - shells; 4 edges */
663
664   node_list[56] = 1; node_list[57] = 2;
665   elem_list[17] = 7; 
666
667   node_list[58] = 2; node_list[59] = 3;
668   elem_list[18] = 7; 
669
670   node_list[60] = 3; node_list[61] = 4;
671   elem_list[19] = 7; 
672
673   node_list[62] = 4; node_list[63] = 1;
674   elem_list[20] = 7;
675
676   /* side set #9 --  3-node shells -- front and back */
677
678   node_list[64] = 30;
679   node_list[65] = 31;
680   node_list[66] = 32; 
681   elem_list[21] = 8; 
682
683   node_list[67] = 32;
684   node_list[68] = 31;
685   node_list[69] = 30; 
686   elem_list[22] = 8; 
687
688   /* set up indices */
689   node_ind[0] = 0;
690   node_ind[1] = 0;
691   node_ind[2] = 0;
692   node_ind[3] = 4;
693   node_ind[4] = 8;
694   node_ind[5] = 36;
695   node_ind[6] = 48;
696   node_ind[7] = 56;
697   node_ind[8] = 64;
698     
699   num_elem_per_set[0] = 0;
700   num_elem_per_set[1] = 0;
701   num_elem_per_set[2] = 2;
702   num_elem_per_set[3] = 2;
703   num_elem_per_set[4] = 7;
704   num_elem_per_set[5] = 4;
705   num_elem_per_set[6] = 2;
706   num_elem_per_set[7] = 4;
707   num_elem_per_set[8] = 2;
708   
709   num_nodes_per_set[0] = 0;
710   num_nodes_per_set[1] = 0;
711   num_nodes_per_set[2] = 4;
712   num_nodes_per_set[3] = 4;
713   num_nodes_per_set[4] = 28;
714   num_nodes_per_set[5] = 12;
715   num_nodes_per_set[6] = 8;
716   num_nodes_per_set[7] = 8;
717   num_nodes_per_set[8] = 6;
718
719   elem_ind[0] = 0;
720   elem_ind[1] = 0;
721   elem_ind[2] = 0;
722   elem_ind[3] = 2;
723   elem_ind[4] = 4;
724   elem_ind[5] = 11;
725   elem_ind[6] = 15;
726   elem_ind[7] = 17;
727   elem_ind[8] = 21;
728
729   error = ex_cvt_nodes_to_sides(exoid,
730                         num_elem_per_set,
731                         num_nodes_per_set,
732                         elem_ind,
733                         node_ind,
734                         elem_list,
735                         node_list,
736                         side_list);
737   printf ("after ex_cvt_nodes_to_sides, error = %d\n", error);
738
739   if (error) {
740     ex_close (exoid);
741     exit(-1);
742   }
743
744   num_df_per_set[0] = 0;
745   num_df_per_set[1] = 0;
746   num_df_per_set[2] = 4;
747   num_df_per_set[3] = 4;
748   num_df_per_set[4] = 0;
749   num_df_per_set[5] = 0;
750   num_df_per_set[6] = 0;
751   num_df_per_set[7] = 0;
752   num_df_per_set[8] = 0;
753
754   df_ind[0] = 0;
755   df_ind[1] = 0;
756   df_ind[2] = 0;
757   df_ind[3] = 4;
758   df_ind[4] = 0;
759   df_ind[5] = 0;
760   df_ind[6] = 0;
761   df_ind[7] = 0;
762   df_ind[8] = 0;
763
764   dist_fact[0] = 30.0; dist_fact[1] = 30.1;
765   dist_fact[2] = 30.2; dist_fact[3] = 30.3;
766
767   dist_fact[4] = 31.0; dist_fact[5] = 31.1;
768   dist_fact[6] = 31.2; dist_fact[7] = 31.3;
769
770
771   error = ex_put_concat_side_sets (exoid, ids, num_elem_per_set,
772                                    num_df_per_set, elem_ind, df_ind,
773                                    elem_list, side_list, dist_fact);
774   printf ("after ex_put_concat_side_sets, error = %d\n", error);
775
776   if (error) {
777     ex_close (exoid);
778     exit(-1);
779   }
780
781/* THIS SECTION IS COMMENTED OUT
782    END COMMENTED OUT SECTION */
783
784
785/* write QA records; test empty and just blank-filled records */
786
787   num_qa_rec = 2;
788
789
790   qa_record[0][0] = "TESTWT";
791   qa_record[0][1] = "testwt";
792   qa_record[0][2] = "07/07/93";
793   qa_record[0][3] = "15:41:33";
794   qa_record[1][0] = "";
795   qa_record[1][1] = "                            ";
796   qa_record[1][2] = "";
797   qa_record[1][3] = "                        ";
798
799   error = ex_put_qa (exoid, num_qa_rec, qa_record);
800   printf ("after ex_put_qa, error = %d\n", error);
801
802   if (error) {
803     ex_close (exoid);
804     exit(-1);
805   }
806
807
808/* write information records; test empty and just blank-filled records */
809
810   num_info = 3;
811
812
813   info[0] = "This is the first information record.";
814   info[1] = "";
815   info[2] = "                                     ";
816
817   error = ex_put_info (exoid, num_info, info);
818   printf ("after ex_put_info, error = %d\n", error);
819
820   if (error) {
821     ex_close (exoid);
822     exit(-1);
823   }
824
825
826/* close the EXODUS files
827 */
828   error = ex_close (exoid);
829   printf ("after ex_close, error = %d\n", error);
830   if (error) {
831     ex_close (exoid);
832     exit(-1);
833   }
834   return 0;
835}