|
[Sponsors] |
February 23, 2011, 11:40 |
Node UDF
|
#1 |
New Member
Join Date: Feb 2011
Posts: 8
Rep Power: 15 |
Hi to everybody,
i want to know if it possible to read nodes coordinate once a time. this is part of my udf code: ---------------------------------------------------------------------------------------------------------------- fprintf(fout,"thread id %d\n", id); begin_f_loop(f,t) { f_node_loop(f,t,n) { v = F_NODE(f,t,n);} } end_f_loop(f,t) fprintf(fout, "\n"); ---------------------------------------------------------------------------------------------------------------- in this way i have obtained the same nodes more than one time, due to the nodes on the same faces. Can somebody help me? Thank's in advance |
|
February 23, 2011, 21:04 |
|
#2 | |
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 17 |
Quote:
/* Initalize all node marks on the thread to 0 */ begin_f_loop(f, t) { f_node_loop(f, t, n) { v=F_NODE(f,t,n); NODE_MARK(v) = 0; } } end_f_loop(f, t); begin_f_loop(f, t) { f_node_loop(f, t, n) { v = F_NODE(f,t,n); pos_x = NODE_X(v); pos_y = NODE_Y(v); if(NODE_MARK(v) == 0) /* if not already visited */ fprintf(fout, "f%d %g %g\n", v, pos_x, pos_y); NODE_MARK(v) = 1; } } end_f_loop(f, t); fclose(fout); |
||
February 24, 2011, 05:43 |
|
#3 |
New Member
Join Date: Feb 2011
Posts: 8
Rep Power: 15 |
Thank you GearBoy ,
it works fine. I want to underline that to use the macro NODE_MARK(), the udf must be compiled and not interpreted... where i can find some reference on this and other similar macro? in the UDF ug there aren't info... |
|
September 20, 2012, 10:13 |
|
#4 | |
Member
|
Quote:
Hi GearBoy! I followed your code as shown as above. It works very well. I succeeded to output node data. However, I faced some problem. Could you help me? I tested DEFINE_CG_MOTION macro with a rotation of a box about x-axis according to "cos(x)" function . I exported several node in this box. When I checked output data from selected node, I compare it to my "cos(x)" function value. I realized that there are slightly different between them. I really appreciate your help. Best regards |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dynamic Mesh UDF | Qureshi | FLUENT | 7 | March 23, 2017 08:37 |
How to get the Global Node Number by UDF : Fluent | Yusuke | FLUENT | 1 | October 23, 2015 11:55 |
Accessing node values using a UDF | Nico | FLUENT | 2 | December 20, 2007 03:50 |
UDF Global Node Number ? | C. H. | FLUENT | 1 | November 24, 2006 11:02 |
Help: how to get node values with UDF? | Dazhi Guo | FLUENT | 0 | February 4, 2001 01:59 |