Skip to content

Commit

Permalink
only loop over bcs if there are any
Browse files Browse the repository at this point in the history
  • Loading branch information
emmarothwell1 committed Apr 25, 2024
1 parent a74740f commit 4d50879
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions firedrake/variational_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ def __init__(self, F, u, bcs=None, J=None,
self.J = J or ufl_expr.derivative(F, u)
self.F = F
self.Jp = Jp
for bc in bcs:
if isinstance(bc, EquationBC):
restrict = False
if bcs:
for bc in bcs:
if isinstance(bc, EquationBC):
restrict = False
self.restrict = restrict

if restrict and bcs:
Expand Down

0 comments on commit 4d50879

Please sign in to comment.