CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

UDF - Interpreted works and compiled doesn't

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   August 27, 2006, 13:54
Default UDF - Interpreted works and compiled doesn't
  #1
AlwaysLearning
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?

  Reply With Quote

Old   August 28, 2006, 02:25
Default Re: UDF - Interpreted works and compiled doesn't
  #2
RoM
Guest
 
Posts: n/a
Use "Message" or "CX_Message" (same syntax as printf) instead of "printf" for compiled udfs.

RoM
  Reply With Quote

Old   August 28, 2006, 05:44
Default Re: UDF - Interpreted works and compiled doesn't
  #3
AlwaysLearning
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.

  Reply With Quote

Old   August 28, 2006, 06:32
Default Re: UDF - Interpreted works and compiled doesn't
  #4
RoM
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
  Reply With Quote

Old   August 30, 2006, 01:36
Default Re: UDF - Interpreted works and compiled doesn't
  #5
PAD
Guest
 
Posts: n/a
On windows clients "printf" only works in interpreted mode. "Message" should work for both modes regardless of operating system.
  Reply With Quote

Old   August 30, 2006, 05:44
Default Re: UDF - Interpreted works and compiled doesn't
  #6
RoM
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
  Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
compiled and interpreted udf mateus FLUENT 1 May 11, 2011 06: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 07:44
Use of F_UDMI(f,t,i) for compiled UDF Damien FLUENT 8 June 18, 2002 08:55


All times are GMT -4. The time now is 22:29.