TAGGED: inverse-design, Lumerical-FDTD
-
-
January 26, 2022 at 12:14 am
noumanzia
SubscriberHi,
How can I visualize the polygon in the python environment of Lumerical when I am making y splitter geometry. Should I use matplotlib to plot the polygon ?
January 27, 2022 at 8:59 pmTaylor Robertson
Ansys Employee
It is important to avoid any self-intersecting geometries, and so checking the shape of geometry is important. Using matplotlib is the easiest way. Something like the following python code would work for FunctionDefinedGeometry.
import matplotlib.pyplot as plt
...
def shape_function(params):
...
return polygon_points
...
points = shape_function(initial_parameters)
x , y =points[:,0], points[:,1]
plt.plot(x, y, 'b-')
plt.show If you are using ParameterizedGeometry then you will need to use lumapi to start a session and have the lumerical GUI draw the structure. Maybe copy your function to a new file, and add a main. That is what I would do anyway.
...
def func(params, fdtd_handle, only_update = True):
...
return
...
if __name__ == "__main__":
with lumapi.FDTD() as fdtd:
fdtd.eval('coupler;') #Set-up script in same directory
params = np.array([()] ) # Test params
func(params, fdtd) #Eval your function
input('Press enter..') #Wait so you can inspect the design
February 1, 2022 at 8:35 amnoumanzia
SubscriberThank you! I will check that and get back if there is still an issue.
Viewing 2 reply threads- You must be logged in to reply to this topic.
Ansys Innovation SpaceBoost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.
Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
Trending discussions- “Import optical generation” or “delta generation rate”?
- Why am I getting “process exited without calling finalize”, and how do I fix it?
- Error: addfdtd is not a valid function or a variable name
- Error on Lumerical device
- Using a license file on a new license server
- Ansys Insight: Transmission results greater than one
- Ansys Insight: Diverging Simulations
- Ansys Insight: About override mesh in FDTD: its use and settings
- Is there a Lumerical script command to output the Simulation and Memory requirements?
- Ansys Insight: Convergence issues in CHARGE
Top Contributors-
3744
-
2573
-
1821
-
1236
-
594
Top Rated Tags© 2023 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.
-