Repository navigation
Fix plane-wave fields at the poles (ϑ = 0, π) - #29
Open
denizkuzucu wants to merge 1 commit into
Open
denizkuzucu wants to merge 1 commit into
denizkuzucu wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #29 +/- ##
==========================================
- Coverage 98.41% 98.40% -0.02%
==========================================
Files 39 39
Lines 2206 2192 -14
==========================================
- Hits 2171 2157 -14
Misses 35 35 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi! In the plane-wave expansion, the associated Legendre functions were computed and divided by sinϑ. At the poles, the cutoff used to avoid division introduced jumps, and at exactly
cosϑ = ±0.999999, none of the three branches is taken, so the field returns zero. This PR uses the angular functions πₙ = Pₙ¹(cosϑ)/sinϑ and τₙ = dPₙ¹(cosϑ)/dϑ (Bohren & Huffman, Absorption and Scattering of Light by Small Particles, Sec. 4.3).The existing sign convention (P₁¹ = −sinϑ) is kept, and the coefficients aₙ, bₙ, cₙ, and dₙ are unchanged.
A test is added to
test/electromagnetics/planeWave.jlto check the continuity of E, H, and the far field near and exactly at the poles.