A.4. Defining Variables

The definition of a variable is similar to the definition of a property in a custom type file and consists of the following required attributes. Some examples are provided below. Refer to the chapter on Defining Custom Types in the Administration Guide for more details on defining custom types.

A variable definition may also contain the following optional attributes:

A variable definition may also contain the following optional child elements:


Important:  Object type labels that are displayed in the EKM user interface are localized labels. You must use the non-localized names when referring to built-in types in configuration files. The non-localized labels are shown in parenthesis next to localized labels in the built-in type description in Appendix B: Built-in Types - Reference in the EKM Administration Guide.


Variable Definition Examples

The following variable definitions are shown below.

Example 1: Mesh Name Variable defines a variable named Mesh Name of type String. Because the name contains the space character, an ID meshName is also specified. The default value of the variable is mesh.msh.

Example 1:  Mesh Name Variable
<variable name="Mesh Name" id="meshName" type="String" default="mesh.msh" description=""/>

Example 2: Dimension Variable defines a variable named Dimension 1 of type Double and id dim1. A description is also provided. The default value for this variable is 6.5. Furthermore this variable has min and max constraints which specify that the value for this variable should lie between 2.0 and 10.0.

Example 2:  Dimension Variable
<variable name="Dimension 1" id="dim1" type="Double"
      description="Dimension 1 of the component" default="6.5">
      <constraint name="min" value="2" />
      <constraint name="max" value="10" />
</variable>

Example 3: Mesh Quality Variable defines a variable named Mesh Quality of type String and id quality. Because enumerations are specified, the value for this variable can only be one of the specified enumerations: Fine, Medium or Coarse.

Example 3:  Mesh Quality Variable
<variable name="Mesh Quality" id="quality" type="String" 
      description="Quality of mesh desired">
      <enumeration>Fine</enumeration>
      <enumeration>Medium</enumeration>
      <enumeration>Coarse</enumeration>
</variable>

Example 4: Disciplines Variable defines a variable named Disciplines of type String. Because the name does not contain any special characters, no id is specified for this variable. The ID will be automatically assigned using the name of the variable. Because the multi-valued attribute is set to true and enumerations are specified, the value can be 0 or more of the specified enumerations: Stress, Thermal, Flow, and Electromagnetic.

Example 4:  Disciplines Variable
<variable name="Disciplines" type="String" multivalued="true"
      description="Simulation disciplines">
      <enumeration>Stress</enumeration>
      <enumeration>Thermal</enumeration>
      <enumeration>Flow</enumeration>
      <enumeration>Electromagnetic</enumeration>
</variable>

Example 5: Project Variable defines a variable named Project of type Reference. Because the baseType constraint is specified, the referenced object should be of the same type as or a subtype of Project.

Example 5:  Project Variable
<variable name="Project" type="Reference" description="Project">
      <constraint name="baseType" value="Project" />
</variable>


Release 18.2 - © ANSYS, Inc. All rights reserved.