Gmsh: quadrilateral mesh

What do you mean with “the representation uses the DOF’s and a backend triangulation of the mesh”? Do you mean, that even when choosing quadrilaterals, the dolfinx backend uses a triangulation (=triangle-shaped elements)?

Not the dolfinx backend, but Pyvista or Paraview. As far as I know, they triangulate everything in the backend even if you have a polygonal mesh. This is hardly noticeable in 2D, but you can observe it in 3D by performing a warp by vector with a sufficiently high factor.

I have never worked with quadrilaterals before, but what is strange to me is that when removing the line gmsh.model.mesh.setRecombine(2, ps) which in my understanding switches from quadrilaterals to triangles (and doubles the element number, as every quadrilateral is replaced by two triangles, but keeps the DOF number the same), I get almost the same solution.

As you said, the solutions looks similar, but they are not the same. The similarity comes from the location of the dofs, which is the same for both cases that are using Lagrange elements.

A similar case can be observed in the elasticity demo, where you can change tetrahedron by hexahedron for Lagrange elements and observe similar (but no same) results.

Could you help me get an intuition for this?
I understand how the basis functions look like, (e.g. degree 1 triangles and degree 1 quads). The Lagrange, degree 1 quadrilateral basis functions are nonlinear (and seemingly involve terms of degree 2, like e.g. xy if I am not mistaken?), while the triangle basis functions are linear.
Why do we get these visually similar solutions, even when using a completely different mesh shape and basis?

The lowest order quadrilateral element, is a bilinear element because it has the form (ax + b)(cy + d), and when restricted to an edge, they behave like the lowest order triangle element (see for example the book " Finite Elements and Fast Iterative Solvers" from Elman-Silvester). By looking some applications of FEM, like elasticity, you can find that the difference between both elements can be considerable in the study of slender structures, where the numerical locking plays a role.

1 Like