|
[Sponsors] |
October 25, 2000, 12:00 |
How to define nodes for a certain cell ?
|
#1 |
Guest
Posts: n/a
|
Hi !
While looping over cells in a thread I need to define coordinates of all cell nodes to provide the next calculations.All I want to do might be done by using functions NODE_X(node), NODE_Y(node), NODE_Z(node),NODE_GX(node),NODE_GY(node),NODE_GZ(n ode), but how can I get this "node" parameter for a certain cell ? Your reply would be very convenient... Best wishes. Mikhail |
|
October 29, 2000, 22:52 |
Re: How to define nodes for a certain cell ?
|
#2 |
Guest
Posts: n/a
|
do you want a kind of following ones?
DEFINE_ADJUST(test_coord,domain) { cell_t c; Thread *t; Node *v; int n; real xn,yn; thread_loop_c(t, domain){ begin_c_loop(c, t){ Message("cell %d (%d) : ",c,C_NNODES(c,t)); c_node_loop(c, t, n){ v = C_NODE(c, t, n); xn = NODE_X(v); yn = NODE_Y(v); Message(" %d(%g,%g)",n,xn,yn); } Message("\n"); } end_c_loop(c,t) } } |
|
November 8, 2000, 21:59 |
Re: How to define nodes for a certain cell ?
|
#3 |
Guest
Posts: n/a
|
Hi Minun, I've try to run your program, but it doesn't work. The error seem when reach the "Message("cell %d (%d) : ",c,C_NNODES(c,t));" line with the error message (unsigned char error). Is it true??, and how to fix it?
|
|
November 12, 2000, 21:51 |
Re: How to define nodes for a certain cell ?
|
#4 |
Guest
Posts: n/a
|
If you compile the source with 'compiled udf', it should work well.
I guess you compiled it with 'interpreted udf'. Change that line to 'printf("cell %d (%d) : ",c,cell_type_nnodes[(int)C_TYPE(c,t)]); You can find following message posted by Chris in this forum. ================================================== =============== That is a bug. It should work OK as is for compiled UDFs. To make it work in the interpreted UDFs, change the line: num = C_NNODES(c,thread); to read: num = cell_type_nnodes[(int)C_TYPE(c,thread)]; Chris |
|
November 17, 2000, 02:42 |
Re: How to define nodes for a certain cell ?
|
#5 |
Guest
Posts: n/a
|
Thank you very much, and i'll try it
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] How do you define a cell zone or region for porous? | bigbang | OpenFOAM Meshing & Mesh Conversion | 6 | March 18, 2016 18:42 |
How can I define the cell centers without using writeCellCenters? | Taylorreihe | OpenFOAM Post-Processing | 4 | February 19, 2016 13:46 |
Missing math.h header | Travis | FLUENT | 4 | January 15, 2009 12:48 |
Free surface boudary conditions with SOLA-VOF | Fan | Main CFD Forum | 10 | September 9, 2006 13:24 |
UDFs for Scalar Eqn - Fluid/Solid HT | Greg Perkins | FLUENT | 0 | October 11, 2000 04:43 |