global face number
Question:
Is it a feasible approach to determine if two cells of bordering threads are neighbours by finding out if they share a face? Lets say I have a cell A in thread A and I loop through the faces (four, since 2d). For every face of cell A I loop through all the cells of thread B and see if any one shares this face. Could this work? Or is the global face number (which can be retrieved with Code:
C_FACE(c,t,n) different for neighbouring cells if they are of different threads? |
It does not work, unfortunately.
But as an easy fix, I just compare the coords of the face centres to determine wether cell are neigbours or not. |
That also did not work. My solution (which works now):
Code:
int neighbourcell(cell_t cell0, Thread *thread0, cell_t cell1, Thread *thread1, int n) //put cell pointers and a face index (of cell 0) -> it is estimated if cell 0 is a neighbour of cell 1, connected via face |
Adjacent cells macros
Did you try these macros:
Code:
F_C0(f,t) |
Yes, see my code above. And they worked, too! ;)
|
Oh :o
Sorry for missreading your code. My bad |
All times are GMT -4. The time now is 02:59. |