This routine extracts the boundary of a mesh. If the original mesh is a solid mesh, it extracts the surface mesh.  If it is a surface mesh, it extracts the edge mesh. If the interface elements have "parent-child" nodes, then only the parent nodes and elements are extracted.  Not all attributes in the input mesh object are created or initialize in the output mesh object.  Among the array-valued attributes,  only xic,yic,zic,itet,jtet,itetoff,itettyp, and icr1 are set. imt is set to 1. The  icontab array is copied from the input mesh object to the output mesh object.

Six new element based attributes, itetclr0, itetclr1, idelem0 and idelem1, idface0, idface1 are added to the output mesh indicating the material numbers (itetclr) on each side of the mesh faces, i.e., the color of elements that existed on each side of a face in the original mesh. The convention is that the normal points into the larger material id (itetclr) material. itetclr0 indicates the color of the elements on smaller itetclr value side (the inside) of the face normal (0 if the face is on an external boundary) and itetclr1 indicates the color of the elements on the outside of the normal. The attributes idelem0 and idelem1 record the element numbers of the input mesh that produced the lower dimensional output mesh. The attributes idface0 and idface1 record the local face number of the input mesh objects.


                   |------> normal
       itetclr = 1 |   itetclr = 2
      itetclr0 = 1 |  itetclr1 = 2
      element# = 1 |  element# = 2
      idelem0  = 1 |  idelem1  = 2

A node attribute, idnode0, records the node number of the input mesh object node.

In addition another element attribute called facecol is added to the elements of the new mesh. The facecol attribute is a model face number constructed from the itetclr0 and itetclr1 attributes. The way the facecol  attribute is constructed does not guarantee that the same facecol value will not be given to two disjoint patches of mesh faces.

If the keyword external is supplied, only the exterior surface mesh will be extracted.  i.e., the interior interfaces between materials will not be extracted.  The default is for the interior interfaces to be extracted as well.

The itp array of the input mesh object must be correctly set prior to calling extract. To insure itp is correctly set a call to resetpts/itp may be required.