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

Fixup

parent 06ffc036
No related branches found
No related tags found
No related merge requests found
from ufl.classes import Sum
from ufl.algorithms import MultiFunction from ufl.algorithms import MultiFunction
...@@ -37,7 +38,7 @@ class UFLValidityChecker(MultiFunction): ...@@ -37,7 +38,7 @@ class UFLValidityChecker(MultiFunction):
def sum(self, o, topsum): def sum(self, o, topsum):
if topsum: if topsum:
for op in o.operands(): for op in o.operands():
if not isinstance(op, ufl.classes.Sum): if not isinstance(op, Sum):
self.sane = len(MultiFunction.__call__(self, op, True)) == self.rank self.sane = len(MultiFunction.__call__(self, op, True)) == self.rank
else: else:
# If this is sum is not part of the topsum, we treat it as all other expressions # If this is sum is not part of the topsum, we treat it as all other expressions
...@@ -47,7 +48,7 @@ class UFLValidityChecker(MultiFunction): ...@@ -47,7 +48,7 @@ class UFLValidityChecker(MultiFunction):
assert len(o.operands()) == 2 assert len(o.operands()) == 2
if topsum: if topsum:
op = o.operands()[0] op = o.operands()[0]
if not isinstance(op, ufl.classes.Sum): if not isinstance(op, Sum):
self.sane = len(MultiFunction.__call__(self, op, True)) == self.rank self.sane = len(MultiFunction.__call__(self, op, True)) == self.rank
else: else:
return self.expr(o, topsum) return self.expr(o, topsum)
......
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