I update my fenicsx from 0.7.0 to 0.8.0. I learned that:
- Replace all
ufl.FiniteElement
andufl.VectorElement
with the appropriatebasix.ufl.element
- Replace
dolfinx.fem.FunctionSpace
withdolfinx.fem.functionspace
So I use the following codes to create a vector functionspace.
import dolfinx
import basix
from mpi4py import MPI
mesh = dolfinx.mesh.create_box(comm=MPI.COMM_WORLD, points=[[0, 0, 0], [1, 1, 1]], n=[2, 2, 2],
cell_type=dolfinx.mesh.CellType.hexahedron)
element = basix.ufl.element(family="Lagrange", cell=mesh.topology.cell_name(),
degree=1, shape=(mesh.topology.dim,))
fs = dolfinx.fem.functionspace(mesh, element)
But output the errors.
Traceback (most recent call last):
File "/mnt/d/BaiduNetdiskWorkspace/MultiscaleDynamicTOP/code/FEniCSBasedProject/Test/create_func_space.py", line 25, in <module>
fs = dolfinx.fem.functionspace(mesh, element)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/petscdir/petsc3.19/x86_64-linux-gnu-real/lib/python3/dist-packages/dolfinx/fem/function.py", line 668, in functionspace
cpp_element = _cpp.fem.FiniteElement_float64(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Invalid celltype in Nedelec
Process finished with exit code 1