Functions to Access User Properties and Materials

Store and Restore Functions for User Subroutines

The user property parameters are stored in Radioss arrays through specialized functions. This method allows a hierarchical property reference, where one user’s property can refer to another user’s property or material. This may also be used in a user’s window interface.
Table 1. Glossary of Function Arguments
Argument Description
mid Material identifier (Starter input number)
pid Property identifier
fun_id Function identifier
sens_id Sensor identifier
imat Material number (internal Radioss material index)
iprop Property number
ifunc Function number
isens Sensor number
mat_index Material index in user property buffer
prop_index Property index in user property buffer
func_index Function index in user material or property buffer
KFUNC=29 Parameter, indicates access to function buffer in user property
KMAT=31 Parameter, indicates access to material buffer in user property
KFUNC=33 Parameter, indicates access to property buffer in user property
KTABLE Parameter, indicates access to property buffer in user property

Storage Functions

integer  ierror = SET_U_PNU (integer func_index, integer fun_id, KFUNC)
integer  ierror = SET_U_PNU (integer func_index, integer fun_id, KTABLE)
integer  ierror = SET_U_PNU (integer mat_index, integer mid, KMAT)
integer  ierror = SET_U_PNU (integer prop_index, integer pid, KPROP)

The user property may relate to other properties, materials, or functions. The above routine stores relative property, material, and function identifiers in current user property. These identifiers are indexed independently for each category and are specified by func_index, mat_index, or prop_index, respectively. The access to different property buffers is distinguished by parameter values KFUNC, KMAT, KPROP, and KTABLE.

The function returns integer flag ierror = 0, if there is no error. If the index is larger than the maximum, it returns:
ierror = maximum allowed index value
        
This is called in Radioss Starter.
Table 2. Examples
ierror = SET_U_PNU(2, 5, KFUNC) Stores a Radioss function described by ID=5 as a second function in current property.
ierror = SET_U_PNU(2, 5, KTABLE) Stores a Radioss table described by ID=5 as a second table in current property.
ierror = SET_U_PNU(1, 3, KMAT) Stores a Radioss material property MID=3 as a first material in current property.
ierror = SET_U_PNU(2, 2,KPROP) Stores property PID = 2 as second property referenced by current property.
integer ierror = SET_U_GEO(integer value_index, float value) Stores a value in current user property buffer at a position referenced by value_index.
If the index is larger than the maximum, it returns:
ierror = maximum   allowed
                index value 
This is called in Radioss Starter.

Restore Funtions for User Properties, Materials, and Functions

float value = GET_U_GEO(integer value_index, integer iprop) Returns a parameter value stored in property buffer iprop at the position specified by value_index. It is called in Radioss Engine and Starter initialization routines.
integer iprop = GET_U_P(integer prop_id) Translates property ID into property number. Use this function only in Radioss Starter and store the result in user array.
integer jprop = GET_U_PNU(integer prop_index, integer iprop, KPROP) Retrieves an internal number of a property jprop referred by another user property iprop at the position specified by prop_index. This is a reverse function to SET_U_PNU function.
integer pid = GET_U_PID(integer iprop) Obtains PID from property number iprop. This is a reverse function to GET_U_P.

float value = GET_U_MAT(integer value_index, integer imat)

Returns a material parameter value stored in material imat at the position specified by integer value_index.

Imat is material number that may be retrieved by following translation function:

integer imat = GET_U_M(integer mid)

If the material is referenced by a user propertyiprop, its number may be also restored using:

integer imat = GET_U_PNU(integer mat_index,integer iprop, KMAT)

KMAT is a parameter indicating material buffer of this property. Mat_index is the position at which the material is stored in this buffer.

integer mid = GET_U_MID(integer imat) Obtains mid from known material number imat. This is a reverse function to GET_U_M.
integer y = GET_U_FUNC(integer ifunc, float x, float dydx) Returns interpolated value of function ifunc, corresponding to abscissa x.

Dxdy is function slope at x.

Integer ifunc is the internal Radioss function number.

