Unknown ufl object type MixedElement

Buenas tardes, estoy ejecutando un código y anteriormente me estaba corriendo sin ningún problema, pero ahora tengo inconvenientes. Agradezco alguien que me pueda colaborar.

Parámetros

T = 100 # final time
num_steps = 500 # number of time steps
dt = T / num_steps # time step size
beta=0.0015
mu=0.85 #mu
muh=0.86# mu humanos
D=0.01 #DIFU
#r= 5
Ks=70
Omega= 80
gama=0.6
gama_1= 0.25

Crear la malla y el espacio de funciones

nx = ny = 30
mesh = RectangleMesh(Point(-1, -1), Point(1, 1), nx, ny)
P1 = FiniteElement(‘P’, triangle, degree=1)

element = MixedElement([P1, P1, P1, P1, P1, P1])
V = FunctionSpace(mesh, element)

EL error que me genera es:

Exception Traceback (most recent call last)
Cell In[21], line 36
33 #P1 = FiniteElement(‘P’, interval, 1)
35 element = MixedElement([P1, P1, P1, P1, P1, P1])
—> 36 V = FunctionSpace(mesh, element)
38 #W = FunctionSpace(mesh, ‘P’,1)
39 W = FunctionSpace(mesh, ‘P’, 1)

File /usr/lib/petsc/lib/python3/dist-packages/dolfin/function/functionspace.py:31, in FunctionSpace.init(self, *args, **kwargs)
29 pass
30 elif len(args) == 2:
—> 31 self._init_from_ufl(*args, **kwargs)
32 else:
33 self._init_convenience(*args, **kwargs)

File /usr/lib/petsc/lib/python3/dist-packages/dolfin/function/functionspace.py:42, in FunctionSpace._init_from_ufl(self, mesh, element, constrained_domain)
39 ufl.FunctionSpace.init(self, mesh.ufl_domain(), element)
41 # Compile dofmap and element
—> 42 ufc_element, ufc_dofmap = ffc_jit(element, form_compiler_parameters=None,
43 mpi_comm=mesh.mpi_comm())
44 ufc_element = cpp.fem.make_ufc_finite_element(ufc_element)
46 # Create DOLFIN element and dofmap

File /usr/lib/petsc/lib/python3/dist-packages/dolfin/jit/jit.py:50, in mpi_jit_decorator..mpi_jit(*args, **kwargs)
48 # Just call JIT compiler when running in serial
49 if MPI.size(mpi_comm) == 1:
—> 50 return local_jit(*args, **kwargs)
52 # Default status (0 == ok, 1 == fail)
53 status = 0

File /usr/lib/petsc/lib/python3/dist-packages/dolfin/jit/jit.py:100, in ffc_jit(ufl_form, form_compiler_parameters)
98 p.update(dict(parameters[“form_compiler”]))
99 p.update(form_compiler_parameters or {})
→ 100 return ffc.jit(ufl_form, parameters=p)

File ~/.local/lib/python3.10/site-packages/ffc/jitcompiler.py:214, in jit(ufl_object, parameters, indirect)
211 set_prefix(parameters[“log_prefix”])
213 # Make unique module name for generated code
→ 214 kind, module_name = compute_jit_prefix(ufl_object, parameters)
216 # Inspect cache and generate+build if necessary
217 module = jit_build(ufl_object, module_name, parameters)

File ~/.local/lib/python3.10/site-packages/ffc/jitcompiler.py:156, in compute_jit_prefix(ufl_object, parameters, kind)
154 object_signature = repr(ufl_object)
155 else:
→ 156 error(“Unknown ufl object type %s” % (ufl_object.class.name,))
158 # Compute deterministic string of relevant parameters
159 parameters_signature = compute_jit_parameters_signature(parameters)

File :1, in (*message)

File ~/.local/lib/python3.10/site-packages/ufl/log.py:172, in Logger.error(self, *message)
170 “Write error message and raise an exception.”
171 self._log.error(*message)
→ 172 raise self._exception_type(self._format_raw(*message))

Exception: Unknown ufl object type MixedElement

Hola @dokken me podria colaborar con con está duda, gracias quedo pendiente.

You surely have a mixture of different installations.

/usr/lib/petsc/lib/python3/dist-packages/dolfin/function/functionspace.py seems to be an instalation from apt, while ~/.local/lib/python3.10/site-packages/ffc/ and ~/.local/lib/python3.10/site-packages/ufl/log.py are local installations.

Delete anything which is FEniCS related from ~/.local/lib/python3.10/.

Finally, english is the official languange in this discourse forum. Please make an effort to write in english. While it’s not a big deal for me (an italian person) to read spanish, other people will find it much more difficult.

1 Like

Thank you very much!