June 19, 2023 at 5:35 pm
Ansys Employee
Not every function will work in Python. By default it is dielectric so you may not need to write
mymaterial = fdtd.addmaterial("Dielectric")
fdtd.setmaterial(mymaterial,"name", "myMaterial")
fdtd.setmaterial("myMaterial","Refractive Index", 1.45)
It is not called "Refractive index". It is called "index", and should be specified after the geometry, eg, you can set the index in the geometry part.
You may need to check the class and see if it has material function.
In this example it is set in
geometry = FunctionDefinedPolygon(func = grating_params_pos, initial_params = params, bounds = bounds, z = 0.0, depth = 110e-9, eps_out = 1.44 ** 2, eps_in = 3.47668 ** 2, edge_precision = 5, dx = 1e-5)
https://optics.ansys.com/hc/en-us/articles/1500007378182