Hello,
My working 0.7 installation was automatically upgraded from Ubuntu 22 PPAs to version 0.8 and is now broken. The following error was issued on previously working code:
Traceback (most recent call last):
File "/home/bill/Cluster/Fenics2020/DielectricResonators/4Resonator/QuadResonatorFilterwMonopole.py", line 183, in <module>
elem = ufl.FiniteElement('Nedelec 1st kind H(curl)', mesh.ufl_cell(), degree=2)
AttributeError: module 'ufl' has no attribute 'FiniteElement'. Did you mean: 'finiteelement'?
I also tried to change the attribute to “finiteelement” and it th efollowing error popped out:
Traceback (most recent call last):
File "/home/bill/Cluster/Fenics2020/DielectricResonators/4Resonator/QuadResonatorFilterwMonopole.py", line 183, in <module>
elem = ufl.finiteelement('Nedelec 1st kind H(curl)', mesh.ufl_cell(), degree=2)
TypeError: 'module' object is not callable
Has anyone else seen this error? How can I fix it?
Thanks for the tip.
Following the Github notes, I added the basix importation lines
from slepc4py import SLEPc
from petsc4py import PETSc
from mpi4py import MPI as nMPI
import basix
import basix.ufl_wrapper
import meshio
import ufl
from dolfinx.mesh import locate_entities_boundary, meshtags
from dolfinx.io import gmshio
from dolfinx import fem
from dolfinx import io
from dolfinx.fem.petsc import LinearProblem
import gmsh
and changed the element creation lines to
elem = basix.ufl_wrapper.create_element('Nedelec 1st kind H(curl)', mesh.ufl_cell().cellname(), degree=2)
V = fem.FunctionSpace(mesh, elem)
u = ufl.TrialFunction(V)
v = ufl.TestFunction(V)
Unfortunately, I get an error that basix.ufl_wrapper does not exist.
ModuleNotFoundError: No module named 'basix.ufl_wrapper'
import basix.ufl_wrapper
What is the correct way to define the element? Is the wrapper under another name?