


{"id":195416,"date":"2021-10-26T23:43:55","date_gmt":"2021-10-26T23:43:55","guid":{"rendered":"\/forum\/forums\/reply\/195416\/"},"modified":"2021-10-26T23:43:55","modified_gmt":"2021-10-26T23:43:55","slug":"195416","status":"publish","type":"reply","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/reply\/195416\/","title":{"rendered":"Reply To: How to input material instead of permittivity in polygon python script"},"content":{"rendered":"<p>Hello<br \/>\n<br \/>\nI 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.<br \/>\n##MATERIAL<br \/>\nopt_material=mode.addmaterial(&#8216;Dielectric&#8217;);<br \/>\nmode.setmaterial(opt_material,&#8217;name&#8217;,&#8217;Si:non-dispersive&#8217;);<br \/>\nn_opt=mode.getindex(&#8216;Si(Silicon)-Palik&#8217;,c\/lam_c);<br \/>\nmode.setmaterial(&#8216;Si:non-dispersive&#8217;,&#8217;RefractiveIndex&#8217;,n_opt); <\/p>\n<p>In the optimization script you define the device and cladding material in the Polygon class.<\/p>\n<p>#Setdeviceandcladdingmaterials,aswellasasdevicelayerthickness<br \/>\neps_in=Material(name=&#8217;Si:non-dispersive&#8217;,mesh_order=2)<br \/>\neps_out=Material(name=&#8217;SiO2:non-dispersive&#8217;,mesh_order=3)<br \/>\ndepth=220.0e-9<\/p>\n<p>#InitializeFunctionDefinedPolygonclass<br \/>\npolygon=FunctionDefinedPolygon(func=splitter,<br \/>\ninitial_params=prev_results<br \/>\nbounds=bounds<br \/>\nz=0.0<br \/>\ndepth=depth<br \/>\neps_out=eps_out,eps_in=eps_in<br \/>\nedge_precision=5<br \/>\ndx=1.0e-9)<\/p>\n<p>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. <\/p>\n<p>eps_in = 3.4 **2<br \/>\neps_out = 1.4 **2<br \/>\nI hope this helps.<\/p>\n","protected":false},"template":"","class_list":["post-195416","reply","type-reply","status-publish","hentry"],"aioseo_notices":[],"acf":[],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/replies\/195416","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/replies"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/reply"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/replies\/195416\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=195416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}