Access auxiliary nodes in curved elements

Hello,

is it possible to access the additional nodes that are generated on curved meshes?
Background: I’d like to write the mesh to interface another solver for comparison. This solver uses curved TET10 (& TRIA6 ) elements.
Up to now I can only write the 4 main nodes, but I’d like to also write the additional 6 nodes in the center of the edges.

Thank you, Jörg

Hi Jörg,

wie have two possibilities for curved elements:

ngmesh.SecondOrder()

(where ngmesh is a Netgen-Mesh). Here we replace Tet4 by Tet10 elements, and we store edge-midpoints with the mesh points. It’s easy to exchange with external software.

The other option is

mesh.Curve(5)

(for an NGSolve-Mesh). Here we represent the mapping by hierarchical p-version finite element functions. Here we don’t compute edge midpoints. It"s less trivial (but also doable) to exchange with external software, since there is no standard for the polynomial basis for the curved elements.

Joachim

Thanks Joachim,

the option
ngmesh.SecondOrder()
would be a good solution. I am currently however using OCC for modeling the geometry, and then it seems I generate the mesh with NGsolve. So the command SecondOrder() yields an error.

Is it possible to either

  • use NETGEN for meshing the OCC geometry, or
  • to transform the NGsolve meshes into NETGEN meshes?

Cheers Jörg

Hi Jörg,
can you give details what the error is you are seeing? For me it works with occ:


from netgen.occ import *
from ngsolve import Mesh

s = Sphere((0,0,0), 1)
geo = OCCGeometry(s)
mesh = geo.GenerateMesh()
mesh.SecondOrder()
mesh.Save("sphere.vol.gz")
mesh = Mesh(mesh)
Draw(mesh)

Best
Christopher

Hi Christopher,

now I also get a curved mesh, thanks.
But how do I access the nodes of a TET or a TRIA?
When I use the command below, I get only the main nodes of the TETs:

for el in mesh.Elements(VOL):
print ("vertices: ", el.vertices) # get vertices of an element

vertices: (V907, V2026, V2075, V2060)
vertices: (V907, V909, V2026, V2060)
vertices: (V741, V868, V1600, V1599)
vertices: (V2005, V3247, V3261, V3264)

Cheers Jörg

Hi Jörg,

el.vertices will return only the vertices.
The netgen mesh can access all points via el.points

for el in mesh.ngmesh.Elements3D():
    print ("points: ", el.points) # get points of an element
    print ("vertices: ", el.vertices) # get vertices of an element

Best,
Michael