Topics related to Lumerical and more

Running Optimization in the background based on RCWA results

    • Ali Vafa

      I am trying to optimize a periodic structure using the built-in optimization tools based on results from the RCWA solver, and I can successfully do that in the GUI. However, for obvious reasons, I would like to run the optimization in the background for a longer time. Is there a way to do that either locally or on a cluster with Slurm? 



    • Guilin Sun
      Ansys Employee

      It is doable but a little complicated.

      First, you need to know how to run script file in background. please refer to Installing and running Lumerical on Linux without GUI

      second, you need to specify the sweep parameters in "model" or structure group. If you want to sweep the layer thickess, you need to use script such as

      setnamed("RCWA","interface absolute positions",[-2.25e-7+t1,4.3e-7+t2,1.1e-6+t3]);

      where t1,t2, and t3 are the thickness parameters ( I have initial values there) you specify in "Setup" "Script".

      please test them before run sweep.

      then set the sweep object to sweep the parameters.

      finally, you need to write a simple script file with this line:


      Other parameters that can be swept can be found by


      But you will still need to have available GUI license to run the simulation, though GUI can be not shown.

      Please try.



    • Ali Vafa

      Thank you for your reply.

      I already have the steps you mentioned ready, i.e., the optimisation parameters are defined in the "model" object and the RCWA interface absolute coordinates are defined in the "setup script" of the "model" object, as you mentioned. Then, I configure the sweep settings by adding these parameters to the list of "Parameters", as shown below.

      And, I can successfully run the optimisation in the GUI. However, I do not understand the final step you mentioned. If I add "runsweep();" to the script file, which is a *.lsf file, how can I run it in the linux terminal? Even the link you have provided says GUI is required to run scripts.

      And if I just save the .fsp file and run it in the terminal using /opt/lumericalv232/bin/rcwa-engine-mpich2nem *.fsp, it will not run the sweep and only runs the RCWA solver for the current configuration.

      Is this what you meant, or am I missing something?

    • Guilin Sun
      Ansys Employee

      Please refer to this page

      You might be able to run the script file without GUI but with the GUI license available. Please try.

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