Subroutine Type |
Driver |
|
Definition |
Used to control a MotionSolve simulation. |
|
Use |
An example of the corresponding UserProgramControl command: |
|
<UserProgramControl usrsub_param_string = "USER(5000, 0.0, 0.0, -9810,0)" usrsub_dll_name = "NULL" /> |
||
Calling Syntax |
Fortran SUBROUTINE CONSUB (PAR, NPAR)
C/C++ void STDCALL CONSUB (double *par, int *npar)
Python def CONSUB(par, npar)
MATLAB function CONSUB(par, npar) |
|
Input Arguments |
[double precision] PAR |
An array that contains the constant arguments from the list provided in the user defined UserProgramControl. |
[integer] NPAR |
Number of entries in the PAR array. |
|
Output Values |
There are no output values from a CONSUB routine. |
|
Example |
The following Python user subroutine is functional when the first parameter is 5000 and modifies the gravity vector to be the values specified by second, third and fourth parameters, and does a transient and quasi-static simulation. def CONSUB(par, npar): if par[0]==5000: commnd = str('ACCGRAV/IGRAV=%11.5f' %par[1]) istat = py_modify(commnd) commnd = str('ACCGRAV/JGRAV=%11.5f' %par[2]) istat = py_modify(commnd) commnd = str('ACCGRAV/KGRAV=%11.5f' %par[3]) istat= py_modify(commnd) istat = py_analys("TRANSIENT", "transient", 0.0, 7.5, 0) istat= py_datout() istat = py_analys("STATICS", "static", 7.5, 8.0, 0) return |