Fixed minor bugs and added functionality. #14
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.
Thank you very much for the code, it has been a big help in my studies and research! I fixed some minor bugs, which might cause problems in very specific cases and added some functionality, if you want to include that.
(1) In structure_base.py on line 136, I changed a y_step to x_step (which has been mentioned in an issue as well), as it is inconsistent. The initial code causes errors if you use a non-uniform grid. There is also the fact that another stepsize is added to x, but not to y. I tried to fix this, but it caused further errors, so I assume this is on purpose.
(2) In structure_base.py on line 372, I removed a +1 stepsize for the discretized height. Even if you choose a stepsize for the layers, such that is correctly discretised (e.g. 10nm stepsize for a 100nm layer), this line of code will still add another self.y_step (in this case 10nm) to the layer thickness and cause it to be larger (110nm) instead. While this might not be an issue for small stepsizes or a low amount of layers, this causes problems for larger stepsizes or many layers, such as in Bragg-mirror structures.
(3) In mode_solver.py I added the functionality to save the x, y values in addition to the electric field amplitude. This was very useful for me in further simulations and I thought it might be useful for others. For now, it's very crude and simply overwrites the initially saved data, such that plotting still works the same, but it works.
If there is any reason as to why (1) and (2) have been done this way, please let me know! Thanks a lot!
Best regards
Alex