|
[Sponsors] |
Basic UDF's using C_NFACES or C_FACE_LOOP: unsigned char compile error |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 4, 2010, 06:32 |
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: 17 |
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) } } This problem seems to correspond to http://www.cfd-online.com/Forums/flu...xpression.html . 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! |
|
August 5, 2010, 11:55 |
|
#2 |
New Member
Bogdan
Join Date: Oct 2009
Posts: 3
Rep Power: 17 |
put curly brackets after begin_c_loop and before end_c_loop. And try to compile the UDF, not to interpret
|
|
Tags |
c_face_loop, c_nfaces, fluent, udf, unsigned char |
|
|
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 13:34 |
user defined function | cfduser | CFX | 0 | April 29, 2006 11:58 |
Problems of Duns Codes! | Martin J | Main CFD Forum | 8 | August 15, 2003 00:19 |
error while compiling the USER Sub routine | CFD user | CFX | 3 | November 25, 2002 16:16 |