TAGGED: anisotropy
-
-
April 24, 2024 at 8:40 amm.hoormannSubscriber
When 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 pmTaylor RobertsonAnsys Employee
Hello 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 amm.hoormannSubscriber
Hello 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.
- 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
- Trapezoidal ring
- Help for qINTERCONNECT
- Absorption cross-section of AuNR excited by prism-based TIR
- Issues with getting result from interconnent analysis script
- How to measure transmission coefficients on a given plane .
- Topology Optimization Error
-
1416
-
599
-
591
-
565
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.