UG3 LIBRARY      : UNSTRUCTURED GRID GENERAL PURPOSE 3D GRID RELATED ROUTINES
-----------------------------------------------------------------------------

The following 3D grid relate routines can be used to check existing grids for
errors and create a variety of grid lists and connectivity maps.

ug3_angmax                     : Find maximum dihedral angle for all tetrahedral
                                 elements of volume grid.
ug3_angmax2                    : Determine maximum dihedral angle and length
                                 scale ratio for each set of flagged elements.
ug3_angmaxb                    : Find maximum planar angle for all triangular
                                 faces of surface grid.
ug3_bfv                        : Determine a normal vector for each boundary
                                 face.
ug3_bnd_nodes                  : Determine node index map for boundary nodes
                                 and optionally either remove interior nodes
                                 from grid data or continue node index map with
                                 interior nodes following boundary nodes.
ug3_bnd_vol_nodes              : Reorder nodes so that boundary nodes are first
                                 followed by interior nodes.
ug3_bsmth                      : Smooth a boundary function value using centroid
                                 averaging.
ug3_bv                         : Determine a normal vector for each boundary
                                 node.
ug3_bv2                        : Determine a normal vector for each boundary
                                 node.
ug3_bv_ls                      : Determine boundary normal vector at a given
                                 node from a least-squares optimization method
                                 that uses the boundary face normals for each
                                 of the boundary faces that surround the node.
ug3_check_bgdata_file          : Check if BGDATA background mesh data file
                                 exists.
ug3_chk                        : Check element connectivity and element volume.
ug3_chkb                       : Check boundary face connectivity.
ug3_chkbc                      : Check grid boundary condition flag values.
ug3_chkbc0                     : Check grid boundary condition flag values
                                 without boundary face neighbor or body map
                                 data.
ug3_chkbcp1                    : Check to see that normal vectors are planar for
                                 all automatically set intersecting BL surfaces.
ug3_chkbcp2                    : Check included angle between intersecting BL
                                 surfaces and adjacent surfaces for all
                                 automatically set intersecting BL surfaces.
ug3_chkbda                     : Check dihedral angle between adjacent
                                 triangular faces of surface grid.
ug3_chkblis                    : Check included angle between intersecting
                                 boundary-layer surfaces and adjacent surfaces.
ug3_chkblisbc                  : Check if boundary faces with a grid BC for a
                                 surface that intersect the BL region are also
                                 adjacent to a surface that generates a BL
                                 region.
ug3_chkbn                      : Check that all nodes are on a boundary surface
                                 and that all faces reference included nodes.
ug3_chkbq                      : Check planar face angles for each triangular
                                 face of surface grid.
ug3_chkbsurf                   : Check and prepare a boundary surface grid for
                                 volume grid generation.
ug3_chkbsurf0                  : Check and reorder a boundary surface grid.
ug3_chkplane                   : Check if a given surface grid is planar.
ug3_chkq                       : Check dihedral angles for each tetrahedral
                                 element of volume grid.
ug3_conv_p1_bmesh_p2           : Convert a standard P1 boundary mesh into a P2
                                 mesh defined by a P1+P2_complement mesh.
ug3_conv_p2_bmesh_p1           : Convert a p2 mesh defined by a p1+p2_complement
                                 mesh to a p1 boundary surface sub-mesh.
ug3_df                         : Determine the node distribution function at all
                                 boundary nodes.
ug3_df0b                       : Set boundary zero value distribution function
                                 using simple averaging.
ug3_df0f                       : Set zero value distribution function using
                                 simple averaging.
ug3_df_gr                      : Interpolate with growth the distribution
                                 function from multiple nodes.
ug3_df_gr_get                  : Get distribution function interpolated with
                                 growth from multiple nodes.
ug3_dfbe                       : Determine the node distribution function at all
                                 boundary face edges.
ug3_dfbf                       : Determine the node distribution function at all
                                 boundary faces.
ug3_dff                        : Determine the node distribution function at all
                                 nodes.
ug3_dfmax                      : Determine the maximum node distribution
                                 function at all boundary nodes.
ug3_dfmin                      : Determine the minimum node distribution
                                 function at all boundary nodes.
ug3_dh_ang_w                   : Determine tet-element angle functions.
ug3_disoel                     : Search for and delete isolated elements with
                                 no neighbors.
ug3_dv                         : Determine circum-radius and circum-center
                                 coordinates for a given element.
ug3_dx                         : Determine maximum dimension for a set of nodes.
ug3_edge_length                : Find maximum and minimum edge length ratios.
ug3_extract_surf               : Extract a component surface grid corresponding
                                 to a given surface ID.
