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

Basic UDF's using C_NFACES or C_FACE_LOOP: unsigned char compile error

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 4, 2010, 05:32
Exclamation Basic UDF's using C_NFACES or C_FACE_LOOP: unsigned char compile error
  #1
New Member
 
Join Date: Oct 2009
Posts: 3
Rep Power: 7
bartklaasen is on a distinguished road
Dear cfd-online members,

I'm trying to implement an UDF that uses the C_FACE_LOOP macro (to loop over the faces of a cell) in very basic implementation that corresponds to examples in the Fluent Manual. However, while interpreting this udf, an error is returned:

Error: C:\test\test1.c: line 20: non-integer subscript expression: unsigned char.

The C_FACE_LOOP statement is at line 20. The same problem occurs when I try to call the C_NFACES macro instead of C_FACE_LOOP.

Here is the most basic implementation to reproduce the error:

Code:
 
#include "udf.h"
DEFINE_ON_DEMAND(test1)
{
 Domain *d;
 Thread *t;
 cell_t c;
 int count = 0;
 d = Get_Domain(1);
 
 thread_loop_c(t,d)
 {
  begin_c_loop(c,t)
   count = C_NFACES(c,t); 
   printf("%i",count);
  end_c_loop(c,t)
 }
}
I tried this with Fluent V12.1, on both 32 bit and 64 bit versions, always in serial 2d dp mode.

This problem seems to correspond to non-integer subscript expression??? . However, the proposed correct implementation there corresponds to the above and doesn't bring a solution.

Does anyone have a possible explanation for this. Or can you reproduce this error?

Many thanks in advance!
bartklaasen is offline   Reply With Quote

Old   August 5, 2010, 10:55
Default
  #2
New Member
 
Bogdan
Join Date: Oct 2009
Posts: 3
Rep Power: 7
alexbog8 is on a distinguished road
put curly brackets after begin_c_loop and before end_c_loop. And try to compile the UDF, not to interpret
alexbog8 is offline   Reply With Quote

Reply

Tags
c_face_loop, c_nfaces, fluent, udf, unsigned char

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
nonNewtonian viscosity model mhassani OpenFOAM Programming & Development 5 January 7, 2013 10:27
checking the system setup and Qt version vivek070176 OpenFOAM Installation 22 June 1, 2010 12:34
user defined function cfduser CFX 0 April 29, 2006 10:58
Problems of Duns Codes! Martin J Main CFD Forum 8 August 14, 2003 23:19
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 16:16


All times are GMT -4. The time now is 09:23.