Hello,
I would like to define a variational problem that uses a mixed function space on a 2D domain in dolfinx. Here is how I define the 2D domain:
L = 1
W = 0.1
domain = mesh.create_rectangle(MPI.COMM_WORLD, [np.array([0, -W/2]), np.array([L, W/2])], [2, 2], cell_type=mesh.CellType.triangle)
Next, I would like the mixed function space to handle a 3D displacement field, with
Vy = ufl.VectorElement('Lagrange', domain.ufl_cell(), degree=1, dim = 3)
and 3 Lagrange multipliers, uniform over the domain, like so
Vp = ufl.VectorElement('Real', domain.ufl_cell(), dim=3)
However, it seems that I cannot assemble these two components:
V = dolfinx.fem.FunctionSpace(domain, ufl.MixedElement([Vy, Vp]))
yields an error:
File ~/anaconda3/envs/fenicsx-0.5.1/lib/python3.9/site-packages/basix/ufl_wrapper.py:1269, in convert_ufl_element(element)
1266 if family_name == "DPC":
1267 discontinuous = True
-> 1269 family_type = _basix.finite_element.string_to_family(family_name, element.cell().cellname())
1270 cell_type = _basix.cell.string_to_type(element.cell().cellname())
1272 variant_info = {
1273 "lagrange_variant": _basix.LagrangeVariant.unset,
1274 "dpc_variant": _basix.DPCVariant.unset
1275 }
File ~/anaconda3/envs/fenicsx-0.5.1/lib/python3.9/site-packages/basix/finite_element.py:87, in string_to_family(family, cell)
84 if family in families:
85 return families[family]
---> 87 raise ValueError(f"Unknown element family: {family} with cell type {cell}")
ValueError: Unknown element family: Real with cell type triangle
Many thanks in advance for your help!