An inquiry regarding an error

amoraamora Member Posts: 10

Hello,

I am trying to run a script but I got an error ''Error: D:/Design/file.lsf line 78: syntax error'' and I am sure that there is no error. Can you have a look please and let me know where's the error?

I have attached a text file with my script. I got the error at line 78. Just try to copy and paste the text file into LSF and see where's the error please.

Thanks

Tagged:

Answers

  • kjohnsonkjohnson Posts: 204Ansys Employee

    Hello @amora ,

    Ansys staff can't download files from the ALF, can you please copy and paste the script into the text of a post? Because this is a syntax error, I think only a few lines (for example lines 75-80) should be needed to see what the problem is.

  • amoraamora Posts: 24Member

    Hello Kjohnson,

    Thanks for your reply. Here is a copy of the script:

    deleteall;

    #Adding the FDTD solver region to the simulation

    xs=300e-9; #radius of holes or circles

    ys=200e-9;

    p=ys+90e-9; #period of array

    #p=332e-9;

    t1=200e-9;

    t2=5e-9;

    #t=50e-9; #thickness of film and holes

    addfdtd;

    set("dimension",2);

    set("x",0);

    set("x span",p);

    set("y",0);

    set("y span",p);

    set("z min",-9.2e-6);

    set("z max", 10.5e-6);

    set("allow symmetry on all boundaries", 1);

    set ("y min BC","Anti-Symmetric");

    set ("y max BC","Anti-Symmetric");

    set ("x min BC","symmetric");

    set ("x max BC","symmetric");


    set ("pml profile",[3]);

    set ("pml layers",[12]);

    set("simulation time",13000e-15);

    set("auto shutoff min",10e-6);

    set("mesh accuracy",3);

    #Setting the simulation boundaries

    addmesh;

    set("name","mesh");

    set("x",0);

    set("x span",xs);

    set("y",0);

    set("y span",ys);

    set("z min",t1);

    set("z max",t2+10e-9);

    set("override x mesh",1);

    set("override y mesh",1);

    set("override z mesh",1);

    set("set maximum mesh step",1);

    set("dx",14e-9);

    set("dy",14e-9);

    set("dz",14e-9);

    #Adding the structure

    addrect;

    set("name","Substrate");

    set("material","CaF3");

    set("x",0);

    set("x span",8e-6);

    set("y",0);

    set("y span",8e-6);

    set("z min",-16.5e-6);

    set("z max",0);

    #Adding Ti

    #addrect;

    addrect;

    set("name","Ti layer");

    set("x",0);

    set("x span",8e-6);

    set("y",0);

    set("y span",8e-6);

    set("z min",0);

    set("z max",t1);

    set("material","Ti (Titanium) - Palik");

    #Adding rectangles

    z_span=0.1e-6;

    nx=3; ny=3;

    ax=0.4e-6;

    ay=0.4e-6;

    n_rows = ny-1; #no. of periods in x direction

    n_cols = nx-1; #no. of periods in y direction

    even_flag = 0;

    for(i=-n_rows/2:n_rows/2) {

    for(j=-n_cols/2:n_cols/2) {

    addcustom;

    set("create 3D object by","extrusion");

    set("equation 1","1-abs(x)"); # abs(y) = 1-abs(x)

    set("x span",xs);

    set("y span",ys);

    set("x",(j)*p);

    set("y",(i)*p);

    set("z min",t1);

    set("z max",t2);

    set("material","Ge (Germanium) - Palik");

    }

    }

    #Adding the source

    addplane;

    set('injection axis','z');

    set('direction','backward');

    set('x min',-1e-6);

    set('x max', 1e-6);

    set('y min',-1e-6);

    set('y max',1e-6);

    set('z',5e-6);

    set('wavelength start',3e-6);

    set('wavelength stop',7e-6);

    set('polarization angle',90);

  • kjohnsonkjohnson Posts: 204Ansys Employee

    Hello @amora ,

    Thank you for providing the script. I'm not allowed to run this script myself unfortunately, and the formatting on the forum may have changed the line spacing so I'm not sure which is line 78. Can you please let me know which line is causing the error? Is it this one: 'set("equation 1","1-abs(x)"); # abs(y) = 1-abs(x)'?

Sign In or Register to comment.