Generation of second-order triangular meshes in legacy FEniCS

For a higher order grid you have to have some specific order you traverse node. For instance, for a higher order (2nd order triangle) degrees of freedom appears on the faces of each element. You need to loop through these in a consistent order.
VTK, GMSH and DOLFINx operate with different ways of doing this.
See for instance


From
DefElement Defilement that shows the dolfinx ordering, while VTK uses
image

from https://www.kitware.com/modeling-arbitrary-order-lagrange-finite-elements-in-the-visualization-toolkit/
perm_vtk in dolfinx maps the transformation from one to the other.

This has to go through mesheditor, as it is the only way of constructing meshes in legacy dolfin.

I would strongly suggest to move to dolfinx, as you would have to add these feature to legacy dolfin yourself (as we as volunteers don’t have time to maintain and update a deprecated software).

There has in addition been made several other improvements to dolfinx, supporting arbitrary order meshes (legacy dolfin is restricted to second order).

Also the code compilation of such forms are way better in dolfinx.