Accessing connectivity for a mesh object

More
5 years 4 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
5 years 4 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
5 years 4 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.103 seconds