I am hoping to start (very slowly) on implementing some form of a computational photonics/electromagnetism package. I know things like Meep, S4, FDTD++, EMPy, and a host of other proprietary/free/closed source tools exist, but this is more about hopefully getting a long-term project for myself that I can use as a multi-language, multi-level learning experience.
Given this, I have a few questions, in decreasing order of how much they have stumped me so far. Direct references to libraries, frameworks, and/or books/papers that can help me gain insight into these questions are greatly appreciated.
- How does one implement geometry? How do I state the location, orientation, of my polygons, or circles, spheres, et al?
- How does one go about meshing? And giving physical qualities to the geometric objects that have been meshed? For example, how do I go about adding my permittivity to my objects? It can't all just be spamming
if-then-elsestatements that return epsilon, can it? If it is, how is this even implemented? Are all the
if-then-elsestatements dealt with at the very beginning before we start simulating?
- For a scalar finite difference, say, 2nd derivative, I've seen it being applied using a sparse matrix, and also as a convolution kernel. Are there any benefits of one over the other?
- Is there any way to apply vector derivatives (the curl, in particular) using either sparse matrices, or convolution kernels, or are loops the only way to go about this?
- Any other resources that one may have encountered in this particular area are welcome.