Skip to content

Commit

Permalink
Simplify [v[0], ..., v[k]] -> v for tensor valued v
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck committed Jan 4, 2025
1 parent 5df0e45 commit 766da29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ufl/tensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __new__(cls, *expressions):
# Simplify [v[0], v[1], ..., v[k]] -> v
if (
all(isinstance(e, Indexed) for e in expressions)
and e0.ufl_operands[0].ufl_shape == (len(expressions),)
and e0.ufl_operands[0].ufl_shape[0] == len(expressions)
and all(e.ufl_operands[0] == e0.ufl_operands[0] for e in expressions)
):
indices = list(chain.from_iterable(e.ufl_operands[1].indices() for e in expressions))
Expand Down

0 comments on commit 766da29

Please sign in to comment.