Command Line Entity Specification

CUBIT identifies objects in the geometry, mesh, and elsewhere using ID numbers and sometimes names. IDs and names are used in most commands to specify which objects on which the command is to operate.

These objects can be specified in CUBIT commands in a variety of ways, which are best introduced with the following examples (the portion of each command which specifies a list of entities is shown in blue):

General ranges: Surface 1 2 4 to 6 by 2 3 4 5 Scheme Pave

Combined geometry, mesh, and genesis entities: Draw Sideset 1 Curve 3 Hex 2 4 6

Geometric topology traversal: Vertex in Volume 2 Size 0.3

Mesh topology traversal: Draw Edge in Hex 32

All keyword: ListBlock all

Expand keyword: my_curve_group expand Scheme Bias Factor 1.5

Except keyword: List Curve 1 to 50 except 2 4 6

In addition to the examples above, there is an extended parsing capability that allows entities to be specified by a general set of criteria. See Extended Entity Specification for details. The following is a simple example of an extended entity specification:

By Criteria: Draw Curve With Length > 3

Types of Entity Range Input

The types of entity range input available in CUBIT can be classified in 4 groups:

  1. General range parsing

    Entity IDs can be entered individually (volume 1), in lists (volume 1 2 3), in ranges (volume 3 to 7), and in stepped ranges (volume 3 to 7 step 2). The word all may also be used to specify all entities of a given type.

    An ID range has the form <start_id> to <end_id>. It represents each ID between start_id and end_id, inclusive.

    A stepped ID range has the form <start_id> To <end_id> {Step|By} <step>. It represents the set of IDs between start_id and end_id, inclusive, which can be obtained by adding some integer multiple of step to start_id. For example, 3 to 8 step 2 is equivalent to 3 5 7.

    The various methods of specifying IDs can be used together. For example:

    draw surface 1 2 4 to 6 vertex all

  2. Topological traversal

    Topological traversal is indicated using the "in" and "common_to" identifiers, can span multiple levels in a hierarchy, and can go either up or down the topology tree. For example, the following entity lists are all valid:

    vertex in volume 3

    volume in vertex 2 4 6

    surface common_to volume 2 3

    curve common_to surface 2 3

    curve 1 to 3 in body 4 to 8 by 2

    If ranges of entities are given on both sides of the "in" identifier, the intersection of the two sets results. For example, in the last command above, the curves that have ids of 1, 2 or 3 and are also in bodies 4, 6 and 8 are used in the command.

    Topology traversal is also valid between entity types. Therefore, the following commands would also be valid:

    draw node in surface 3

    draw surface in edge 362

    draw hex in face in surface 2

    draw node in hex in face in surface 2

    draw edge in node in surface 2

    draw face common_to volume 1 2

  3. Exclusion

    Entity lists can be entered then filtered using the "except" identifier. This identifier and the ids following it apply only to the immediately preceding entity list, and are taken to be the same entity type. For example, the following entity lists are valid:

    curve all except 2 4 6

    curve 1 2 5 to 50 except 2 3 4

    curve all except 2 3 4 in surface 2 to 10

    curve in surface 3 except 2 (produces empty entity list!)

    Entity names can also be used to specify the exclusion list. For example:

    curve all except pivot_1

    When using mulitple names to specify the exclusion list it is necessary to use the "in" keyword with parentheses. For example:

    curve all except curve in (pivot_1 top_left)

    In the above example, all curves are in the entity list except the curve named "pivot_1" and the curve named "top_left".

  4. Group expansion

    Groups in CUBIT can consist of any number of geometry entities, and the entities can be of different type (vertex, curve, etc.). Operations on groups can be classified as operations on the group itself or operations on all entities in the group. If a group identifier in a command is followed immediately by the `expand' qualifier, the contents of the group(s) are substituted in place of the group identifier(s); otherwise the command is interpreted as an operation on the group as a whole. If a group preceding the `expand' qualifier includes other groups, all groups are expanded in a recursive fashion.

    For example, consider group 1, which consists of surfaces 1, 2 and curve 1. Surfaces 1 and 2 are bounded by curves 2, 3, 4 and 5. The commands in Table 1, illustrate the behavior of the `expand' qualifier.

Table 1. Parsing of group commands; Group 1 consists of Surfaces 1-2 and Curve 1; Surfaces 1 and 2 are bounded by Curves 2-5.

Command Entity list produced
Curve in Group 1 Curve 1
Curve in group 1 expand Curves 1, 2, 3, 4, 5

The `expand' qualifier can be used anywhere a group command is used in an entity list; of course, commands which apply only to groups will be meaningless if the group id is followed by the `expand' qualifier.

Precedence of "Except" and "In"

Several keywords take precedence over others, much the same as some operators have greater precedence in coding languages. In the current implementation, the keyword "Except" takes precedence over other keywords, and serves to separate the identifier list into two sections. Any identifiers following the "Except" keyword apply to the list of entities excluded from the entities preceding the "Except". Table 2 shows the entity lists resulting from selected commands.

Table 2. Precedence of "Except" and "In" keywords; Group 1 consists of Surfaces 1-2 and Curve 1.

Command Entity list produced
Curve all except 1 in Group 1 (All curves except curve 1)
Curve all except 2 3 4 in Surf 2 to 10 (All curves except 2, 3, 4)

In the first command, the entities to be excluded are the contents of the list "[Curve] 1 in Group 1", that is the intersection of the lists "Curve 1" and "Curve in Group 1"; since the only curve in Group 1 is Curve 1, the excluded list consists of only Curve 1. The remaining list, after removing the excluded list, is all curves except Curve 1.

In the second command, the excluded list consists of the intersection of the lists "Curve 2 3 4" and "Curve in Surf 2 to 10"; this intersection turns out to be just Curves 2, 3 and 4. The remaining list is all curves except those in the excluded list.

Placement in CUBIT Commands

In general, anywhere a range of entities is allowed, the new parsing capability can be used. However, there can be exceptions to this general rule, because of ambiguities this syntax would produce. Currently, the only exception to this rule is the command used to define a sideset for a surface with respect to an owning volume.