0 update all – MTS Fracture Analyzer User Manual

Page 89

Advertising
background image

Note:

The example above is not entered as TestVariableX=10. You must enter SetValue in the Function
Editor.

Arrays

To read a test variable array in a function, enter the code as in the following example:

functionVariableX=TestVariableX.Value.ValueArray

The above syntax is the function variable code to get the value of the array variable.

Non-array variables

To read a test variable that is not an array, enter the code as in the following example:

functionVariableX=TestVariableX

Order of sub-functions

If you have more than one function within the main function, the main function should appear first in the code,
for example:

def SquareAndSum(a,b):

return Sum(Mat,Power(a,2) +Math.Power(b,2)

def Sum(a,b):

return a+b

Here the main function SquareAndSum uses a helper subfunction Sum. Only the first function shows in the
global function list.

Recommended:

Limit the use of sub-functions and enter one function so that it appears in the global list correctly.
Using multiple sub functions can become problematic and cause errors when the test is run.

Parentheses

Parentheses ( ) indicate you must add a parameter to the function.

To specify a variable, click Edit List and select one or more variables.

Square brackets

Square brackets [ ] indicate you can add an optional parameter to the function. The brackets must be removed
in any case, or an error occurs.

7.7.3.0 Update All

The Update All button synchronizes the common functions in the test or analysis definition with all geometries
of the same domain as the test domain. A common function is a function that has one name but has different

MTS TestSuite™ Fracture Analyzer User Guide 89

7.0 Variable Analysis

Advertising