CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Compiled UDF (http://www.cfd-online.com/Forums/fluent/29336-compiled-udf.html)

Lu Hu February 7, 2002 13:15

Compiled UDF
 
Anybody has tried to use thread_loop_c in compiled UDF(OS: Win2k Professional)? I wrote one like this:

#include "udf.h"

extern Domain* domain;

DEFINE_ON_DEMAND(test) {

Thread *t;

cell_t c;

thread_loop_c(t,domain)

{

begin_c_loop(c,t)

{

}

end_c_loop(c,t)

} }

I can compile the file and get the .dll file. But when I tried to run the udf in Fluent, it gave the error message: Error: FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: ()

Seems I cannot use thread_loop_c. Has anybody encountered similar problem? Thanks.

Lu


hampton February 14, 2002 09:15

Re: Compiled UDF
 
Hi,

the reason of error is "extern Domain* domain". this macro does not work on any Windows . So you have to replace this macro to "Domain *domain = Get_Domain(1)".

Thanks.

Lu Hu February 14, 2002 13:19

Re: Compiled UDF
 
Thank you. It works!


All times are GMT -4. The time now is 13:08.