- 
		
			- 
April 4, 2023 at 6:48 pmAaron Adkins SubscriberI 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
 Â 0.00000000e+00 0.00000000e+00]
- 
April 5, 2023 at 10:11 pmGuilin Sun Ansys EmployeeThis 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 Adkins SubscriberThe 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 CONVERGENCE: REL_REDUCTION_OF_F_<=_FACTR*EPSMCH 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? Thank you 
- 
April 6, 2023 at 10:10 pmGuilin Sun Ansys Employee Please check the forward/adjoint simulation files and see if they are normal.    - 
April 6, 2023 at 10:16 pmAaron Adkins SubscriberThank you, I believe I have enough memory. When I try 2D topology optimization with 5.5 x 5.5 um, I get this trace: opt.run() 
 Â File "c:\users\zlab\desktop\inverse design\lumopt\lumopt\optimization.py", line 145, in run
 Â Â self.initialize()
 Â 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
 Â Â self.reset_start_params(start_params, self.scale_initial_gradient_to)
 Â File "c:\users\zlab\desktop\inverse design\lumopt\lumopt\optimizers\optimizer.py", line 51, in reset_start_params
 Â Â self.auto_detect_scaling(min_required_rel_change)
 Â 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
 Â Â return self.calculate_gradients()
 Â 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 Adkins SubscriberOk 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 Sun Ansys EmployeeThe 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. 
 
- 
- The topic ‘Lumopt topology superoptimization not starting binarization phase’ is closed to new replies.
- 
                        
                        4167
- 
                        
                        1487
- 
                        
                        1363
- 
                        
                        1194
- 
                        
                        1021
© 2025 Copyright ANSYS, Inc. All rights reserved.
 You are navigating away from the AIS Discovery experience
You are navigating away from the AIS Discovery experience 
               
          