CUSFNC

Utility/Data Access SubroutineThe CUSFNC utility subroutine obtains a scalar output from a custom defined function in MotionSolve. The custom function must already be defined using the MotionSolve custom mapping file.

Format

Fortran Calling Syntax
CALL CUSFNC (FNCNAM, RPAR, NSIZE, STATE, ERRFLG)
C/C++ Calling Syntax
c_cusfnc(fncnam, rpar, nsize, state, errflg)
Python Calling Syntax
[state, errflg] = py_cusfnc(fncnam, rpar)
MATLAB Calling Syntax
[state, errflg] = m_cusfnc(fncnam, rpar)

Attributes

FNCNAM
[string]
A string that specifies the name of the predefined custom function for the CUSFNC call. Valid function names depend on what has been defined using the custom mapping file.
RPAR
[double]
A real vector containing input parameters for the FNCNAM. The size of this array must be NSIZE.
NSIZE
[integer]
A scalar integer variable that contains the number of parameters for the CUSFNC call.
STATE
[double]
The real value extracted by the function call.
ERRFLG
[bool]
A logical flag that represents the success of the CUSFNC function call.
  • False/0 - Success.
  • True/nonzero - Error in the function call.

Comments

This function can be called by any user subroutine. To create a custom function, please see Writing Custom Functions for MotionSolve.