ug3_face_ang_w                 : Determine planar face corner angle functions.
                                 The maximum value corresponds to the corner
                                 with the maximum angle. The minimum value
                                 corresponds to the corner with the minimum
                                 angle.
ug3_face_area                  : Determine face area vector.
ug3_face_map                   : Determine face map data structure for volume
                                 mesh.
ug3_face_sort                  : Face sorting routines for face based data
                                 structures.
ug3_ibfe                       : Determine boundary face to boundary face
                                 connectivity for a multiply connected boundary
                                 face.
ug3_ibfibf                     : Determine boundary face to boundary face
                                 connectivity. Simply connected (no more than
                                 two boundary faces per boundary edge) surfaces
                                 are reordered if all faces do not have the
                                 same orientation.
ug3_ibfibf0                    : Determine initial boundary face to boundary
                                 face connectivity.
                                 Also automatically set the grid boundary
                                 condition flag for embedded/transparent
                                 surfaces. If a surface has at least one edge
                                 that is free then automatically set the grid
                                 boundary condition flag for that surface to an
                                 embedded/transparent surface. An embedded
                                 surface is defined as a set of connected faces
                                 that have one or more open outer edges and any
                                 other outer edges connected to one or more
                                 faces of another surface. 
ug3_ibfibf2                    : Determine boundary face to boundary face
                                 connectivity. Simply connected (no more than
                                 two boundary faces per boundary edge) surfaces
                                 are reordered if all faces do not have the
                                 same orientation. This version creates its own
                                 temporary work arrays.
ug3_ibfin                      : Create a list of boundary faces surrounding a
                                 node.
ug3_iblisibf                   : Flag boundary faces that intersect the BL
                                 region.
ug3_ibnin                      : Create a list of boundary nodes surrounding a
                                 node.
ug3_iboibf                     : Determine the number of closed boundary
                                 objects.
ug3_iboibf0                    : Determine the number of closed boundary
                                 objects.
ug3_ibor                       : Reorder the boundary surface grid connectivity
                                 if any boundary object does not have RH
                                 orientation. 
ug3_idibf                      : Set boundary surface face IDs by boundary
                                 surface face grid BC.
ug3_idibf2                     : Set boundary surface face IDs based on surface
                                 discontinuity.
ug3_idiel                      : Set volume ID flag.
ug3_idiel2                     : Set volume ID flag using ug3_iviel.
ug3_idielm                     : Set volume ID flag in mixed element region.
ug3_idsmth                     : Distribute normal spacing and BL thickness on
                                 surface faces set by individual surface face
                                 ID.
ug3_ielibf                     : Determine for each boundary face the element
                                 that contains that face and set the element
                                 neighbors at boundaries.
ug3_ielibf0                    : Determine for each boundary face the element
                                 that contains the face.
ug3_ielibf2                    : Determine for each boundary face the element
                                 that contains the face from the element to
                                 element connectivity.
ug3_ielibfm                    : Determine for each boundary face the element
                                 that contains the face and an ID flag that
                                 identifies the element face orientation.
ug3_ieliel                     : Determine the element to element connectivity.
ug3_ieliel2                    : Determine the element to element connectivity
                                 from element node connectivity.
ug3_ieliel2b                   : Add boundary faces to element to element
                                 connectivity.
ug3_ieliel3b                   : Add boundary faces to element to element
                                 connectivity and determine for each boundary
                                 face the element that contains that face.
ug3_ielin                      : Create a list of elements surrounding a node.
ug3_ielinm                     : Create a list of mixed elements surrounding a
                                 node.
ug3_ieljel                     : Create list of nearby elements for each
                                 element.
ug3_ifin                       : Create a list of tria and quad boundary faces
                                 surrounding a node.
ug3_inix                       : Determine map based on physical location.
ug3_injn                       : Reorder nodes to be connected or un-connected.
ug3_interp                     : Interpolate data at new locations from
                                 existing data and grid.
ug3_iobjiel                    : Determine the number of solid objects.
ug3_iqin                       : Create a list of quad faces surrounding a node.
ug3_irfibf                     : Check the boundary face reconnection flag and
                                 reset it so that the flag matches that of the
                                 adjacent faces, and set the boundary
                                 reconnection flag between faces of different
                                 surface ID's.
ug3_irfibfm                    : Reset the boundary face reconnection flag at
                                 partition boundary surface faces and at
                                 transparent boundary surface faces.
ug3_iviel                      : Label elements that are fully connected as a
                                 single volume .
