global face number

 Register Blogs Members List Search Today's Posts Mark Forums Read

 October 6, 2009, 10:12 global face number #1 New Member   Join Date: Apr 2009 Location: KA, Germany Posts: 20 Rep Power: 8 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?

 October 7, 2009, 05:00 #2 New Member   Join Date: Apr 2009 Location: KA, Germany Posts: 20 Rep Power: 8 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.

 October 7, 2009, 09:07 #3 New Member   Join Date: Apr 2009 Location: KA, Germany Posts: 20 Rep Power: 8 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 { Thread *threadf; //face thread of face Thread *tc0; //cell threads of neighbours to face Thread *tc1; //cell threads of neighbours to face face_t face; cell_t c0; //neighbour to the face cell_t c1; //neighbour to the face face = C_FACE(cell0,thread0,n); //the face of cell 1 threadf = C_FACE_THREAD(cell0,thread0,n); //the face thread of this face c0 = F_C0(face,threadf); c1 = F_C1(face,threadf); tc0 = F_C0_THREAD(face,threadf); tc1 = F_C1_THREAD(face,threadf); if ( (c0 == cell0 && c1 == cell1 && tc0 == thread0 && tc1 == thread1) || (c0 == cell1 && c1 == cell0 && tc0 == thread1 && tc1 == thread0) ) { return 1; } else { return 0; } }```

 October 20, 2009, 03:04 Adjacent cells macros #4 Senior Member     Dragos Join Date: Mar 2009 Posts: 647 Rep Power: 11 Did you try these macros: Code: ```F_C0(f,t) F_C1(f,t)``` ?

 October 20, 2009, 03:14 #5 New Member   Join Date: Apr 2009 Location: KA, Germany Posts: 20 Rep Power: 8 Yes, see my code above. And they worked, too!

 October 20, 2009, 03:24 #6 Senior Member     Dragos Join Date: Mar 2009 Posts: 647 Rep Power: 11 Oh Sorry for missreading your code. My bad

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post hsieh Open Source Meshers: Gmsh, Netgen, CGNS, ... 32 September 13, 2011 05:50 ankgupta8um OpenFOAM Running, Solving & CFD 7 January 15, 2011 14:38 erica FLUENT 0 November 24, 2007 06:41 Rasmus Gjesing (Gjesing) OpenFOAM Native Meshers: blockMesh 10 April 2, 2007 14:00 Alan Main CFD Forum 4 August 17, 2006 07:33

All times are GMT -4. The time now is 20:48.