Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.
Photonics – Chinese

Photonics – Chinese

Topics related to Lumerical and more, in Chinese language.

脚本如何添加Sampled 3D data类型的材料

    • Lord Li
      Subscriber

      我注意到,在:

      https://optics.ansys.com/hc/en-us/articles/360034930013-addmaterial-Script-command

      https://optics.ansys.com/hc/en-us/articles/360034409654-setmaterial-Script-command

      两个页面中是可以对conductive和(n,k)材料的property(如refractive index)进行设置。

       

      但是,当我需要添加各向异性材料(Sampled 3D data类型材料)时,设置property却出现了报错,参照链接 我的脚本如下:

      setmaterial(addmaterial("Sampled 3D data"),"name","LN-Zelmon");

      setmaterial("material_123","anisotropy",2);

      setmaterial("material_123","wavelength",sampledData(:,1));

      setmaterial("material_123","Re(index xx)",sampledData(:,2));

      setmaterial("material_123","Re(index yy)",sampledData(:,3));

      setmaterial("material_123","Re(index zz)",sampledData(:,4));

      (在此,sampledData是已经定义好的矩阵)

      脚本从第三行到第六行都提示 The material's Refractive index property is not available.

      Sampled 3D data的界面如下,按理来说property的设置应该没问题。

      因此,想请问应如何设置property?

    • Guilin Sun
      Ansys Employee

      这种材料需要先将材料数据做成TXT文件,然后输入,而不是用脚本这样添加。只有单套数据才可以,比如nk 材料和电导率材料。

      参见 

      Ansys Insight: 如何找到材料库中没有的材料折射率,并输入到软件中?

      • Lord Li
        Subscriber

        现在需要使用脚本来添加,不知道能否实现呢?

    • Guilin Sun
      Ansys Employee

      最好不要用脚本,因为你不知道材料拟合怎么样。

      你可以添加到材料库中,不需要每次都要输入,否则材料已经存在,即使删除用此材料的几何形体,因为材料在材料库中(非永久,仅在此文件中),再输入此材料的话脚本就会出错。

      参见 https://optics.ansys.com/hc/en-us/articles/360034915093-Creating-new-sampled-data-materials-in-FDTD 看看后面部分如何添加到材料库。

Viewing 2 reply threads
  • The topic ‘脚本如何添加Sampled 3D data类型的材料’ is closed to new replies.
[bingo_chatbox]