Question to element numbering/indexing

Hello everyone!

I’m working with element indices in python and C++ and I’m getting strange results.

In python I get the element list with:

elements = [e for e in fes.Elements()]

where the list order matches the element.nr :

elements[i].nr == i

In C++ I get the element number in two different ways:

elnr = mip.GetTransformation().GetElementNr();

and

FESpace::Element el elnr = el.Nr();

Is the element numbering the same between the two languages?

I noticed the the python element object also has a index value:

elements[i].index

What does that mean?

Thanks for the help!

elements[i].index tells you which domain (or surface) the element is part of.

The others should all coincide.

Best,
Lukas