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.

Accessing connectivity for a mesh object

More
4 years 9 months ago #1667 by bhaveshshrimali
I am experimenting with the python interface and trying to obtain a second order mesh. Consider the following MWE:
Code:
# Some code to generate a `geo` object mesh = geo.GenerateMesh(maxh=10) mesh.SecondOrder() Elems = mesh.Elements2D() for elem in Elems: print(elem.vertices)
This outputs only `3` vertices, and if I am correct, the first three. How to access the complete connectivity for each element ? What is a better approach to generate a 6-noded triangular mesh.
More
4 years 9 months ago #1668 by mneunteufel
Hi bhaveshshrimali,

with
Code:
elem.vertices
you get always only the three vertex points of the triangle. Use
Code:
elem.points
instead to get all 6. The first three will coincide with the result from elem.vertices.

Best
Michael
The following user(s) said Thank You: bhaveshshrimali
More
4 years 9 months ago #1670 by bhaveshshrimali
Ah I see, Thanks. Makes complete sense. What I meant was the points on the triangle (and not just the vertices).

Thank you very much!!
Bhavesh
Time to create page: 0.156 seconds