|
[Sponsors] |
August 27, 2006, 14:54 |
UDF - Interpreted works and compiled doesn't
|
#1 |
Guest
Posts: n/a
|
I am writing some UDF's so that I can get at some of the flow data - not relevant right now.
To allow me to see how my UDF's are performing, I wanted to sprinkle the code with some printf statements. Unfortuntaley the Printf doesn't seem to do anything. I have now stripped the UDF right down to simply a few lines of Printf. This works OK when interpreted but not when compiled. When I compile the UDF I don't seem to get any errors and it loads alright. Anyone got any ideas? |
|
August 28, 2006, 03:25 |
Re: UDF - Interpreted works and compiled doesn't
|
#2 |
Guest
Posts: n/a
|
Use "Message" or "CX_Message" (same syntax as printf) instead of "printf" for compiled udfs.
RoM |
|
August 28, 2006, 06:44 |
Re: UDF - Interpreted works and compiled doesn't
|
#3 |
Guest
Posts: n/a
|
Thank you for this. Very helpful. I have also located some text in the fluent help file that refers to 'Message'. Strange thing is that it seems as though it should work (printf), in both interpreted and compiled mode.
|
|
August 28, 2006, 07:32 |
Re: UDF - Interpreted works and compiled doesn't
|
#4 |
Guest
Posts: n/a
|
I had a discussion with fluent suuport about this problem. The output from the fluent solver (written in c) to the cortex (scheme) is buffered and the message buffer needs to be fluhed bevor you will see the output in the cortex gui. The standard printf function wont do this, so fluent provides the Message macro. As far as i know, Message will work only in compiled udfs and not in interpreted mode.
RoM |
|
August 30, 2006, 02:36 |
Re: UDF - Interpreted works and compiled doesn't
|
#5 |
Guest
Posts: n/a
|
On windows clients "printf" only works in interpreted mode. "Message" should work for both modes regardless of operating system.
|
|
August 30, 2006, 06:44 |
Re: UDF - Interpreted works and compiled doesn't
|
#6 |
Guest
Posts: n/a
|
The good old hello-world-udf will not run in interpreted mode on my WinXP machine.
#include "udf.h" DEFINE_ON_DEMAND(hello) { Message("Hello world!\n"); } The interpreter quits with Error: C:\hello.c: line 7: function "CX_Message" not found (pc=5). Compiling works fine though. RoM |
|
October 29, 2018, 19:13 |
|
#7 | |
New Member
Chunrong Zhao
Join Date: Oct 2018
Posts: 3
Rep Power: 8 |
Quote:
I got "Error code 126" when I used COMPLIED but okay for INTERPRETED. Do you know why it happened ? I tried to fix it by referring https://www.cfd-online.com/Forums/fluent/174350-udf-compilation-error-code-126-a.html but didn't work. many thanks |
||
October 29, 2018, 21:40 |
|
#8 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
reason of error code 126 is version mismatch
best regards |
|
October 29, 2018, 21:54 |
|
#9 |
New Member
Chunrong Zhao
Join Date: Oct 2018
Posts: 3
Rep Power: 8 |
Hi AlexanderZ,
Very appreciate your reply. Since I don't own much knowledge about CS, can you explain it in details and what should I do to fix this error? thanks and regards |
|
October 30, 2018, 01:52 |
|
#10 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
in other thread you've mentioned, that you have both v19.0 and v.18.2 version of fluent.
Most likely you are compiling your UDF using one version, but run it with another. Or you are not compiling library, because of some problems with compiler or code) and than try to read "bad" library, which was compiled long time ago for other fluent version best regards |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
compiled and interpreted udf | mateus | FLUENT | 1 | May 11, 2011 07:09 |
Difference between interpreted and compiled for DEFINE_ADJUST? | KatyaM | Fluent UDF and Scheme Programming | 1 | November 3, 2009 10:30 |
PROBLEM WItH COMPILED UDF. | Nia | FLUENT | 5 | November 6, 2007 12:53 |
.F compiled on Winnt works, but on AIX doesn't | Daiga | CFX | 11 | May 9, 2006 08:44 |
Use of F_UDMI(f,t,i) for compiled UDF | Damien | FLUENT | 8 | June 18, 2002 09:55 |