CONSUB

Driver SubroutineUsed 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"
/>

Format

Fortran Calling Syntax
SUBROUTINE CONSUB (PAR, NPAR)
C/C++ Calling Syntax
void STDCALL CONSUB (double*par,int *npar)
Python Calling Syntax
def CONSUB(par, npar)
MATLAB Calling Syntax
function CONSUB(par, npar)

Attributes

PAR
[double precision]
An array that contains the constant arguments from the list provided in the user defined UserProgramControl.
NPAR
[integer]
Number of entries in the PAR array.

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