TAGGED: inverse-design
-
-
July 24, 2025 at 2:29 pm
raano1
SubscriberDear Ansys Support Team,
I reviewed the example “Topology optimization of an O-band/C-band wavelength de-multiplexer with 100nm feature size constraint” on your Knowledge Base (https://optics.ansys.com/hc/en-us/articles/4403241716371), but could not find the following:
Full 3D Python script (topology.py)
Required .lsf simulation files
GDSII export instructions or script
Steps to extract and plot the transmission spectrum
Could you please provide these or direct me to where I can access them? -
July 24, 2025 at 4:51 pm
-
July 24, 2025 at 5:26 pm
raano1
SubscriberThank you for the update. I’ll follow up in the Photonics forum. Please let me know if the requested files or instructions will be shared there.
-
July 24, 2025 at 6:43 pm
Kirill
Forum ModeratorDear Subscriber,
Thank you for reporting this. We’ll look into why the mentioned content is missing.
In the meantime, I suggest reviewing these two related examples:
- Topology Optimization of a 4-channel wavelength demultiplexer 2D-TE
- Inverse Design of a Splitter Using Topology OptimizationBest regards,
Kirill -
July 24, 2025 at 6:51 pm
raano1
SubscriberDear Kirill,
Thank you for the quick response and for sharing the related examples. I’ll review them in the meantime.I would appreciate it if you could provide the missing content from the original example as early as possible, as I specifically need that example code for my work.
Looking forward to your update.
-
July 28, 2025 at 2:21 pm
raano1
SubscriberDear Kirill,
Thanks for your response.
-
July 28, 2025 at 4:32 pm
anna.wirth-singh
Ansys EmployeeHello,
I can answer that question about how to implement the minimum feature size constraint. Please see this reference, towards the bottom of the article, for details on the topology settings: Optimizable Geometry - Python API – Ansys Optics
The parameter you will need to adjust is 'filter_R'. It is set to 200nm by default.
Best,
Anna
-
July 29, 2025 at 3:27 pm
raano1
SubscriberDear Anna,
Thank you for your previous guidance on minimum feature size in topology optimization.
-
July 30, 2025 at 3:42 pm
raano1
SubscriberSee the next reply
-
July 30, 2025 at 5:07 pm
anna.wirth-singh
Ansys EmployeeHi, thanks for the additional questions, I’ll answer as many as I can.
1.If you do not see a final .fsp file dropped into the main folder, please look into the subfolder with the highest number (opts_1) and find the ‘forward_n.fsp’ also with the highest number. Each time you initiate the optimization process, it will create a new folder and then inside that folder there will be forward and adjoint simulation files corresponding to that part of the optimization. The most recently produced forward.fsp file will contain the optimized result.
2. Please see this page for reference on the GDS export process: GDS pattern extraction for inverse designed devices using contours method – Ansys Optics
3. To visualize the transmission spectrum, you should add a Mode expansion monitor – Simulation object – Ansys Optics over the output waveguide. You should look for the T_forward or T_backward result (depending on which direction your monitor is facing), as described here: Using and understanding Mode Expansion Monitors – Ansys Optics -
July 30, 2025 at 5:28 pm
raano1
SubscriberDear Ansys Support Team,
Thank you for your previous guidance on minimum feature size in topology optimization.
-
July 31, 2025 at 4:22 pm
anna.wirth-singh
Ansys EmployeeHi,
I looked into your question about the settings a bit more deeply. Both filter_R and min_feature_size are meant to implement a minimum feature size in designs to ensure manufacturability, but they are implemented at different stages of the optimization process. Even with spatial filtering (filter_R) , the process may create some features that break the rules. To add additional constraints, min_feature_size is additionally used to penalize designs that do not follow the minimum feature size rules. Topology optimization is unique to the setup that you have, so there is not a one-size-fits-all approach, but I think it would be safe to set min_feature_size = 100nm and then the filter_R a bit smaller (perhaps 75nm) if you are using the DFM phase.
And yes, it is possible to use the Python API (Python API overview – Ansys Optics) to display a plot in Matplotlib. This page has an example code snippet that may be useful: Script Commands as Methods - Python API – Ansys Optics
Best,
Anna
-
August 4, 2025 at 6:24 pm
raano1
SubscriberThanks
-
August 5, 2025 at 2:11 am
Kirill
Forum ModeratorDear Subscriber,
This issue is difficult to resolve without access to the details of your simulation. Unfortunately, the format of this forum isn’t well suited for handling such cases.
However, you may be eligible for support through the Ansys Customer Support Space (ACSS), where we can assist you more effectively.
For details, please refer to How to register on Ansys Customer Support Space. Please try submitting your request there.Best regards,
Kirill -
August 5, 2025 at 5:00 pm
raano1
SubscriberThanks
-
August 7, 2025 at 8:05 pm
Taylor Robertson
Ansys EmployeeHello,
I don't believe that the optimization has run to completion, but it looks like the Transmission targets are pretty close to the target. I don't believe that DFM is being allowed to complete. Maybe reduce the max_iterations ~200.
Because you have two channels and wavelength targets there are multiple simulations being run. The results you are looking at are for the second target 600-800nm. You can look at "opts_0\forward_0.fsp” to see the other wavelength target.
Alternatively, I would adjust the bandwidth in the final simulation and plot the results for 500-800nm.
fdtd.load(fsp_path)
fdtd.switchtolayout()
fdtd.setglobalsource('wavelength start',500e-9)
fdtd.setglobalsource('wavelength stop',800e-9)
fdtd.setglobalmonitor('frequency points',100)
fdtd.run()
Some other things to consider, you are using a single index value of 2.417 for the whole bandwidth, while there is likely dispersion. The filter_R parameter is the radius of the convolution filter used in the grescale and binarization. This isn't guaranteed to to achieve a minimum feature size, but is intended to close out small features in the topology object - box blur. There is no definitive answer here, you can play around to see how this effects performance and minimum feature size. The DFM step, actually penalizes the FOM when minimum features are present, and then optimizes; however, I don't think you have run the DFM step for this device.Best Regards,
-
August 18, 2025 at 4:51 pm
raano1
SubscriberPlease see the next reply...
-
August 20, 2025 at 2:17 pm
raano1
SubscriberPlease see the next reply.
-
August 21, 2025 at 5:51 pm
raano1
SubscriberDear Ansys Support Team,
When I run the Python code, I get the following error:numpy._core._exceptions._ArrayMemoryError: Unable to allocate 2.00 GiB for an array with shape (301, 401, 101, 11) and data type complex128
-
August 21, 2025 at 8:05 pm
Taylor Robertson
Ansys EmployeeHello,
The lumopt pakage will add a mode expansion monitor MEM based on the FOM - frequency monitor you define, and the modes(number, direction) and wavelengths specified in other objects ModeMatch and Wavelengths. It is not necessary to define the MEM explicitly, just like the adjoint source is set-up automatically in the backward sims.
I have never seen this issue with numpy memory, but it is a Numpy problem and not something we can support.
numpy._core._exceptions._ArrayMemoryError: Unable to allocate 2.00 GiB for an array with shape (301, 401, 101, 11) and data type complex128It seems like the only workaround I can tell is exploring ways of reducing the data in the opt_fields monitor. You can do this by making it smaller, making the mesh larger or reudcing the number of wavelengths. For example you probably don't need 20nm mesh in the z direction.
I will need to look into this a bit further, but for some reason your array is 128bit complex. We could almost certainly reduce that to 32bit float to help avoid this issue in the future.
-
September 16, 2025 at 4:44 pm
raano1
SubscriberThanks
-
September 25, 2025 at 4:13 pm
raano1
SubscriberDear Ansys Support Team,
I am working on a topology optimization problem for a 3D wavelength demultiplexer (WDM).
I saw the results at iteration 101 and iteration 175. However, I observed an issue: at iteration 175, the transmission in Channel 2 drops significantly in the 600–650 nm range.I am seeking guidance on how to refine the design to better satisfy the stricter spectral requirements.
-
September 30, 2025 at 1:13 am
George Patsamanis
Ansys EmployeeHello and thank you for the question.
Judging from the broadband transmission at the ports, you have setup the parameters correctly and the optimization process returned logical results.
Indeed, fom1 provides high transmission at 520nm-540nm with 20nm bandwidth, while fom2 provides high transmission overall over the significantly larger bandwidth of 200nm at 600-800nm.It is possible that this unwanted spike you observe around 600-625nm (for both foms) occurs due to an optimization tradeoff, in order to maintain the transmission of the rest of fom2’s bandwidth at a high level. Even though the spike looks larger at iteration 175 compared to 101, the entire broadband performance of fom2 has been computed higher for 175. This is evident from the Figure of Merit plot (top left).
It makes sense to perform one more optimization cycle with a few more suggestions, such as refining the mesh and increasing the wavelength points to observe the difference. In addition, the total size of the optimizable region plays a significant role to the maximum performance that can be achieved. Increasing the length (and width) as well of the fields region can help the optimization, and a new geometry may suppress or vanish this spike. A smaller feature size might be worth testing as an alternative approach, but this will result in a higher fabrication complexity.
I hope the above are helpful for your studies.
Kind regards,
George -
October 8, 2025 at 9:42 pm
raano1
SubscriberHello ANSYS Support Team,
I am running my simulation using the D: drive, which has plenty of free space (as shown in the attached image). However, during my inverse design simulation in ANSYS, the computer shuts down automatically after about 10–12 steps.
Previously, the same code ran successfully up to 120–175 steps without any issues.
Could you please advise on what might be causing this and how I can resolve it?
Thank you,
-
October 14, 2025 at 5:00 pm
Kirill
Forum ModeratorDear Subscriber,
This issue does not appear to be related to the Lumerical itself, but rather to a hardware stability problem. Since the system is shutting down completely, it’s likely caused by thermal or power limitations.
As a first debugging step, I recommend running a standard FDTD simulation on your system to confirm whether it behaves the same way. You could also try saving and running your simulation on the C: drive to check if performance or stability improves.
Additionally, please monitor your system’s CPU, GPU, and SSD temperatures during the run. If the SSD overheats, some systems may throttle or even shut down to prevent damage. Ensuring good airflow or using SSD thermal pads or heatsinks can help maintain stability during long simulations.
Best regards,
Kirill -
October 23, 2025 at 5:00 pm
raano1
SubscriberHello ANSYS Support Team,
I am running my simulation using the C: drive, which has plenty of free space,also i checked power and temperature everything. However, during my inverse design simulation in ANSYS, the computer shuts down automatically after about 10–12 steps.
Previously, the same code ran successfully up to 220-250 steps without any issues.
Could you please advise on what might be causing this and how I can resolve it?
-
October 24, 2025 at 5:28 pm
Kirill
Forum ModeratorHi @raano1,
As a reminder, please keep each thread focused on a single topic, as outlined in the Guidelines for Posting on Ansys Learning Forum.
The issues you are describing seem to be hardware-related. We can’t assist further, as this problem is not reproducible on our end.
I recommend reaching out to your local IT support and running hardware stress tests to verify system stability. Please also make sure that all Windows updates are installed and that your GPU/display drivers are updated to the latest version available from the manufacturer’s website. It’s also a good idea to check for a BIOS update for your motherboard.
If the issue persists, try running the simulation on a different machine to see if the problem can be reproduced.
Best regards,
Kirill -
November 4, 2025 at 4:17 pm
raano1
SubscriberDear Ansys Support Team,
After the simulation finished, it created opts_0 and opts_1. Then I went to opts_1, opened forward_0, and saw this.How can I add the blue box like that?
To extract the GDS file from the FSP file, I go to Global Index, then Visualize, then Index, and view it there.
But I can not see any layer like that
I also want to know something else. For the results, I’m using the python code method and I got the result. In the case of the GDS file, I’m using a direct Python code-will it automatically create the GDS file? Is that possible?
Could you please guide me properly? -
November 4, 2025 at 6:44 pm
anna.wirth-singh
Ansys EmployeeThanks for the updates. From your first image, it appears that the topology optimization may not have fully completed – as described in Optimizable Geometry - Python API – Ansys Optics, there should be a binarization step after the greyscale optimization in order to discretize the permittivity into the two levels:
Since there is a lot of color range in the plot, it appears the structure has not yet been binarized (material/ no material) – it may still be a gradient refractive index. Did you get any error messages on this run?
For GDS export of topology devices like this, we recommend the getcontour - Script command – Ansys Optics method as described in this article: GDS pattern extraction for inverse designed devices using contours method – Ansys Optics
For the issue with the visualizer – can you please check the z position? Possibly the index monitor is not viewing the desired cross-section. Alternatively, if the structure has not fully binarized so there are no sharp edges, it may struggle to identify any contours.
Best,
Anna
-
November 6, 2025 at 7:47 pm
raano1
SubscriberDear Ansys Support Team,
It ran for 205 steps and generated the FSP file. I set the maximum iteration number to 300, but it stopped at iteration 205. I still need to clear it more -what do you think? Is it still grayscale? And what should I do next? -
November 11, 2025 at 10:40 pm
anna.wirth-singh
Ansys EmployeeHi, do you receive any error message when the optimization stops at iteration 205? I would say that further binarization can be done, but it looks like it is almost there.
Another reason the optimization may stop is if the ‘ftol’ setting is reached – this setting is the minimum required change in the FOM between two subsequent iterations for the optimization to continue. If the optimization reaches a steady state (not improving in subsequent iterations), it will stop automatically. This means the FOM is most likely as good as it will get.
Regarding the result – it seems the optimization is certainly working, but it’s likely not possible to achieve perfectly 0% transmission at the desired wavelength ranges. The optimization will do its best, but it may not be possible to go all the way there. You can try adjusting the optimization algorithm, but in most cases the default settings with L-BFGS-B optimizer does well.
For gds export, we’re unfortunately not able to debug your script in detail. We can just guide the general approach to follow GDS pattern extraction for inverse designed devices using contours method – Ansys Optics, which contains an example script.
Best,
Anna
-
November 12, 2025 at 4:25 pm
raano1
SubscriberThank you for your response.
I received the following error message during the optimization:
“worker thread returned while attached to silo 0x19A.”
Also, sometimes the optimization causes my computer to stop or shut down automatically. -
November 12, 2025 at 5:04 pm
Kirill
Forum ModeratorDear @raano1,
That message is a Windows kernel bug check (not an Lumerical error). Specifically, it maps to WORKER_THREAD_RETURNED_WHILE_ATTACHED_TO_SILO (0x0000019A), which is typically triggered by a faulty/unstable driver or system component under load.
Bug Check 0x19A WORKER_THREAD_RETURNED_WHILE_ATTACHED_TO_SILO - Windows drivers | Microsoft Learn
We can't reproduce the issue on our end, so we can't support this. Try to run the simulation on a different machine.
Best regards,
Kirill
-
- You must be logged in to reply to this topic.
-
4177
-
1488
-
1363
-
1195
-
1021
© 2025 Copyright ANSYS, Inc. All rights reserved.





