Chapter 6: User Defined Math Functions

Users can write external variable calculator functions called User Defined Math Functions (UDMF) that can be dynamically loaded by EnSight. These functions appear in EnSight's calculator in the general function list and can be used just as any other calculator function to derive new variables.

Several examples of UDMFs can be found in the directory $CEI/ensight242/src/math_functions/. See these examples if you wish to create your own UDMFs.

When the EnSight server starts it will look in the following subdirectories for UDMF dynamic shared libraries:

./libudmf-devel.so (.sl) (.dll)
$ENSIGHT10_UDMF/libudmf-*.so (.sl) (.dll)
<install location>/ensight242/machines/$ENSIGHT10_ARCH/lib_udmf/libudmf-*.so (.sl) (.dll)

Depending on the server platform, the dynamic shared library must have the correct suffix for that platform (for example, .so, .sl, .dll).

How the Routines Are Invoked

Currently, when a UDMF is used in the EnSight calculator, it is invoked for each node in the specified part(s) if all the variables operated on for the specified part(s) are node centered. If all of the variables are element centered, then the UDMF is invoked for each element in the part(s). If the variables are a mix of node and element centered values, then the node centered values are automatically converted to element centered values and then the UDMF is invoked for each element using element centered variables.

Arguments and the return type for the UDMF can be either scalar or vector EnSight variables or constants.

Current Limitation

At this time, only variable quantities and constants can be passed into UDMFs. There is no mechanism for passing in either part geometry, neighboring variables, or other information.