From 337d0872148a93c31d5f9402b1857f019d21ec7c Mon Sep 17 00:00:00 2001 From: Pablo Brubeck Date: Sat, 21 Dec 2024 08:49:32 -0600 Subject: [PATCH] Fix tests --- firedrake/assemble.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firedrake/assemble.py b/firedrake/assemble.py index a1d0009eb1..de7baf4f6d 100644 --- a/firedrake/assemble.py +++ b/firedrake/assemble.py @@ -817,8 +817,8 @@ def restructure_base_form(expr, visited=None): return ufl.action(expr, ustar) # -- Case (6) -- # - if isinstance(expr, ufl.FormSum) and all(not isinstance(c, ufl.form.BaseForm) for c in expr.components()): - # Return ufl.Sum + if isinstance(expr, ufl.FormSum) and all(ufl.duals.is_dual(a.function_space()) for a in expr.arguments()): + # Return ufl.Sum if we are assembling a FormSum with Coarguments (a primal expression) return sum(w*c for w, c in zip(expr.weights(), expr.components())) return expr