Hello everyone,
I was wondering what is the difference between the index notation and the ufl.inner() function. To be more precise, I’m doing the inner product of two rank 2 tensors. When the shapes of these tensors are not compatible I expect to get an error both with index notation and ufl.inner(). However, when I use index notation I obtain some result. How does ufl interpret this shape mismatch and still provide a result?
Consider the following MWE:
import ufl as ufl
i = ufl.Index()
j = ufl.Index()
a = ufl.as_tensor([[0, 0],
[0, 0]])
b = ufl.as_tensor([[0, 0]])
c = a[i,j]*b[i,j]
print(f'Result using index notation: {c}')
c_ = ufl.inner(a,b)
print(f'Result using ufl.inner notation: {c_}')
I guess I’m misunderstanding something in the index notation.
Thanks in advance.