This node allows you to use Ansys Speos inside optiSLang It requires a prepared Speos model (*.scdocx) with published input parameters.
From version 2023 R2 and later, a wizard-based Speos integration has been added into optiSLang.
Setup
There are two methods for setting up a Speos workflow:
Set up using the Solver wizard (for more details, see Ansys Speos Wizard).
Set up manually:
In the Modules pane, expand > or type
Ansys Speos
in the search bar.Drag and drop the Ansys Speos node onto the Scenery pane or your solver chain.
Add Ansys Speos Core and Ansys Speos Output nodes to the solver chain for a complete Speos workflow.
In the dialog box of the Ansys Speos node, browse for and open an existing Speos project. The Ansys Speos solver node supports Speos project files (*.scdocx).
Parametrization Tab
Parameters are loaded and listed in the table. Register the parameters by dragging them to the Parameter pane or highlighting them in the table and clicking the multi-action button. You should rename the parameter names to short names.
Note: For identically named parameters, you must move them to the Parameter pane and rename them individually.
Execution Settings Tab
The following execution sequence runs for each design:
Open the project
Execute Python script pre-update
Update parametrics
Update Optical Part Design
Check the set parametrics
Execute Python script post-update
Export geometries and images
Export simulations
Close the project
Option | Description |
---|---|
Product | Lists the supported versions of Speos (Ansys Speos 2023 R2 and later). Select the version you are using from the list. |
Batch mode | When selected, Speos is started without a user interface. When cleared, Speos is started with a user interface. |
Python script pre update | When selected, you can load a Python script that executes before the design is updated. |
Python script post update | When selected, you can load a Python script that executes after the design has been updated. |
Note:
The parameters are updated for the project in the order that they are displayed in the registration table. The sort order is always alphabetical and can be changed by renaming.
If the Speos project contains Block Recording or history track parameters, the published parameters cannot be changed. All parametric changes must be done with Block Recording.
The following environment variables are available for the Python scripts (pre- and post-update) during the execution sequence:
Environment Variable | Description |
---|---|
OSL_DESIGN_NO | The current design number (for example, 1). |
OSL_DESIGN_NAME | The current design directory name (for example, Design0001). |
OSL_DESIGN_DIR | The absolute path of the current design directory. |
OSL_PROJECT_DIR | The absolute path of the current project (*.opd). |
OSL_WORKING_DIR | The absolute path of the current working directory. |
OSL_NODE_NAME | The name of the current node. |
OSL_RLS_VER | The version number of optiSLang. |
OSL_RLS_REV | The revision number of optiSLang. |
OSL_RLS_FLG | Empty unless a specific version of optiSLang is used. |
Note:
You get access to the environment variables by using the following IronPython code:
import os OSL_DESIGN_DIR = os.getenv('OSL_DESIGN_DIR')
The default working directory of Speos is NOT the design directory. If you need to change the current working directory to the design directory, then use the following IronPython code:
import os os.chdir(os.getenv('OSL_DESIGN_DIR'))
Simulations Tab
Option | Description |
---|---|
Speos Simulations to be solved | The selected simulations are exported in the design directory and resolved by the Speos Core node. |
Export Tab
Option | Description |
---|---|
Export formats | The selected formats are written as result files in the design directory. |
Additional formats | Exports defined file types during the run. In the field, separate the file types using commas (,), semicolons (;), or pipes (|). For supported export formats, see Exporting: Supported File Formats in the Discovery SpaceClaim documentation. |
Run Options
This node has general Run Options. The number of supported options is individual for each node.
Hint: Using the run option "Designs per process" can lead to a very high memory allocation of the Speos project, as the allocated memory is only released when the Speos process is closed. It is recommended to use a small number for "Designs in process" if memory is limited.
Limitations
Only supported on Windows systems.
Both optiSLang and Speos must be the same version (for example, 2024R1).
Currently, there is no functionality to define the geometry update order for the Optical Part Design.
Workaround: Create a Python script to define the update order manually and use it in the pre-update function (see Execution Settings Tab).
If OPD features cannot be updated with given parameter values, an error message is not displayed in optiSLang.
Currently, multi-design process (number of parallel runs > 1) is not supported.
3D texture updates are not automatically updated. To optimize them, use a Python script:
texture = SpeosSim.Component3DTexture.Find("my3dtexturename").Compute() sim = SpeosSim.SimulationDirect.Find("mysimulationname").LinkedExport()
Supported Versions
See the Supported Integration Versions table.