|
[Sponsors] |
June 29, 2000, 06:11 |
UDF for looping over nodes in cells.
|
#1 |
Guest
Posts: n/a
|
I'm trying to develop an interpreted UDF (under Windows NT) that will ultimately check to see whether cells lie on a specified plane or not (so that I can then access cell centre values on that plane). However, in order to do this, I need a UDF that can access the coordinates of all nodes associated with a particular cell. The UDF included below is designed to run as a 'Chip-exec' command, but unfortunately I have problems getting it to compile. I suspect I have the same sort of problem as the C_NNODE item posted here recently. Can anyone shed some light as to why the UDF below should not compile? The error which comes up is:-
cpp -IE:\FLUENT.INC\fluent5.3/src -IE:\FLUENT.INC\fluent5.3/cortex/src -IE:\FLUENT.INC\fluent5.3/client/src -IE:\FLUENT.INC\fluent5.3/multiport/src -I. -DUDFCONFIG_H="<udfconfig.h>" e:\fluent.inc\libudf\src\cinfo3b.c Error: e:\fluent.inc\libudf\src\cinfo3b.c: line 19: non-integer subscript expression: unsigned char. This must refer to the 'n' contained in the line 'c_node_loop(c, t, n). What do I need to do before the compiler will recognise this line? Any help will be greatly appreciated! Malcolm W. mwallace@nel.uk ************************************************** ************************* #include "udf.h" extern Domain *domain; void cinfo3(); void cinfo3() { cell_t c; Thread *t; Node *v; int n; real yvalue; thread_loop_c(t, domain) { begin_c_loop_all(c, t) { c_node_loop(c, t, n) { v = CELL_NODE(c, t, n); yvalue = NODE_Y(v); } } end_c_loop(c,t) } } |
|
June 30, 2000, 10:44 |
Re: UDF for looping over nodes in cells.
|
#2 |
Guest
Posts: n/a
|
You are right, it is the same problem. Change the c_node_loop(c,t,n) line to read
for(n=0;n<cell_type_nnodes[(int)C_TYPE(c,t)];++n) Also you need to change CELL_NODE(c,t,n) to C_NODE(c,t,n). |
|
June 30, 2000, 16:01 |
Re: UDF for looping over nodes in cells.
|
#3 |
Guest
Posts: n/a
|
Hmm. That didn't work at all. Apparently it didn;t like the less-than symbol. Lets try again, but where it shows LT you want to use the less-than sign (the ampersand lt semicolon doesn't work either...).
You need to replace the c_node_loop(c,t,n) line with: for (n=0; n LT cell_type_nnodes[(int)C_TYPE(c,t)]; n++) Also you need to change CELL_NODE(c,t,n) to C_NODE(c,t,n). |
|
July 3, 2000, 10:22 |
Re: UDF for looping over nodes in cells.
|
#4 |
Guest
Posts: n/a
|
Problem solved! Thanks Chris.
Malcolm |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] external flow with snappyHexMesh | chelvistero | OpenFOAM Meshing & Mesh Conversion | 11 | January 15, 2010 20:43 |
export nodes, cells and heat transfer coefficients | Ademar Cardoso | FLUENT | 0 | September 13, 2005 18:22 |
Setting pressure value for specific cells, UDF | Amir | FLUENT | 2 | September 1, 2005 19:59 |
Set up the velocity of some cells in the UDF. | Fluenter | FLUENT | 6 | September 27, 2004 02:30 |
CFX4.3 -build analysis form | Chie Min | CFX | 5 | July 13, 2001 00:19 |