|
[Sponsors] |
March 9, 2012, 19:36 |
Neighbor of a boundary face
|
#1 |
Senior Member
Senthil Kabilan
Join Date: Mar 2009
Posts: 113
Rep Power: 17 |
Hi Foamers,
I need to access the neighboring faces of boundary face. I have the following code: label patchID = mesh.boundaryMesh().findPatchID("walls"); const polyPatch& cPatch = mesh.boundaryMesh()[patchID]; forAll(cPatch, facei) { I need to access the neighboring FACES of facei } Thanks in advance! Senthil |
|
March 10, 2012, 02:36 |
|
#2 |
Disabled
Join Date: Mar 2011
Posts: 174
Rep Power: 15 |
Code:
List<List<bool> > neighbourFace; // a list for each face, // a list of bools for the other faces of the patch // The bool responds to whether they are neighbour faces or not label patchID = mesh.boundaryMesh().findPatchID("walls"); const polyPatch& cPatch = mesh.boundaryMesh()[patchID]; neighbourFace.setSize(cPatch.size()); forAll(cPatch, faceI) // faceI: the face whose neighbour faces we want { neighbourFace[faceI].setSize(cPatch.size()); forAll(cPatch, faceJ) // faceJ: possible neighbour face { neighbourFace[faceI][faceJ] = false; if (faceI != faceJ) // if they are the same, they can't be neighbours { forAll(cPatch[faceI], pointI) // check all points of which faceI consists { forAll(cPatch[faceJ], pointJ) // and compare them with the ones of faceJ { if (cPatch[faceI][pointI] == cPatch[faceJ][pointJ]) { neighbourFace[faceI][faceJ] = true; } } } } } } I check if there are common points but you can easily modify it to check if there are common edges only. |
|
March 10, 2012, 14:41 |
|
#3 |
Senior Member
Senthil Kabilan
Join Date: Mar 2009
Posts: 113
Rep Power: 17 |
Hi anon_a,
Thank you for the help! Cheers! Senthil |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] mesh airfoil NACA0012 | anand_30 | OpenFOAM Meshing & Mesh Conversion | 13 | March 7, 2022 17:22 |
CFX13 Post Periodic interface | EtaEta | CFX | 7 | December 8, 2011 17:15 |
channelFoam for a 3D pipe | AlmostSurelyRob | OpenFOAM | 3 | June 24, 2011 13:06 |
[blockMesh] BlockMesh FOAM warning | gaottino | OpenFOAM Meshing & Mesh Conversion | 7 | July 19, 2010 14:11 |
Boundary conditions? | Tom | Main CFD Forum | 0 | November 5, 2002 01:54 |