Photonics

Photonics

Topics related to Lumerical and more.

User select mode in FDTD port using lumerical script

TAGGED: , ,

    • minusunny
      Subscriber

      Hi how to add user select mode  in FDTD port:

      set('mode selection','user select');

      set('number of field profile samples',2);

      #set('select modes',1);

       

      updateportmodes(2);

    • Amrita Pati
      Ansys Employee

      Hi,

      Let's say you want to inject the first 5 modes, you can try the following line of code:

      setnamed("FDTD::ports::port 1","selected mode numbers",[1,2,3,4,5]);

      Regards,
      Amrita

    • minusunny
      Subscriber

      Hi,

      I am trying to add to analysis group: This is what i wrote:

      addport; # add port

      ##input source

      set('name','In1');

      set('x',0e-06);

      set('y',0e-06);

      set('y span',2e-06);

      set('z',0);

      set('z span', 2e-06);

      set('injection axis', 'x-axis');

      set('direction', 'Forward');

      set('mode selection','user select');

      set('number of field profile samples',5);

      setnamed('FDTD::ports::In1','selected mode numbers',1);

      If i try this :

      error: prompt line 1125: in setnamed, no items matching the name 'FDTD::ports::In1' can be found.

       I need to select 2nd mode from the user select mode.

    • Amrita Pati
      Ansys Employee

      Hi,

      Thanks for sharing additional details. I was able to run your script successfully:

      When you test the script, make sure that you are in Layout mode. I saw this error when I tested the script in the analysis mode. As objects are not created in analysis mode, Line 1109 won't be able to find the object. Make sure that the port is being created before setting the other properties. Please let me know if you are already running it in Layout Mode and still see the error. 

      Regards,
      Amrita

    • minusunny
      Subscriber

      Thank you, due to some reasom it is giving me error, but when i applied changes it worked!.

      Minu

    • Amrita Pati
      Ansys Employee

      You are welcome! Great to know that it's working. I will close this post then.

      Regards,
      Amrita

Viewing 5 reply threads
  • The topic ‘User select mode in FDTD port using lumerical script’ is closed to new replies.