Ansys Learning Forum Forums Discuss Simulation Photonics 2D inverse design grating coupler Reply To: 2D inverse design grating coupler

Lito
Ansys Employee

@rahul.sanghvi,

If you set the environment for Lumerical API in the cluster then you simply remove the PATH set in your script. 

Set environment to Lumerical 2024 R2.3 using the default install path and our bundled Python3: (change the “install path“ according to the path in your cluster)

export PATH=/opt/lumerical/v242/bin:/opt/lumerical/v242/python/bin:$PATH
export PYTHONPATH=$PYTHONPATH:/opt/lumerical/v242/api/python
export QT_QPA_PLATFORM=offscreen

Example Python Script: save as lumtest.py, – without the path settings. 

import lumapi
fdtd = lumapi.FDTD(hide=True)
fdtd.addfdtd()
fdtd.addring()
fdtd.addmesh()
fdtd.addrect()
fdtd.save("mytest.fsp")

Then run the example script above in the cluster: 

cd /{directory/folder of you script}
python lumtest.py

If it creates (mytest.fsp) on the same folder as your script, then this confirms that you can run Lumerical API on the cluster.

Â