Hello,
I’ve encountered an issue with the UFL library that prevents me from working with indexed expressions and halts me with the following error. For example, for the simple program below, which was provided as an answer to one of the topics here, it gives me the following error.
the program:
from dolfin import *
from ufl import indices
mesh = UnitSquareMesh(5,5)
V = VectorFunctionSpace(mesh, ‘CG’,1)
A = Constant(((1,2), (3,4)))
x = Constant((5,6))
i,j = indices(2)
u = as_vector(A[i,j]*x[i], (j))
v = project(u, V)
and the error:
Not expecting i_8.
Traceback (most recent call last):
File /usr/lib/python3/dist-packages/spyder_kernels/py3compat.py:356 in compat_exec
exec(code, globals, locals)
File ~/Desktop/WorkDir/Paper/ufltest.py:12
u = as_vector(A[i,j]*x[i], (j))
File /usr/lib/python3/dist-packages/ufl_legacy/exproperators.py:438 in _getitem
all_indices, slice_indices, repeated_indices = create_slice_indices(component, shape, self.ufl_free_indices)
File /usr/lib/python3/dist-packages/ufl_legacy/index_combination_utils.py:166 in create_slice_indices
error(“Not expecting {0}.”.format(ind))
File /usr/lib/python3/dist-packages/ufl_legacy/log.py:158 in error
raise self._exception_type(self._format_raw(*message))
UFLException: Not expecting i_8.
Does anyone know where the source of this problem might be?