Skip to content

Commit

Permalink
make solve string more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
dham committed Jul 6, 2024
1 parent 3902982 commit 439e791
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions firedrake/adjoint_utils/blocks/solving.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,15 @@ def _init_solver_parameters(self, args, kwargs):
self.assemble_kwargs = {}

def __str__(self):
return "solve({} = {})".format(ufl2unicode(self.lhs),
ufl2unicode(self.rhs))
try:
lhs_string = ufl2unicode(self.lhs)
except AttributeError:
lhs_string = str(self.lhs)
try:
rhs_string = ufl2unicode(self.rhs)
except AttributeError:
rhs_string = str(self.rhs)
return "solve({} = {})".format(lhs_string, rhs_string)

def _create_F_form(self):
# Process the equation forms, replacing values with checkpoints,
Expand Down

0 comments on commit 439e791

Please sign in to comment.