integer ifunc = GET_U_NUMFUN(integer fun_id) Restores the function number from function identifier.
integer fun_id = GET_U_FID(integer ifunc) Restores the function ID from function number.
If a function is referenced by a user property iprop or by user material imat, its internal number may be also obtained using following functions.
integer ifunc =
                GET_U_MNU(integer mat_index, integer imat, 
                KFUNC)
   integer ifunc = GET_U_PNU(integer prop_index, integer iprop,
                KFUNC) 
   integer itable = GET_U_PNU(integer prop_index, integer iprop, KTABLE)
                

Mat_index and prop_index are the function indexes stored in imat material or iprop property, respectively.

KFUNC is a parameter indicating a function storage buffer in user property or material.

KTABLE is a parameter indicating a table storage buffer in user property or material.

Storage and Retrieval Procedures for Functions and Tables Example

Direct Access via Function or Table ID
Engine:
ifunc = GET_U_NUMFUN(fun_id)
y = GET_U_FUNC(ifunc, x, dydx)
itable = GET_U_NUMTABLE(table_id)
CALL GET_U_TABLE(itable, x, y)

Function and table IDs must be stored in Starter in a user buffer to be available in Engine subroutine. This is the simplest way to access Radioss functions and tables but may be costly, if the model contains a large number of functions or tables. This is recommended only for small Radioss models.

Direct Access via Function Number
Starter:
ifunc = GET_U_NUMFUN(fun_id)
itable = GET_U_NUMTABLE(table_id)
Engine:
y = GET_U_FUNC(ifunc, x, dydx)
CALL GET_U_TABLE(itable, x, y)

The function number is retrieved once in Starter and stored in user buffer. The Engine subroutine can access the function directly by its number.

Function Access via User Property or User Material Index
Starter:
ifunc = GET_U_PNU(prop_index, iprop, KFUNC), or
ifunc = GET_U_MNU(mat_index, imat, KFUNC)
itable = GET_U_PNU(prop_index, iprop, KTABLE

Engine:
y = GET_U_FUNC(ifunc, x, dydx)
CALL GET_U_TABLE(itable, x, y)

Prop_index or mat_index are independent for each user property (iprop or imat) and numerated from one to a maximum number of functions in related property. Engine routines access the function values directly by its stored number. This is the recommended manner for use with large Radioss models if an old Radioss version is used.

The function number is restored in Starter using internal function indexes in user property or material.
Note: Inside user material laws itable can be stored in UPARAM array.
Note: The same principles apply to user property or material with the exception that storing property or material numbers is possible only in Starter initialization routines, not in lecture routines. For more details, see user property examples.
Table 3. User Access Functions Call Range
Access Function User Routine
  userwis userwi lecgxx rinixx ruserxx lecsen_usrx user_sensx
set_u_geo     x        
set_u_pnu     x        
set_u_sens_value   x     x   X
set_u_sens_ipar           x  
set_u_sens_fpar           x  
set_u_sens_acti   x     x   X
get_u_geo x x   x x x X
get_u_mat x x x x x x X
get_u_pnu x x   x x x X
get_u_mnu x x x x x x X
get_u_pid x x   x x x X
get_u_mid x x x x x x X
get_u_m x x x x x x X
get_u_p x x   x x x X
get_u_func x x x x x x X
get_u_table* x x x x x x X
get_u_numfun x x x x x x X
get_u_numtable* x x x x x x X
get_u_skew x x x x x x X
get_u_skew_num x x x x x x X
get_u_sens_ipar   x     x   X
get_u_sens_ipar   x     x   X
get_u_numsens   x     x   X
get_u_idsens   x     x   X
get_u_sens_value   x     x   X
get_u_sens_acti   x     x   X
get_u_numacc   x     x   X
get_u_accel   x     x   X
get_u_numnod   x     x   X
get_u_nod_x   x     x   X
get_u_nod_d   x     x   x
get_u_nod_v   x     x   x
get_u_nod_a              
get_u_time              
get_u_cycle              
               
Note: An asterisk (*) denotes usage of get_u_numtable and get_u_table. For this, the Fortran module INTERFACE_UTABLE_MOD is needed, which is included either in your library or in your user module package (for Windows).