Photonics

Photonics

Topics related to Lumerical and more.

Help on running inverse design CWDM 3D topology optmization

    • wcai05
      Subscriber

      Dear Ansys support team,
       
      I have successfully completed the 2D optimization and am moving on to the 3D optimization for the device.
       
      I keep receiving a 'failed to evaluate code' error or a 'simulation did not complete successfully' error for my optimization code.
      I have no clue how to debug my code for these given error messages.
       
      I have attached my scripts to this repo in case you want to take a look at them: https://github.com/wcai05/cwdm_topology_3d
       
      I sincerely hope you can provide any suggestions on the techniques that I can try to make it work.
       
      Thank you for your time and support.
       
      Best regards,
      Wangning

    • anna.wirth-singh
      Ansys Employee

      Hi Wangning,

      Thank you for your question and for sharing your files. I have received them and will take a look. Could you please tell me which version of Lumerical you are using? 

      I was able to replicate your error in 2023 R1. I believe the error is indicating some kind of API connection issue, but I am not sure exactly what is causing it yet.

      Best,

      Anna

    • anna.wirth-singh
      Ansys Employee

      Hi Wangning,

      Unfortunately, it is beyond our support scope for me to deeply investigate your files. However, I can recommend a general troubleshooting process.

      If you navigate to your Lumerical installation folder (usually C:/Program Files/Lumerical) , you should be able to locate the lumapi python files. From there, you can locate the line of code producing the error and try to trace it back to the source.

      Since your 2D optimization completed successfully but the 3D optimization is producing an error, I would suspect the issue may be due to a class or function related to the 3D topology geometries. If you are not using the most recent version of Lumerical, it is recommended that you update. A ‘failed to evaluate code’ error can indicate an issue with the API connection – it is also worth checking that all files your optimization may need (helper functions and py files, for example) are accessible from the working directory. Please check to see if you have an environment variable "LUMERICAL_HOME" defined in your bashrc file (Linux) or system environment variables (Windows). It is recommended that you delete this environment variable. Please see this page on command line warnings for CML compiler, which also utilizes the Python API so the warning is relevant: Command Line Errors and Warnings – Ansys Optics

      I also recommend visiting this page Optimizable Geometry - Python API – Ansys Optics for more information about topology optimization.

      Best,

      Anna

    • wcai05
      Subscriber

      Hi Anna,

      Thank you very much for your support and suggestions. The lumerical version I am using is 2024 R2.3. 

      I'll look into the relevant links you provided and see if I can figure it out.

      Thank you again for your help.

      Best,

      Wangning

    • anna.wirth-singh
      Ansys Employee

      Hi Wangning,

      Thanks, and good luck with your troubleshooting. Since you are using a current version of Lumerical, you should have the most up to date files for lumopt. I still suspect that this particular error has to do with the API connection.

      Best,

      Anna

      • wcai05
        Subscriber

        Hi Anna,

        I just figured out the error. The mesh setting for my simulation was too accurate. I've changed the mesh setting for dz to 80nm and have not encountered any further issues. Thank you for your time.

        Best,

        Wangning

    • anna.wirth-singh
      Ansys Employee

      Hi Wangning,

      I'm glad to hear you figured it out! Thanks for the update. 

      Best,

      Anna

Viewing 5 reply threads
  • You must be logged in to reply to this topic.