RuntimeError for higher degree Taylor Hood

Hello dolfinx users,

I’m transitioning from a usual Taylor Hood (P2,P1) to a higher degree Taylor Hood (P3,P2). As the title suggests, I’m having a mysterious RuntimeError in the process.


import ufl
import dolfinx as dfx
from mpi4py.MPI import COMM_WORLD as comm


FE = ufl.FiniteElement("CG",mesh.ufl_cell(),2)
VE = ufl.VectorElement("CG",mesh.ufl_cell(),3,3)
TH=dfx.FunctionSpace(mesh,VE*FE) # Taylor Hodd elements ; stable element pair

Traceback :

Traceback (most recent call last):
  File "***.py", line 11, in <module>
    TH=dfx.FunctionSpace(mesh,VE*FE) # Taylor Hodd elements ; stable element pair
  File "/usr/local/dolfinx-complex/lib/python3.8/dist-packages/dolfinx/fem/", line 421, in __init__
    cpp_dofmap = cpp.fem.create_dofmap(mesh.mpi_comm(), ffi.cast(
RuntimeError: Permuting DOFs for vector elements not implemented.

I’m using dolfinx version I’m very surprised with this behaviour, I expected * to be more tolerant on degrees of provided FunctionSpaces

I don’t have this old version of dolfinx available. Do you get the same behaviour if you define your Taylor Hood element with a ufl.MixedElement?

Nope. Thanks for the hint, I really thought the two formalisms were equivalent

I would strongly suggest updating to the latest version of DOLFINx (0.5.0 released in august), as 0.3.0 was released over a year ago, and 0.3.1 is an intermediate state between 0.3.0 and 0.4.0 (released in april).

I understand your point, I had a bad time during the last update is all.

Actually @nate, the RuntimeError arises with the FunctionSpace not the Cartesian product, so I guess I’m stuck with upgrading

Good news is indeed there’s no problem with 0.5.0.

Syntax adaptation wasn’t nearly as painful as the switch from dolfin to dolfinx too, thanks to the devs for enforcing some backward compatibility !