PrintExpressionVariables()

Given a path to an object and a parameter name, prints a list of the variables that can be used in an expression on the provided object path. For convenience, as a special case, the parameter name may be omitted if the path is to a DataTransfer object.

The list is formatted as a table with the variable's VariableName, TensorType, and unit string (in the defined unit system) as elements.

For DataTransfer objects, the list of variables is ordered with the most likely variables first (that is, variables sharing the same quantity type and/or dimensionality as the target of the expression).

If an expression cannot be used on the specified data model object or if there are no valid variables that can be used in the expression, then no output is printed.


Note:  For the purposes of the command, "valid" means that the variable may be used in the expression. However, "valid" does not necessarily mean that the variable can be used in the expression. Other validation rules may preclude the use of the variable. For more information, see Expressions Validation in the System Coupling User's Guide.


Essential Keyword Arguments

ObjectPath : string

Path of the object for which a list of expression variables is printed.

Optional Keyword Arguments

ParameterName : string

Name of the parameter for which expression variables is printed.

Note that this argument is optional only if the ObjectPath is to a DataTransfer object.

Return Type

None

Example 49: Use with ObjectPath to get source-side variables for a data transfer


PrintExpressionVariables(ObjectPath = '/SystemCoupling/CouplingInterface:Interface-1/DataTransfer:Transfer-1')
 
+-----------------------------------------------------------------------------+
|                             Available Variables                             |
+-----------------------------------------------------------------------------+
| Variable                            |   Tensor Type        Dimension        |
+-----------------------------------------------------------------------------+
| Target                              |                                       |
|   Loss                              |     (Scalar)       [kg m^2 s^-3]      |
| Source                              |                                       |
|   heatflow                          |     (Scalar)       [kg m^2 s^-3]      |
|   Position                          |     (Vector)            [m]           |
|   Normal                            |     (Vector)            [ ]           |
|   Area                              |     (Scalar)           [m^2]          |
|   Step                              |     (Scalar)            [ ]           |
|   Iteration                         |     (Scalar)            [ ]           |
|   Time                              |     (Scalar)            [s]           |
+-----------------------------------------------------------------------------+


Example 50: Use with DatamodelRoot() to get source-side variables for a data transfer


DatamodelRoot().CouplingInterface['Interface-1'].DataTransfer['Transfer-1'].PrintExpressionVariables() 
 
+-----------------------------------------------------------------------------+
|                             Available Variables                             |
+-----------------------------------------------------------------------------+
| Variable                            |   Tensor Type        Dimension        |
+-----------------------------------------------------------------------------+
| Target                              |                                       |
|   Loss                              |     (Scalar)       [kg m^2 s^-3]      |
| Source                              |                                       |
|   heatflow                          |     (Scalar)       [kg m^2 s^-3]      |
|   Position                          |     (Vector)            [m]           |
|   Normal                            |     (Vector)            [ ]           |
|   Area                              |     (Scalar)           [m^2]          |
|   Step                              |     (Scalar)            [ ]           |
|   Iteration                         |     (Scalar)            [ ]           |
|   Time                              |     (Scalar)            [s]           |
+-----------------------------------------------------------------------------+