Skip to content

Commit

Permalink
ufl2unicode fail (FEniCS#237)
Browse files Browse the repository at this point in the history
* In a recent change to UFL, subdomain_id was transformed from a single value to a tuple. This broke some assumptions in ufl2unicode that I have fixed here.

* Update ufl/formatting/ufl2unicode.py

Co-authored-by: Connor Ward <[email protected]>

* Update ufl/formatting/ufl2unicode.py

Co-authored-by: Connor Ward <[email protected]>

* Update ufl/formatting/ufl2unicode.py

Co-authored-by: Connor Ward <[email protected]>

* Update ufl/formatting/ufl2unicode.py

Co-authored-by: Connor Ward <[email protected]>

---------

Co-authored-by: Connor Ward <[email protected]>
  • Loading branch information
Ig-dolci and connorjward authored Nov 3, 2023
1 parent 372a93b commit 0fe782c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions ufl/formatting/ufl2unicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,15 @@ def get_integral_symbol(integral_type, domain, subdomain_id):

# TODO: Render domain description

if isinstance(subdomain_id, numbers.Integral):
istr += subscript_number(int(subdomain_id))
elif subdomain_id == "everywhere":
pass
elif subdomain_id == "otherwise":
istr += "[rest of domain]"
elif isinstance(subdomain_id, tuple):
istr += ",".join([subscript_number(int(i)) for i in subdomain_id])
subdomain_strs = []
for subdomain in subdomain_id:
if isinstance(subdomain, numbers.Integral):
subdomain_strs.append(subscript_number(int(subdomain)))
elif subdomain == "everywhere":
pass
elif subdomain == "otherwise":
subdomain_strs.append("[rest of domain]")
istr += ",".join(subdomain_strs)

dxstr = ufl.measure.integral_type_to_measure_name[integral_type]
dxstr = measure_font(dxstr)
Expand Down

0 comments on commit 0fe782c

Please sign in to comment.