dft_energy routines and Scheme wrappers for SWIG #744
Merged
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.
A new
dft_energy
class is added to the namespace which is used to compute the electric (ε|E|2) and magnetic (μ|H|2) energy density from the Fourier-transformed fields. These routines can facilitate e.g. calculating the group velocity of a guided mode. Scheme (but not Python) wrappers for SWIG are included.Once the Python wrappers are added in a separate PR, a test will be created based on computing the group velocity of a waveguide mode using two different methods: (1) as the ratio of the Poynting flux to the energy density and (2) directly via
get_eigenmode_coefficients
involving mode decomposition. The test will verify that these results are nearly identical.Documentation also needs to be added following the test.