udfSetError()

Print an error message and exit the solver.

Syntax

udfSetError( udfHd, format, ... ) ;

Type

AcuSolve User-Defined Function Basic

Parameters

udfHd
The opaque handle (pointer) which was passed to the user function.
format
C printf() format.
...
List of C variables.

Return Value

None.

Description

This routine allows the user to print out a message and exit the solver if an error is detected. The argument list is the same as that of fprintf(), except that here udfHd takes the place of the file descriptor. For example,
String user_name ;
...
user_name = udfGetName( udfHd ) ;
if ( strcmp(user_name,  "viscosity water") != 0 ) {
   /* compute viscosity for water */
   ...
} else if ( strcmp(user_name, "viscosity air") != 0 ) {
   /* compute viscosity for air */
   ...
} else {
   udfSetError( udfHd, "Invalid user name %s", user_name ) ;
}

Errors

This routine expects a valid udfHd.