Trying to geneterate a 2-D periodic Mesh with second order elements


I’m trying to use NETGEN to generate a 2-D periodic Mesh.

I’m using Windows 10, and my idea is to upload a python file through “Solve/Load Python” from the menu and save the “vol” file I’ll next upload to my code on Matlab.

The problem is: I need second order elements, but I’m not getting how to set this. I made the python file attached to this post, but Netgen gives me the message “AttributeError: ‘ngsolve.comp.Mesh’ object has no attribute ‘SecondOrder’”.

Thank you in advance for any idea that can help me on this.



I’ve been reading the documentations and examples I found online, but I still couldn’t set netgen, using my python code, to generate the mesh with second order triangular element (TRIG6).

The python file I’m using is attached to this post.

Still, any help would be greatly appreciated.



the NGSolve-mesh does not have the SecondOrder method, but the underlying NETGEN mesh does, which can be accessed through the ngmesh attribute:

mesh = Mesh(periodic.GenerateMesh(maxh=0.1))


Thank you! it worked perfectly for what I need