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

Sacconi, Andrea a.sacconi11 at imperial.ac.uk
Fri May 17 16:05:21 CEST 2013


Hi Martin, hi all,

many thanks for your answer!
Your code is very helpful, and it works.

I only have one additional question: is there any relationship between the label "indexInInside" and the labels of the vertices?
I mean, if the indexInInside is 2, I would expect to get the vertices labelled 0 and 1 as its corners, but sometimes it is not the case.
Is mine a fair assumption, or is it a symptom that I am messing up somewhere?

Actually, the question can be generalised to the 3D case: could I have a label "indexInInside" equal to 2, and three corners {0, 2, 3}, instead of {0, 1, 3}?

Thanks a lot!

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

________________________________________
From: dune-bounces+a.sacconi11=imperial.ac.uk at dune-project.org [dune-bounces+a.sacconi11=imperial.ac.uk at dune-project.org] on behalf of Martin Nolte [nolte at mathematik.uni-freiburg.de]
Sent: 04 May 2013 23:07
To: dune at dune-project.org
Subject: Re: [Dune] Local index of vertices and vertices w.r.t. intersections

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

_______________________________________________
Dune mailing list
Dune at dune-project.org
http://lists.dune-project.org/mailman/listinfo/dune




More information about the Dune mailing list