[Dune] Extract neighbouring element opposite to a certain vertex

Martin Nolte nolte at mathematik.uni-freiburg.de
Thu Feb 25 15:41:51 CET 2016


Hi Marco,

yes, you have to iterate over all intersections to find the corresponding 
neighboring entity (I assume you are using a conforming grid, otherwise the 
neighbor will not be unique).

You seek the intersection satisfying

indexInIndide() == Entity::dimension - vtxIdx.

Note that, in general, the world dimension does not coincide with the 
dimension (though I guess it does in your case).

As to your second question: There is no guarantee on the order the faces are 
traversed in.

Best,

Martin

On 02/25/2016 03:29 PM, Agnese, Marco wrote:
> Hi,
>
> I have a simplex entity and I want to extract the neighbouring element
> opposite to the vertex with local index vtxIdx.
>
> Therefore I need to find the intersection opposite to this vertex.
>
> This intersection has local index faceIdx=worlddim-vtxIdx. Is it right?
>
>
> So if I extract entity.template subEntity<1>(faceIdx) I should be able to
> extract this face. Am I correct? But the face extracted in this way is not an
> intersection therefore I can't use it to find the neighbouring entity. Is
> there a solution here?
>
>
> The other solution is to loop over the intersections and extract the vtxIdx-th
> one. But does it work always? Or which is the ordering of this intersections?
>
> I would expect to have them sorted accordingly the face local index (so
> faceIdx) but that seems not to be the case. What am I missing?
>
>
> Thank you very much for your help,
>
> cheers,
>
> Marco.
>
>
>
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
>

-- 
Dr. Martin Nolte <nolte at mathematik.uni-freiburg.de>

Universität Freiburg                                   phone: +49-761-203-5630
Abteilung für angewandte Mathematik                    fax:   +49-761-203-5632
Hermann-Herder-Straße 10
79104 Freiburg, Germany




More information about the Dune mailing list