TAGGED: anisotropy
-
-
April 24, 2024 at 8:40 am
m.hoormann
SubscriberWhen I want to set an anistropic (n,k) material the new material does not take the refractive index values, but has only the values of 1, 1, 1. Also, I get the error "The material property, Refractive Index was not set. The property value must be a string or a matrix."
I use the following python script to set the material:n_GaN = [2.4869, 2.3, 2.4869]material = "GaN"mode.setmaterial(mode.addmaterial("(n,k) Material"), "name", material)mode.setmaterial(material, "Anisotropy", 1)mode.setmaterial(material, {"Refractive Index": n_GaN, "Imaginary Refractive Index": [0, 0, 0]})ÂHere, "mode" is defined as:Âmode = lumapi.MODE()ÂDo I have to define the values in anbother way? -
April 24, 2024 at 10:35 pm
Taylor Robertson
Ansys EmployeeHello Matthias,
You have defined the indices of GaN as a list, but the materials need to be defined as a arrays, or using a string for the predefined materials in material library. In python [,,] creates a list data type which you need to convert to np array.
This type conversion between python and lsf can get a little complicated. I would suggest keeping it as simple as possible.
mode.setmaterial(material, "Refractive Index", np.array(n_GaN))
mode.setmaterial(material, "Imaginary Refractive Index", np.array([0, 0, 0])) -
April 25, 2024 at 5:57 am
m.hoormann
SubscriberHello Mr. Robertson,
thank you for the fast reply. Now it works.Â
Best,
Matthias
-
- The topic ‘Setting refractive index for an anisotropic material does not work’ is closed to new replies.
-
3044
-
971
-
863
-
858
-
792
© 2025 Copyright ANSYS, Inc. All rights reserved.