Closed cianwilson closed 1 year ago
If the argument v is scalar then len(v.ufl_shape) = 0 and choosing the indices based on:
v
len(v.ufl_shape)
oi1 = oi[:-rv] oi2 = oi[-rv:]
is not valid. Specifically v[oi2] will produce the error (see #123):
v[oi2]
Component and shape length don't match.
This PR makes scalar v a special case so that the product can be evaluated as a tensor scalar product.
It also adds a unit test for this case, which fails with current main.
If the argument
v
is scalar thenlen(v.ufl_shape)
= 0 and choosing the indices based on:is not valid. Specifically
v[oi2]
will produce the error (see #123):This PR makes scalar
v
a special case so that the product can be evaluated as a tensor scalar product.It also adds a unit test for this case, which fails with current main.