barry Qin
Subscriber

A1：案例里说dipole cloud中改变Electric dipole和Magnetic dipole可以获得TE或TM的能带图，细究代码，其实dipole_type用在了dipole光源的设置里，例如：

set(“theta”, rand*360);

set(“phi”,rand*360);

set(“dipole type”,dipole_type);

A2：案例的分析组脚本是六个案例通用的，相关参数也是，不同的案例由不同的lattice type决定，即：

# lattice type: 1 if 2D rectangular lattice, 2 if hexagonal lattice, 3 if 3D rectangular lattice,

#4 if fcc lattice, 5 if bcc lattice, 6 for woodpile

if (lattice_type==1){ # if rectangular 2D lattice

for(i=1:n_dipoles) {

set(“name”,”s”+num2str(i));

set(“override global source settings”,1);

set(“set frequency”,1);

set(“frequency start”,f1);

set(“frequency stop”,f2);

set(“x”,(rand-0.5)*ax*0.6);

set(“y”,(rand-0.5)*ay*0.6);

set(“z”,(rand-0.5)*z_span);

set(“phase”,rand*360);

set(“dipole type”,dipole_type);

set(“theta”,theta);

set(“phi”,rand*360);

}

}

if (lattice_type==3) { # if 3D rectangular lattice

for(i=1:n_dipoles) {

set(“name”,”s”+num2str(i));

set(“override global source settings”,1);

set(“set frequency”,1);

set(“frequency start”,f1);

set(“frequency stop”,f2);

set(“x”,(rand-0.5)*ax*0.8); # keep dipoles 20% away from bloch boundaries to inject properly

set(“y”,(rand-0.5)*ay*0.8);

set(“z”,(rand-0.5)*az*0.8);

set(“phase”,rand*360);

set(“dipole type”,dipole_type);

set(“phi”,rand*360);

set(“theta”,rand*360);

}

}

az就起到了作用。