Plug-in Library

The Plug-in library provides support for applying a compiled or interpreted script operation on a value table.

This library allows a user-defined routine to be executed for each value record being processed, and enables conditional logic and control flow when table-based approaches are inadequate. A plug-in, once defined, can be called as if it were a built-in operator, and if properly configured, can be made visible to the HyperView Expression Builder.
The execution of a plug-in is the same as any other Result Math operator, and is driven by the HyperWorks application which controls what subcase, simulation step, entity pool, and layer. Once a particular pool, layer, and data type, is selected within a simulation step by the HyperWorks application, a read request is made for the plug-in data type. The read request triggers the processing of the values by the plug-in and follows a sequence that has been broken down into events that are processed by the plug-in. These events are passed function or objects that allow the plug-in to query the data being processed and to add records to the destination value table:
Event Arguments Description
Begin table_info Called once before the data type is read for a given pool and layer. The table_info argument is an object/function that allows the table to be queried.
OnRecord record_info, record_action Called for each record being processed in the data type. The record_info argument is an object/function that allows the record to be queried. The record_action argument is an object/function that allows data to be output to the destination value table.
End table_info, record_action Called after all records have been processed for the data type pool/layer.

The query/action objects allow the plug-in to query the data passing through the data type request as well as the entities directly attached to the value. They have the same basic signature, independent of the plug-in type (C++/Templex/Tcl):

The following sections provide additional information regarding the various Plug-in Library options that are available:
Function Property/Method Description
table_info label,

domain type

Label the table label.

Domain of the table (real, complex).

record_info id,

data,

count,

part ID,

system ID,

dimension,

numeric Type,

domain type

Entity ID of the value record.

Data within the value (scalar, vector, tensor).

Number of value items (>1 for corner-bound).

Part ID the element belongs to (0 for nodal).

System ID for directional values.

Dimension for tonsorial values.

Numeric type (float, double).

Domain type (real, complex).

record_action AddRecord Supports the addition of a value to the destination value table. Records can be added in the OnRecord or End event only.
option_string

(scripted plug-ins only)

GetOption,

GetOption(key)

Returns the optional argument passed for the “opt_str” argument. Any argument passed that is not recognized as a function parameter will be added to a key/value pair list of optional arguments that will work with the GetOption(key) form of this command. The second form of the optional argument setting/getting is available only via XML, and not through the Expression Builder.