You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import dolfinx
from mpi4py import MPI
mesh = dolfinx.mesh.create_unit_square(MPI.COMM_WORLD, 1, 1)
V = dolfinx.fem.FunctionSpace(mesh, ("CG", 1))
val = dolfinx.fem.Constant(mesh, 1.0)
expr = dolfinx.fem.Expression(val, V.element.interpolation_points())
which throws
Traceback (most recent call last):
File "$HOME/bb/interpconstant.py", line 7, in <module>
expr = dolfinx.fem.Expression(val*val, V.element.interpolation_points())
File "$HOME/local/local/lib/python3.10/dist-packages/dolfinx/fem/function.py", line 117, in __init__
self._ufcx_expression, module, self._code = jit.ffcx_jit(mesh.comm, (ufl_expression, _X),
File "$HOME/local/local/lib/python3.10/dist-packages/dolfinx/jit.py", line 56, in mpi_jit
return local_jit(*args, **kwargs)
File "$HOME/local/local/lib/python3.10/dist-packages/dolfinx/jit.py", line 211, in ffcx_jit
r = ffcx.codegeneration.jit.compile_expressions([ufl_object], parameters=p_ffcx, **p_jit)
File "$HOME/local/local/lib/python3.10/dist-packages/ffcx/codegeneration/jit.py", line 210, in compile_expressions
ffcx.naming.compute_signature(expressions, _compute_parameter_signature(p)
File "$HOME/local/local/lib/python3.10/dist-packages/ffcx/naming.py", line 62, in compute_signature
signature = ufl.algorithms.signature.compute_expression_signature(expr, rn)
File "$HOME/local/local/lib/python3.10/dist-packages/ufl/algorithms/signature.py", line 118, in compute_expression_signature
terminal_hashdata = compute_terminal_hashdata([expr], renumbering)
File "$HOME/local/local/lib/python3.10/dist-packages/ufl/algorithms/signature.py", line 64, in compute_terminal_hashdata
data = expr._ufl_signature_data_(renumbering)
File "$HOME/local/local/lib/python3.10/dist-packages/ufl/constant.py", line 72, in _ufl_signature_data_
self._ufl_domain._ufl_signature_data_(renumbering), repr(self._ufl_shape),
File "$HOME/local/local/lib/python3.10/dist-packages/ufl/domain.py", line 121, in _ufl_signature_data_
return ("Mesh", renumbering[self], self._ufl_coordinate_element)
KeyError: Mesh(VectorElement(FiniteElement('Lagrange', triangle, 1), dim=2), 0)
The text was updated successfully, but these errors were encountered:
nate-sime
changed the title
Interpolation of dolfinx.fem.Expression containing a dolfinx.fem.Constant failsdolfinx.fem.Expression containing only a dolfinx.fem.Constant fails
Aug 31, 2022
Perhaps I've done something silly, but consider
which throws
The text was updated successfully, but these errors were encountered: