UDF_Cell variables!
Hi; I want to find a face (or edge in 2D) with maximum length in a cell (largest face of a cell). I want to calculate this value for all cells. How can I do this? I want to use a formulation includs maximume length of edge in each cell. Thanks
|
Re: UDF_Cell variables!
Here is a part of code that does what you want, or almost:
Thread *t; cell_t c; Domain *d; char first; int n,i; Node *node, *prev; real l, lprev; d = Get_Domain(1); thread_loop_c(t, d) /*loops over all cell threads in domain*/ { begin_c_loop(c, t) /* loops over cells in a cell thread */ { first = 1; found = 0; c_node_loop(c, t, n) /*loops over nodes in a cell*/ { node = C_NODE(c,t,n); if(1 == first)/*first node in cell*/ { first = 0; prev = node; } else { l = 0; for(i = 0; i < ND_ND; i++) l += (node->x[i]-prev->x[i])*(node->x[i]-prev->x[i]); l = (l < lprev ? lprev : l); lprev = l; } } } end_c_loop(c, t) } |
Re: UDF_Cell variables!
Is it possible to use node->x[0] for NODE_X(node)?
|
Re: UDF_Cell variables!
Yes, it is. Look through the header files and you'll find some interesting things there!
|
Re: UDF_Cell variables!
Hi; Thanks. I will apply this. ROOZBEH
|
Re: UDF_Cell variables!
hi roozbeh are you iranian? where are you? can you help me about complicated model in gambit? thank you arashshahin@yahoo.com
|
All times are GMT -4. The time now is 15:12. |