diff --git a/python/dune/perftool/loopy/transformer.py b/python/dune/perftool/loopy/transformer.py index 3ad304f1310683d17fbc62c312cebeba6e5e5c4b..71681e958ff46a9121e0b0aee1159bbd18c9057b 100644 --- a/python/dune/perftool/loopy/transformer.py +++ b/python/dune/perftool/loopy/transformer.py @@ -53,11 +53,25 @@ class UFL2LoopyVisitor(ModifiedTerminalTracker, UFL2PymbolicMapper): super(UFL2LoopyVisitor, self).__init__() def coefficient(self, o): - # All trial functions should already be handled by the TrialFunctionExtractor class! + # All trial functions should already be handled assert o.count() != 0 # TODO implement non-trialfunction coefficients raise NotImplementedError + def index_sum(self, o): + from dune.perftool.ufl.shape import determine_shape + + # Define an iname for each of the indices in the multiindex + for i in o.ufl_operands[1].indices(): + shape = determine_shape(o.ufl_operands[0], i) + from dune.perftool.pdelab import name_index + name = name_index(i) + iname(name) + domain(name, shape) + + # Now continue processing the expression + return self.call(o.ufl_operands[0]) + # TODO use multiple inheritance and have a geometry transformer in the pdelab subpackage def facet_area(self, o): from pymbolic.primitives import Variable