[Sandia National Laboratories]
[About Sandia]
[Unique Solutions]
[Working With Us]
[Contacting Us]
[News Center]
[Search]
[Sandia Home]
[Cubit Home]
[More CuTips]
[Navigation Panel]




Cu-Tip #3: Mesh Copying, Mirroring and Morphing in Cubit

  1. Introduction
  2. Throughout the past couple of years many improvements have been made in the meshing capabilities of Cubit. One of the most powerful improvements has been the mesh copying algorithm. This document is meant to be a quick introduction to and a guide for the use of the mesh copying capabilities of the current version of Cubit.

  3. Background
  4. Previous to this major change, a rudimentary mesh copy capability existed, but mesh could only be copied between duplicated bodies (one body was a copy of another). This, of course, severely limited the usefulness of the copy command.

  5. Current Capabilities
  6. The copy command has been completely rewritten to take advantage of the concept of morphing. Morphing is the process of taking a topological entity and transforming it to fit a differently-shaped space. In this case a mesh is morphed from a geometric entity (surface, curve, or volume) and applied to a different geometric entity. The use of the morphing code enables Cubit to copy meshes from a given entity to another, perhaps completely unrelated and topologically different entity, with a great deal of success.

  7. Automatic Orientation
  8. Much work has gone into the morphing algorithm to enable it to successfully detect how to match a source mesh to a target surface. As is explained below, the user can specify how the mesh is supposed to be oriented. If, however, the user wishes to keep her intervention to a minimum, the program goes into a detection loop trying to find matching information. The first and most foolproof way to make a match is for the interval counts on matching sides to be equal. If there is a unique way of orienting the mesh using compatible interval counts, the algorithm will pick it. If there is ambiguity with interval matching, or a suitable match cannot be found, then the algorithm will progress to a geometric matching scheme, whereby the edges are sorted according to length, then matched to see if a unique pairing can be obtained. Usually this is sufficient to find a good match. If, however, the program still cannot find a unique match, then it is assumed that any match will work, and a semi-random match is made.

  9. CUBIT Commands
  10. The versatility of the mesh copy capability leads to many methods of application. The user may assign the copy scheme to a part, allowing that part to be meshed at a later time, or the user may use the copy command to transfer a mesh immediately.
    Examples of these follow, and two tables will appear afterwards, giving the exhaustive capabilities.

     First we will discuss the immediate meshing commands.
     

    • Copy:
    • The user invokes the copy command at the command prompt as follows:

       CUBIT> copy mesh surface 1 onto surface 2

      This is the most basic version of the command. Cubit will then look at the source surface and attempt to match up the boundaries of the source with the target as explained above. Chances are that Cubit will succeed in finding a viable match, and then the mesh will be transferred to the target surface. If the correlation chosen automatically is satisfactory, then that is all that need be done. If, however, the user has a specific orientation in mind, it might be better to specific some additional information. This information is specified as follows:

      CUBIT> copy mesh surface 1 onto surface 2 source curve 1 target curve 2

      By specifying the source and target curves, the user is telling Cubit that no matter what, she wants those two curves to be matched in the transfer. Now, as can be seen, by only specifying source and target curves, the user is still leaving a little bit of work up to the program. There will still be two ways to match up the geometry. Cubit will enter the matching loop to see if there is a unique match. If those efforts fail, Cubit will default to a material-on-the-left orientation. If the user feels it to be important, she can specify more information to "nail down" the resulting match. This extra information might include vertices, nodes, or mesh edges.

      Material-on-the-left means that the curves will be matched up with each other in such a fashion that proceeding around each loop, the surface will be on the left-hand-side. This can also be though of as a right-hand-rule, outward normal orientation
    • Mirror
    • The user invokes the mirror command as follows:

       CUBIT> mirror mesh surface 1 onto surface 2

      The difference between the mirror command and the copy command has to do with the default way of matching surfaces. Whereas the copy command defaults to a material-on-the-left orientation, the mirror command will try to flip the mesh on the target surface. This is useful in cases where a mesh needs to be consistent through a volume, so the source and target surfaces need to be matches, but mirrored, such as on cylinder end caps. The mirror command only accepts certain orientation data, specifically source and target vertices or nodes. As an additional note, anything that can be accomplished with the mirror command or scheme can be accomplished with copying--all it takes is supplying the correct mesh orientation information.
       
       
       

    command source entity onto target entity optional data
    copy mesh surface (id) onto surface (id) source curve (id) target curve (id) source vertex (id) target vertex (id) source edge (id) target edge (id) source node (id) target node (id)
    mirror mesh surface (id) onto surface (id) source vertex (id) target vertex (id) source node (id) target node (id)
    copy mesh volume (id) onto volume (id) source curve (id) target curve (id) source vertex (id) target vertex (id)
    copy mesh curve (id_range) onto curve (id_range) source vertex (id) target vertex (id)
    Summary of immediate meshing commands.

    Next we will discuss the scheme commands.
     

    • Scheme Copy (Morph)
    • The copy scheme is invoked as follows::

       CUBIT> surface 2 scheme copy

      As can be seen, assigning a scheme to a surface doesn't even require the specification of a source surface. The code will notice that and search for a suitable source surface. In finding a suitable source surface, the program searches for meshed surfaces that have the same number of intervals around the outside edges. If that fails to find a source surface, then geometric properties such as number of sides are compared. Usually this will yield a suitable match, but if not, a warning is printed and the user has another opportunity to enter more orientation information. Any combination of orientation info (see table below) can be supplied to ensure that a match is suitable, subject to the Miscellaneous Limitations. The Copy Scheme is also referred to as the Morph Scheme, and the two words are completely interchangeable in the setting of schemes.

    • Scheme Mirror
    • The mirror scheme is invoked the same as the copy scheme, and is used the same way. It carries the same restrictions as the mirror mesh command.
       
       
       

    target entity scheme scheme name optional data
    surface (id) scheme copy source surface (id) source curve (id) target curve (id) source vertex (id) target vertex (id) source edge (id) target edge (id) source node (id) target node (id)
    surface (id) scheme morph source surface (id) source curve (id) target curve (id) source vertex (id) target vertex (id) source edge (id) target edge (id) source node (id) target node (id)
    surface (id) scheme mirror source surface (id) source vertex (id) target vertex (id) source node (id) target node (id)
    volume (id) scheme copy source volume (id) source surface (id) target surface (id) source curve (id) target curve (id) source vertex (id) target vertex (id)
    volume (id) scheme morph source volume (id) source surface (id) target surface (id) source curve (id) target curve (id) source vertex (id) target vertex (id)
    curve (id_range) scheme copy source curve (id_range) source vertex (id) target vertex (id)
    curve (id_range) scheme morph source curve (id_range) source vertex (id) target vertex (id)
    Summary of meshing scheme commands.
    Notes on tables:
    Through inspection of the previous table you can see that the curve morphing commands are a little bit different in that they require that the user specify the source curves. The curve morphing scheme also can take a range of curves as both the source and the target. This is because the curve morphing code can handle many-to-one, many-to-many, and one-to-many situations.

  11. Discussion of Commands
    • command parity
    • If the user enters a source entity (such as source curve, etc) the user must also enter a target entity. ie. the user cannot specify a source vertex without specifying a target vertex.

    • entity relation
    • If the user enters orientation data, that data must be related. For example, the user enters source and target vertices, nodes, edges, and curves (he obviously wants to make sure of a perfect match). The nodes must lie on the vertices, edges, and curves, the vertices must lie on the curves, and the edges must lie on the curves. This allows the morphing code to figure out the information it needs--otherwise it will get too confused.

    • number of entities
    • The user may only enter one pair of each type of entity. In other words, the user may not enter two sets of source and target vertices for the same surface.

    • id_ranges
    • When using the curve morphing command, the id_ranges for the curves must form a contiguous segment. Note also that id_ranges may be used for the other commands, but this does NOT mean that the user will get many-to-one copying. Id-ranges are only to be used to cut down on the number of commands that have to be entered. An example of this is the following series of commands:

      CUBIT> surface 1 scheme morph source surface 6 source vertex 4 target vertex 6
      CUBIT> surface 2 scheme morph source surface 6 source vertex 3 target vertex 5
      CUBIT> surface 3 scheme morph source surface 6 source vertex 3 target vertex 2

      This series of commands may be entered thusly:

      CUBIT> surface 1 2 3 scheme morph source surface 6 source vertex 4 3 3 target vertex 6 5 2

      ie. the ids will be matched respectively.
       

  12. Other User Commands
    • set morph smooth on
    • Setting the morph smooth flag to on enables an algorithm which will try very hard to make an exact copy of the surface mesh on the target surface. The copying algorithm does an approximate copy, and that usually is good enough. But, for those who desire an exact match, the morph smoother will try to provide it.
       

  13. Developer Commands
    • Debug 53 on
    • This command turns on the debugging flag for surface morphing. This allows the developer to watch the creation of the target mesh, and see in-depth information about the algorithm

    • Debug 65 on
    • This command turns on the debugging flag for volume morphing. This allows the developer to watch the creation of the target mesh, and see in-depth information about the algorithm
       

    • Debug 81 on
    • This command turns on the debugging flag for curve morphing. This allows the developer to watch the creation of the target mesh, and see in-depth information about the algorithm
       

  14. Miscellaneous Limitations
    • While the curve and surface morphing code can handle topologically non-similar copying, the volume morpher cannot. This means that the source volume and the target volume must have the same number of surfaces and they must be connected the same way.
    • Copying of triangular surface meshes is allowed, but copying of tetrahedral volume meshes is not supported yet. Cubit will not crash if this is tried, but will not successfully copy the tetrahedra.


[Mail to:djmelan@sandia.gov] Darryl Melander

Last modified: September 23, 1998


Back to top of page

Questions and Comments || Acknowledgment and Disclaimer