MODSET
Utility/Data Access SubroutineThe MODSET subroutine accesses and modifies the model data as specified in the MotionSolve XML input file.
Use
It may be called from all user-written subroutines.
Format
- Fortran Calling Syntax
- MODSET (element, id, attribute, input, info)
- C/C++ Calling Syntax
- c_modset (element, id, attribute, input, info)
- Python Calling Syntax
- info = py_modset (element, id, attribute, input)
- MATLAB Calling Syntax
- info = m_modset (element, id, attribute, input)
Attributes
- ELEMENT
- [string]
- ID
- [integer]
- ATTRIBUTE
- [string]
- INPUT
- [string]
Output
- INFO
- [integer]
Examples
To modify the attribute expr of the joint motion with id=303002 in the XML file to 2D+10D*sin(72D*TIME-11.537D):
<Motion_Joint
id = "303002"
type = "EXPRESSION"
val_type = "D"
expr = "0."
joint_id = "303003"
joint_type = "R"
ic_disp = "0."
ic_vel = "0."
/>
From a Fortran user subroutine, call:
CALL MODSET('Motion_Joint ', 303002,'expr', '2D+10D*sin(72D*TIME-11.537D)',INFO)
To modify the same attribute again to 20D+sin(72D*TIME-11.537D), call:
CALL MODSET('Motion_Joint ', 303002,'expr', '20D+sin(72D*TIME-11.537D)',INFO)
Or, you may optionally use:
CALL SET_ATTRIBUTE('20D+sin(72D*TIME-11.537D)',INFO)
from a Fortran user subroutine.
Comments
- Input strings are case-insensitive.
- MODFNC and MODSET are both general model data access utility subroutines. The former reads ("gets") the value of the element attribute, the latter "sets" or modifies the value of the element attribute.
- If the input is an array, it should be concatenated as a string, in the same form as appeared in the output string from MODFNC.
- After MODFNC or MODSET calls, if you want to keep modifying the same attribute, you may call MODSET to access the same attribute again or optionally use SET_ATTRIBUTE (input, info) until another MODFNC or MODSET is issued. SET_ATTRIBUTE modifies the attribute accessed by the last MODFNC or MODSET call.