From 766da293153855c58404144cdbf233384caa679d Mon Sep 17 00:00:00 2001 From: Pablo Brubeck Date: Fri, 3 Jan 2025 20:38:34 -0600 Subject: [PATCH] Simplify [v[0], ..., v[k]] -> v for tensor valued v --- ufl/tensors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ufl/tensors.py b/ufl/tensors.py index 3b956e1a5..5b821f792 100644 --- a/ufl/tensors.py +++ b/ufl/tensors.py @@ -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))