Upost

Model ElementThe UPOST element allows you to generate your own results file.

Class Name

Upost

Attribute Summary

Name Property Modifiable by command? Designable?
function Function ("POSTSUB") NO NO
routine Routine ()

Usage

# Defined in a compiled user subroutine
Upost (function=userString, routine=string)

# Defined in a Python function
Upost (function=userString, routine=functionPointer)

Attributes

User-subroutine defined in a compiled DLL
function
String defining a valid user function MotionSolve expression.
The list of parameters that are passed from the data file to the user defined subroutine where the Upost is defined.
The function attribute is mandatory.
routine
String
Specifies an alternative name for the user subroutine. The name consists of two pieces of information, separated by "::". The first is the pathname to the shared library containing the function that computes the response of the user-defined Variable. The second is the name of the function in the shared library that does the computation.
An example is: routine="/staff/Altair/engine.dll::myUpost"
  • "/staff/Altair/engine.dll is the dll
  • "myUpost" is the function within this DLL that performs the calculations
The attribute routine is optional.
When not specified, routine defaults to "POST_SUB".
User-subroutine defined in a user-written Python script
function
String defining a valid user function MotionSolve expression.
The list of parameters that are passed from the data file to the user defined subroutine where the Variable is defined.
The function attribute is mandatory.
routine
Pointer to a callable function in Python.
An example is: routine=myUpost.
  • myUpost is a Python function or method that can be called from wherever the model resides.
The attribute routine is optional.
When not specified, routine defaults to POST_SUB.

Example

  1. Define a Python function rocket_fuel_consumption that saves fuel consumption data to a file.
    Upost (function="USER()", routine=rocket_fuel_consumption)
  2. Define a C++ function rocket_fuel_consumption that saves fuel consumption data to a file. It exists in a DLL named Arianne.
    Upost (function="USER()", routine="Arianne::rocket_fuel_consumption")

Comments

  1. See Properties for an explanation about what properties are, why they are used, and how you can extend these.
  2. POSTSUB is called every output step. You can perform the required output operations at this point.