SURSUB

ModelingUsed to specify a user-defined surface element and its derivatives for a reference surface element.

Use

User-defined surfaces are typically used in conjunction with point-to-surface and curve-to-surface constraints. User-defined surface calling a SURSUB for the calculation of the values:

<Reference_ParamSurface
     id                  = "555"
     is_u_closed         = "TRUE"
     is_v_closed         = "TRUE"
     u_start             = "-1."
     u_end               = "1."
     v_start             = "-1."
     v_end               = "1."
     usrsub_param_string = "USER(1,400,100)"
     usrsub_dll_name     = "NULL"
/>

Format

Fortran Calling Syntax
SUBROUTINE SURSUB (ID, PAR, NPAR, ALPHA, BETA, IORD, IFLAG, VALUES)
C/C++ Calling Syntax
void STDCALL SURSUB (int *id, double *par, int *npar, double *alpha, double *beta, int *iord, int *iflag, double *values)
Python Calling Syntax
def SURSUB(id, par, npar, alpha, beta, iord, iflag):
    return values
MATLAB Calling Syntax
function values = SURSUB(id, par, npar, alpha, beta, iord, iflag)

Attributes

ID
[integer]
The user-defined parameter surface 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.
IORD
[integer]
The order of the time derivative.
0
The surface coordinates.
1
The surface first derivatives with respect to ALPHA and BETA.
2
The surface second derivatives with respect to ALPHA and BETA.
ALPHA
[double precision]
The value of the first independent parameter whose limits are defined by u_start and u_end.
BETA
[double precision]
The value of the second independent parameter whose limits are defined by v_start and v_end.
IFLAG
[logical]
The initialization flag.

Output

VALUE
[double precision]
The output values array that contains the computed surface coordinates and first and second derivatives. In particular, if IORD is zero, then the VALUE is an array of dimension 3 that contains X, Y, and Z coordinates as a function of u and v.

Example

def SURSUB(id, par, npar, alpha, beta, iord, iflag):

    isurtyp =int(par[0])

    cosa = cos(pi*(alpha))
    cosb = cos(pi*(beta))
    sina = sin(pi*(alpha))
    sinb = sin(pi*(beta))

    values = []
    r = par[1]
    if iord == 0:
        values.append(r*cosa*cosb)
        values.append(r*cosa*sinb)
        values.append(r*sina)

    return values