|
[Sponsors] |
September 16, 2007, 16:16 |
UDF
|
#1 |
Guest
Posts: n/a
|
HI,
I have writtena simple UDF which I have pasted below. When I compile it as interpreted UDF , I can see the message in the printf line in the console window while iterating. However if I comlpile it as compiled UDF and even after hooking it I cannot see the message in the console window while iterating. Does anyone have an idea why this is so? Any sort of help will be appreciated!!!!! #include "udf.h" DEFINE_ADJUST(my_adjust,d) { Thread *t; cell_t c; printf("I am here"); } |
|
September 16, 2007, 17:46 |
Re: UDF
|
#2 |
Guest
Posts: n/a
|
Assuming that all else is well, it is possible that IO buffering is the problem. Use "Message" instead of "printf" or explicitly flush stdout.
Jason D. |
|
September 16, 2007, 18:12 |
Re: UDF
|
#3 |
Guest
Posts: n/a
|
thanks,
I am a mechanical engineer. Can u be more precise regarding "explicitly flush stdout"??? thanks in advance |
|
September 17, 2007, 13:10 |
Re: UDF
|
#4 |
Guest
Posts: n/a
|
Well, I am also a mechanical engineer, so I don't know what that is about. To answer the question: "Message" acts pretty much like "printf", so all you have to do is replace printf with Message (see section 3.7 of the 6.3 UDF manual). I strongly urge you to use Message, as explicitly flushing stdout is a pain in the neck when you forget to do it (done that). My output eventually showed up - if I recall correctly it appeared when I reloaded my UDF's. After that I have always used Message. However, should you wish to go the flush route, to explicitly flush stdout you'll need to add
fflush(stdout); after your printf to see it properly. As far as I know what I have said is valid under Windows and Linux. Jason D. |
|
September 17, 2007, 16:38 |
Re: UDF
|
#5 |
Guest
Posts: n/a
|
Hi Jasond.
Thanks man. It really works. Gr8. I am damn happy. Well just wanted to inroduce my self to u. I am a student in SWEDEN, doing my thesis on UDF. I am trying to write a UDF for adopting 4 transport equations for a new turbulence model. I have written the code, but I was unable to debug some errors in the code because of the above problem. Now that its solved I am very happy. Thanks again..... What about u? where r u from???? and what do u do??? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dynamic Mesh UDF | Qureshi | FLUENT | 7 | March 23, 2017 07:37 |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 22:14 |
How to add a UDF to a compiled UDF library | kim | FLUENT | 3 | October 26, 2011 21:38 |
UDF...UDF...UDF...UDF | Luc SEMINEL | FLUENT | 0 | November 25, 2002 04:03 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 04:01 |