CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Find the common edges shared by two patches (

liu October 20, 2008 15:01

Hi, All In my code, I want
Hi, All

In my code, I want to find the common edges which are shared by two patches, say patch1 and patch 2.

I now I have to loop around all the edges of the patches to compare. But I am too lazy. Did anybody already do this? Or maybe someone could point me to somewhere and save me a lot time?

deepsterblue October 20, 2008 21:48

I can take a guess - Every
I can take a guess -

Every primitivePatch edges() call provides an edge addressing list that spans between 0 and nInternalEdges, and from then on, all edges are patch boundary edges. Comparing boundary edges for patch1 and patch2 should be a much quicker way of obtaining common edges, rather than looping through all of them.

Hope this helps.

All times are GMT -4. The time now is 19:56.