Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

Question to element numbering/indexing

More
4 years 2 months ago #2445 by NilsHM
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:
Code:
elements = [e for e in fes.Elements()]
where the list order matches the element.nr :
Code:
elements[i].nr == i

In C++ I get the element number in two different ways:
Code:
elnr = mip.GetTransformation().GetElementNr();
and
Code:
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:
Code:
elements[i].index
What does that mean?

Thanks for the help!
More
4 years 1 month ago - 4 years 1 month ago #2446 by lkogler
Code:
elements[i].index
tells you which domain (or surface) the element is part of.

The others should all coincide.

Best,
Lukas
Last edit: 4 years 1 month ago by lkogler.
The following user(s) said Thank You: NilsHM
Time to create page: 0.120 seconds