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 8, 2024
1 parent b06040c commit a18ef57
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 a18ef57

Please sign in to comment.