Forward compatibility: flex
[foam-extend-3.2.git] / applications / utilities / postProcessing / graphics / newEnsightFoamReader / README_2.01_to_2.03
bloba501b8524c35ee86256d5279256b2ffca9db0840
1 README_USERD_2.03
2 =================
4 At this API revision level:
6 1. Routines to handle materials have been added.
7 2. Routines to handle nsided and nfaced elements have been added
8 3. A routine has modified so structured ranges can be specified
10 ****************************************************************************
11 Note: The dummy_gold reader, the Ensight Gold example reader, and the
12       SILO reader have been moved to this 2.03 API level.
13 ****************************************************************************
15 -------------------------------
16 Quick Index of Library Routines
17 -------------------------------
19 The new new routines are:
20 -------------------------
21 USERD_get_number_of_material_sets    Gets the number of material sets
22 USERD_get_matf_set_info              Gets the material set indices and names
23 USERD_get_number_of_materials        Gets the number of materials
24 USERD_get_matf_var_info              Gets the material indices and descriptions
25 USERD_size_matf_data                 Gets the length of either the
26                                         material ids list,
27                                         mixed-material ids list, or
28                                         mixed-material values list
29 USERD_load_matf_data                 Gets the material ids list,
30                                         mixed-material ids list, or
31                                         mixed-material values list
33 USERD_get_nsided_conn                Gets the element connectivities for nsided
34                                         elements. (utilizes the number of nodes
35                                         per element obtained in
36                                         USERD_get_part_elements_by_type)
37 USERD_get_nfaced_nodes_per_face      Gets the number of nodes per face for nfaced
38                                         elements (utilizes the number of faces
39                                         per element obtained in
40                                         USERD_get_part_elements_by_type)
41 USERD_get_nfaced_conn                Gets the element connectivities for nfaced
42                                         elements (utilizes the number of nodes
43                                         per face obtained in
44                                         USERD_get_nfaced_nodes_per_face)
45 The modified routine is:
46 ------------------------
47 USERD_get_gold_part_build_info       Gets the info needed for part building
48                                         process
50 --------------------
51 Header files changes
52 --------------------
53 global_extern.h         has appropriate changes, must use it
54 global_extern_proto.h   new file, access from global_extern.h
56 Basically the the old global_extern.h file has been split into two files now.
60 -------------------------
61 Order Routines are called
62 -------------------------
64 The various main operations are given basically in the order they will
65 be performed.  Within each operation, the order the routines will be
66 called is given.
68 10. To see if materials in the model
70         USERD_get_number_of_material_sets
72       If any material sets in the model (calls these once per material set):
73         USERD_get_matf_set_info
74         USERD_get_number_of_materials
75         USERD_get_matf_var_info
77       For each elment type of each part containing material ids, calls:
78         USERD_size_matf_data
79         USERD_load_matf_data
81       If there are any elements with mixed materials, when a domain or
82       interface is created, calls these again per part:
84         USERD_size_matf_data
85         USERD_load_matf_data
87 6. Part building (per part created)
89         both unstructured and structured:
90         --------------------------------
91         USERD_set_time_set_and_step
93         if unstructured part:
94         --------------------
95         USERD_get_part_element_ids_by_type
96         USERD_get_part_elements_by_type
98           If any nsided elements:
100             USERD_get_nsided_conn
102           If any nfaced elements:
104             USERD_get_nfaced_nodes_per_face
105             USERD_get_nfaced_conn
107         USERD_get_part_coords
108         USERD_get_part_node_ids
110          .
111          .
112          .
115 -----------------------
116 Detailed Specifications
117 -----------------------
119 Include files:
120 --------------
121 The following header file is required in any file containing these library
122 routines.
124        #include "global_extern.h"
128 *******************************************************************************
129 ****************************** Special Note ***********************************
130 *******************************************************************************
132 Make sure you use the proper define in the global_extern.h header file, namely:
133 #define USERD_API_203
135 Also, Make sure the api version in the USERD_get_reader_version routine is set
136 to "2.03" or larger.
138 Make sure your reader has access to the global_extern_proto.h   This is a new
139 file which is access from the new global_extern.h
141 *******************************************************************************
142 *******************************************************************************
144 ____________________
145 --------------------
146 New Library Routines
147 ____________________
148 --------------------
150 --------------------------------------------------------------------
151 USERD_get_number_of_material_sets -
153    Description:
154    -----------
155    Get the number of material sets in the model
157    Specification:
158    -------------
159    int USERD_get_number_of_material_sets( void )
162    Returns:
163    -------
164    Num_material_sets = number of material sets
165                        (Zero would indicate that you have no materials
166                         to deal with in the model)
168                        or
170                        -1 if an error condition
172    Arguments:
173    ---------
174    none
176    Notes:
177    -----
178   * You may want to keep this as a global for use in other routines.
180    ###############################################################
181    NOTE:  For EnSight 7.6, only one material set is supported
182           within EnSight.
183           Thus the only valid returns here are:
184                0 (no materials)
185                1 (for the one material set allowed)
186           or  -1 (if an error)
188           If the casefile has more than this, this reader will
189           read them, but EnSight will issue an error message and
190           choke on them!
191    ###############################################################
193   ================================================================
194   A very simple explanatory example, to use as a reference for the
195   materials routines:
197   Given a 2D mesh composed of 9 quad (Z_QUA04) elements, with two materials.
198   Most of the model is material 1, but the top left corner is material 9 -
199   basically as shown:
202         *--------*--------*--------*
203         |        |   /    |        |
204         |     Mat 9 /     |        |
205         |        | /      |        |
206         |        |/       |        |
207         |  e7    /   e8   |   e9   |
208         |       /|        |        |
209         |      / |        |        |
210         |     /  |        |        |
211         *----/---*--------*--------*
212         |   /    |        |        |
213         |  /     |        |        |
214         | /      |      Mat 1      |
215         |/       |        |        |
216         |   e4   |   e5   |   e6   |
217         |        |        |        |
218         |        |        |        |
219         |        |        |        |
220         *--------*--------*--------*
221         |        |        |        |
222         |        |        |        |
223         |        |        |        |
224         |        |        |        |
225         |   e1   |   e2   |   e3   |
226         |        |        |        |
227         |        |        |        |
228         |        |        |        |
229         *--------*--------*--------*
232   Thus, in this routine, set:
233     Num_material_sets = 1
235   In USERD_get_matf_set_info, set:
236     mat_set_ids[0]    = 1
237     mat_set_name[0]   = "Material Set 1"  (or whatever name desired)
239   In USERD_get_number_of_materials, input would be set_index = 0, and
240   would need to set:
241     Num_materials[0] = 2
243   For simplicity, the ids and descriptions that would be returned in
244   USERD_get_matf_var_info could be:
245     mat_ids[0] = 1
246     mat_ids[1] = 9
247     mat_desc[0] = "mat 1"   (or whatever desired)
248     mat_desc[2] = "mat 9"
250   The per element material ids list would need to be:
252      material ids:
253      -------------
254      ids_list[0] = 1  (material id 1, for elem e1)
255      ids_list[1] = 1  (     "                  e2)
256      ids_list[2] = 1  (     "                  e3)
257      ids_list[3] = -1 (negative of index into mixed-material id list, for elem e4)
258      ids_list[5] = 1  (material id 1, for elem e5)
259      ids_list[5] = 1  (     "                  e6)
260      ids_list[5] = -5 (negative of index into mixed-material id list, for elem e7)
261      ids_list[5] = -9 (     "                                                  e8)
262      ids_list[5] = 1  (material id 1, for elem e9)
264   Finally we need the mixed material ids list and the mixed materials values list,
265   which would need to be:
267        mixed-material ids:
268        -------------------
269    ==> 1  ids_list[0]  =  2  (the -1 in the material variable points here,
270                                       2 indicates that two materials are present)
271        2  ids_list[1]  =  1  (1st material is 1)
272        3  ids_list[2]  =  9  (2nd material is 9)
273        4  ids_list[3]  = -1  (negative of index into mixed-material val_list)
274    ==> 5  ids_list[4]  =  2  (the -5 in the material variable points here,
275                                       2 indicates that two materials are present)
276        6  ids_list[5]  =  1  (1st material is 1)
277        7  ids_list[6]  =  9  (2nd material is 9)
278        8  ids_list[7]  = -3  (negative of index into mixed-material val_list)
279    ==> 9  ids_list[8]  =  2     etc.
280        10 ids_list[9]  =  1
281        11 ids_list[10] =  9
282        12 ids_list[11] = -5
284        mixed-material values:
285        ----------------------
286    ==> 1 val_list[0] = 0.875 (the -1 in the  mixed-material ids_list points here,
287                                        and this is the value for material 1)
288        2 val_list[1] = 0.125 (the value for material 9)
289    ==> 3 val_list[2] = 0.125 (the -3 in the mixed-materials ids_list points here)
290        4 val_list[3] = 0.875
291    ==> 5 val_list[4] = 0.875 (the -5 in the mixed-materials ids_list points here)
292        6 val_list[5] = 0.125
294   So, USERD_size_matf_data would need to return
295        matf_size = 8, when called with set_id    = 1
296                                        part_id   = 1
297                                        wtyp      = Z_QUA04
298                                        mat_type  = Z_MAT_INDEX
300        matf_size = 12, when called with set_id   = 1
301                                         part_id  = 1
302                                         mat_type = Z_MIX_INDEX
304                  = 6, when called with set_id   = 1
305                                        part_id  = 1
306                                        mat_type = Z_MIX_VALUE
308   And, USERD_load_matf_data would need to return:
309     the int array ids_list as shown above when called with:
310        set_id   = 1
311        part_id  = 1
312        wtyp     = Z_QUA04
313        mat_type = Z_MAT_INDEX (indicating id list).
315     the int array ids_list as shown above when called with:
316        set_id   = 1
317        part_id  = 1
318        mat_type = Z_MIX_INDEX (indicating id list).
320     the float array val_list as shown above when called with:
321        set_id   = 1
322        part_id  = 1
323        mat_type = Z_MIX_VALUE (indicating val list).
327 -------------------------------------------------------------------------
328 USERD_get_matf_set_info
330    Description:
331    -----------
332    Get the material set ids and names
334    Specification:
335    -------------
336    int USERD_get_matf_set_info(int *mat_set_ids,
337                                char **mat_set_name)
339    Returns:
340    -------
341    Z_OK  if successful
342    Z_ERR if not successful
344    Arguments:
345    ---------
346    (OUT) mat_set_ids  = 1D material set ids array
348                                (Array will have been allocated
349                                 Num_material_sets long)
351    (OUT) mat_set_name = 2D material set name array
353                                (Array will have been allocated
354                                 Num_material_sets by Z_BUFL long)
356    Notes:
357    -----
358    * Will not be called if Num_material_sets is zero
359    * See USERD_get_number_of_material_sets header for explanatory example
362 -------------------------------------------------------------------------
363 USERD_get_number_of_materials
365    Description:
366    -----------
367    Gets the number of materials in the material set
369    Specification:
370    -------------
371    int USERD_get_number_of_materials( int set_index )
373    Returns:
374    -------
375    Num_materials[set_index]   = Number of materials in the set
376                                  0 indicates no materials information present
377                                 -1 indicates an error
378    Arguments:
379    ---------
380    (IN) set_index             = the material set index (zero based)
382    Notes:
383    -----
384   * See USERD_get_number_of_material_sets header for explanatory example
385   * Will not be called if Num_material_sets is zero
386   * You may want to keep this as a global for use in other routines.
389 --------------------------------------------------------------------
390 USERD_get_matf_var_info
392    Description:
393    -----------
394    Gets the material ids and descriptions for the material set
396    Specification:
397    -------------
398    int USERD_get_matf_var_info(int set_index,
399                                int *mat_ids,
400                                char **mat_desc)
402    Returns:
403    -------
404    Z_OK  if successful
405    Z_ERR if not successful
407    Arguments:
408    ---------
409    (IN)  set_index               = the material set index (zero based)
411    (OUT) mat_ids[set_index]      = 1D integer array containing the material
412                                    ids to associated with each material
414                                     (Array will have been allocated
415                                      Num_materials[set_index] long)
417    (OUT) mat_desc[set_index]     = 2D char array containing the material
418                                    descriptions to associated with each material
420                                     (Array will have been allocated
421                                      Num_materials[set_index] by Z_BUFL long)
423    Notes:
424    -----
425   * See USERD_get_number_of_material_sets header for explanatory example
426   * Will not be called if Num_material_sets is zero, or
427      Num_materials[set_index] is zero
430 --------------------------------------------------------------------
431 USERD_size_matf_data
433    Description:
434    -----------
435    Get the length of the material id list, mixed-material id list, or
436    mixed-material values list for the given material set and part (and
437    element type if material id list)
439    Specification:
440    -------------
441    int USERD_size_matf_data( int set_index,
442                              int part_id,
443                              int wtyp,
444                              int mat_type,
445                              int *matf_size)
448    Returns:
449    -------
450    Z_OK  if successful
451    Z_ERR if not successful
453    Arguments:
454    ---------
455   (IN)  set_index         = the material set index (zero based)
457   (IN)  part_id           = the part number desired
459   (IN)  wtyp              = the element type        (used for Z_MAT_INDEX only)
461                                   Z_POINT    node point element
462                                   Z_BAR02    2 node bar
463                                   Z_BAR03    3 node bar
464                                   Z_TRI03    3 node triangle
465                                   Z_TRI06    6 node triangle
466                                   Z_QUA04    4 node quad
467                                   Z_QUA08    8 node quad
468                                   Z_TET04    4 node tetrahedron
469                                   Z_TET10   10 node tetrahedron
470                                   Z_PYR05    5 node pyramid
471                                   Z_PYR13   13 node pyramid
472                                   Z_PEN06    6 node pentahedron
473                                   Z_PEN15   15 node pentahedron
474                                   Z_HEX08    8 node hexahedron
475                                   Z_HEX20   20 node hexahedron
476                                   Z_NSIDED  nsided polygon
477                                   Z_NFACED  nfaced polyhedron
479                                   Z_G_POINT    ghost node point element
480                                   Z_G_BAR02    2 node ghost bar
481                                   Z_G_BAR03    3 node ghost bar
482                                   Z_G_TRI03    3 node ghost triangle
483                                   Z_G_TRI06    6 node ghost triangle
484                                   Z_G_QUA04    4 node ghost quad
485                                   Z_G_QUA08    8 node ghost quad
486                                   Z_G_TET04    4 node ghost tetrahedron
487                                   Z_G_TET10   10 node ghost tetrahedron
488                                   Z_G_PYR05    5 node ghost pyramid
489                                   Z_G_PYR13   13 node ghost pyramid
490                                   Z_G_PEN06    6 node ghost pentahedron
491                                   Z_G_PEN15   15 node ghost pentahedron
492                                   Z_G_HEX08    8 node ghost hexahedron
493                                   Z_G_HEX20   20 node ghost hexahedron
494                                   Z_G_NSIDED  ghost nsided polygon
495                                   Z_G_NFACED  ghost nfaced polyhedron
497   (IN)  mat_type          = Z_MAT_INDEX for material ids list
498                             Z_MIX_INDEX for mixed-material ids list
499                             Z_MIX_VALUE for mixed-material values list
501   (OUT) matf_size         = the length of the material id list, or
502                             mixed-material id list, or
503                             mixed-material values list
504                             for the given material set and part number
505                             (and element type if Z_MAT_INDEX)
507    Notes:
508    -----
509   * See USERD_get_number_of_material_sets header for explanatory example
510   * Will not be called if Num_material_sets is zero, or
511      Num_materials[set_index] is zero
514 ----------------------------------------------------------------------
515 USERD_load_matf_data
517    Description:
518    -----------
519    Get the material id list, mixed-material id list, or
520    mixed-material values list for the given material set and part (and
521    element type if material id list)
523    Specification:
524    -------------
525    int USERD_load_matf_data( int set_index,
526                              int part_id,
527                              int wtyp,
528                              int mat_type,
529                              int *ids_list,
530                              float *val_list)
533    Returns:
534    -------
535    Z_OK  if successful
536    Z_ERR if not successful
538    Arguments:
539    ---------
540   (IN)  set_index         = the material set index (zero based)
542   (IN)  part_id           = the part number desired
544   (IN)  wtyp              = the element type        (used for Z_MAT_INDEX only)
546                                   Z_POINT    node point element
547                                   Z_BAR02    2 node bar
548                                   Z_BAR03    3 node bar
549                                   Z_TRI03    3 node triangle
550                                   Z_TRI06    6 node triangle
551                                   Z_QUA04    4 node quad
552                                   Z_QUA08    8 node quad
553                                   Z_TET04    4 node tetrahedron
554                                   Z_TET10   10 node tetrahedron
555                                   Z_PYR05    5 node pyramid
556                                   Z_PYR13   13 node pyramid
557                                   Z_PEN06    6 node pentahedron
558                                   Z_PEN15   15 node pentahedron
559                                   Z_HEX08    8 node hexahedron
560                                   Z_HEX20   20 node hexahedron
561                                   Z_NSIDED  nsided polygon
562                                   Z_NFACED  nfaced polyhedron
564                                   Z_G_POINT    ghost node point element
565                                   Z_G_BAR02    2 node ghost bar
566                                   Z_G_BAR03    3 node ghost bar
567                                   Z_G_TRI03    3 node ghost triangle
568                                   Z_G_TRI06    6 node ghost triangle
569                                   Z_G_QUA04    4 node ghost quad
570                                   Z_G_QUA08    8 node ghost quad
571                                   Z_G_TET04    4 node ghost tetrahedron
572                                   Z_G_TET10   10 node ghost tetrahedron
573                                   Z_G_PYR05    5 node ghost pyramid
574                                   Z_G_PYR13   13 node ghost pyramid
575                                   Z_G_PEN06    6 node ghost pentahedron
576                                   Z_G_PEN15   15 node ghost pentahedron
577                                   Z_G_HEX08    8 node ghost hexahedron
578                                   Z_G_HEX20   20 node ghost hexahedron
579                                   Z_G_NSIDED  ghost nsided polygon
580                                   Z_G_NFACED  ghost nfaced polyhedron
582   (IN)  mat_type          = Z_MAT_INDEX for material ids list
583                             Z_MIX_INDEX for mixed-material ids list
584                             Z_MIX_VALUE for mixed-material values list
586   (OUT) ids_list          = If mat_type is Z_MAT_INDEX:
587                             ---------------------------
588                              1D material id list
589                                (Int array will have been allocated
590                                 the appropriate size, as returned in
591                                  USERD_size_matf_data for mat_type Z_MAT_INDEX)
593                             If mat_type is Z_MIX_INDEX:
594                             ---------------------------
595                              1D mixed-material id list
596                                (Int array will have been allocated
597                                 the appropriate size, as returned in
598                                  USERD_size_matf_data for mat_type Z_MIX_INDEX)
600   (OUT) val_list          = 1D mixed-materials values list
601                             (only used if mat_type is Z_MIX_VALUE)
603                                (Float array will have been allocated
604                                 the appropriate size, as returned in
605                                 USERD_size_matf_data for mat_type Z_MIX_VALUE)
607    Notes:
608    -----
609   * See USERD_get_number_of_material_sets header for explanatory example
610   * Will not be called if Num_material_sets is zero,
611      or Num_materials[set_index] is zero,
612      or the appropriate size from USERD_size_matf_data is zero
616 --------------------------------------------------------------------
617 USERD_get_nsided_conn -
619    Description:
620    -----------
621    Gets the array containing the connectivity of nsided elements
623    Specification:
624    -------------
625    int USERD_get_nsided_conn(int part_number,
626                              int *nsided_conn_array)
628    Returns:
629    -------
630    Z_OK  if successful
631    Z_ERR if not successful
633    Arguments:
634    ---------
635    (IN)  part_number         = the part number
637    (OUT) nsided_conn_array   = 1D array of nsided connectivies
639                                (int array will have been allocated long enough
640                                 to hold all the nsided connectivities. Which is
641                                 the sum of all the nodes_per_element values in
642                                 the conn_array of USERD_get_part_elements_by_type)
645    Notes:
646    -----
647    * Will not be called unless there are some nsided elements in the the part.
649    * Providing nsided information to Ensight:
651      1. In USERD_get_gold_part_build_info, provide the number of nsided
652         elements in the part.
654      2. In USERD_get_part_elements_by_type, provide (in the conn_array),
655         the number of nodes per nsided element. (as if connectivity
656         length of an nsided element is one)
658      3. In this routine, provide the streamed connectivities for each of the
659         nsided elements.
662      Simple example:         5        6
663                             +--------+
664      3 nsided elements:    /|         \
665      (1 4-sided           / |          \
666       1 3-sided          /  |           \
667       1 7-sided)        /   |            \ 7
668                        /3   |4            +
669                       +-----+             |
670                       |     |             |
671                       |     |             |8
672                       |     |             +
673                       |     |            /
674                       |     |           /
675                       |     |          /
676                       |1    |2        /9
677                       +-----+--------+
679       1. In USERD_get_gold_part_build_info:
680               number_of_elements[Z_NSIDED] = 3
681                                              .
682                                             /|\
683                                              |
684       2. In USERD_get_part_elements_by_type:
685           length of conn_array will be:      3 x 1
687           for element_type of Z_NSIDED:
688               conn_array[0][0] = 4           (for the 4-sided element)
689               conn_array[1][0] = 3           (for the 3-sided element)
690               conn_array[2][0] = 7           (for the 7-sided element)
692                            Sum  ===
693                                  14    <---------+
694                                                  |
695       3. In this routine:                        |
696            length of nsided_conn_array will be:  14
698               nsided_conn_array[0]  = 1      (connectivity of 4-sided element)
699               nsided_conn_array[1]  = 2
700               nsided_conn_array[2]  = 4
701               nsided_conn_array[3]  = 3
703               nsided_conn_array[4]  = 3      (connectivity of 3-sided element)
704               nsided_conn_array[5]  = 4
705               nsided_conn_array[6]  = 5
707               nsided_conn_array[7]  = 2      (connectivity of 7-sided element)
708               nsided_conn_array[8]  = 9
709               nsided_conn_array[9]  = 8
710               nsided_conn_array[10] = 7
711               nsided_conn_array[11] = 6
712               nsided_conn_array[12] = 5
713               nsided_conn_array[13] = 4
717 --------------------------------------------------------------------
718 USERD_get_nfaced_nodes_per_face -
720    Description:
721    -----------
722    Gets the array containing the number of nodes per face for each face
723    of the nfaced elements.
725    Specification:
726    -------------
727    int USERD_get_nfaced_nodes_per_face(int part_number,
728                                        int *nfaced_npf_array)
730    Returns:
731    -------
732    Z_OK  if successful
733    Z_ERR if not successful
735    Arguments:
736    ---------
737    (IN)  part_number       = the part number
739    (OUT) nfaced_npf_array  = 1D array of nodes per face for all faces of
740                              nfaced elements
742                              (int array will have been allocated long enough
743                               to hold all the nodes_per_face values. Which is
744                               the sum of all the number of faces per element
745                               values in the conn_array of
746                               USERD_get_part_elements_by_type)
748    Notes:
749    -----
750    * Will not be called unless there are some nfaced elements in the
751      the part
753    * Providing nfaced information to Ensight:
755      1. In USERD_get_gold_part_build_info, provide the number of nfaced
756         polyhedral elements in the part.
758      2. In USERD_get_part_elements_by_type, provide (in the conn_array),
759         the number of faces per nfaced element. (as if connectivity
760         length of an nfaced element is one)
762      3. In this routine, provide the streamed number of nodes per face
763         for each of the faces of the nfaced elements.
766      Simple example:         11        10   12
767                             +--------+-----+
768      2 nfaced elements:    /|        |\   /|
769      (1 7-faced           / |        | \ / |
770       1 5-sided)         /  |        |  +9 |
771                         /   |        | /|  |
772                        /7   |      8 /  |  |
773                       +-----------+/ |  |  |
774                       |     |5    |  |4 |  |6
775                       |     +-----|--+--|--+
776                       |    /      |   \ | /
777                       |   /       |    \|/3
778                       |  /        |     +
779                       | /         |    /
780                       |/1         |2 /
781                       +-----------+/
783       1. In USERD_get_gold_part_build_info:
784               number_of_elements[Z_NFACED] = 2
785                                              .
786                                             /|\
787                                              |
788       2. In USERD_get_part_elements_by_type:
789           length of conn_array will be:      2 x 1
790           for element_type of Z_NFACED:
791               conn_array[0][0] = 7           (for the 7-faced element)
792               conn_array[1][0] = 5           (for the 5-faced element)
794                                 ==
795                            Sum  12    <---------+
796                                                 |
797       3. In this routine:                       |
798            length of nfaced_npf_array will be:  12
800             nfaced_npf_array[0]  = 5  (5-noded top face of 7-faced element)
801             nfaced_npf_array[1]  = 5  (5-noded bot face of 7-faced element)
802             nfaced_npf_array[2]  = 4  (4-noded front face of 7-faced element)
803             nfaced_npf_array[3]  = 4  (4-noded left face of 7-faced element)
804             nfaced_npf_array[4]  = 4  (4-noded back face of 7-faced element)
805             nfaced_npf_array[5]  = 4  (4-noded right front face of 7-faced element)
806             nfaced_npf_array[6]  = 4  (4-noded right back face of 7-faced element)
808             nfaced_npf_array[7]  = 3  (3-noded top face of 5-faced element)
809             nfaced_npf_array[8]  = 3  (3-noded bot face of 5-faced element)
810             nfaced_npf_array[9]  = 4  (4-noded back face of 5-faced element)
811             nfaced_npf_array[10] = 4  (4-noded right face of 5-faced element)
812             nfaced_npf_array[11] = 4  (4-noded left front face of 5-faced element)
814                                    ==
815                              Sum   48   <-------------+
816                                                       |
817       4. In USERD_get_nfaced_conn:                    |
818             length of the nfaced_conn_array will be:  48
820             nsided_conn_array[0] = 7   (conn of 5-noded top face of 7-faced elem)
821             nsided_conn_array[1] = 8
822             nsided_conn_array[2] = 9
823             nsided_conn_array[3] = 10
824             nsided_conn_array[4] = 11
826             nsided_conn_array[5] = 1   (conn of 5-noded bot face of 7-faced elem)
827             nsided_conn_array[6] = 5
828             nsided_conn_array[7] = 4
829             nsided_conn_array[8] = 3
830             nsided_conn_array[9] = 2
832             nsided_conn_array[10] = 1  (conn of 4-noded front face of 7-faced elem)
833             nsided_conn_array[11] = 2
834             nsided_conn_array[12] = 8
835             nsided_conn_array[13] = 7
837             nsided_conn_array[14] = 5  (conn of 4-noded left face of 7-faced elem)
838             nsided_conn_array[15] = 1
839             nsided_conn_array[16] = 7
840             nsided_conn_array[17] = 11
842             nsided_conn_array[18] = 4  (conn of 4-noded back face of 7-faced elem)
843             nsided_conn_array[19] = 5
844             nsided_conn_array[20] = 11
845             nsided_conn_array[21] = 10
847             nsided_conn_array[22] = 2  (conn of 4-noded right front face of 7-faced)
848             nsided_conn_array[23] = 3
849             nsided_conn_array[24] = 9
850             nsided_conn_array[25] = 8
852             nsided_conn_array[26] = 3  (conn of 4-noded right back face of 7-faced)
853             nsided_conn_array[27] = 4
854             nsided_conn_array[28] = 10
855             nsided_conn_array[29] = 9
857             nsided_conn_array[30] = 9  (conn of 3-noded top face of 5-faced elem)
858             nsided_conn_array[32] = 12
859             nsided_conn_array[32] = 10
861             nsided_conn_array[33] = 3  (conn of 3-noded bot face of 5-faced elem)
862             nsided_conn_array[34] = 4
863             nsided_conn_array[35] = 6
865             nsided_conn_array[36] = 6  (conn of 4-noded back face of 5-faced elem)
866             nsided_conn_array[37] = 4
867             nsided_conn_array[38] = 10
868             nsided_conn_array[39] = 12
870             nsided_conn_array[40] = 3  (conn of 4-noded right face of 5-faced elem)
871             nsided_conn_array[41] = 6
872             nsided_conn_array[42] = 12
873             nsided_conn_array[43] = 9
875             nsided_conn_array[44] = 4  (conn of 4-noded left front face of 5-faced)
876             nsided_conn_array[45] = 3
877             nsided_conn_array[46] = 9
878             nsided_conn_array[47] = 10
882 --------------------------------------------------------------------
883 USERD_get_nfaced_conn
885    Description:
886    -----------
887    Gets the array containing the connectivity of nsided faces of nfaced elements
889    Specification:
890    -------------int
891    int USERD_get_nfaced_conn(int part_number,
892                              int *nfaced_conn_array)
894    Returns:
895    -------
896    Z_OK  if successful
897    Z_ERR if not successful
899    Arguments:
900    ---------
901    (IN)  part_number        = the part number
903    (OUT) nfaced_conn_array  = 1D array of nsided face connectivies of nfaced
904                               elements
906                               (int array will have been allocated long enough to
907                                hold all the nsided face connectivities. Which is
908                                the sum of all the nodes per face values in the
909                                nfaced_npf_array of USERD_get_nfaced_nodes_per_face)
911    Notes:
912    -----
913  * Will not be called unless there are some nfaced elements in the part
915  * Providing nfaced information to Ensight:
917      1. In USERD_get_gold_part_build_info, provide the number of nfaced
918         polyhedral elements in the part.
920      2. In USERD_get_part_elements_by_type, provide (in the conn_array),
921         the number of faces per nfaced element. (as if connectivity
922         length of an nfaced element is one)
924      3. In this routine, provide the streamed number of nodes per face
925         for each of the faces of the nfaced elements.
928      Simple example:         11        10   12
929                             +--------+-----+
930      2 nfaced elements:    /|        |\   /|
931      (1 7-faced           / |        | \ / |
932       1 5-sided)         /  |        |  +9 |
933                         /   |        | /|  |
934                        /7   |      8 /  |  |
935                       +-----------+/ |  |  |
936                       |     |5    |  |4 |  |6
937                       |     +-----|--+--|--+
938                       |    /      |   \ | /
939                       |   /       |    \|/3
940                       |  /        |     +
941                       | /         |    /
942                       |/1         |2 /
943                       +-----------+/
945       1. In USERD_get_gold_part_build_info:
946               number_of_elements[Z_NFACED] = 2
947                                              .
948                                             /|\
949                                              |
950       2. In USERD_get_part_elements_by_type:
951           length of conn_array will be:      2 x 1
952           for element_type of Z_NFACED:
953               conn_array[0][0] = 7           (for the 7-faced element)
954               conn_array[1][0] = 5           (for the 5-faced element)
956                                 ==
957                            Sum  12    <---------+
958                                                 |
959       3. In USERD_get_faced_nodes_per_face:     |
960            length of nfaced_npf_array will be:  12
962             nfaced_npf_array[0]  = 5  (5-noded top face of 7-faced element)
963             nfaced_npf_array[1]  = 5  (5-noded bot face of 7-faced element)
964             nfaced_npf_array[2]  = 4  (4-noded front face of 7-faced element)
965             nfaced_npf_array[3]  = 4  (4-noded left face of 7-faced element)
966             nfaced_npf_array[4]  = 4  (4-noded back face of 7-faced element)
967             nfaced_npf_array[5]  = 4  (4-noded right front face of 7-faced element)
968             nfaced_npf_array[6]  = 4  (4-noded right back face of 7-faced element)
970             nfaced_npf_array[7]  = 3  (3-noded top face of 5-faced element)
971             nfaced_npf_array[8]  = 3  (3-noded bot face of 5-faced element)
972             nfaced_npf_array[9]  = 4  (4-noded back face of 5-faced element)
973             nfaced_npf_array[10] = 4  (4-noded right face of 5-faced element)
974             nfaced_npf_array[11] = 4  (4-noded left front face of 5-faced element)
976                                    ==
977                              Sum   48   <-------------+
978                                                       |
979       4. In this function:                            |
980             length of the nfaced_conn_array will be:  48
982             nsided_conn_array[0] = 7   (conn of 5-noded top face of 7-faced elem)
983             nsided_conn_array[1] = 8
984             nsided_conn_array[2] = 9
985             nsided_conn_array[3] = 10
986             nsided_conn_array[4] = 11
988             nsided_conn_array[5] = 1   (conn of 5-noded bot face of 7-faced elem)
989             nsided_conn_array[6] = 5
990             nsided_conn_array[7] = 4
991             nsided_conn_array[8] = 3
992             nsided_conn_array[9] = 2
994             nsided_conn_array[10] = 1  (conn of 4-noded front face of 7-faced elem)
995             nsided_conn_array[11] = 2
996             nsided_conn_array[12] = 8
997             nsided_conn_array[13] = 7
999             nsided_conn_array[14] = 5  (conn of 4-noded left face of 7-faced elem)
1000             nsided_conn_array[15] = 1
1001             nsided_conn_array[16] = 7
1002             nsided_conn_array[17] = 11
1004             nsided_conn_array[18] = 4  (conn of 4-noded back face of 7-faced elem)
1005             nsided_conn_array[19] = 5
1006             nsided_conn_array[20] = 11
1007             nsided_conn_array[21] = 10
1009             nsided_conn_array[22] = 2  (conn of 4-noded right front face of 7-faced)
1010             nsided_conn_array[23] = 3
1011             nsided_conn_array[24] = 9
1012             nsided_conn_array[25] = 8
1014             nsided_conn_array[26] = 3  (conn of 4-noded right back face of 7-faced)
1015             nsided_conn_array[27] = 4
1016             nsided_conn_array[28] = 10
1017             nsided_conn_array[29] = 9
1019             nsided_conn_array[30] = 9  (conn of 3-noded top face of 5-faced elem)
1020             nsided_conn_array[32] = 12
1021             nsided_conn_array[32] = 10
1023             nsided_conn_array[33] = 3  (conn of 3-noded bot face of 5-faced elem)
1024             nsided_conn_array[34] = 4
1025             nsided_conn_array[35] = 6
1027             nsided_conn_array[36] = 6  (conn of 4-noded back face of 5-faced elem)
1028             nsided_conn_array[37] = 4
1029             nsided_conn_array[38] = 10
1030             nsided_conn_array[39] = 12
1032             nsided_conn_array[40] = 3  (conn of 4-noded right face of 5-faced elem)
1033             nsided_conn_array[41] = 6
1034             nsided_conn_array[42] = 12
1035             nsided_conn_array[43] = 9
1037             nsided_conn_array[44] = 4  (conn of 4-noded left front face of 5-faced)
1038             nsided_conn_array[45] = 3
1039             nsided_conn_array[46] = 9
1040             nsided_conn_array[47] = 10
1043 ________________________
1044 ------------------------
1045 Modified Library Routine
1046 ________________________
1047 ------------------------
1049 --------------------------------------------------------------------
1050 USERD_get_gold_part_build_info
1052    Description:
1053    -----------
1054    Gets the info needed for part building process
1056    Specification:
1057    -------------
1058    int
1059    USERD_get_gold_part_build_info(int *part_id,
1060                                   int *part_types,
1061                                   char *part_description[Z_BUFL],
1062                                   int *number_of_nodes,
1063                                   int *number_of_elements[Z_MAXTYPE],
1064                                   int *ijk_dimensions[9],
1065                                   int *iblanking_options[6])
1067    Returns:
1068    -------
1069    Z_OK  if successful
1070    Z_ERR if not successful
1072    Arguments:
1073    ---------
1074    (OUT) part_id                = Array containing the external part
1075                                   ids for each of the model parts.
1077                                   IMPORTANT:
1078                                    Parts numbers must be >= 1, because
1079                                    of the way they are used in the GUI
1081               *******************************************
1082                The ids provided here are the numbers by
1083                which the parts will be referred to in the
1084                GUI (if possible). They are basically
1085                labels as far as you are concerned.
1087                Note: The part numbers you pass to routines
1088                which receive a part_number or block_number
1089                or which_part as an argument are the 1-based
1090                table index of the parts!
1092                example:  If Numparts_available = 3
1094                          Table index        part_id
1095                          -----------        -------
1096                           1                  13
1097                           2                  57
1098                           3                  125
1100                           ^                   ^
1101                           |                   |
1102                           |                    These are placed in:
1103                           |                      part_id[0] = 13
1104                           |                      part_id[1] = 57
1105                           |                      part_id[2] = 125
1106                           |                    for GUI labeling purposes.
1107                           |
1108                            These implied table indices are the part_number,
1109                            block_number, or which_part numbers that you would
1110                            pass to routines like:
1112                           USERD_get_part_coords(int part_number,...
1113                           USERD_get_part_node_ids(int part_number,...
1114                           USERD_get_part_elements_by_type(int part_number,...
1115                           USERD_get_part_element_ids_by_type(int part_number,...
1116                           USERD_get_block_coords_by_component(int block_number,...
1117                           USERD_get_block_iblanking(int block_number,...
1118                           USERD_get_block_ghost_flags(int block_number,...
1119                           USERD_get_ghosts_in_block_flag(int block_number)
1120                           USERD_get_border_availability( int part_number,...
1121                           USERD_get_border_elements_by_type( int part_number,...
1122                           USERD_get_var_by_component(int which_variable,
1123                                                      int which_part,...
1124                           USERD_get_var_value_at_specific(int which_var,
1125                                                           int which_node_or_elem,
1126                                                           int which_part,...
1127               ********************************************
1129                                    (Array will have been allocated
1130                                     Numparts_available long)
1132    (OUT) part_types             = Array containing one of the
1133                                   following for each model part:
1135                                         Z_UNSTRUCTURED or
1136                                         Z_STRUCTURED  or
1137                                         Z_IBLANKED
1139                                    (Array will have been allocated
1140                                     Numparts_available long)
1142    (OUT) part_description       = Array containing a description
1143                                   for each of the model parts
1145                                    (Array will have been allocated
1146                                     Numparts_available by Z_BUFL
1147                                     long)
1149    (OUT) number_of_nodes        = Number of unstructured nodes in the part
1151                                    (Array will have been allocated
1152                                     Numparts_available long)
1154    (OUT) number_of_elements     = 2D array containing number of
1155                                   each type of element for each
1156                                   unstructured model part.
1157                                   ------------
1158                                   Possible types are:
1160                                  Z_POINT   =  point
1161                                  Z_BAR02   =  2-noded bar
1162                                  Z_BAR03   =  3-noded bar
1163                                  Z_TRI03   =  3-noded triangle
1164                                  Z_TRI06   =  6-noded triangle
1165                                  Z_QUA04   =  4-noded quadrilateral
1166                                  Z_QUA08   =  8-noded quadrilateral
1167                                  Z_TET04   =  4-noded tetrahedron
1168                                  Z_TET10   = 10-noded tetrahedron
1169                                  Z_PYR05   =  5-noded pyramid
1170                                  Z_PYR13   = 13-noded pyramid
1171                                  Z_PEN06   =  6-noded pentahedron
1172                                  Z_PEN15   = 15-noded pentahedron
1173                                  Z_HEX08   =  8-noded hexahedron
1174                                  Z_HEX20   = 20-noded hexahedron
1176     Starting at API 2.01:
1177     ====================
1178                                  Z_G_POINT    ghost node point element
1179                                  Z_G_BAR02    2 node ghost bar
1180                                  Z_G_BAR03    3 node ghost bar
1181                                  Z_G_TRI03    3 node ghost triangle
1182                                  Z_G_TRI06    6 node ghost triangle
1183                                  Z_G_QUA04    4 node ghost quad
1184                                  Z_G_QUA08    8 node ghost quad
1185                                  Z_G_TET04    4 node ghost tetrahedron
1186                                  Z_G_TET10   10 node ghost tetrahedron
1187                                  Z_G_PYR05    5 node ghost pyramid
1188                                  Z_G_PYR13   13 node ghost pyramid
1189                                  Z_G_PEN06    6 node ghost pentahedron
1190                                  Z_G_PEN15   15 node ghost pentahedron
1191                                  Z_G_HEX08    8 node ghost hexahedron
1192                                  Z_G_HEX20   20 node ghost hexahedron
1194     Starting at API 2.02:
1195     ====================
1196                                  Z_NSIDED     n node nsided polygon
1197                                  Z_NFACED     n face nfaced polyhedron
1198                                  Z_G_NSIDED   n node ghost nsided polygon
1199                                  Z_G_NFACED   n face ghost nfaced polyhedron
1201                                 (Ignored unless Z_UNSTRUCTURED type)
1203                                    (Array will have been allocated
1204                                     Numparts_available by
1205                                     Z_MAXTYPE long)
1207    (OUT) ijk_dimensions         = 2D array containing ijk dimension info
1208                                   for structured blocks
1210                                   For Z_UNSTRUCTURED - is ignored
1212                                   For Z_STRUCTURED or Z_IBLANKED
1214         Prior to version 2.03:
1215         ----------------------
1216                                    (Array will have been allocated
1217                                     Numparts_available by 3 long)
1219                               ijk_dimensions[][0] = I dimension
1220                               ijk_dimensions[][1] = J dimension
1221                               ijk_dimensions[][2] = K dimension
1224         Starting at version 2.03:
1225         ------------------------
1226                                    (Array will have been allocated
1227                                     Numparts_available by 9 long)
1229                               There are two ways to do this:
1230                               ------------------------------
1231                               1. The simple one, without ranges.
1233                                    This is good for all structured models
1234                                    that will NOT be used in EnSight's
1235                                    Server of Servers
1237                                    Simply provide the ijk dimensions in the
1238                                    first three slots and place a -1 in
1239                                    the 4th slot.  (The remaining slots will
1240                                    be ignored).
1242                               Thus,
1243                               ijk_dimensions[][0] = I dimension of block
1244                               ijk_dimensions[][1] = J dimension of block
1245                               ijk_dimensions[][2] = K dimension of block
1246                               ijk_dimensions[][3] = -1
1248                         (J planes)
1249                             4 *-------*-------*
1250                               |       |       |    ijk_dimension[0][0] = 3
1251                               |       |       |    ijk_dimension[0][1] = 4
1252                               |       |       |    ijk_dimension[0][2] = 1
1253                             3 *-------*-------*
1254                               |       |       |    ijk_dimension[0][4] = -1
1255                               |       |       |
1256                               |       |       |
1257                             2 *-------*-------*
1258                               |       |       |
1259                               |       |       |
1260                               |       |       |
1261                             1 *-------*-------*
1262                               1       2       3  (I planes)
1266                               2. Using ranges.
1268                                   This one can be used anytime, but MUST
1269                                   be used if EnSight's Server of Servers
1270                                   is to be used!
1272                                   The first 3 slots contain the ijk dimension
1273                                   of the complete block (of which this may be
1274                                   a portion).  The last 6 slots contain the
1275                                   ijk min and max ranges within the complete.
1277                               Thus,
1278                               ijk_dimensions[][0] = I dim of complete block
1279                               ijk_dimensions[][1] = J dim of complete block
1280                               ijk_dimensions[][2] = K dim of complete block
1282                               ijk_dimensions[][3] = Imin of portion (1-based)
1283                               ijk_dimensions[][4] = Imax of portion (1-based)
1284                               ijk_dimensions[][5] = Jmin of portion (1-based)
1285                               ijk_dimensions[][6] = Jmax of portion (1-based)
1286                               ijk_dimensions[][7] = Kmin of portion (1-based)
1287                               ijk_dimensions[][8] = Kmax of portion (1-based)
1290                               example1: (Model has one part, a simple 2D block,
1291                                          and want whole thing)
1293                         (J planes)
1294                             4 *-------*-------*
1295                               |       |       |    ijk_dimension[0][0] = 3
1296                               |       |       |    ijk_dimension[0][1] = 4
1297                               |       |       |    ijk_dimension[0][2] = 1
1298                             3 *-------*-------*
1299                               |       |       |    ijk_dimension[0][3] = 1
1300                               |       |       |    ijk_dimension[0][4] = 3
1301                               |       |       |    ijk_dimension[0][5] = 1
1302                             2 *-------*-------*    ijk_dimension[0][6] = 4
1303                               |       |       |    ijk_dimension[0][7] = 1
1304                               |       |       |    ijk_dimension[0][8] = 1
1305                               |       |       |
1306                             1 *-------*-------*
1307                               1       2       3  (I planes)
1310                               example2: (Want to have the block represented
1311                                          in two portions - 2 parts)
1313                         (J planes)                 top portion
1314                             4 *-------*-------*
1315                               |       |       |    ijk_dimension[0][0] = 3
1316                               |       |       |    ijk_dimension[0][1] = 4
1317                               |       |       |    ijk_dimension[0][2] = 1
1318                             3 *-------*-------*
1319                               .       .       .    ijk_dimension[0][3] = 1
1320                               .       .       .    ijk_dimension[0][4] = 3
1321                               .       .       .    ijk_dimension[0][5] = 3
1322                             2 .................    ijk_dimension[0][6] = 4
1323                               .       .       .    ijk_dimension[0][7] = 1
1324                               .       .       .    ijk_dimension[0][8] = 1
1325                               .       .       .
1326                             1 .................
1327                               1       2       3  (I planes)
1330                         (J planes)                 bottom portion
1331                             4 .................
1332                               .       .       .    ijk_dimension[1][0] = 3
1333                               .       .       .    ijk_dimension[2][1] = 4
1334                               .       .       .    ijk_dimension[3][2] = 1
1335                             3 *-------*-------*
1336                               |       |       |    ijk_dimension[1][3] = 1
1337                               |       |       |    ijk_dimension[1][4] = 3
1338                               |       |       |    ijk_dimension[1][5] = 1
1339                             2 *-------*-------*    ijk_dimension[1][6] = 3
1340                               |       |       |    ijk_dimension[1][7] = 1
1341                               |       |       |    ijk_dimension[1][8] = 1
1342                               |       |       |
1343                             1 *-------*-------*
1344                               1       2       3  (I planes)
1347         And note that if you were partioning this block for
1348         EnSight's Server of Servers, you would only have one part,
1349         instead of two.  Each SOS server would return its appropriate
1350         ranges in the last 6 slots. The first 3 slots would remain constant.
1353    (OUT) iblanking_options      = 2D array containing iblanking
1354                                   options possible for each
1355                                   structured model part.
1356                                   ----------
1357                                   (Ignored unless Z_IBLANKED type)
1359                                   (Array will have been allocated
1360                                    Numparts_available by 6 long)
1362        iblanking_options[][Z_EXT]     = TRUE if external (outside)
1363                         [][Z_INT]     = TRUE if internal (inside)
1364                         [][Z_BND]     = TRUE if boundary
1365                         [][Z_INTBND]  = TRUE if internal boundary
1366                         [][Z_SYM]     = TRUE if symmetry surface
1369    Notes:
1370    -----
1371    If you haven't built a table of pointers to the different parts,
1372    you might want to do so here as you gather the needed info.
1374    This will be based on Current_time_step