User Function Argument Registration ucarg (C)

This section describes the user function argument registration.

Each argument of a C user function which has been initially registered with ucfunc is requested with a call in uclib to ucarg:

ucarg(void *func, char *type, char *variable, int size);

func: a pointer to the user function.

type: a character string giving the type of the argument, either of the following:

  • "Cell" for a cell field
  • "Face" for a face field
  • "Vertex" for a vertex field

variable: a character string naming the requested argument, which must be a valid Simcenter STAR-CCM+ variable.

size: the storage in bytes required for one element of the variable array. This size is used to ensure that the precision of the user function matches the precision of Simcenter STAR-CCM+. Examples are:

  • sizeof(Real) if variable is a Real scalar per element
  • sizeof(CoordReal[3]) if variable is a CoordReal vector per element
  • sizeof(int[2]) if variable is a pair of integers per element

The Real and CoordReal types define the precision of floating-point variables, and are defined in the uclib.h file.

Calls to ucarg must be made in the order the user function needs the arguments in.