|
[Sponsors] |
July 28, 2014, 07:18 |
Problem with compiled UDFs
|
#1 |
New Member
Join Date: Jul 2014
Posts: 7
Rep Power: 12 |
Hello guys,
I'm using Fluent 15.0 on Windows XP 64 Bit with MS Visual Studio C++ 2008 Express and MS .net Framework 2.0 (64 Bit). My problem is, that fluent can compile my UDFs without errors, but it seems to me that fluent doesn't execute them, it does not make a difference whether I start my simulation after compiling or without. But if I try to compile a UDF with errors (e.g. forgot a semicolon), an error message is displayed in the console. Therefore I think the compiler works. I changed the system-variable "path" how it is explained in http://www.cfd-online.com/Wiki/Fluen...with_Fluent_13 Subsection: "How can I manage to compile my UDF with Windows 7 64bit?" If I just write a little UDF to print something on console, nothing will be displayed. My code: #include "udf.h" DEFINE_ADJUST(ausgabe,d) { Message("test"); } I hope somebody can help me. Regards Nils |
|
July 28, 2014, 10:46 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Can you compile the code
Code:
DEFINE_ON_DEMAND(test) { Message("test"); } |
|
July 30, 2014, 04:18 |
|
#3 |
New Member
Join Date: Jul 2014
Posts: 7
Rep Power: 12 |
Hello,
I just tested it and nothing comes up on the screen. Regards Nils |
|
July 30, 2014, 05:15 |
|
#4 | ||
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Quote:
My screen shows: Quote:
|
|||
July 30, 2014, 05:30 |
|
#5 |
New Member
Join Date: Jul 2014
Posts: 7
Rep Power: 12 |
Yes,
after Building: Setting Post Processing and Surfaces information ... Done. Copied E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent/E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent est.c to libudf\src udf_names.c and user_nt.udf files in 3ddp_host are upto date. (system "copy "E:\PROGRA~1\ANSYSI~1\v150\fluent"\fluent15.0.0\sr c\makefile_nt.udf "libudf\win64\3ddp_host\makefile" ") 1 file(s) copied. (chdir "libudf")(chdir "win64\3ddp_host")udf_names.c and user_nt.udf files in 3ddp_node are upto date. (system "copy "E:\PROGRA~1\ANSYSI~1\v150\fluent"\fluent15.0.0\sr c\makefile_nt.udf "libudf\win64\3ddp_node\makefile" ") 1 file(s) copied. (chdir "libudf")(chdir "win64\3ddp_node") Done. After Loading: Opening library "E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent\libudf"... Library "E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent\libudf\win64\3ddp_ho st\libudf.dll" opened Opening library "E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent\libudf"... Library "E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent\libudf\win64\3ddp_no de\libudf.dll" opened Opening library "E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent\libudf"... Library "E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent\libudf\win64\3ddp_no de\libudf.dll" opened Opening library "E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent\libudf"... Library "E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent\libudf\win64\3ddp_no de\libudf.dll" opened Opening library "E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent\libudf"... Library "E:\Documents and Settings\Student\Desktop\Simulation\Shell\particle Tracking_files\dp0\FFF\Fluent\libudf\win64\3ddp_no de\libudf.dll" opened test Done. Did you mean this? |
|
July 30, 2014, 05:44 |
|
#6 |
New Member
Join Date: Jul 2014
Posts: 7
Rep Power: 12 |
And
test::libudf is visible at the "execute on demand"-window, but nothing happens after clicking. |
|
July 30, 2014, 06:05 |
|
#7 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Strange: for me it also does not show on the screen.
However, when I replace it by Code:
Message("test%d\n",0); |
|
August 4, 2014, 04:46 |
|
#8 |
New Member
Join Date: Jul 2014
Posts: 7
Rep Power: 12 |
Hi,
now this shows up: test0 test0 test0 test0 test0 So obviously the compiler works. But when I change it to: #include "udf.h" DEFINE_EXECUTE_AT_END(test) { Message("test%d\n",0); } There's not the output on the console. |
|
August 6, 2014, 10:35 |
|
#9 |
New Member
Join Date: Jul 2014
Posts: 7
Rep Power: 12 |
Does somebody know, why there are 5 "test"-outputs although I executed the UDF only once?
|
|
August 6, 2014, 10:43 |
|
#10 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
That is because you are running in parallel, so 5 instances of your udf are loaded (one for the host, and 4 for the nodes if I am correct). If you want to see it only once, replace "Message" by "Message0".
|
|
August 6, 2014, 10:45 |
|
#11 |
New Member
Join Date: Jul 2014
Posts: 7
Rep Power: 12 |
Oh, thank you
|
|
Tags |
compiler, error, problem, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Interepreted Vs. Compiled UDFs | Antonis | Fluent UDF and Scheme Programming | 10 | March 22, 2018 12:15 |
problem using property udfs in parallel mode | EllenW | FLUENT | 0 | June 23, 2009 18:18 |
URGENT UDF's erosion_macro problem | alex | FLUENT | 7 | October 18, 2005 19:18 |
problem in compiled UDF | kumar | FLUENT | 1 | October 5, 2005 19:40 |
UDFs' problem | Benny | FLUENT | 14 | June 13, 2005 12:05 |