# Metal boundary conditions switchtolayout; simulation; setnamed("MODE","x min bc","metal"); setnamed("MODE","x max bc","metal"); setnamed("MODE","y min bc","metal"); setnamed("MODE","y max bc","metal"); findmodes; x=getdata("mode1","x"); y=getdata("mode1","y"); n=getdata("mode1","neff"); E2=getelectric("mode1"); image(x*1e6,y*1e6,E2,"x (um)","y (um)","E^2, Metal, neff="+num2str(n)); setplot("colorbar min",0); setplot("colorbar max",1); exportfigure("usr_start_metal_bc_1"); image(x*1e6,y*1e6,log10(E2),"x (um)","y (um)","log10(E^2), Metal, neff="+num2str(n)); setplot("colorbar min",-15); setplot("colorbar max",0); exportfigure("usr_start_metal_bc_2"); ?"Effective index with metal BC: "+num2str(n); # PML boundary conditions switchtolayout; simulation; setnamed("MODE","x min bc","PML"); setnamed("MODE","x max bc","PML"); setnamed("MODE","y min bc","PML"); setnamed("MODE","y max bc","PML"); findmodes; x=getdata("mode1","x"); y=getdata("mode1","y"); n=getdata("mode1","neff"); E2=getelectric("mode1"); image(x*1e6,y*1e6,E2,"x (um)","y (um)","E^2, PML, neff="+num2str(n)); setplot("colorbar min",0); setplot("colorbar max",1); exportfigure("usr_start_metal_bc_3"); image(x*1e6,y*1e6,log10(E2),"x (um)","y (um)","log10(E^2), PML, neff="+num2str(n)); setplot("colorbar min",-15); setplot("colorbar max",0); exportfigure("usr_start_metal_bc_4"); ?"Effective index with PML BC: "+num2str(n);