Functions for User Sensors

Restore Functions for Sensor Parameters

You can access the integer and float sensor parameter buffers using two functions, similar to those used in the Starter subroutine:
  • integer ierr = GET_U_SENS_IPAR(integer isens, sens_index, integer var)
  • integer ierr = GET_U_SENS_FPAR(integer isens, sens_index, float var)
The internal Radioss sensor numbers isens are not sensor identifiers that can be used to access the parameter buffers. The additional function that translates a sensor ID into an internal sensor number is:
  • integer isens = GET_U_NUMSENS(integer sens_id)
The function returns 0 if the sensor ID is not found in the Radioss database. The value can be stored in a local variable for multiple access to parameter buffers, or call the buffer access functions directly with the sensor ID, using the GET_U_NUMSENS function:
  • ierr = GET_U_SENS_IPAR(GET_U_NUMSENS(sens_id),sens_index,var)

Read/Write Functions of Working Array Buffers

To store and read current information, use a user array (float). Its length is limited to 100 variables and can be accessed with:
  • integer ierr =SET_U_SENS_VALUE (integer isens,integer sens_index,float var)
  • integer ierr =GET_U_SENS_VALUE(integer isens,integer sens_index,float var

The user variables are stored and retrieved from a buffer of sensor isens, using buffer index sens_index.

Use the function inverse GET_U_NUMSENS to translate a sensor number into its ID, or if a sensor identifier is needed.
  • integer isens = GET_U_SENS_ID(integer sens_id

Set and Check Global Activation Flags

The same mechanisms used to activate and deactivate standard Radioss sensors can be used with user sensors. This way, they can activate springs, interfaces, rigid walls, or other sensors using a specific user condition. Additionally, the user sensor may form part of a hierarchy of Radioss sensors (ex: logical sensors) or use standard sensors as input.

Use these functions with standard activation flags:
  • integer ierr = SET_U_SENS_ACTI(integer isens)

    This function activates user sensors isens. The activation time is set as current time. The sensor activation will actually be delayed one cycle to preserve a hierarchical sensor activation order in parallel processing.

  • float dtime = GET_U_SENS_ACTI(integer isens)

    This function returns a time delay sine the first activation of sensor number isens. If dtime > 0, the sensor is active. Use this to check the state of standard sensors or other user sensors that were activated by GET_U_SENS_ACTI.

    User sensors may activate Radioss variables only by specialized functions, which include:
    Access Functions to Radioss Time and Cyle Variables
    float Time = GET_U_TIME()
    Returns the actual simulation time.
    integer Ncyc = GET_U_CYCLE()
    Returns the actual cycle number.
    Accelerator Access Functions
    integer ierr = GET_U_ACCEL(integer iacc, float ax, float ay, float az)
    Provides access to Radioss accelerometer values.
    Note: ax, ay, az are acceleration components.
    iacc is the accelerometer number.
    integer iacc = GET_U_NUMACC(integer acc_id)
    Restores accelerometer number from its identifier.
    Nodal Value Access Functions
    These allow access to node coordinates (x, y, z); node displacement componentss (dx, dy, dz); node velocity components (vx, yx, vx); and node acceleration components (ax, ay, az). All use an internal node number (not a node identifier) as an argument.
    • integer ierr = GET_U_NOD_X(integer inode, float x, float y, float z)
    • integer ierr = GET_U_NOD_D(integer inode, float dx, float dy, float dz)
    • integer ierr = GET_U_NOD_V(integer inode, float vx, float vy, float vz)
    • integer ierr = GET_U_NOD_A(integer inode, float ax, float ay, float az
    Additionally, the function below restores an internal number inode from a node identifier node_id. Call this function once and store the result in a local variable.
    • integer inode = GET_U_NUMNOD(node_id)