Skip to content

Conversation

@jzitelli
Copy link
Contributor

This is a minimal change addressing the issue raised in #3557

@garth-wells
Copy link
Member

We aim to have demos and tests run (near) identical code in real and complex cases. Otherwise testing is problematic. Can you make the real case run the same code? Setting the NumPy type should discard the complex part when computing with reals.

Also, run ruff to format the Python code.

@jzitelli
Copy link
Contributor Author

Thank you for the feedback, I was indeed able to consolidate the real/complex code paths. In the real mode the script will simply solve for the real part of the complex exponential (I updated the introductory comments accordingly). I also fixed the lint errors found using ruff.

@garth-wells garth-wells added the demo New demo or demo enhancements/improvements label Dec 23, 2024
@garth-wells
Copy link
Member

Resolves #3557

@garth-wells garth-wells added this pull request to the merge queue Dec 23, 2024
Merged via the queue into FEniCS:main with commit 76080fb Dec 24, 2024
20 checks passed
schnellerhase pushed a commit to schnellerhase/fenics-dolfinx that referenced this pull request Dec 28, 2024
…mode (FEniCS#3563)

* modify demo_helmholtz.py to solve for plane wave solution in complex mode

* consolidate code b/t real and complex modes; ruff linter fixes

* Run ruff format

* Small tidy up

---------

Co-authored-by: Garth N. Wells <gnw20@cam.ac.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

demo New demo or demo enhancements/improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants