Ansys Learning Forum › Forums › Discuss Simulation › Photonics › The two modes overlap the integral › Reply To: The two modes overlap the integral
Hello,
Thank you for your reply. I have looked into the issue further, and I think you need to manually add the desired d-cards to the DECK (right click in the Mode list and "add selected modes to the global deck") prior to using savedcard in order to save all the mode data. In the screenshot below, I added modes 1 and 2 to the deck as shown. If I then save and re-load the data using savedcard() and loaddata(), I do see all modes populate the list, but only global_mode1 and global_mode2 are available for overlap calculations. Please try manually adding the desired modes to the deck and then saving to use the savedcard method.Â
For the script I sent, one possible explanation for the error could be that the data sampling or span in x and y is different for the two modes. The list of coordinates x and y should be the same for all the fields involved in the calculation. Another possibility is the orientation of the fields - this script was written for a waveguide propagating along the z axis. If your structure is oriented differently, the calculation would need to be rotated. Please let me know if these can explain your results.Â
Finally, I want to let you know that an update to the overlap overlap - Script command – Ansys Optics function is in progress (planned for release in 2025 R1) so that the function accepts datasets in addition to d-cards. This will provide additional functionality and will make it much easier to create, save, and load fields to perform overlap calculations. This update will likely be useful for you, but in the meantime I would suggest trying to troubleshoot the script to manually calculate the overlap.Â