Entity Names

By default, geometric entities in Trelis are referenced using an entity type (e.g. Surface, Volume) and an id, for example "draw surface 1".  However, geometric entities can also be assigned names, to simplify working with specific entities.  Once a name is assigned to an entity, that name can be used in any Trelis command in place of the entity type and number.  For example, if surface 1 were named 'mysurf1', the command above would be equivalent to "draw mysurf1".  Also, since entity names are saved with the geometry, this also provides a means for persistent identifiers for geometric entities.   Names can be added or removed using the following commands.

{Group|Body|Volume|Surface|Curve|Vertex} {Name | Rename} {`<entity_name>'| Default}

{Group|Body|Volume|Surface|Curve|Vertex} Remove Name {`<entity_name>'| All | Default}

The name of each topological entity appears in the output of the List command. In addition, topological entities can be labeled with their names (see label command). A list of all names currently assigned and their corresponding entity type and id (optionally filtered by entity type) can be obtained with the command

List Names [{Group|Body|Volume|Surface|Curve|Vertex|All}] 


Valid and Invalid Names

Although any string may be used as an entity name, only valid names may be used directly in commands. A name is valid if it begins with a letter or underscore ("_"), followed by any combination of zero or more letters, digits, or the characters ".", "_", or "@". If an attempt is made to assign an invalid name to an entity, Trelis will generate a valid version of the invalid name by replacing invalid characters with an underscore. Then both the valid and invalid versions of the name are assigned to the entity. For example, assigning the name "123#" to a volume will result in the volume having two names, "123#" and "_23_". The valid name can be used directly in commands (mesh _23_), while the invalid name can only be referenced using a longer, less direct syntax (mesh volume with name "123#").

Reconciling Duplicate Names

When an attempt is made to assign the same name to two different entities, a suffix is added to the name of the second entity to make it unique. The suffix consists of the "@" character followed by one or more letters or numbers. For example, the following commands will result in volumes 1 to 3 having the names "hinge", "hinge@A", and "hinge@B", respectively:

volume 1 name "hinge"
volume 2 name "hinge"
volume 3 name "hinge"

To prevent this automatic "fixing" of names, the Fix Duplicate Names flag may be switched to off. If the user attempts to assign a duplicate name while the flag is set to off, the name will remain unchanged.

Set Fix Duplicate Names [ON|Off]

Automatic Name Creation

Trelis provides an option for automatically assigning names to entities upon entity creation.  This option is controlled with the command: 

Set Default Names {On|OFF}

When this option is on, entities are assigned default names consisting of a geometry type concatenated with the entity id, for example 'cur1', 'surf26', or 'vol62'.

Automatic Name Propagation

Trelis automatically propagates names through webcuts. If an entity that has been assigned the name "Gear" is split through webcuts, the resulting bodies are named "Gear" and "Gear@A". Try the following example.

br x 10
volume 1 name "Cube"
webcut volume 1 xplane
webcut volume 1 2 yplane
webcut volume 1 2 3 4 zplane
label volume name


Figure 1. Name Propagation through Webcuts

You can operate on these propagated names using wildcards such as:

mesh volume with name 'Cube*'
block 1 volume with name 'Cube*'

Naming Merged Entities

When entities that have the same base name, such as "platform" and "platform@A", are merged, the resulting entities is assigned both names. The set merge base names on command tells Trelis that in this situation, it should merge the names too. The command syntax is:

Set Merge Base Names [On|OFF]

For example:

brick x 10
vol 1 copy move 10
surf 6 name 'platform'
surf 10 name 'platform'

Surface 10 actually is named platform@A, since we don't want duplicate names

merge all
list surf 6

You see that surface 6 has both 'platform' and 'platform@A' as names. Now, for the contrasting example

brick x 10
vol 1 copy move 10
surf 6 name 'platform'
surf 10 name 'platform'

set merge base names on
merge all
list surf 6

You see that surface 6 has only 'platform' as its name.