Open diego-hayashi opened 4 days ago
One possible fix:
diff --git a/firedrake/variational_solver.py b/firedrake/variational_solver.py
index bba281bc1..430a9c311 100644
--- a/firedrake/variational_solver.py
+++ b/firedrake/variational_solver.py
@@ -366,7 +366,7 @@ class LinearVariationalProblem(NonlinearVariationalProblem):
else:
if not isinstance(L, (ufl.BaseForm, slate.slate.TensorBase)):
raise TypeError("Provided RHS is a '%s', not a Form or Slate Tensor" % type(L).__name__)
- if len(L.arguments()) != 1:
+ if len(L.arguments()) > 1:
raise ValueError("Provided RHS is not a linear form")
F = ufl_expr.action(J, u) - L
Describe the bug When solving the Stokes equations that were defined with
TrialFunction
, Firedrake returns an error.Steps to Reproduce Run the following code, which is based on stokes-topology-rol-firedrake.py, and set to run with
TrialFunction
:Expected behavior The code should have run fine.
Error message
Additional Info If the line
L = rhs(F)
, which is a form of theempty
type, is changed toL = Constant(0.)*q*dx
, Firedrake is able to solve the equation.