MODFNC
Utility/Data Access SubroutineRetrieves the model data as specified in the XML solver input file.
Use
The function can be called by any user-defined subroutine.
Format
- Fortran Calling Syntax
- MODFNC(ELEMENT, ID, ATTRIBUTE, OUTPUT, INFO)
- C/C++ Calling Syntax
- c_modfnc (element, id, attribute, output, info)
- Python Calling Syntax
- [output, info] = py_modfnc(element, id, attribute)
- MATLAB Calling Syntax
- [output, info] = m_modfnc(element, id, attribute)
Attributes
- ELEMENT
- [string]
- ID
- [integer]
- Attribute
- The name of the attribute associated with the XML element.
Output
- OUTPUT
- [string]
- INFO
- [integer]
- ATTRIBUTE
- [string]
Example
To access the body_id of the marker with id=30101010 in the XML file as follows:
<Reference_Marker
id = "30101010"
body_id = "30101"
body_type = "RigidBody"
/>
from a Fortran user subroutine you may call
CALL MODFNC('Reference_Marker',30101010,'body_id', STRG,INFO)
CALL STR2INTARY(STRG, ARRAY, NSIZE, ISTAT)
In this example, the STRG returns a value of '30101' and the INFO returns a value of 2, indicating a single integer. The subsequent call to STR2INTARY using STRG as input yields an output ARRAY(1)=30101, NSIZE=1, and ISTAT=0 (normal return).
Comments
- Input is case-insensitive.
- You are responsible for providing sufficient storage in the output string.
- The following model and command elements can be queried using the
MODFNC data access sub routine:
Element class Element Name Reference Reference_Marker, Reference_Spline, Reference_Variable, Reference_Matrix, Reference_FlexData, Reference_Array, Reference_ParamCurve, Reference_DeformCurve, Reference_ParamSurface, Reference_DeformSurface, Reference_String, Reference_2DCluster Post Post_Graphic, Post_Request Constraint Constraint_Joint, Constraint_JPrim, Constraint_Mate, Constraint_Coupler, Constraint_PTCV, Constraint_PTdCV, Constraint_PTdSF, Constraint_CVCV, Constraint_PTSF, Constraint_CVSF, Constraint_SFSF, Constraint_Gear, Constraint_UserConstr, Constraint_General Force Force_Gravity, Force_SpringDamper, Force_Bushing, Force_Beam, Force_Field, Force_MultiPoint, Force_FlexModal, Force_Scalar_TwoBody, Force_Contact, Force_PTdSF, Force_StateEqn, Force_Penalty, Force_JointFriction, Force_Vector_OneBody, Force_Vector_TwoBody Body Body_Rigid, Body_Flexible, Body_Point Motion Motion_Marker, Motion_Joint Control Control_Diff, Control_SISO, Control_StateEqn, Control_PlantInput, Control_PlantOutput Param Param_Transient, Param_Static, Param_Linear, Param_Simulation, Param_Unit Sensor Sensor_Event, Sensor_Evaluate, Sensor_Proximity JointInitialVel JointInitialVel_Rev, JointInitialVel_Trans, JointInitialVel_Cyl Simulate (Command) Simulate - The output string may be processed by calling STR2INTARY or STR2DBLARY, to convert the output from strings to integer(s), for info = 2, 3, or to convert the output from strings to double(s), for info = 4, 5.