TAGGED: fdtd
-
-
September 7, 2021 at 5:24 pm
MansoorAS
SubscriberHello,
I want to run some simulations from Python API and design some structures for FDTD. I checked the files of Y-branch but I found they do not have structure groups in them. Can anyone provide an example of structure group creation through python API.
Thank you
September 9, 2021 at 6:21 pmTaylor Robertson
Ansys EmployeeHello MansoorAS,
I the PID grating coupler uses the Python API with structure groups, and I would refer to the lsf documentation. Remember the python methods should behave the same as these documented script commands. Alternatively you can use eval to directly execute lsf code from python.
You can add groups usingaddstructuregroup - Script commandoraddanalysisgroup - Script command. Once this is selected you can add parameters, and scripts to the perform the setup or analysis usingadduserprop - Script, command. These would likely be variables defined in model or calculated from model parameters. To find out the properties use queryanalysisprop or queryuserprop.
For some advanced examples of how to work with the Python API
I hope this helps. Also you may find the/courses/index.php/photonics/Lumerical Scripting - Sim Objects course helpful.
September 9, 2021 at 8:50 pmMansoorAS
SubscriberHello troberts,
Thank you for response.
I have a project that I built with python script, my structure group has planarsolid object( truncated cone) . What I am trying to do is automate the process with python and make it reads all the parameters and variable for the structure from excel or txt file. I thought about using evalScript but I found that it make it more complicated.
I do not have support access to download the example files .
September 13, 2021 at 9:34 pmMansoorAS
SubscriberI was able to set each part of the group by itself but I faced a problem with custom object. How I can set the equation? I set it like the following
fdtd.set("equation 1", 1e6*r+slope *x)
but did not work. num2str is not working with api.
September 17, 2021 at 12:59 amTaylor Robertson
Ansys EmployeeHey Mansoor
In the python environment you will need to use their string conversion function. I think it is.
fdtd.set("equation 1", str(1e6*r+slope *x))
Viewing 4 reply threads- The topic ‘Structure group settings in Python API’ is closed to new replies.
Ansys Innovation SpaceTrending discussionsTop Contributors-
3492
-
1057
-
1051
-
965
-
942
Top Rated Tags© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-