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

Implement the IndexSum handler correctly

parent 5e072d6c
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
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