April 4, 2023 at 6:48 pmAaron AdkinsSubscriber
I am trying to use the superoptimization feature to create a 1x2 splitter using topology optimization, but when I run the optimization it reaches the max iterations for greyscale but does not enter the binarization phase. I have tried with separately defined geometries, FOMs, optimizers etc. This does not happen when there is just a single optimization. I get this message and then the program ends:
STOP: TOTAL NO. of ITERATIONS REACHED LIMIT
FINAL FOM = 0.44252052955475274
FINAL PARAMETERS = [4.30539533e-05 4.43574223e-05 4.37587580e-05 ... 0.00000000e+00
April 5, 2023 at 10:11 pmGuilin SunAnsys Employee
This is a little strange for me. How does the FOM behave? according to the example, it needs to reach optimum in greyscal phase then begins the binarization. Maybe this is the cause? how many iterations you used? Please double this initial grescale interation number and see if it works.
April 6, 2023 at 3:14 pmAaron AdkinsSubscriber
The FOM behaves differently, it increases and converges to 0.5 (unlike the example with one FOM). I have tried increasing the number of iterations to a high number but the optimization always ends with the message
Also, if I can ask another question, I am unable to run an optimization for an area larger than 5x5 um. I have tried many different mesh sizes but for any area larger than 5x5 it is unable to calculate the gradient. Do you have any suggestions for this?
April 6, 2023 at 10:10 pmGuilin SunAnsys Employee
Please check the forward/adjoint simulation files and see if they are normal.
April 6, 2023 at 10:16 pmAaron AdkinsSubscriber
Thank you, I believe I have enough memory. When I try 2D topology optimization with 5.5 x 5.5 um, I get this trace:
File "c:\users\zlab\desktop\inverse design\lumopt\lumopt\optimization.py", line 145, in run
File "c:\users\zlab\desktop\inverse design\lumopt\lumopt\optimization.py", line 216, in initialize
self.optimizer.initialize(start_params = start_params, callable_fom = callable_fom, callable_jac = callable_jac, bounds = bounds, plotting_function = plotting_function)
File "c:\users\zlab\desktop\inverse design\lumopt\lumopt\optimizers\optimizer.py", line 45, in initialize
File "c:\users\zlab\desktop\inverse design\lumopt\lumopt\optimizers\optimizer.py", line 51, in reset_start_params
File "c:\users\zlab\desktop\inverse design\lumopt\lumopt\optimizers\optimizer.py", line 72, in auto_detect_scaling
gradients = self.callable_jac(params)
File "c:\users\zlab\desktop\inverse design\lumopt\lumopt\optimizers\generic_optimizers.py", line 57, in callable_jac_local
gradients= -callable_jac(params / self.scaling_factor) / self.scaling_factor
File "c:\users\zlab\desktop\inverse design\lumopt\lumopt\optimization.py", line 309, in callable_jac
File "c:\users\zlab\desktop\inverse design\lumopt\lumopt\optimization.py", line 329, in calculate_gradients
fom_partial_derivs_vs_wl = self.geometry.calculate_gradients_on_cad(self.sim, 'forward_fields', 'adjoint_fields', self.adjoint_fields.scaling_factor)
File "c:\users\zlab\desktop\inverse design\lumopt\lumopt\geometries\topology.py", line 171, in calculate_gradients_on_cad
sim.fdtd.eval(('params = struct;'
File "C:\Program Files/Lumerical/v222/api/python\lumapi.py", line 1283, in eval
evalScript(self.handle, code, True)
File "C:\Program Files/Lumerical/v222/api/python\lumapi.py", line 261, in evalScript
raise LumApiError("Failed to evaluate code")
lumapi.LumApiError: 'Failed to evaluate code'
April 7, 2023 at 10:49 pmAaron AdkinsSubscriber
Ok I have resolved the size issue, but I still cannot get the optimization to run binarization phase when there are two FOMs. I have tried many different number of iterations, and it always stops at the max iterations and never continues.
April 10, 2023 at 4:50 pmGuilin SunAnsys Employee
The example is for one FOM. When you have two FOMs you will need to further develop the optimization or refer some publications. You can also visit the original GItHub and see if they support the two FOMs.
- You must be logged in to reply to this topic.
Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.
Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Why am I getting “process exited without calling finalize”, and how do I fix it?
- “Import optical generation” or “delta generation rate”?
- Error: addfdtd is not a valid function or a variable name
- Error on Lumerical device
- Using a license file on a new license server
- Ansys Insight: Transmission results greater than one
- Finding your Ansys (or Lumerical) account number
- Ansys Insight: Diverging Simulations
- Ansys Insight: Why my simulation result is different from published paper or experiment?
- Is there a Lumerical script command to output the Simulation and Memory requirements?
© 2023 Copyright ANSYS, Inc. All rights reserved.