[Dune] Local index of vertices and vertices w.r.t. intersections

Martin Nolte nolte at mathematik.uni-freiburg.de
Sun May 5 00:07:22 CEST 2013


Hi Andrea,

it seems to me that you only want to know the local vertex indices of a given 
edge within a triangle. This information can be obtained from the reference 
element (method subEntity).

For (non-periodic) boundary intersections you can be sure that they always 
coincide with a codim-1 subentity (in your case an edge) of the inside element. 
The local number of this edge is provided by the method indexInInside.

The code you prining your vertex numbers could look as follows:

const ReferenceElement< ctype, 2 > &refTriangle
   = ReferenceElements< ctype, 2 >::simplex();
const int edge = intersection.indexInInside();
for( int k = 0; k < 2; ++k )
{
   std::cout << "{" << refElement.subEntity( edge, 1, k, 2 )
             << ", " << refElement.subEntity( edge, 1, k, 2 )
             << "}" << std::endl:
}

Please note: intersection.geometry() might enumerte the positions of these 
vertices in opposite order. If you're willing to compare coordinates, you can 
also reverse engineer the information you desire from 
intersection.geometryInInside() including the correct ordering.

I don't know whether this answers your question, but hopefully it helps a little.

Best,

Martin


On 05/04/2013 06:36 PM, Sacconi, Andrea wrote:
> Hi all,
>
> sorry to bother you again, but I realise that yesterday I asked a question
> putting a wrong title, so I got the right tip, but I had something else in mind.
>
> Anyway, suppose you are using AlbertaGrid and you have your triangle, with three
> vertices with local indices 0, 1, 2 respectively.
> If I want to access the three boundary edges, I call the Intersection Iterator,
> and with intersectionIter -> corner(0) I get *for the current edge* the
> coordinates of the 0-th vertex, and similarly for the 1-st.
> Well, to which indices in {0, 1, 2} of the underlying triangle do the
> "corner(0)" and "corner(1)" correspond?
>
> Yesterday I asked about global index, my mistake. I meant the *local* indices,
> w.r.t. the triangle, i.e., the responses have to be {0, 1}, {1, 2} and {0, 2}
> (maybe with permutation(s) in the pair(s)).
> I can't associate the current intersection to the original local indices.
> Hope that now I have put the question more clearly!
> I apologise again, it was my fault.
>
> Cheers,
> Andrea
> __________________________________________________________
>
> Andrea Sacconi
> PhD student, Applied Mathematics
> AMMP Section, Department of Mathematics, Imperial College London,
> London SW7 2AZ, UK
> a.sacconi11 at imperial.ac.uk
>
>
> _______________________________________________
> 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