Ansys Learning Forum Forums Discuss Simulation Photonics Planar Solid Not Working as Expected Reply To: Planar Solid Not Working as Expected

ldepra
Subscriber

Hi Amrita, 

thank you for the response. I accidentally did not include the x1 through x8.

I have posted below the full script:

 

deleteall; clear;


x1=0;    
x2=10e-6;
x3=10e-6;
x4=0;
x5=0;
x6=10e-6;
x7=10e-6;
x8=0;

y1=-1.5e-6-0.5e-6;

y2=-1.5e-6-0.5e-6;

y3=1.5e-6+0.5e-6;

y4=1.5e-6+0.5e-6;

y5=-1.5e-6;

y6=-1.5e-6;

y7=1.5e-6;

y8=1.5e-6;

 

z1=0;

z2=0;

z3=0;

z4=0;

z5=0.6e-6;

z6=0.06e-6;

z7=0.06e-6;

z8=0.6e-6;

 

 

vtx= [x1,y1,z1; #1

x2,y2,z2; #2

x3,y3,z3; #3

x4,y4,z4; #4

x5,y5,z5; #5

x6,y6,z6; #6

x7,y7,z7; #7

x8,y8,z8]; #8


a = cell(6);

for(i = 1:6){

a{i} = cell(1);

}

 

 

#facets:

 

 

a{1}{1} = [1,4,3,2]; #bottom facet

a{2}{1} = [1,2,6,5];

a{3}{1} = [2,3,7,6];

a{4}{1} = [3,4,8,7];

a{5}{1} = [1,5,8,4];

a{6}{1} = [5,6,7,8]; #top facet

addplanarsolid(vtx,a);
set("index",4);
set("x",0);

 

addmesh;
set("based on a structure",1);
set("structure","solid");
set("buffer",0e-6);
set("dy",0.001e-6);
set("dz",0.001e-6);
set("dx",0.001e-6);

addfdtd;
set("x",0e-6);
set("x span",20e-6);
set("y",0);
set("y span",5e-6);
set("z",0);
set("z span",3e-6);

addindex;
set("monitor type","2D X-normal");
set("x",10e-6);
set("y",0);
set("y span",8e-6);
set("z",0);
set("z span",8e-6);
addindex;
set("monitor type","2D X-normal");
set("x",0e-6);
set("y",0);
set("y span",8e-6);
set("z",0);
set("z span",8e-6);