%This program calculate the wave guide by a photonic crystal.
%For two dimension case.
%Only for TM case, in this version.
%Trial Version
clear;
%tic
%Initial parameters and other things.
W=0.291; %Normalized frequency
%The following parameters are control parameters.
WaveGuide=1; %If this program is for Wave Guide? If so, please specify 1.
IsMovie=0; %If you want to play movie, please use 1.
IsFigure=1; %If it will plot the figures? If so, please specify 1.
WantToSeeEp=1; %Do you want to see the distrubution of Ep? If so, please specify 1.
%End of defining control parameters
MLatx=11; %How many Lattice cell in x direction.
MLaty=11; %How many Lattice cell in y direction.
NMlat=21; %The gird number in each Lattice Cell.
%SHOULD BE ODD INTEGER!!!!
if mod(NMlat,2)==0
NMlat=NMlat+1;
end %Force it to be a odd integer!
NTx=MLatx*NMlat+1; %It is the number of the Grid along x axis.
NTy=MLaty*NMlat+1; %It is the number of the Grid along y axis.
if WaveGuide==1
Nrow=4; %The row number of coloumns between the PML boundary and the waveguide.
end
NPML=12; %How many PML layers will be used in our computation.
NTimeSteps=2500; %Total number of Time Steps
Meach=20; %Define the interval for plot figures if IsFigure==1.
%This also works for saving intervals.
% % % R=0.2; %The radius of dielectric columns