CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT

Looping over faces in a cell

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

LinkBack Thread Tools Display Modes
Old   April 10, 2002, 16:55
Default Looping over faces in a cell
Posts: n/a

I want to loop over all the faces in a cell. I used the following code. When I compile it, it says there is an error on line c_face_loop(c,t,n). error message is "non-integer subscript expression: unsigned char". I would be grateful if somebody can help me debug this code.

Thread *t,*tf; cell_t c; face_t f; int n,k;

thread_loop_c (t,d) {

begin_c_loop (c,t)



f = C_FACE(c,t,n);

tf = C_FACE_THREAD(c,t,n);

} end_c_loop (c,t) }

Thank you Senthil
  Reply With Quote

Old   April 10, 2002, 21:30
Default Re: Looping over faces in a cell
Posts: n/a
I think this must be the compiler's incompatibility...

Add this line in your file just below #include "udf.h":

#define C_NFACES(c,t)(cell_type_nfaces[(int)(C_TYPE((c),(t)))])

Good luck!

  Reply With Quote

Old   April 10, 2002, 22:41
Default Re: Looping over faces in a cell
Posts: n/a
Hi Johnix,

Thanks... It worked after including that statement you mentioned. Though it gave a warning stating that C_NFACES had already been defined in mem.h

I am a new user of fluent. I would like to understand what this statement does. I used the compiler supplied by fluent(Use contributed cpp).Thanks in Advance.

  Reply With Quote

Old   April 11, 2002, 11:41
Default You are welcome!
Posts: n/a
This line just overloaded the same definition in mem.h

We can easily find the designer's intention is to save mem space. The compiler should accept "uchar" as an array subscript. But why not? Maybe it's the oldest C compiler...

If you meet any problem like this, try to find the answer in the /applic/fluent/.../src/*.h files. Such source codes can be helpful.


  Reply With Quote


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
snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Native Meshers: snappyHexMesh and Others 2 March 27, 2011 21:11
DecomposePar unequal number of shared faces maka OpenFOAM Pre-Processing 6 August 12, 2010 09:01
external flow with snappyHexMesh chelvistero OpenFOAM 11 January 15, 2010 20:43
Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 2 July 15, 2005 04:15
Warning 097- AB Siemens 6 November 15, 2004 05:41

All times are GMT -4. The time now is 16:59.