January 21, 2022 at 6:59 pmwcai05Subscriber
Hi, I wonder what's the equivalent python command for the following lumerical script?
pole = [0,0; 1,9; 6,9.8; 10,10]*1e-6; set("poles",pole);
Thank youJanuary 24, 2022 at 8:41 pmJanuary 25, 2022 at 6:41 amJanuary 28, 2022 at 1:55 amKyleAnsys Employee
That function should take a lumapi.MODE object as an argument and set up the simulation with the required objects, as described on this page: Getting Started with lumopt - Python API. This page has an example that uses this approach: https://support.lumerical.com/hc/en-us/articles/360042305274
Also, note that you are passing the function itself to the Optimization constructor, so you shouldn't be calling the function in line 108 in your second screenshot.
January 28, 2022 at 2:42 amFebruary 5, 2022 at 8:46 pmFebruary 7, 2022 at 8:54 pmKyleAnsys EmployeeThe created source might be outside the simulation region. If you open the simulation created by the script, is there a plane wave source with the name "source" inside the simulation region?
February 7, 2022 at 10:23 pmFebruary 9, 2022 at 2:20 amKyleAnsys Employee
As you can see in the Python files indicated in the traceback, this error occurs because the script command getnamednumber("source") returns a number less than 1. If you enter the command
In the script prompt with this file, what value is returned? Are you sure that this is the base simulation script file being used when you run the optimization?
February 9, 2022 at 5:53 amFebruary 9, 2022 at 11:10 pmKyleAnsys EmployeeThat's odd, I'm not sure what might be causing this issue. One thing you could tryinpassing the base simulation to the optimization with this predefined FSP file rather than defining the it with a Python method. The "Project Init" section of this page describes how to do this: https://support.lumerical.com/hc/en-us/articles/360050995394.
February 9, 2022 at 11:56 pmwcai05Subscriber
The script will work if the base simulation was defined in FSP file. The reason why I'm trying to redo it in python is that the run time of the script is too long so I wish to push it on to a cluster. however, the formatting of the cluster only allows one file to run.
February 11, 2022 at 12:57 amKyleAnsys Employee
If it works with the FSP file directly, there might be something wrong with the Python method used to set up the geometry. A lumapi.FDTD object, representing an FDTD simulation, is passed to the Python method. This is the simulation where the geometry and simulation objects need to be added. I would recommend double checking that you're adding simulation objects to this FDTD object, you might be creating a new FDTD simulation and adding the objects to that.
Viewing 12 reply threads
Ansys Innovation Space
- You must be logged in to reply to this topic.
Simulation World 2022
Earth Rescue – An Ansys Online Series
Ansys BlogTrending discussions
- “Import optical generation” or “delta generation rate”?
- Error on Lumerical device
- Why am I getting “process exited without calling finalize”, and how do I fix it?
- Using a license file on a new license server
- Ansys Insight: Convergence issues in CHARGE
- Ansys Insight: About override mesh in FDTD: its use and settings
- Ansys Insight: Diverging Simulations
- Lumerical support has moved to the Ansys Learning Forum (ALF)
- Is there a Lumerical script command to output the Simulation and Memory requirements?
- focusing efficiency
Top Rated Tags