udfGetType()

Get the type of the user-defined function.

Syntax

type = udfGetType( udfHd ) ;

Type

AcuSolve User-Defined Function Basic

Parameters

udfHd
The opaque handle (pointer) which was passed to the user function.

Return Value

type (integer)
The returned type can have several different values, depending on the user-defined function type:
Returned Type Value
Meaning of Type Value
UDF_MULT_FUNCTION
Multiplier function.
UDF_NODAL_BC
Nodal boundary condition.
UDF_NODAL_BC_DIR
Nodal BC direction vector.
UDF_PERIODIC_BC
Periodic boundary condition.
UDF_ELEMENT_COMPONENT
Element component (fan or heat exchanger).
UDF_ELEMENT_BC
Element boundary condition.
UDF_VISCOSITY
Element viscosity.
UDF_CONDUCTIVITY
Element thermal conductivity.
UDF_DIFFUSIVITY
Element species diffusivity.
UDF_GRAVITY
Element gravity (generalized volumetric body force).
UDF_MASS_HEAT_SOURCE
Element heat source per unit mass.
UDF_VOLUME_HEAT_SOURCE
Element heat source per unit volume.
UDF_MASS_SPECIES_SOURCE
Element species source per unit mass.
UDF_VOLUME_SPECIES_SOURCE
Element species source per unit volume.
UDF_EMISSIVITY
Radiation surface emissivity.
UDF_DENSITY
Element density.
UDF_SPECIFIC_HEAT
Element enthalpy.
UDF_MESH_MOTION
Mesh motion.
UDF_ELEMENT_OUTPUT
Element output.
UDF_SURFACE_TENSION
Surface tension.
UDF_CONTACT_ANGLE
Contact angle.
UDF_FLEXIBLE_BODY
Flexible body.
UDF_VISCOELASTIC
Viscoelastic model.

Description

This routine returns the type of the user-defined function. This routine may be used to determine the expected return value of the function. Among other usages, this allows a single routine to be used for multiple objectives. For example,
Integer type ;
...
type = udfGetType( udfHd ) ;
UDF_PROTOTYPE(usrFunc) ;
if ( type == UDF_VISCOSITY ) {
    /* compute viscosity */
    ...
} else if ( type == UDF_CONDUCTIVITY ) {
    /* compute thermal conductivity */
    ...
} else {
udfSetError( udfHd, "Invalid type %d", type ) ;
}

Errors

This routine expects a valid udfHd as an argument. An invalid argument returns an error.