Skip to content

Commit 9afbfd4

Browse files
committed
Revert "remove_indices formmanup"
This reverts commit 813e3c3.
1 parent c0a094d commit 9afbfd4

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

firedrake/formmanipulation.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
from firedrake.petsc import PETSc
1111
from firedrake.ufl_expr import Argument
12-
from tsfc.ufl_utils import remove_indices
1312

1413

1514
class ExtractSubBlock(MultiFunction):
@@ -134,7 +133,7 @@ def argument(self, o):
134133

135134

136135
@PETSc.Log.EventDecorator()
137-
def split_form(form, diagonal=False, do_simplify=True):
136+
def split_form(form, diagonal=False):
138137
"""Split a form into a tuple of sub-forms defined on the component spaces.
139138
140139
Each entry is a :class:`SplitForm` tuple of the indices into the
@@ -170,8 +169,6 @@ def split_form(form, diagonal=False, do_simplify=True):
170169
assert len(shape) == 2
171170
for idx in numpy.ndindex(shape):
172171
f = splitter.split(form, idx)
173-
if do_simplify:
174-
f = remove_indices(f)
175172
if len(f.integrals()) > 0:
176173
if diagonal:
177174
i, j = idx

firedrake/slate/static_condensation/la_utils.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,7 @@ def __init__(self, prefix, Atilde, K, KT, pc, vidx, pidx, non_zero_saddle_mat=No
316316
self.inner_S_inv_hat = self.build_inner_S_inv()
317317

318318
def _split_mixed_operator(self):
319-
# Note that if the subform (successfully) simplifies to Zero(),
320-
# the subform will no longer carry arguments, which slate uses
321-
# to determine the shape of the Matrix. As a workaround, we
322-
# set a flag to not simplify the subforms.
323-
split_mixed_op = dict(split_form(self.Atilde.form, do_simplify=False))
319+
split_mixed_op = dict(split_form(self.Atilde.form))
324320
id0, id1 = (self.vidx, self.pidx)
325321
A00 = Tensor(split_mixed_op[(id0, id0)])
326322
self.list_split_mixed_ops = [A00, None, None, None]
@@ -331,12 +327,12 @@ def _split_mixed_operator(self):
331327
A11 = Tensor(split_mixed_op[(id1, id1)])
332328
self.list_split_mixed_ops = [A00, A01, A10, A11]
333329

334-
split_trace_op = dict(split_form(self.K.form, do_simplify=False))
330+
split_trace_op = dict(split_form(self.K.form))
335331
K0 = Tensor(split_trace_op[(0, id0)])
336332
K1 = Tensor(split_trace_op[(0, id1)])
337333
self.list_split_trace_ops = [K0, K1]
338334

339-
split_trace_op_transpose = dict(split_form(self.KT.form, do_simplify=False))
335+
split_trace_op_transpose = dict(split_form(self.KT.form))
340336
K0 = Tensor(split_trace_op_transpose[(id0, 0)])
341337
K1 = Tensor(split_trace_op_transpose[(id1, 0)])
342338
self.list_split_trace_ops_transpose = [K0, K1]

tests/slate/test_assemble_tensors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def test_matrix_subblocks(mesh):
246246

247247
# Test individual blocks
248248
indices = [(0, 0), (0, 1), (1, 0), (1, 1), (1, 2), (2, 1), (2, 2)]
249-
refs = dict(split_form(A.form, do_simplify=False),)
249+
refs = dict(split_form(A.form))
250250
_A = A.blocks
251251
for x, y in indices:
252252
ref = assemble(refs[x, y]).M.values

0 commit comments

Comments
 (0)