ug3_lrmin                      : Determine minimum edge length ratio.
ug3_mdisn                      : Set a flag at discontinuous boundary nodes.
ug3_met2df                     : Determine the equivalent isotropic length scale
                                 from a given metric.
ug3_mq_elem                    : Set element flag for regions surrounding low
                                 quality elements.
ug3_msd_elem                   : Set element flag for sub-domain interface
                                 boundary regions.
ug3_nelem_est                  : estimate the total number of elements that
                                 will be generated.
ug3_nelpnmax                   : Check maximum elements per node.
ug3_nnodeb                     : Determine the maximum node index on the
                                 boundary surface.
ug3_nnodeb2                    : Determine the maximum node index on the
                                 boundary surface from the element neighbor
                                 connectivity.
ug3_nstv                       : Normalize and check a given normal vector and
                                 then create a suitable set of orthogonal
                                 tangential vectors.
ug3_octree                     : Create, search within, modify, and delete an
                                 octree based data structure.
ug3_p2_tet_q                   : Evaluate P2-Tet element quality measure
                                 function.
ug3_proj_vector                : Determine the transformation vectors for a
                                 plane defined by a normal vector.
ug3_proj_uv_from_xyz           : Given dx1,dx2,dx3 in xyz physical space find
                                 du1,du2 in uv transformed space.
ug3_proj_xyz_from_uv           : Given du1,du2 in uv transformed space find
                                 dx1,dx2,dx3 in xyz physical space.
ug3_qchk                       : Check and output element quality information.
ug3_qchk_get_prog_param        : Get QCHK program control input parameters/
                                 arguments.
ug3_qchk_initialize_param      : Set the name, flag, default value, minimum
                                 allowable value, maximum allowable value and
                                 description for all QCHK parameters.
ug3_qtria                      : Replace quad surface faces with tria surface
                                 faces.
ug3_qtria_recd                 : Reconnect tria surface faces derived from quad
                                 surface faces if they are adjacent to
                                 discontinuities.
ug3_qvlr                       : Determine the tet volume-length to
                                 edge-length ratio function, q.
ug3_tet_qvlr                   : Determine the tet volume-length to
                                 edge-length ratio function, q.
ug3_pyramid_qvlr               : Determine the pyramid volume-length to
                                 edge-length ratio function, q.
ug3_prism_qvlr                 : Determine the prism volume-length to
                                 edge-length ratio function, q.
ug3_hex_qvlr                   : Determine the hex volume-length to
                                 edge-length ratio function, q.
ug3_read_bgdata_file           : Read BGDATA background mesh data file.
ug3_read_func_file             : Read function data from a function file.
ug3_read_gdata                 : Read boundary surface grid BC, boundary surface
                                 reconection flag, BL initial spacing, and BL
                                 thicknes.
ug3_read_grid_file             : Read grid data from a volume or surface grid
                                 file.
ug3_read_grid_file2            : Read grid data from a volume or surface grid
                                 file.
ug3_read_sfunc                 : Read function data from a SFUNC/UFUNC function
                                 file.
ug3_read_split_data_file       : Read hex-element split-face data from a SPLIT
                                 data file.
ug3_read_surf                  : Read grid data from an open SURF surface grid
                                 file.
ug3_read_surf_grid_file        : Read grid data from a SURF surface grid file.
ug3_read_ugrid                 : Read grid data from a UGRID volume or surface
                                 grid file.
ug3_read_write_mesh            : Read and write grid data from a MESH file using
                                 external routines. 
ug3_reorder0                   : Reorders the elements so that the elements
                                 with mflag[ielem] == 0 are first in the
                                 ordering if there are at least relem0*nelem
                                 elements to be reordered.
ug3_reorder0bf                 : Reorders the boundary faces so that the
                                 boundary faces with mflag[ibface] == 0 are
                                 first in the ordering.
ug3_reorder0bn                 : Reorders the boundary nodes so that the
                                 boundary nodes with mflag[inode] == 0 are
                                 first in the ordering.
ug3_reorder0n                  : Reorders the nodes so that the nodes with
                                 mflag[inode] == 0 are first in the ordering.
ug3_reorderb                   : Reorders nodes so that all boundary nodes are
                                 first in the ordering.
ug3_reorderid                  : Reorder the boundary faces and nodes so that
                                 the boundary faces and nodes with the same ID
                                 are grouped and consecutively ordered together.
                                 Also, create new duplicate boundary nodes such
                                 that each boundary face group with the same ID
                                 have unique nodes that are not shared by any
                                 other ID group.
ug3_reordern                   : Reorders the nodes so that the nodes of
                                 elements less than ielem0 are first in the
                                 ordering.
