Skip to content
Snippets Groups Projects
Commit b49f5321 authored by Dominic Kempf's avatar Dominic Kempf
Browse files

Select components of list tensors if indexed with fixed indices

parent 7d57386a
No related branches found
No related tags found
No related merge requests found
......@@ -232,7 +232,12 @@ class UFL2LoopyVisitor(ModifiedTerminalTracker):
return self._index_or_fixed_index(o)
def list_tensor(self, o):
return self.interface.pymbolic_list_tensor(o)
if all(isinstance(i, int) for i in self.indices):
index = self.indices[0]
self.indices = self.indices[1:]
return self.call(o.ufl_operands[index])
else:
return self.interface.pymbolic_list_tensor(o)
def identity(self, o):
return self.interface.pymbolic_identity(o)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment