SFOSUB

ModelingUsed to compute the force value for a force entity.

Use

User defined request calling a SFOSUB for the calculation of the force magnitude:
<Force_Scalar_TwoBody
     id                  = "30101"
     type                = "Force"
     i_marker_id         = "30103031"
     body1_id            = "30103"
     j_marker_id         = "30104041"
     body2_id            = "30104"
     usrsub_param_string = "USER(50,1000)"
     usrsub_dll_name     = "NULL">
  </Force_Scalar_TwoBody>

Format

Fortran Calling Syntax
SUBROUTINE SFOSUB (ID, TIME, PAR, NPAR, DFLAG,IFLAG, VALUE)
C/C++ Calling Syntax
void STDCALL SFOSUB (int *id, double *time, double *par, int *npar, int *dflag, int *iflag, double *result)
Python Calling Syntax
def SFOSUB(id, time, par, npar, dflag, iflag):
    return value
MATLAB Calling Syntax
function result = SFOSUB(id, time, par, npar, dflag, iflag)

Attributes

ID
[integer]
The user-defined force element identifier.
TIME
[double precision]
The current simulation time.
PAR
[double precision]
An array that contains the constant arguments from the list provided in the user-defined statement.
NPAR
[integer]
The number of entries in the PAR array.
DFLAG
[logical]
The differencing flag.
IFLAG
[logical]
The initialization flag.

Output

VALUE
[double precision]
The output value that contains the force value that the SFOSUB has computed.

Example

def SFOSUB(id, time, par, npar, dflag, iflag):
    [dm, errflg] = py_sysfnc("DM", [par[0],par[1]])
    [vm, errflg] = py_sysfnc("VM", [par[2],par[3]])
    [vector, errflg] = py_impact(dm, vm, par[4], par[5], par[6], par[7], par[8],0)

    return vector[0]