ug3_rmtbf                      : Remove internal transparent/embedded surface
                                 faces from boundary surface connectivity and
                                 reset element neighbor connectivity.
ug3_rmtbfd                     : Remove duplicate faces and nodes from
                                 transparent boundary surface faces.
ug3_set_ibcibf                 : Set BC flag at all faces using parameter
                                 structure data.
ug3_set_irfibf                 : Set reconnection flag based on dihedral angle
                                 between adjacent triangular faces of surface
                                 grid and turn reconnection off between faces
                                 with different surface ID flags.
ug3_setbcp                     : Check for planar surfaces that are not BL
                                 generating surfaces and automatically set the
                                 grid boundary condition flag for them to that
                                 for an intersecting surface.
ug3_sgins                      : Insert re-generated sub-grid into grid.
ug3_sign                       : Check the element connectivity ordering for RH
                                 rule.
ug3_sliver_info                : Get information about sliver elements.
ug3_split_data                 : Routines to save, get and free hex-element
                                 split-face data.
ug3_get_split_data             : Get hex-element split-face data.
ug3_save_split_data            : Save hex-element split-face data.
ug3_free_split_data            : Free hex-element split-face data.
ug3_srch                       : Find the element that contains the node
                                 x01,x02,x03.
ug3_srchbf                     : Find the boundary surface face that contains
                                 the node x01, x02, x03.
ug3_subgrid                    : Extract sub-grid for a specified element
                                 region.
ug3_tbfd                       : Create duplicate faces and nodes for
                                 transparent boundary surface faces.
ug3_triaq                      : Replace previously converted tria surface faces
                                 with quad surface.
ug3_version                    : Put compile date, compile OS, version date, and
                                 version number in text string.
ug3_vol
ug3_tet_vol                    : Compute tet element volume.
ug3_pyramid_vol                : Compute pyramid element volume.
ug3_prism_vol                  : Compute prism element volume.
ug3_hex_vol                    : Compute hex element volume.
ug3_chk_tet_vol                : Compute and check tet element volume.
ug3_chk_pyramid_vol            : Compute and check pyramid element volume.
ug3_chk_prism_vol              : Compute and check prism element volume.
ug3_chk_hex_vol                : Compute and check hex element volume.
ug3_chkvol                     : Check tet element volumes.
ug3_chkvolm                    : Check mixed element volumes.
ug3_tvol                       : Compute total tet element volume.
ug3_tvolm                      : Compute total mixed element volume.
ug3_volm                       : Compute mixed element volumes.
ug3_volrchk                    : Check tet element volume ratios.
ug3_vsmth                      : Smooth a function value using centroid
                                 averaging.
ug3_write_angchk               : Check mixed element dihedral angles.
ug3_write_bgdata_file          : Write BGDATA background mesh data file.
ug3_write_func_file            : Incrementally write solution data to a function
                                 file.
ug3_write_gdata                : Write boundary surface grid BC, boundary
                                 surface reconection flag, BL initial spacing,
                                 and BL thicknes.
ug3_write_grid_file            : Incrementally write grid data to a volume grid
                                 file.
ug3_write_grid_file2           : Incrementally write grid data to a volume grid
                                 file.
ug3_write_qvlrchk              : Check mixed element volume-length to
                                 edge-length ratio.
ug3_write_sfunc                : Incrementally write solution data to a SFUNC
                                 function file.
ug3_write_split_data_file      : Write hex-element split-face data to a SPLIT
                                 data file.
ug3_write_surf                 : Write grid data to an open SURF surface grid
                                 file.
ug3_write_surf_grid_error_file : Write a UG3 boundary surface grid file with
                                 faces in error identified or a surface grid
                                 node error file with nodes in error listed.
ug3_write_surf_grid_file       : Write grid data to a SURF surface grid file.
ug3_write_ugrid                : Incrementally write grid data to a UGRID volume
                                 grid file.
ug3_write_volchk               : Check mixed element volumes.
ug3_write_volrchk              : Check mixed element volume ratios.
ug3_write_volrchk2             : Check tet element volume ratios.
ug3_x2x3                       : Transform to 3d coordinates from 2d plane
                                 orientated coordinates.
ug3_xmax                       : Determine min/max coordinates for a given set
                                 of nodes.

To use these routines, the UG (general purpose routines) and UG3 (general
purpose 3D routines) must be linked using the following compiler flags.

   -Lsimsys_sys_dir -lug3 -lug

The directory simsys_sys_dir is the SimSys system directory. C or C++ source
code that contain a call to one of the UG3 routines must have the following
following include statement.

   #include "simsys_sys_dir/src/ug3/UG3_LIB.h"
