-
-
October 21, 2021 at 5:18 pmxyjxyj1992Subscriber
Hi, I am trying to specify the material of the polygon by providing the name of the material, but there is always an error popping out. But when I refer to the source code "polygon" in lumopt, it does allow us to give eps_in the name of a material. Can anyone help? Thanks!
October 25, 2021 at 6:44 pmGuilin SunAnsys EmployeeBased on my limited knowledge on Pyhon assisted simulation, as you mentioned, it allows to have material name. However in the screenshot 3, it is this script
float(base_epsilon) fails, as it tried to convert "Si (Silicon) - Palik" to float value. "Si (Silicon) - Palik" is string which can only be assigned to material property to an object.
October 25, 2021 at 6:55 pmxyjxyj1992SubscriberThanks for your reply. But as shown in figure 2, in the script "polygon", the underlining command is to identify whether the input belongs to the material category, so it can be the material name as a string. But the script fails to do that somehow, and the users are not allowed to make any changes on either of these in-built scripts.
October 25, 2021 at 10:31 pmGuilin SunAnsys EmployeeIn Fig 2 I did not find "polygon". Polygon is the geometry. For objects in FDTD, it has geometry and material, and one can assign material to a geometry. So you should be able to assign a material using script. For example, in the Y-branch example, the script can assign material to the rectangle.
However for lumopt, it is from 3rd party, and you will need to modify it in order to expand its functionality: https://github.com/chriskeraly/lumopt
Welcome to LumOpt: Easy Adjoint Optimization for Lumerical ...
you can find more information online and some tutorials.
It is out of the scope of this forum.
October 26, 2021 at 11:43 pmTaylor RobertsonAnsys EmployeeHello
I believe that if you refer to the y-branch example, it shows how to define a new material based on existing one through Python. See the setup script varFDTD_y_branch.py line 39-43.
##MATERIAL
opt_material=mode.addmaterial('Dielectric');
mode.setmaterial(opt_material,'name','Si:non-dispersive');
n_opt=mode.getindex('Si(Silicon)-Palik',c/lam_c);
mode.setmaterial('Si:non-dispersive','RefractiveIndex',n_opt);
In the optimization script you define the device and cladding material in the Polygon class.
#Setdeviceandcladdingmaterials,aswellasasdevicelayerthickness
eps_in=Material(name='Si:non-dispersive',mesh_order=2)
eps_out=Material(name='SiO2:non-dispersive',mesh_order=3)
depth=220.0e-9
#InitializeFunctionDefinedPolygonclass
polygon=FunctionDefinedPolygon(func=splitter,
initial_params=prev_results bounds=bounds z=0.0 depth=depth eps_out=eps_out,eps_in=eps_in edge_precision=5 dx=1.0e-9)
You could pass the name of a material already defined in the base FDTD file just make sure this string is exactly the same as the name in fdtd, and that it is an instance of Material. If you just want to pass the permittivity that should be fine as well.
eps_in = 3.4 **2
eps_out = 1.4 **2
I hope this helps.
November 10, 2021 at 11:15 pmxyjxyj1992SubscriberHi
Thank you so much for your reply, that really helps! Sorry it takes so long for me to see your reply.
November 12, 2021 at 12:19 amTaylor RobertsonAnsys EmployeeHey Glad to hear. I've marked it as a solution.
Good Luck in your optimizations
Viewing 6 reply threads- The topic ‘How to input material instead of permittivity in polygon python script’ 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
- Topology Optimization Error
- Edge Coupler EME Example Issue
- How to measure transmission coefficients on a given plane .
Top Contributors-
1241
-
543
-
523
-
225
-
209
Top Rated Tags© 2024 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.
-
The Ansys Learning Forum is a public forum. You are prohibited from providing (i) information that is confidential to You, your employer, or any third party, (ii) Personal Data or individually identifiable health information, (iii) any information that is U.S. Government Classified, Controlled Unclassified Information, International Traffic in Arms Regulators (ITAR) or Export Administration Regulators (EAR) controlled or otherwise have been determined by the United States Government or by a foreign government to require protection against unauthorized disclosure for reasons of national security, or (iv) topics or information restricted by the People's Republic of China data protection and privacy laws.