CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   non-integer subscript expression??? (https://www.cfd-online.com/Forums/fluent/67762-non-integer-subscript-expression.html)

mohsen zendehbad August 26, 2009 01:07

non-integer subscript expression???
 
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.

jalarron August 26, 2009 01:30

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

mohsen zendehbad August 26, 2009 01:41

yes, i have declared, i write them in execute_at_end macro

jalarron August 26, 2009 19:26

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)
}
}

}

mohsen zendehbad August 29, 2009 01:01

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

bartklaasen August 4, 2010 05:38

Similar problem
 
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!

jalarron August 4, 2010 08:04

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

bartklaasen August 4, 2010 08:16

Implementation
 
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.


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