1 README_USERD_IN_BUFFERS
2 ========================
3 Five optional routines for normal elements,
5 USERD_get_part_coords_in_buffers |
6 USERD_get_part_node_ids_in_buffers |
7 USERD_get_part_elements_by_type_in_buffers |If any of these are implemented,
8 USERD_get_part_element_ids_by_type_in_buffers |all 5 of them must be implemented
9 USERD_get_var_by_component_in_buffers |
13 one optional routine for nsided elements,
15 USERD_get_nsided_conn_in_buffers
19 and one optional routine for nfaced elements,
21 USERD_get_nfaced_conn_in_buffers
24 can be added into any API 2.* reader to be used by the
25 Unstructured Auto Distribute capability in EnSight 8.2 and later.
27 Unstructured Auto Distribute is a capability requiring Server of Servers (SOS)
28 that will partition an unstructured model for you automatically across a set of
31 If you do not implement the routines listed above (and described below) in your
32 reader, EnSight can still perform this operation but will require much more memory on
33 each server to read in the data (somewhat like each server having to read the
34 whole model). You will however, get the execution advantage of having your model
35 partitioned across multiple servers.
37 If you do implement these routines in your reader (in a proper manner), you
38 should be able to not only get the execution advantages, but also memory usage
39 on each server which is proportional to the subset that it is assigned to deal with.
42 Note that the optional routines are functionally quite similar
43 to the following functions. And thus their implementation should
44 not be too difficult to add to any existing reader that has already
46 ------------------------------------------
48 USERD_get_part_node_ids
49 USERD_get_part_elements_by_type
50 USERD_get_part_element_ids_by_type
51 USERD_get_var_by_component
62 /*--------------------------------------------------------------------
63 * USERD_get_part_coords_in_buffers -
64 *--------------------------------------------------------------------
66 * Get the coordinates for an unstructured part in buffers.
68 * (IN) part_number = The part number
70 * (1-based index of part table, namely:
72 * 1 ... Numparts_available.
74 * It is NOT the part_id that
75 * is loaded in USERD_get_gold_part_build_info)
77 * (IN) first = TRUE if first invocation of a buffered set.
78 * Will be FALSE for all subsequent invocations
79 * of the set. This is so you can open files, get to
80 * the correct starting spot, initialize, etc.
82 * (IN) n_beg = Zero based, first node index
85 * (IN) n_end = Zero based, last node index
88 * Thus, for first five nodes:
91 * total_number = (n_end - n_beg) + 1 = (4 - 0) + 1 = 5
93 * for second five nodes, would be:
96 * total_number = (n_end - n_beg) + 1 = (9 - 5) + 1 = 5
98 * for all nodes of a part, would be:
100 * n_end = num_nodes - 1
102 * (IN) buffer_size = The size of the buffer.
103 * Namely: coord_array[3][buffer_size]
105 * (OUT) coord_array = 2D float buffer array which is set up to hold
106 * x,y,z coordinates of nodes.
108 * (IMPORTANT: the second dimension of of this array is 0-based!!!)
110 * (IMPORTANT: in the sister routine (USERD_get_part_coords) - which
111 * does not use buffers. This array is 1-based. So pay attention.)
113 * (Array will have been allocated
114 * 3 by buffer_size long
116 * Example, if we had a part with 645 nodes and the buffer size was set to 200
119 * first = TRUE Will be TRUE the first time!
123 * coord_array[3][200] fill with values for nodes 1 - 200 (zero-based)
124 * *num_returned = 200 set this
125 * return(0) return this (indicates more to do)
127 * second invocation: which occurs because we returned a 0 last time
128 * first = FALSE will now be FALSE
132 * coord_array[3][200] fill with values for nodes 201 - 400 (zero-based)
133 * *num_returned = 200 set this
134 * return(0) return this (indicates more to do)
136 * third invocation: which occurs because we returned a 0 last time
137 * first = FALSE will still be FALSE
141 * coord_array[3][200] fill with values for nodes 401 - 600 (zero-based)
142 * *num_returned = 200 set this
143 * return(0) return this (indicates more to do)
145 * fourth invocation: which occurs because we returned a 0 last time
146 * first = FALSE will still be FALSE
150 * coord_array[3][200] fill with values for nodes 601 - 645 (zero-based)
151 * *num_returned = 45 set this
152 * return(1) return this (indicates done!)
154 * (OUT) *num_returned = The number of nodes whose coordinates are returned
155 * in the buffer. This will normally be equal to
156 * buffer_size except for that last buffer -
157 * which could be less than a full buffer.
159 * returns 0 if got some, more to do
160 * 1 if got some, done
164 * * This will be based on Current_time_step
166 * * Not called unless number_of_nodes for the part > 0
168 * * Again, make sure each buffer is zero based. For our example above:
172 * ------- ------- -------- -------
173 * coord_array[0][0] x for node 1 node 201 node 401 node 601
174 * coord_array[1][0] y for " " " "
175 * coord_array[2][0] z for " " " "
177 * coord_array[0][1] x for node 2 node 202 node 402 node 602
178 * coord_array[1][1] y for " " " "
179 * coord_array[2][1] z for " " " "
183 * coord_array[0][199] x for node 200 node 400 node 600 node 645
184 * coord_array[1][199] y for " " " "
185 * coord_array[2][199] z for " " " "
186 *--------------------------------------------------------------------*/
188 USERD_get_part_coords_in_buffers(int part_number,
200 /*--------------------------------------------------------------------
201 * USERD_get_part_node_ids_in_buffers -
202 *--------------------------------------------------------------------
204 * Get the node ids for an unstructured part in buffers.
206 * (IN) part_number = The part number
208 * (1-based index of part table, namely:
210 * 1 ... Numparts_available.
212 * It is NOT the part_id that
213 * is loaded in USERD_get_gold_part_build_info)
215 * (IN) first = TRUE if first invocation of a buffered set.
216 * Will be FALSE for all subsequent invocations
217 * of the set. This is so you can open files, get to
218 * the correct starting spot, initialize, etc.
220 * (IN) n_beg = Zero based, first node index
221 * of the buffered set
223 * (IN) n_end = Zero based, last node index
224 * of the buffered set
226 * Thus, for first five nodes:
229 * total_number = (n_end - n_beg) + 1 = (4 - 0) + 1 = 5
231 * for second five nodes, would be:
234 * total_number = (n_end - n_beg) + 1 = (9 - 5) + 1 = 5
236 * for all nodes of a part, would be:
238 * n_end = num_nodes - 1
240 * (IN) buffer_size = The size of the buffer.
241 * Namely: nodeid_array[buffer_size]
243 * (OUT) nodeid_array = 1D buffer array which is set up to hold
246 * (IMPORTANT: this array is 0-based!!!)
248 * (IMPORTANT: in the sister routine (USERD_get_part_node_ids) - which
249 * does not use buffers. This array is 1-based. So pay attention.)
251 * (Array will have been allocated
254 * Example, if we had a part with 645 nodes and the buffer size was set to 200
257 * first = TRUE Will be TRUE the first time!
261 * nodeid_array[200] fill with values for nodes 1 - 200 (zero-based)
262 * *num_returned = 200 set this
263 * return(0) return this (indicates more to do)
265 * second invocation: which occurs because we returned a 0 last time
266 * first = FALSE will now be FALSE
270 * nodeid_array[200] fill with values for nodes 201 - 400 (zero-based)
271 * *num_returned = 200 set this
272 * return(0) return this (indicates more to do)
274 * third invocation: which occurs because we returned a 0 last time
275 * first = FALSE will still be FALSE
279 * nodeid_array[200] fill with values for nodes 401 - 600 (zero-based)
280 * *num_returned = 200 set this
281 * return(0) return this (indicates more to do)
283 * fourth invocation: which occurs because we returned a 0 last time
284 * first = FALSE will still be FALSE
288 * nodeid_array[200] fill with values for nodes 601 - 645 (zero-based)
289 * *num_returned = 45 set this
290 * return(1) return this (indicates done!)
293 * (OUT) *num_returned = The number of nodes whose ids are returned
294 * in the buffer. This will normally be equal
295 * to buffer_size except for that last buffer
296 * - which could be less than a full buffer.
298 * returns 0 if got some, more to do
299 * 1 if got some, done
303 * * This will be based on Current_time_step
305 * * Not called unless number_of_nodes for the part > 0
307 * * Again, make sure each buffer is zero based. For our example above:
311 * ------- ------- -------- -------
312 * nodeid_array[0] id for node 1 node 201 node 401 node 601
314 * nodeid_array[1] id for node 2 node 202 node 402 node 602
318 * nodeid_array[199] id for node 200 node 400 node 600 node 645
319 *--------------------------------------------------------------------*/
321 USERD_get_part_node_ids_in_buffers(int part_number,
332 /*--------------------------------------------------------------------
333 * USERD_get_part_elements_by_type_in_buffers -
334 *--------------------------------------------------------------------
336 * Gets the connectivities for the elements of a particular type
337 * in an unstructured part in buffers
339 * (IN) part_number = The part number
341 * (1-based index of part table, namely:
343 * 1 ... Numparts_available.
345 * It is NOT the part_id that
346 * is loaded in USERD_get_gold_part_build_info)
348 * (IN) element_type = One of the following (See global_extern.h)
349 * Z_POINT node point element
352 * Z_TRI03 3 node triangle
353 * Z_TRI06 6 node triangle
354 * Z_QUA04 4 node quad
355 * Z_QUA08 8 node quad
356 * Z_TET04 4 node tetrahedron
357 * Z_TET10 10 node tetrahedron
358 * Z_PYR05 5 node pyramid
359 * Z_PYR13 13 node pyramid
360 * Z_PEN06 6 node pentahedron
361 * Z_PEN15 15 node pentahedron
362 * Z_HEX08 8 node hexahedron
363 * Z_HEX20 20 node hexahedron
365 * Starting at API 2.01:
366 * ====================
367 * Z_G_POINT ghost node point element
368 * Z_G_BAR02 2 node ghost bar
369 * Z_G_BAR03 3 node ghost bar
370 * Z_G_TRI03 3 node ghost triangle
371 * Z_G_TRI06 6 node ghost triangle
372 * Z_G_QUA04 4 node ghost quad
373 * Z_G_QUA08 8 node ghost quad
374 * Z_G_TET04 4 node ghost tetrahedron
375 * Z_G_TET10 10 node ghost tetrahedron
376 * Z_G_PYR05 5 node ghost pyramid
377 * Z_G_PYR13 13 node ghost pyramid
378 * Z_G_PEN06 6 node ghost pentahedron
379 * Z_G_PEN15 15 node ghost pentahedron
380 * Z_G_HEX08 8 node ghost hexahedron
381 * Z_G_HEX20 20 node ghost hexahedron
382 * Z_NSIDED n node ghost nsided polygon
383 * Z_NFACED n face ghost nfaced polyhedron
385 * Starting at API 2.02:
386 * ====================
387 * Z_NSIDED n node nsided polygon
388 * Z_NFACED n face nfaced polyhedron
389 * Z_G_NSIDED n node ghost nsided polygon
390 * Z_G_NFACED n face ghost nfaced polyhedron
392 * (IN) first = TRUE if first invocation of a buffered set.
393 * Will be FALSE for all subsequent invocations
394 * of the set. This is so you can open files, get to
395 * the correct starting spot, initialize, etc.
397 * (IN) e_beg = Zero based, first element number
398 * of the buffered set
400 * (IN) e_end = Zero based, last element number
401 * of the buffered set
403 * Thus, for first five elements of a type:
406 * total_number = (e_end - e_beg) + 1 = (4 - 0) + 1 = 5
408 * for second five elements of a type, would be:
411 * total_number = (e_end - e_beg) + 1 = (9 - 5) + 1 = 5
413 * for all elements of the type of a part, would be:
415 * n_end = num_elements_of_type - 1
417 * (IN) buffer_size = The size of the buffer.
418 * Namely: conn_array[buffer_size][element_size]
420 * (OUT) conn_array = 2D buffer array which is set up to hold
421 * connectivity of elements of the type.
423 * (Array will have been allocated
425 * the type by connectivity length
428 * ex) The allocated dimensions available
429 * for this routine will be:
430 * conn_array[buffer_size][3] when called with Z_TRI03
432 * conn_array[buffer_size][4] when called with Z_QUA04
434 * conn_array[buffer_size][8] when called with Z_HEX08
438 * * Example, (if 158 quad elements, and buffer size is 200)
440 * (get all 158 quad4s in one invocation)
441 * element_type = Z_QUA04
442 * first = TRUE Will be TRUE the first time!
443 * e_beg = 0 (zero based, first element index)
444 * e_end = 157 (zero based, last element index)
446 * conn_array[200][4] Use first 158 locations of the array
447 * *num_returned = 158 set this
448 * return(1) return this (indicates no more to do)
450 * * Example, (if 158 quad elements, and buffer size is 75)
453 * element_type = Z_QUA04
454 * first = TRUE Will be TRUE the first time!
458 * conn_array[75][4] load in conn for elements 1 - 75
459 * *num_returned = 75 set this
460 * return(0) return this (indicates more to do)
463 * element_type = Z_QUA04
464 * first = TRUE Will be TRUE the first time!
468 * conn_array[75][4] load in conn for elements 76 - 150
469 * *num_returned = 75 set this
470 * return(0) return this (indicates more to do)
473 * element_type = Z_QUA04
474 * first = TRUE Will be TRUE the first time!
478 * conn_array[75][4] load in conn for elements 151 - 158
479 * *num_returned = 8 set this
480 * return(1) return this (indicates no more to do)
483 * (OUT) *num_returned = The number of elements whose connectivities
484 * are returned in the buffer. This will
485 * normally be equal to buffer_size except for
486 * that last buffer - which could be less than
489 * returns 0 if got some, more to do
490 * 1 if got some, done
494 * * This will be based on Current_time_step
496 * * Again, make sure each buffer is zero based. For our example using buffers above:
500 * ------- ------- --------
501 * conn_array[0][0] node 1 in conn for quad 1 quad 76 quad 151
502 * conn_array[0][1] node 2 in conn for quad 1 quad 76 quad 151
503 * conn_array[0][2] node 3 in conn for quad 1 quad 76 quad 151
504 * conn_array[0][3] node 4 in conn for quad 1 quad 76 quad 151
506 * conn_array[1][0] node 1 in conn for quad 2 quad 77 quad 152
507 * conn_array[1][1] node 2 in conn for quad 2 quad 77 quad 152
508 * conn_array[1][2] node 3 in conn for quad 2 quad 77 quad 152
509 * conn_array[1][3] node 4 in conn for quad 2 quad 77 quad 152
513 * conn_array[74][0] node 1 in conn for quad 75 quad 150 quad 158
514 * conn_array[74][1] node 2 in conn for quad 75 quad 150 quad 158
515 * conn_array[74][2] node 3 in conn for quad 75 quad 150 quad 158
516 * conn_array[74][3] node 4 in conn for quad 75 quad 150 quad 158
517 *--------------------------------------------------------------------*/
519 USERD_get_part_elements_by_type_in_buffers(int part_number,
532 /*--------------------------------------------------------------------
533 * USERD_get_part_element_ids_by_type_in_buffers -
534 *--------------------------------------------------------------------
536 * Gets the ids for the elements of a particular type
537 * in an unstructured part in buffers
539 * (IN) part_number = The part number
541 * (1-based index of part table, namely:
543 * 1 ... Numparts_available.
545 * It is NOT the part_id that
546 * is loaded in USERD_get_gold_part_build_info)
548 * (IN) element_type = One of the following (See global_extern.h)
549 * Z_POINT node point element
552 * Z_TRI03 3 node triangle
553 * Z_TRI06 6 node triangle
554 * Z_QUA04 4 node quad
555 * Z_QUA08 8 node quad
556 * Z_TET04 4 node tetrahedron
557 * Z_TET10 10 node tetrahedron
558 * Z_PYR05 5 node pyramid
559 * Z_PYR13 13 node pyramid
560 * Z_PEN06 6 node pentahedron
561 * Z_PEN15 15 node pentahedron
562 * Z_HEX08 8 node hexahedron
563 * Z_HEX20 20 node hexahedron
565 * Starting at API 2.01:
566 * ====================
567 * Z_G_POINT ghost node point element
568 * Z_G_BAR02 2 node ghost bar
569 * Z_G_BAR03 3 node ghost bar
570 * Z_G_TRI03 3 node ghost triangle
571 * Z_G_TRI06 6 node ghost triangle
572 * Z_G_QUA04 4 node ghost quad
573 * Z_G_QUA08 8 node ghost quad
574 * Z_G_TET04 4 node ghost tetrahedron
575 * Z_G_TET10 10 node ghost tetrahedron
576 * Z_G_PYR05 5 node ghost pyramid
577 * Z_G_PYR13 13 node ghost pyramid
578 * Z_G_PEN06 6 node ghost pentahedron
579 * Z_G_PEN15 15 node ghost pentahedron
580 * Z_G_HEX08 8 node ghost hexahedron
581 * Z_G_HEX20 20 node ghost hexahedron
582 * Z_NSIDED n node ghost nsided polygon
583 * Z_NFACED n face ghost nfaced polyhedron
585 * Starting at API 2.02:
586 * ====================
587 * Z_NSIDED n node nsided polygon
588 * Z_NFACED n face nfaced polyhedron
589 * Z_G_NSIDED n node ghost nsided polygon
590 * Z_G_NFACED n face ghost nfaced polyhedron
592 * (IN) first = TRUE if first invocation of a buffered set.
593 * Will be FALSE for all subsequent invocations
594 * of the set. This is so you can open files, get to
595 * the correct starting spot, initialize, etc.
597 * (IN) e_beg = Zero based, first element number
598 * of the buffered set
600 * (IN) e_end = Zero based, last element number
601 * of the buffered set
603 * Thus, for first five elements of a type:
606 * total_number = (e_end - e_beg) + 1 = (4 - 0) + 1 = 5
608 * for second five elements of a type, would be:
611 * total_number = (e_end - e_beg) + 1 = (9 - 5) + 1 = 5
613 * for all elements of the type of a part, would be:
615 * n_end = num_elements_of_type - 1
617 * (IN) buffer_size = The size of the buffer.
618 * Namely: elemid_array[buffer_size]
620 * (OUT) elemid_array = 1D buffer array which is set up to hold ids
621 * of elements of the type.
623 * (Array will have been allocated
626 * * Example, (if 158 quad elements, and buffer size is 200)
628 * (get all 158 quad4 ids in one invocation)
629 * element_type = Z_QUA04
630 * first = TRUE Will be TRUE the first time!
631 * e_beg = 0 (zero based, first element index)
632 * e_end = 157 (zero based, last element index)
634 * elemeid_array[200] Use first 158 locations of the array
635 * *num_returned = 158 set this
636 * return(1) return this (indicates no more to do)
638 * * Example, (if 158 quad elements, and buffer size is 75)
641 * element_type = Z_QUA04
642 * first = TRUE Will be TRUE the first time!
646 * elemid_array[75] load in ids for elements 1 - 75
647 * *num_returned = 75 set this
648 * return(0) return this (indicates more to do)
651 * element_type = Z_QUA04
652 * first = TRUE Will be TRUE the first time!
656 * elemid_array[75] load in ids for elements 76 - 150
657 * *num_returned = 75 set this
658 * return(0) return this (indicates more to do)
661 * element_type = Z_QUA04
662 * first = TRUE Will be TRUE the first time!
666 * elemid_array[75] load in ids for elements 151 - 158
667 * *num_returned = 8 set this
668 * return(1) return this (indicates no more to do)
671 * (OUT) *num_returned = The number of elements whose ids are returned
672 * in the buffer. This will normally be equal
673 * to buffer_size except for that last buffer
674 * - which could be less than a full buffer.
676 * returns 0 if got some, more to do
677 * 1 if got some, done
681 * * This will be based on Current_time_step
683 * * Again, make sure each buffer is zero based. For our example using buffers above:
687 * ------- ------- --------
688 * elemid_array[0] elem id for quad 1 quad 76 quad 151
690 * elemid_array[1] elem id for quad 2 quad 77 quad 152
694 * elemid_array[74] elem id for quad 75 quad 150 quad 158
695 *--------------------------------------------------------------------*/
697 USERD_get_part_element_ids_by_type_in_buffers(int part_number,
711 /*--------------------------------------------------------------------
712 * USERD_get_var_by_component_in_buffers - used by unstructured parts
713 *--------------------------------------------------------------------
716 * Get the component value at each node for a given variable in the part
720 * Get the component value at each element of a specific part and type for
721 * a given variable in buffers.
723 * (IN) which_variable = The variable number
725 * (IN) which_part Since EnSight Version 7.4
726 * -------------------------
729 * (1-based index of part table, namely:
731 * 1 ... Numparts_available.
733 * It is NOT the part_id that
734 * is loaded in USERD_get_gold_part_build_info)
736 * Prior to EnSight Version 7.4
737 * ----------------------------
738 * = The part id This is the part_id label loaded
739 * in USERD_get_gold_part_build_inf\o.
740 * It is NOT the part table index.
742 * (IN) var_type = Z_SCALAR
744 * Z_TENSOR ( symmetric tensor)
745 * Z_TENSOR9 (asymmetric tensor)
749 * if Z_PER_NODE: Not used
751 * if Z_PER_ELEM: = The element type
752 * Z_POINT node point element
755 * Z_TRI03 3 node triangle
756 * Z_TRI06 6 node triangle
757 * Z_QUA04 4 node quad
758 * Z_QUA08 8 node quad
759 * Z_TET04 4 node tetrahedron
760 * Z_TET10 10 node tetrahedron
761 * Z_PYR05 5 node pyramid
762 * Z_PYR13 13 node pyramid
763 * Z_PEN06 6 node pentahedron
764 * Z_PEN15 15 node pentahedron
765 * Z_HEX08 8 node hexahedron
766 * Z_HEX20 20 node hexahedron
768 * Starting at API 2.01:
769 * ====================
770 * Z_G_POINT ghost node point element
771 * Z_G_BAR02 2 node ghost bar
772 * Z_G_BAR03 3 node ghost bar
773 * Z_G_TRI03 3 node ghost triangle
774 * Z_G_TRI06 6 node ghost triangle
775 * Z_G_QUA04 4 node ghost quad
776 * Z_G_QUA08 8 node ghost quad
777 * Z_G_TET04 4 node ghost tetrahedron
778 * Z_G_TET10 10 node ghost tetrahedron
779 * Z_G_PYR05 5 node ghost pyramid
780 * Z_G_PYR13 13 node ghost pyramid
781 * Z_G_PEN06 6 node ghost pentahedron
782 * Z_G_PEN15 15 node ghost pentahedron
783 * Z_G_HEX08 8 node ghost hexahedron
784 * Z_G_HEX20 20 node ghost hexahedron
785 * Starting at API 2.02:
786 * ====================
787 * Z_NSIDED n node nsided polygon
788 * Z_NFACED n face nfaced polyhedron
789 * Z_G_NSIDED n node ghost nsided polygon
790 * Z_G_NFACED n face ghost nfaced polyhedron
794 * (IN) imag_data = TRUE if imag component
795 * FALSE if real component
797 * (IN) component = The component: (0 if Z_SCALAR)
798 * (0 - 2 if Z_VECTOR)
799 * (0 - 5 if Z_TENSOR)
800 * (0 - 8 if Z_TENSOR9)
802 * * 6 Symmetric Indicies, 0:5 *
803 * * ---------------------------- *
804 * * | 11 12 13 | | 0 3 4 | *
806 * * T = | 22 23 | = | 1 5 | *
810 * * 9 General Indicies, 0:8 *
811 * * ---------------------------- *
812 * * | 11 12 13 | | 0 1 2 | *
814 * * T = | 21 22 23 | = | 3 4 5 | *
816 * * | 31 32 33 | | 6 7 8 | *
819 * if Z_PER_NODE: = Zero based, first node index of the buffered set
820 * if Z_PER_ELEM: = Zero based, first element index of the buffered set
823 * if Z_PER_NODE: = Zero based, last node index of the buffered set
824 * if Z_PER_ELEM: = Zero based, last element index of the buffered set
826 * Thus, for first five elements or nodes:
829 * total_number = (e_end - e_beg) + 1 = (4 - 0) + 1 = 5
831 * for second five elements or nodes, would be:
834 * total_number = (e_end - e_beg) + 1 = (9 - 5) + 1 = 5
836 * for all elements or nodes of a part, would be:
838 * n_end = num_elements_or_nodes - 1
840 * (IN) first = TRUE if first invocation of a buffered set.
841 * Will be FALSE for all subsequent invocations
842 * of the set. This is so you can open files, get to
843 * the correct starting spot, initialize, etc.
845 * (IN) buffer_size = The size of the buffer.
846 * Namely: var_array[buffer_size]
848 * (IN) leftside = TRUE if current time is at a timestep or
849 * when getting the left side of a time
850 * span that encloses the current time.
851 * = FALSE when getting the right side of a time
852 * span that encloses the current time.
856 * |-------------|--------------|-------... requires no interpolation
857 * ^ get values at step2 (leftside = TRUE)
858 * current time (leftside = TRUE)
863 * |-------------|--------------|-------... requires interpolation
864 * ^ get values at step2 (leftside = TRUE)
865 * current time and get values at step3 (leftside = FALSE)
867 * Note that it would generally be easier for this routine if EnSight got all
868 * of the left side, then all of the right side, and then did its
869 * interpolation. But, in the spirit of doing things in buffers (to save
870 * memory) it gets a left side buffer (and the corresponding right side
871 * buffer and interpolates these), if needed, before going to the next
872 * buffer of the set. Thus, you need to be able to handle that situation.
874 * Note also that EnSight will have called the routine to change the current
875 * time step between the two invocations when interpolation is required.
876 * And Ensight does the interpolating. This variable is provided so
877 * that you can deal with two different files or pointers between the
878 * corresponding invocations for the two times
882 * -----------------------------------------------------------------------
883 * (IMPORTANT: this array is 0-based for both Z_PER_NODE and Z_PER_ELEM!!!
884 * -----------------------------------------------------------------------
886 * if Z_PER_NODE: = 1D buffer array set up to hold a variable
887 * component value for nodes.
889 * if Z_PER_ELEM: = 1D buffer array set up to hold a variable
890 * component value for elements.
892 * (Array will have been allocated
895 * Info stored in this fashion:
896 * var_array[0] = var component for node or element 1 of part
897 * var_array[1] = var component for node or element 2 of part
898 * var_array[2] = var component for node or element 3 of part
901 * * Example, (if 158 quad elements with a real Z_PER_ELEM scalar,
902 * current time is between steps, and buffer size is 75)
904 * first invocation: (for left side of time span)
905 * var_type = Z_SCALAR
906 * which_type = Z_PER_ELEM
911 * first = TRUE Will be TRUE the first time!
913 * leftside = TRUE <==
914 * var_array[75] load in scalar value for elements 1 - 75
915 * *num_returned = 75 set this
916 * return(0) return this (indicates more to do)
918 * second invocation: (for right side of time span)
919 * var_type = Z_SCALAR
920 * which_type = Z_PER_ELEM
925 * first = TRUE Note: Will still be TRUE (because is right side)
927 * leftside = FALSE <==
928 * var_array[75] load in scalar value for elements 1 - 75
929 * *num_returned = 75 set this
930 * return(0) return this (indicates more to do)
932 * -------------------------------
933 * third invocation: (for left side of time span)
934 * var_type = Z_SCALAR
935 * which_type = Z_PER_ELEM
940 * first = FALSE Will be FALSE now
942 * leftside = TRUE <==
943 * var_array[75] load in scalar value for elements 76 - 150
944 * *num_returned = 75 set this
945 * return(0) return this (indicates more to do)
947 * fourth invocation: (for right side of time span)
948 * var_type = Z_SCALAR
949 * which_type = Z_PER_ELEM
956 * leftside = FALSE <==
957 * var_array[75] load in scalar value for elements 76 - 150
958 * *num_returned = 75 set this
959 * return(0) return this (indicates more to do)
961 *------------------------------------
962 * fifth invocation: (for left side of time span)
963 * var_type = Z_SCALAR
964 * which_type = Z_PER_ELEM
969 * first = FALSE Will still be FALSE
971 * leftside = TRUE <==
972 * var_array[75] load in scalar value for elements 151 - 158
973 * *num_returned = 8 set this
974 * return(1) return this (indicates no more to do)
976 * sixth invocation: (for right side of time span)
977 * var_type = Z_SCALAR
978 * which_type = Z_PER_ELEM
985 * leftside = FALSE <==
986 * var_array[75] load in scalar value for elements 151 - 158
987 * *num_returned = 8 set this
988 * return(1) return this (indicates no more to do)
991 * (OUT) *num_returned = The number of nodes or elements whose variable
992 * values are returned in the buffer. This will
993 * normally be equal to buffer_size except for
994 * that last buffer - which could be less than
997 * returns 0 if got some, more to do
998 * 1 if got some, done
1002 * * This will be based on Current_time_step
1004 * * Again, make sure each buffer is zero based. For our example using buffers above:
1007 * ---------------- ------------------ -------------------
1009 * ------- ------- -------- -------- --------- ---------
1010 * var_array[0] scalar of quad 1L quad 1R quad 76L quad 76R quad 151L quad 151R
1012 * var_array[1] scalar of quad 2L quad 2R quad 77L quad 77R quad 152L quad 152R
1016 * var_array[74] scalar of quad 75L quad 75R quad 150L quad 150R quad 158L quad 158R
1018 * Where: L indicates left time step
1019 * R indicates right time step
1020 *--------------------------------------------------------------------*/
1022 USERD_get_var_by_component_in_buffers(int which_variable,
1039 /*--------------------------------------------------------------------
1040 * USERD_get_nsided_conn_in_buffers -
1041 *--------------------------------------------------------------------
1043 * Gets the two arrays containing the connectivity information
1044 * of nsided elements in buffers
1046 * (IN) part_number = The part number
1048 * (1-based index of part table, namely:
1050 * 1 ... Numparts_available.
1052 * It is NOT the part_id that
1053 * is loaded in USERD_get_gold_part_build_info)
1055 * (IN) first = TRUE if first invocation of a buffered set.
1056 * Will be FALSE for all subsequent invocations
1057 * of the set. This is so you can open files,
1058 * get to the correct starting spot,
1061 * (IN) e_beg = Zero based, first element number
1062 * of the buffered set
1064 * (IN) e_end = Zero based, last element number
1065 * of the buffered set
1067 * Thus, for first five elements of a type:
1070 * total_number = (e_end - e_beg) + 1 = (4 - 0) + 1 = 5
1072 * for second five elements of a type, would be:
1075 * total_number = (e_end - e_beg) + 1 = (9 - 5) + 1 = 5
1077 * for all elements of the type of a part, would be:
1079 * n_end = num_elements_of_type - 1
1081 * (IN) buffer_size = The size of the num_nodes_per_elem_array buffer.
1082 * Namely: num_nodes_per_elem_array[buffer_size]
1084 * (OUT) num_nodes_per_elem_array = 1D buffer array of the number of nodes
1085 * per nsided element.
1087 * (OUT) nsided_conn_array = 1D buffer array of nsided connectivies
1089 * (int array will have been allocated
1090 * long enough to hold all the nsided
1091 * connectivities in the buffered chunk)
1093 * (OUT) *num_returned = The number of elements whose connectivities
1094 * are returned in the buffer. This will
1095 * normally be equal to buffer_size except for
1096 * that last buffer - which could be less than
1099 * Providing nsided information to Ensight:
1101 * NOTE: for other nsided operations you need these first two, but we
1102 * don't actually use them in this routine.
1104 * 1. In USERD_get_gold_part_build_info, provide the number of nsided
1105 * elements in the part.
1107 * 2. In USERD_get_part_elements_by_type, provide (in the conn_array),
1108 * the number of nodes per nsided element. (as if connectivity
1109 * length of an nsided element is one)
1111 * We do use the following:
1112 * 3. In this routine, provide the corresponding num_nodes_per_element and
1113 * streamed connectivities for each of the nsided elements in this
1117 * Simple example: 5 6
1119 * 3 nsided elements: /| \
1122 * 1 7-sided) / | \ 7
1134 * NOTE, don't really use these first two here (See USERD_get_nsided_conn)
1136 * 1. In USERD_get_gold_part_build_info:
1137 * number_of_elements[Z_NSIDED] = 3
1141 * 2. In USERD_get_part_elements_by_type:
1142 * length of conn_array will be: 3 x 1
1144 * for element_type of Z_NSIDED:
1145 * conn_array[0][0] = 4 (for the 4-sided element)
1146 * conn_array[1][0] = 3 (for the 3-sided element)
1147 * conn_array[2][0] = 7 (for the 7-sided element)
1152 * But for our example, lets assume that that our buffer is just 2
1154 * 3. In this routine:
1161 * num_nodes_per_elem_array[2] load it: num_nodes_per_elem_array[0] = 4
1162 * num_nodes_per_elem_array[1] = 3
1164 * nsided_conn_array[at least 7] load it: nsided_conn_array[0] = 1
1165 * nsided_conn_array[1] = 2
1166 * nsided_conn_array[2] = 4
1167 * nsided_conn_array[3] = 3
1169 * nsided_conn_array[4] = 3
1170 * nsided_conn_array[5] = 4
1171 * nsided_conn_array[6] = 5
1173 * return(0) return this (indicates more to do)
1175 * second invocation:
1180 * num_nodes_per_elem_array[2] load it: num_nodes_per_elem_array[0] = 7
1182 * nsided_conn_array[at least 7] load it: nsided_conn_array[0] = 2
1183 * nsided_conn_array[1] = 9
1184 * nsided_conn_array[2] = 8
1185 * nsided_conn_array[3] = 7
1186 * nsided_conn_array[4] = 6
1187 * nsided_conn_array[5] = 5
1188 * nsided_conn_array[6] = 4
1190 * return(1) return this (indicates no more to do)
1192 * returns 0 if got some, more to do
1193 * 1 if got some, done
1197 * * This will be based on Current_time_step
1199 * * Will not be called unless there are some nsided elements in the
1201 *--------------------------------------------------------------------*/
1203 USERD_get_nsided_conn_in_buffers(int part_number,
1204 int *num_nodes_per_elem_array,
1205 int *nsided_conn_array,
1215 /*--------------------------------------------------------------------
1216 * USERD_get_nfaced_conn_in_buffers -
1217 *--------------------------------------------------------------------
1219 * Gets three arrays containing the number of faces per element,
1220 * number of nodes per face, and connectivity per face of nfaced
1221 * elements in buffers
1223 * (IN) part_number = The part number
1225 * (1-based index of part table, namely:
1227 * 1 ... Numparts_available.
1229 * It is NOT the part_id that
1230 * is loaded in USERD_get_gold_part_build_info)
1232 * (IN) first = TRUE if first invocation of a buffered set.
1233 * Will be FALSE for all subsequent invocations
1234 * of the set. This is so you can open files,
1235 * get to the correct starting spot,
1238 * (IN) e_beg = Zero based, first element number
1239 * of the buffered set
1241 * (IN) e_end = Zero based, last element number
1242 * of the buffered set
1244 * Thus, for first five elements of a type:
1247 * total_number = (e_end - e_beg) + 1 = (4 - 0) + 1 = 5
1249 * for second five elements of a type, would be:
1252 * total_number = (e_end - e_beg) + 1 = (9 - 5) + 1 = 5
1254 * for all elements of the type of a part, would be:
1256 * n_end = num_elements_of_type - 1
1258 * (IN) buffer_size = The size of the num_nodes_per_elem_array buffer.
1259 * Namely: num_nodes_per_elem_array[buffer_size]
1261 * (OUT) nfaced_fpe_array = 1D buffer array of the number of faces per nfaced
1264 * (int array will have been allocated
1267 * (OUT) nfaced_npf_array = 1D buffer array of the number of nodes per face
1268 * for nfaced elements.
1270 * (int array will have been allocated long
1271 * enough to hold a buffer's size of values)
1273 * (OUT) nfaced_conn_array = 1D array of nsided face connectivies of
1276 * (int array will have been allocated
1277 * long enough to hold a buffer's worth of values)
1279 * Providing nfaced information to Ensight:
1281 * NOTE: for other nfaced operations you need these first two, but we
1282 * don't actually use them in this routine.
1284 * 1. In USERD_get_gold_part_build_info, provide the number of nfaced
1285 * polyhedral elements in the part.
1287 * 2. In USERD_get_part_elements_by_type, provide (in the conn_array),
1288 * the number of faces per nfaced element. (as if connectivity
1289 * length of an nfaced element is one)
1291 * We do use the following:
1292 * 3. In this routine, provide the corresponding number of faces per nfaced
1293 * element, streamed number of nodes per face, and streamed face
1294 * connectivities for each of the faces of the nfaced elements in the
1295 * bufferred portion.
1298 * Simple example: 11 10 12
1300 * 2 nfaced elements: /| |\ /|
1301 * (1 7-faced / | | \ / |
1302 * 1 5-sided) / | | +9 |
1305 * +-----------+/ | | |
1307 * | +-----|--+--|--+
1315 * Note, don't really use these first two here (See USERD_get_nfaced_conn)
1317 * 1. In USERD_get_gold_part_build_info:
1318 * number_of_elements[Z_NFACED] = 2
1322 * 2. In USERD_get_part_elements_by_type:
1323 * length of conn_array will be: 2 x 1
1324 * for element_type of Z_NFACED:
1325 * conn_array[0][0] = 7 (for the 7-faced element)
1326 * conn_array[1][0] = 5 (for the 5-faced element)
1331 * But for our simple example, lets assume that that our buffer is just 1
1332 * so that we have multiple invocations. ================
1334 * 3. In this routine:
1341 * nfaced_fpe_array[1] load it: nfaced_fpe_array[0] = 7
1343 * nfaced_npf_array[at least 7] load it: nfaced_npf_array[0] = 5
1344 * nfaced_npf_array[1] = 5
1345 * nfaced_npf_array[2] = 4
1346 * nfaced_npf_array[3] = 4
1347 * nfaced_npf_array[4] = 4
1348 * nfaced_npf_array[5] = 4
1349 * nfaced_npf_array[6] = 4
1351 * nsided_conn_array[at least 30] load it: nsided_conn_array[0] = 7
1352 * nsided_conn_array[1] = 8
1353 * nsided_conn_array[2] = 9
1354 * nsided_conn_array[3] = 10
1355 * nsided_conn_array[4] = 11
1357 * nsided_conn_array[5] = 1
1358 * nsided_conn_array[6] = 5
1359 * nsided_conn_array[7] = 4
1360 * nsided_conn_array[8] = 3
1361 * nsided_conn_array[9] = 2
1363 * nsided_conn_array[10] = 1
1364 * nsided_conn_array[11] = 2
1365 * nsided_conn_array[12] = 8
1366 * nsided_conn_array[13] = 7
1368 * nsided_conn_array[14] = 5
1369 * nsided_conn_array[15] = 1
1370 * nsided_conn_array[16] = 7
1371 * nsided_conn_array[17] = 11
1373 * nsided_conn_array[18] = 4
1374 * nsided_conn_array[19] = 5
1375 * nsided_conn_array[20] = 11
1376 * nsided_conn_array[21] = 10
1378 * nsided_conn_array[22] = 2
1379 * nsided_conn_array[23] = 3
1380 * nsided_conn_array[24] = 9
1381 * nsided_conn_array[25] = 8
1383 * nsided_conn_array[26] = 3
1384 * nsided_conn_array[27] = 4
1385 * nsided_conn_array[28] = 10
1386 * nsided_conn_array[29] = 9
1387 * *num_returned = 1;
1390 * second invocation:
1395 * nfaced_fpe_array[1] load it: nfaced_fpe_array[0] = 5
1397 * nfaced_npf_array[at least 7] load it: nfaced_npf_array[0] = 3
1398 * nfaced_npf_array[1] = 3
1399 * nfaced_npf_array[2] = 4
1400 * nfaced_npf_array[3] = 4
1401 * nfaced_npf_array[4] = 4
1403 * nsided_conn_array[at least 18] load it: nsided_conn_array[0] = 9
1404 * nsided_conn_array[1] = 12
1405 * nsided_conn_array[2] = 10
1407 * nsided_conn_array[3] = 3
1408 * nsided_conn_array[4] = 4
1409 * nsided_conn_array[5] = 6
1411 * nsided_conn_array[6] = 6
1412 * nsided_conn_array[7] = 4
1413 * nsided_conn_array[8] = 10
1414 * nsided_conn_array[9] = 12
1416 * nsided_conn_array[10] = 3
1417 * nsided_conn_array[11] = 6
1418 * nsided_conn_array[12] = 12
1419 * nsided_conn_array[13] = 9
1421 * nsided_conn_array[14] = 4
1422 * nsided_conn_array[15] = 3
1423 * nsided_conn_array[16] = 9
1424 * nsided_conn_array[17] = 10
1425 * *num_returned = 1;
1428 * returns 0 if got some, more to do
1429 * 1 if got some, done
1433 * * This will be based on Current_time_step
1435 * * Will not be called unless there are some nfaced elements in the
1437 *--------------------------------------------------------------------*/
1439 USERD_get_nfaced_conn_in_buffers(int part_number,
1440 int *nfaced_fpe_array,
1441 int *nfaced_npf_array,
1442 int *nfaced_conn_array,