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]
The name of the XML element.
ID
[integer]
The identifier of the element.
ATTRIBUTE
[string]
The name of the attribute associated with the XML element.
INPUT
[string]
The value of the attribute, casted as character string.

Output

INFO
[integer]
The information about the call status or return value type. A negative value indicates failure in modifying the model data.
0
Attribute successfully modified.
-1
Element name unrecognized or unsupported.
-2
ID not found or invalid.
-3
Attribute name unrecognized or unsupported.
-4
Attribute is a non-modifiable constant character string.

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

  1. Input strings are case-insensitive.
  2. 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.
  3. 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.
  4. 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.