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.

Error: addfdtd is not a valid function or a variable name

    • momchil
      Subscriber

      Hi I am trying to run older scripts, and I get an error that "addfdtd is not a valid function or a variable name" -

      is addfdtd removed from MODE 2021 R1 release?

      I cannot find FDTD object under Simulation also, why is that?

    • momchil
      Subscriber
      Hi,
      answering my own question - the error is due to improper project start - when running scripts with FDTD engine command (i.e. addfdtd) start the launcher and open a "New FDTD Project".
      The error was due to my MODE application starting the default project with EME solver instead.
    • Guilin Sun
      Ansys Employee
      You are right that if you use script you will need to launch the proper project first. If you manually open a new project from "File", you will be able to open any solver from the launcher as the recent a few versions have this compacity.
    • simenew.assefa
      Subscriber


      # Import the refractive index data for each material
      importmaterial(glass, "SiO2.mdf"); # Replace "SiO2.mdf" with the appropriate MDF file for glass
      importmaterial(ito, "ITO.mdf"); # Replace "ITO.mdf" with the appropriate MDF file for ITO
      importmaterial(zno, "ZnO.mdf"); # Replace "ZnO.mdf" with the appropriate MDF file for ZnO
      importmaterial(p3ht_pcbm, "P3HT_PCBM.mdf"); # Replace "P3HT_PCBM.mdf" with the appropriate MDF file for P3HT:PCBM
      importmaterial(moo3, "MoO3.mdf"); # Replace "MoO3.mdf" with the appropriate MDF file for MoO3
      importmaterial(al, "Al.mdf"); # Replace "Al.mdf" with the appropriate MDF file for Al

      # Define the layer thicknesses (nm)
      thickness_glass = ...;
      thickness_ito = ...;
      thickness_zno = ...;
      thickness_p3ht_pcbm = ...;
      thickness_moo3 = ...;
      thickness_al = ...;

      # Create the multilayer structure
      stack = stack();
      addlayer(stack, thickness_glass, glass);
      addlayer(stack, thickness_ito, ito);
      addlayer(stack, thickness_zno, zno);
      addlayer(stack, thickness_p3ht_pcbm, p3ht_pcbm);
      addlayer(stack, thickness_moo3, moo3);
      addlayer(stack, thickness_al, al);

      Calculate the absorption spectrum
      spectrum = spectrum(lambda);
      addpower();
      addanalysis();

      active layer.lsf;
      Error: C:\Users\Newaye\Desktop\active layer.lsf.lsf line 13: importmaterial is not a valid function or variable name.

      CAN ANY ONE HELP ME HOW TO RUN IT?

Viewing 3 reply threads
  • The topic ‘Error: addfdtd is not a valid function or a variable name’ is closed to new replies.
[bingo_chatbox]