HyperWorks Solvers

CONSUB - Driver Subroutine

CONSUB - Driver Subroutine

Previous topic Next topic No expanding text in this topic  

CONSUB - Driver Subroutine

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

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.07.50)

        istat= py_datout()

        istat = py_analys("STATICS""static"7.58.00)

    return

See Also:

Driver Subroutines