Skip to content

Correct dtype of output of ufl.real#825

Merged
jorgensd merged 6 commits intomainfrom
dokken/correct-dtype-ffcx
Mar 20, 2026
Merged

Correct dtype of output of ufl.real#825
jorgensd merged 6 commits intomainfrom
dokken/correct-dtype-ffcx

Conversation

@jorgensd
Copy link
Member

ufl.real(something) gave a complex valued output, breaking conditionals like ufl.conditional(ufl.real(...)>0, a, b)
in complex mode.
Reported at:
https://fenicsproject.discourse.group/t/error-with-ufl-condition-in-complex-valued-problems/19611?u=dokken

Copy link
Contributor

@nate-sime nate-sime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Just need to ensure ufl.imag also yields a real number.

jorgensd and others added 2 commits March 19, 2026 21:42
Same handling in both expression and integral

Co-authored-by: Jørgen Schartum Dokken <dokken92@gmail.com>
@coveralls
Copy link

coveralls commented Mar 20, 2026

Coverage Status

coverage: 84.597% (+0.02%) from 84.581%
when pulling bd697e3 on dokken/correct-dtype-ffcx
into 372d4a7 on main.

@jorgensd jorgensd added this pull request to the merge queue Mar 20, 2026
Merged via the queue into main with commit 5dcb90e Mar 20, 2026
33 checks passed
@jorgensd jorgensd deleted the dokken/correct-dtype-ffcx branch March 20, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants