The distribution of DOFs for P3 element is not uniform?

Hi, I’m working with DOLFINx and I want to use the quadrilateral element with polynomial degree 3, i.e, Q3 elements. But I’m confused about the distribution of the dofs

I read from DefElement that the dofs in Q3 element should distribute uniformly.
I define the function space as follows:

and my codes are written like this

So far I creat a 1\times 1 mesh and define Q3 space on this mesh, and if I print the coordinates of the dofs, I get the following results:

Screenshot from 2023-09-29 16-18-51

It seems like the some dofs are not located at the third points of the square. Are there any bugs in my codes, or this is just what it should be? Thanks in advance.

Non-uniform distribution is beneficial, see: Variants of Lagrange elements — DOLFINx 0.6.0 documentation for details.

1 Like

Hi, thanks for reply. As for the “equispaced” element, did you remove it from dolfinx? I mean, I have try to specify the lagrange_variant, if I write my code as follows

I always get error like:

but I read from https://github.com/FEniCS/basix/blob/main/python/wrapper.cpp, it seems to be correct.
[/quote]

Make sure you are looking at the appropriate version of Basix. Basix, along with dolfinx, changes is API quite rapidly. If you use dolfinx v0.6.x you should use Basix v0.6.y, where x and y indicates different patch releases.

If you use Basix main, then you should use dolfinx main branch

Yes, this is what I did, both of the dolfnx and basix are v0.6.0, and I think the parameter “Lagrange_variant” should have been defined and we just assgin different values. But I don’t know why I can not pass “equispaced” to it, at least I can see from code line 465 in https://github.com/FEniCS/basix/blob/v0.6.0/python/wrapper.cpp, there is this option.

See: Variants of Lagrange elements — DOLFINx 0.6.0 documentation of the Dolfinx v0.6.0 demo