Skip to content
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

Enhancement: Medium Evaluation #415

Closed
smartalecH opened this issue Jul 11, 2018 · 7 comments · Fixed by #919
Closed

Enhancement: Medium Evaluation #415

smartalecH opened this issue Jul 11, 2018 · 7 comments · Fixed by #919

Comments

@smartalecH
Copy link
Collaborator

Along with #398, it would be nice to simply evaluate a Medium at a given frequency point and return the complex permittivity. This would be useful for verifying that a given dispersion profile really is what you intend. It's all too easy to incorrectly convert one dispersion format to Meep's...

This would also enable the same dispersion material definitions within MPB and the frequency domain solver.

@stevengj
Copy link
Collaborator

Yes, that would be nice. We've also discussed adding a frequency argument to output-epsilon or similar in order to output the dielectric profile evaluated at a given frequency.

@smartalecH
Copy link
Collaborator Author

I agree that would also be useful.

Do the eigenmode source and eigenmode expansion features currently support material dispersion? If not, would this be a viable way to enable that feature?

@stevengj
Copy link
Collaborator

No, MPB does not support dispersive materials and doesn't support lossy materials.

@smartalecH
Copy link
Collaborator Author

If this hasn't been assigned to anyone, I'm willing to work on this feature (I need it for my research).

@stevengj
Copy link
Collaborator

stevengj commented Aug 1, 2018

Since all the susceptibilities are of the form χ = σ f(ω) (where f is a scalar and σ can be a tensor), we basically just need to give f(ω). Probably should start with a virtual method double susceptibility::chi1(double freq, double sigma=1) in C++ with a corresponding method in lorentzian_susceptibility that returns σ f(ω) for a scalar σ that defaults to 1.

@smartalecH
Copy link
Collaborator Author

Sorry this is taking so long. I'm still learning to balance my various research projects with a newborn...

I have a few questions regarding your preferred implementation:

Would it be practical to create a member function within medium_struct that loops through each susceptibility within its corresponding E_susceptibilities list, summing up each call to susceptibility::chi1? i.e. double medium_struct::get_chi1(double freq) could cleanly and natively account for multiple susceptibilities and for predefined sigmas. This function could even return a tensor for anisotropic materials (i.e σ is a tensor).

This approach seems to encourage a more object-oriented description of the Medium class in both python and C++. It could also (temporarily) enable dispersion within the eigenmode source/ deomposition features by adding it to the meep_mpb_eps() function (I'm looking at a possible alternative to the get_chi1inv () function).

Or would you prefer to leave everythin to the user and stick strictly with the susceptibility::chi1 member function? This approach seems easier to implement with the swig interface since the susceptibilities are explicately defined, while the python Medium class doesn't appear to have an explicit mapping to the C++ backend.

I may be misinterpreting several of these C++ functions so please set me straight! It's a lot of code to parse through...

@stevengj
Copy link
Collaborator

To start with, I think we should have just a susceptibility::chi1(double freq) function.

Once that is built, additional functionality can be built on top of that, e.g. to interpolate σ(x) for a given point x, evaluate ε for a medium, etcetera.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants