Accessing Report Values and Co-located Field Function Values
In an expression, you can use the getReportValue function to extract scalar values for a subset of parts that are included in a scalar report, in addition to the overall report results. Additionally, you can use the getCollocatedValue function to extract the value of a field function at the location of the value computed by a maximum or minimum report.
getReportValue
The operator syntax is:
getReportValue(${Scalar Report}, {"part name" | @Filter("filter name")}, {LITERAL | PATTERN})
where:
-
Scalar Report is the name of a scalar report field function.
- part name can either be the
literal name of a part that is referenced by the scalar report or it can be a
string pattern. The third argument determines which option applies. String
patterns follow the rules of a regular expression where characters such as
*
,+
, and?
have a special meaning. part name must specify a subset of the list of parts that are included in Scalar Report itself. -
Instead of a part name string, you can specify the part selection using a filter that you already defined within the node. For example,
wheregetReportValue(${Minimum1Report}, @Filter("InletParts"))
InletParts
is the name of the filter that contains the multiple parts. - The third argument LITERAL or PATTERN denotes the type of input of the second argument (and is optional). If it is omitted, getReportValue(${Scalar Report}, "name") is equivalent to getReportValue(${Scalar Report}, "name", PATTERN).
Note | This feature is available for scalar values only. |
- Arithmetic, Logical, and Trigonometric Operators
-
-
Arithmetic binary operators (+, -, *, /...) are supported and the defined behavior is as follows:
getReportValue($report1, "nameA", LITERAL) + getReportValue($report2, "name")
or
getReportValue($report2, "name") + getReportValue($report1, "nameA", LITERAL)
results in the value of the nameA part value of the report report1 being added to the part value(s) of report2 that correspond to the string pattern name, and the overall value of
getReportValue($report1, "nameA") + getReportValue($report2, "nameB")
results in part values of the common parts being added and also the overall values being added. The part list of the result consists of the union of parts nameA and nameB. A per-part error nonexistent report part is output for each part that is not present in both, which results in an overall error status of incomplete computation.
- Logical operators are supported and the behavior is similar to binary operations with regard to per-part values, overall values, and errors for missing parts.
- Trigonometric functions and other miscellaneous functions like sqrt, log, floor, and ceil are supported.
-
- Conditional and Alternate Value Operators
-
-
Conditional expression is supported. In the example
getReportValue($report1, "nameA") > getReportValue($report2, "nameB") ? getReportValue($report3, "nameC") : getReportValue($report4, "nameD", LITERAL)
the overall value of
getReportValue($report1, "nameA") > getReportValue($report2, "nameB")
dictates whether the output of the expression is
getReportValue($report3, "nameC") or getReportValue($report4, "nameD", LITERAL).
-
The alternate value function is supported. In the example
alternateValue(getReportValue($report1, "nameA"), 1.0)
if getReportValue($report1, "nameA") cannot be evaluated for some reason, the alternate value 1.0 is used. Note that an error during the evaluation of getReportValue($report1, "nameA") does not result in the alternate value 1.0.
-
- Example of Using the getReportValue Operator
-
Consider a report MaximumA with the following list of parts: part, part 1, part surface 1, part 2, plane section 1, region 1, boundary 1, boundary 2, and boundary 3:
getReportValue($MaximumA, "part.*", PATTERN)
results in part values of:
- part
- part 1
- part surface 1
- part 2
and an overall value that is maximum of the above four part values (not the MaximumA report value).
getReportValue($MaximumA, "part", LITERAL)
results in no part values but an overall value of report value of part.
getReportValue($MaximumA, "part", PATTERN)
results in both a part value and an overall value which are one and the same. You get a different output from the LITERAL option.
getReportValue($MaximumA, "part.*", LITERAL)
produces an error with nonexistent report part since there is no part part.*.
getReportValue($MaximumA, ".* 1", PATTERN)
results in part values of:
- part 1
- part surface 1
- plane section 1
- region 1
- boundary 1
and an overall value of maximum of the above five part values.
Common examples of string patterns used in regular expressions are:- .* - all parts
- .*surface - all parts that end in "surface"
So you can use the following syntax:
getReportValue($reportFF, ".*")
This technique generates output of per-part value of all the parts along with the overall report value, similar to the Run Report action.
When you include the getReportValue operator in an expression report, you obtain a subset of part report values of a scalar report. The expression report output has been modified to resemble the output of a scalar report, if the expression report has part values. So
getReportValue(${Scalar Report}, "name", LITERAL)
results in no part values but just an overall value equal to the part report value. However,
getReportValue(${Scalar Report}, "name")
or
getReportValue(${Scalar Report}, "name", PATTERN)
results in part values and an overall value.
getCollocatedValue
This operator allows you to extract the value of a field function at the location of the value computed by a maximum or minimum report. For example, a maximum report evaluates the maximum value of a field function that you specify. Using the getCollocatedValue operator, you can evaluate the value of another field function at the location where the maximum value was calculated.
The operator syntax is:
getCollocatedValue(${report name}, ${field function name}, "part name", PATTERN|LITERAL)
where:
- report name is the name of the report.
- field function name is the name of the scalar field function that is evaluated at the location of the report value.
- part name is an optional argument that specifies a subset of the list of parts that are included in the report. You can specify the name of a part using its literal name or a string pattern.
- When including parts, the argument LITERAL or PATTERN denotes the method for specifying part name. When omitted, the default is PATTERN.