TAGGED: inverse-design, Lumerical-FDTD
-
-
January 26, 2022 at 12:14 amnoumanziaSubscriber
Hi,
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 RobertsonAnsys 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 amnoumanziaSubscriberThank you! I will check that and get back if there is still an issue.
Viewing 2 reply threads- The topic ‘Inverse design y branch visulizaing initial geometry’ is closed to new replies.
Ansys Innovation SpaceTrending discussions- Difference between answers in version 2024 and 2017 lumerical mode solution
- Errors Running Ring Modulator Example on Cluster
- INTERCONNECT – No results unless rerun simulation until it gives any
- Import material .txt file with script
- Help for qINTERCONNECT
- Trapezoidal ring
- Issues with getting result from interconnent analysis script
- How to measure transmission coefficients on a given plane .
- Topology Optimization Error
- Absorption cross-section of AuNR excited by prism-based TIR
Top Contributors-
1311
-
591
-
569
-
525
-
366
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.
-