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

Photonics

Topics related to Lumerical and more.

How to refer a particular source in script for simulation with multiple source?

TAGGED: 

    • Saha
      Subscriber

      Hi, I need a quick help on this error in analysis script

      -->sppump=sourcepower(f,1,'Pump'); # Pump is name for one of the sources 
      error-->in sourcepower: no source named Pump was found
      But when I am just testing it in command prompt, this line works. Not sure what I am doing wrong.



    • Guilin Sun
      Ansys Employee

      It might be related to version? I tested using the newest version of FDTD and it works fine:

      f=getdata("CD::T","f");

      sp=sourcepower(f);

      spp=sourcepower(f,1,"source_1");

    • Saha
      Subscriber

      Thanks for responding. However it still doesn't work for the script. Is there any alternative way to extract the power info using getdata()?

    • Guilin Sun
      Ansys Employee

      I am not sure what do you mean "for the script". I tested a file and it works fine.

      Have you upgraded the software version?  what is your OS version?

      If this hinders your project and could not find a way to resolve, I would suggest that you disable the other source ad then use the default sourcepower to get the specific source result, with the given frequency.

       

       

Viewing 3 reply threads
  • The topic ‘How to refer a particular source in script for simulation with multiple source?’ is closed to new replies.
[bingo_chatbox]