Skip to content

Avoid divide by epsilon in macroscopic algorithms #4448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: development
Choose a base branch
from

Conversation

eebasso
Copy link
Contributor

@eebasso eebasso commented Nov 27, 2023

Summary

This PR makes the calculation of alpha and beta in the algorithms of MacroscopicProperties.H more efficient and avoids dividing by the relative permittivity epsilon. The check on epsilon upon initialization is relaxed to require non-negativity instead of strict positivity.

Additional Information

The changes allow for the possibility of epsilon being zero while reducing the numbers of operations to calculate the coefficients. In particular, the number of division operations gets cut from two to one. In the case of beta, an additional multiplication operation is cut. This could be significant since these calculations occur inside the for loops to evolve the E-field.

@ax3l ax3l added enhancement New feature or request component: core Core WarpX functionality labels Nov 27, 2023
@ax3l ax3l requested a review from RemiLehe November 27, 2023 23:40
Copy link
Member

@ax3l ax3l left a comment

Choose a reason for hiding this comment

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

Awesome 👍

Copy link
Member

@RevathiJambunathan RevathiJambunathan left a comment

Choose a reason for hiding this comment

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

Thanks for this PR! Looks good to me!
Were you able to test this, @eebasso with any of the inputs in this PR or any other inputs?

@ax3l
Copy link
Member

ax3l commented Nov 30, 2023

@eebasso just curious: for which (meta?) material is epsilon=0?

@eebasso
Copy link
Contributor Author

eebasso commented Nov 30, 2023

Thanks for this PR! Looks good to me! Were you able to test this, @eebasso with any of the inputs in this PR or any other inputs?

I have not yet tested it. I'll try it soon.

@eebasso just curious: for which (meta?) material is epsilon=0?

According to "N. Garcia, E. V. Ponizovskaya, John Q. Xiao; Zero permittivity materials: Band gaps at the visible. Appl. Phys. Lett. 18 February 2002; 80 (7): 1120–1122", one possible realization would be a dielectric medium with embedded metallic nanoparticles and nanowires. They state

"In the limit of long wavelengths, these composites will behave like a homogeneous medium with zero permittivity that will completely reflect electromagnetic waves."

Furthermore, there are materials such as superconductors that can have negative permittivity at radio frequencies.

… macroscopic-properties-avoid-divide-by-epsilon
@RevathiJambunathan
Copy link
Member

@eebasso would you like to add your test result in the PR description just to double check ? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: core Core WarpX functionality enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants