how to find the index of the adjacent cell of one cell?
I want to get the tempreture in the left cell next to one cell. And there are 4 faces on one cell in my grid. How can I do this with udf ?
real x[ND_ND], xf[ND_ND];
C_CENTROID(x, c, t);
c_face_loop(c, t, n) /* loops over all faces of a cell */
tf = C_FACE_THREAD(c,t,n);
f = C_FACE(c,t,n);
F_CENTROID(xf, f, tf);
if is_left_to_the_cell(x, xf) /* is the face left to the cell? */
c0 = F_C0(f, tf);
if (c0 == c) /* is itself */
c0 = F_C1(f, tf);
T = C_T(c0,t);
Than you very much !
|All times are GMT -4. The time now is 09:02.|