HyperWorks Solvers

SURSUB

SURSUB

Previous topic Next topic No expanding text in this topic  

SURSUB

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

Subroutine Type

Modeling

Definition

Used to specify a user-defined surface element and its derivatives for a reference surface element.  User-defined surfaces are typically used in conjunction with point-to-surface and curve-to-surface constraints.

Use

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"

 />

Calling Syntax

Fortran

SUBROUTINE SURSUB (ID, PAR, NPAR, ALPHA, BETA, IORD, IFLAG, VALUES)

 

C

void STDCALL SURSUB (int *id, double *par, int *npar, double *alpha, double *beta, int *iord, int *iflag, double *values)

 

Python

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

    return values

 

MATLAB

function values = SURSUB(id, par, npar, alpha, beta, iord, iflag)

Input Arguments

[integer] ID

The user-defined parameter surface element identifier.

 

[double precision] TIME

The current simulation time.

 

[double precision] PAR

An array that contains the constant arguments from the list provided in the user defined statement.

 

[integer] NPAR

The number of entries in the PAR array.

 

[integer] IORD

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

 

[double precision] ALPHA

The value of the first independent parameter whose limits are defined by u_start and u_end.

 

[double precision] BETA

The value of the second independent parameter whose limits are defined by v_start and v_end.

 

[logical] IFLAG

The initialization flag.

Output Values

[double precision] VALUE

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

See Also:

Modeling Subroutines