Hierarchy of setup script



In INTERCONNECT, let’s say we have a few subcomponents within a compound component. When running simulation, what is the simulation hierarchy for the setup scripts? Does the scripts in lower physical hierarchy runs first?

Thank you


Hi @zqlu, thank you for the post. First of all, the setup script does not always run when the simulation runs. If you have noticed, there is a “run setup script” setting in the “Root Element” Property View window. If it is set to “automatic”, then the setup script only runs when something is changed in the script. If it is set to “always”, then the setup script will run every time the simulation runs.

Then if the setup script runs, it runs with the order from parent to children, which means if you have a compound inside another compound, then the very inner elements follow the setup script directly contain them (which is the inner compound). I made a very simple example file setup_script_test.icp (203.4 KB) , in which the very inner waveguide’s length is set by the setup script in both compound, you can find that it follows the order of the inner compound.

I hope this helps :grinning:


Thank you very much. This is clear.


Another thing to mention, the “run setup script” is not only for Root Element but also for all the compound elements, so you can set them separately.