Error in setup script output when modifying port objects

yihaocuiyihaocui Member Posts: 2
edited May 5 in Photonics

Hi, I'm trying to create my entire simulation environment within the 3D FDTD model setup script and when I go to modify the port object within the FDTD simulation object, I get an error for no objects matching that name were found. This happens for both the "select" and "setnamed" commands. Interestingly, if I execute the same command from the script prompt no errors are produced. I've also set the model setup script as a construction group however, I'm able to manipulate every other object expect for the port objects.

For context, the reason why I am not building my simulation environment (simulation of a grating coupler) using the usual method is because I've noticed a bug in using the built-in PSO function. Earlier versions of my simulation involved modifying the FDTD region span according to the changes in grating geometry; however, I noticed that as the PSO was running through the various iterations of different parameter values, the FDTD region span updated with a lag - that is to say the span for the current ith simulation is according to the (i-1) simulation values. As a result, the boundary of the FDTD region would sometimes intersect with a grating causing instability or inaccurate results.

Thank you for your time!


  • kjohnsonkjohnson Posts: 172Ansys Employee

    Hello @yihaocui ,

    To access the ports from the model setup script you will have to use a name that gives their scope, for example "::model::FDTD::ports::port 1". Is this what you're doing in your script?

    Regarding the FDTD region not updating properly with the PSO tool, I would recommend that you double check the order that the FDTD region and the grating geometry are being updated, it's possible that the FDTD region is updating before the grating geometry.

Sign In or Register to comment.