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

non-integer subscript expression???

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 26, 2009, 02:07
Default non-integer subscript expression???
  #1
Member
 
MOHSEN Zendehbad
Join Date: Aug 2009
Posts: 35
Rep Power: 16
mohsen zendehbad is on a distinguished road
i have written this line in my udf:
nfc = C_NFACES(c,t);

and i get this error while interpreting the *.c file:
Error: C:\Fluent.Inc\MonEssai.c: line 37: non-integer subscript expression: unsigned char.

what should i do.
mohsen zendehbad is offline   Reply With Quote

Old   August 26, 2009, 02:30
Default
  #2
New Member
 
Javier Larrondo
Join Date: Jun 2009
Posts: 17
Blog Entries: 1
Rep Power: 16
jalarron is on a distinguished road
Hi,

Just obvious questions, but have you declared c, t and nfc properly?
cell_t c;
Thread *t;
int nfc ;

In what macro are you trying to use this?
Cheers,
Javier
jalarron is offline   Reply With Quote

Old   August 26, 2009, 02:41
Default
  #3
Member
 
MOHSEN Zendehbad
Join Date: Aug 2009
Posts: 35
Rep Power: 16
mohsen zendehbad is on a distinguished road
yes, i have declared, i write them in execute_at_end macro
mohsen zendehbad is offline   Reply With Quote

Old   August 26, 2009, 20:26
Default
  #4
New Member
 
Javier Larrondo
Join Date: Jun 2009
Posts: 17
Blog Entries: 1
Rep Power: 16
jalarron is on a distinguished road
Can you post your code or is too long?
Be careful to declare the domain, thread and also what type of thread are you going to loop.
In general you must use this structure to access the data:

DEFINE_EXECUTE_AT_END(execute_at_end)
{

Domain *d;
Thread *t;
cell_t c;
int nfc;
d = Get_Domain(1);

thread_loop_c(t,d)
{
if (FLUID_THREAD_P(t))
{
begin_c_loop(c,t)
nfc = C_NFACES(c,t);
end_c_loop(c,t)
}
}

}
jalarron is offline   Reply With Quote

Old   August 29, 2009, 02:01
Default
  #5
Member
 
MOHSEN Zendehbad
Join Date: Aug 2009
Posts: 35
Rep Power: 16
mohsen zendehbad is on a distinguished road
yes i found the problem, exactly the problem was that i had not used the above process for accessing the data,
THANK YOU for your cooperation
mohsen zendehbad is offline   Reply With Quote

Old   August 4, 2010, 06:38
Default Similar problem
  #6
New Member
 
Join Date: Oct 2009
Posts: 3
Rep Power: 16
bartklaasen is on a distinguished road
Dear,

I have the same problem as described here. I found out that a similar error also occurs when calling C_FACE_LOOP instead of C_NFACES.

Could you please provide us more details on your solution? Because when I implement this macro as described above by jallaron, the error is still there.

Many thanks!
bartklaasen is offline   Reply With Quote

Old   August 4, 2010, 09:04
Default
  #7
New Member
 
Javier Larrondo
Join Date: Jun 2009
Posts: 17
Blog Entries: 1
Rep Power: 16
jalarron is on a distinguished road
Hi could you provide your implementation to check it out. Using C_FACE_LOOP also needs to declare a face thread and an integer variable which will store the local index face numbers.
Cheers,
Javier
jalarron is offline   Reply With Quote

Old   August 4, 2010, 09:16
Default Implementation
  #8
New Member
 
Join Date: Oct 2009
Posts: 3
Rep Power: 16
bartklaasen is on a distinguished road
Thanks for taking a look at this. My implementation:

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)
 }
}
When interpreting this results in Error: C:\test\test1.c: line 20: non-integer subscript expression: unsigned char. Line 20 contains the C_NFACES. Compiling also doesn't work. I tried this with Fluent V12.1, on both 32 bit and 64 bit versions, always in serial 2d dp mode.
bartklaasen is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble Using Pressure In Expression For BC Nolan CFX 4 June 23, 2008 17:10
Writing an expression for fully developed flow! Usman CFX 12 December 20, 2007 12:26
Relief Plots in CFX Michael CFX 15 June 30, 2006 09:01
Lift, Drag Vs time chart,calculations Jamesd69climber CFX 8 February 17, 2005 18:23
Creating, loop or iteration using expression edito Jan CFX 3 July 28, 2003 12:01


All times are GMT -4. The time now is 10:36.