Skip to content

Commit 76ec367

Browse files
committed
Fixup
1 parent 3bd935e commit 76ec367

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

firedrake/formmanipulation.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,12 @@ def matrix(self, o):
171171
bcs = ()
172172
return AssembledMatrix(tuple(args), bcs, submat)
173173

174+
def interpolate(self, o, operand):
175+
if isinstance(operand, Zero):
176+
return ZeroBaseForm(o.arguments())
177+
178+
return o._ufl_expr_reconstruct_(operand)
179+
174180

175181
SplitForm = collections.namedtuple("SplitForm", ["indices", "form"])
176182

firedrake/interpolation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,8 +1767,8 @@ def __init__(self, expr, V, bcs=None, **kwargs):
17671767
for j, sub_interp in firedrake.formmanipulation.split_form(form):
17681768
j = max(j) if j else 0
17691769
# Ensure block sparsity
1770-
vi, operand = sub_interp.argument_slots()
1771-
if not isinstance(operand, ufl.classes.Zero):
1770+
if not isinstance(sub_interp, ufl.ZeroBaseForm):
1771+
vi, operand = sub_interp.argument_slots()
17721772
Vtarget = vi.function_space().dual()
17731773
adjoint = vi.number() == 1 if isinstance(vi, Coargument) else True
17741774

@@ -1780,9 +1780,9 @@ def __init__(self, expr, V, bcs=None, **kwargs):
17801780
Isub = Interpolator(sub_interp, Vtarget, bcs=sub_bcs, **kwargs)
17811781
self.sub_interpolators[indices] = Isub
17821782

1783-
self.callable = self._callable
1783+
self.callable = self._get_callable
17841784

1785-
def _callable(self):
1785+
def _get_callable(self):
17861786
"""Assemble the operator."""
17871787
shape = tuple(len(a.function_space()) for a in self.arguments)
17881788
Isubs = self.sub_interpolators

0 commit comments

Comments
 (0)