[Dune] uggrid<2> global vertex id order incorrect?

Lars Lubkoll lubkoll at zib.de
Tue Apr 10 15:34:39 CEST 2012


Hi,

I have some questions concerning the ordering and access of vertices in 
a UGGrid<2>. What I would like to do is the following:
When "sitting" on a codim-1 entity (an edge) I want to get the edge's 
corners global vertex ids and their coordinates.

To access the global vertex id, I did the following:
I first used the GenericReferenceElement's subEntity function to map the 
local corner id in the edge onto its local id in the triangle. Then I 
used the IndexSet's subIndex function to get the global vertex id.

Now I had 2 choices to access the corresponding coordinates:
a: using Intersection::geometry()::corner(localCornerIdInEdge)
b: using a Codim<dim>::Iterator

- (b) seems to work correctly, but is nor elegant or efficient as the 
iterator does not support random access and consequently I have to use 
the increment-operator:(.
- (a) does invert the order of the corners of edge 1 (local index wrt to 
the triangle containing this edge)

This behaviour is illustrated in "grid_id_test.cpp", which may be easier 
to understand than my explanation, in the appendix and leads me to the 
following questions:

1. Am I just doing something wrong?
2. If not is the above behaviour intended?
3. Is there a way to directly access a vertex via its global id?

Kind regards,


Lars Lubkoll

P.S.: I am using Dune2.0, gcc4.3.2 and UGGrid<2>.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: grid_id_test.cpp
Type: text/x-c++src
Size: 3305 bytes
Desc: not available
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20120410/425dd7e6/attachment.cpp>


More information about the Dune mailing list