CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDF int id; (http://www.cfd-online.com/Forums/fluent/31203-udf-int-id.html)

Li Jingping April 4, 2003 04:34

UDF int id;
 
I wrote a UDF for excercise.

#include "udf.h"

DEFINE_ON_DEMAND(my_udf) { Domain *domain; domain=Get_Domain(3); int id; Thread *f_thread=Lookup_Thread(domain, id); }

Once I interrepted it in FLUENT, it told me the syntax error on "int id;". I am confused! Is my UDF right or not? Is it required any other condition to define an integer index?

Thanks in advance!

Li Jingping April 4, 2003 09:29

Re: UDF int id;
 
i resolved this problem by myself, though I don't know why.

Change the sequence of the lines and divide the assignment line for thread into two parts as follows:

#include "udf.h"

DEFINE_ON_DEMAND(my_udf) { int idŁ»Thread *f_thread;Domain *domain; domain=Get_Domain(3); f_thread=Lookup_Thread(domain, id); }

UDF can be compiled by FLUENT.

Very confused. Anyone can tell me why?



All times are GMT -4. The time now is 17:04.