[ANSYS, Inc. Logo] return to home search
next up previous contents index

3.6.4 Accessing a Scheme Variable in a UDF

After a new variable is defined on the Scheme side (using a text command), you will need to bring it over to the solver side to be able to use it in your UDF. ` RP' macros are used to access Scheme variables in UDFs, and are listed below.


RP_Get_Real("variable-name") Returns the double value of variable-name
RP_Get_Integer("variable-name") Returns the integer value of variable-name
RP_Get_String("variable-name") Returns the char* value of variable-name
RP_Get_Boolean("variable-name") Returns the Boolean value of variable-name

For example, to access the user-defined Scheme variable pres_av/thread-id in your UDF C function, you will use RP_Get_Integer . You can then assign the variable returned to a local variable you have declared in your UDF (e.g., surface_thread_id) as demonstrated below:

 surface_thread_id = RP_Get_Integer("pres_av/thread-id");


next up previous contents index Previous: 3.6.3 Changing a Scheme
Up: 3.6 Scheme Macros
Next: 3.7 Input/Output Macros
Release 12.0 © ANSYS, Inc. 2009-01-14