www.gusucode.com > FDTD计算二维光子带隙的程序 > FDTD计算二维光子带隙的程序/247787/Initialize.m

    function Initialize

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Electromagnetic Finite-Difference Time-Domain %
% Version 1.20, Release 1                       %
%                                               %
%   (C) Copyright 2005                          %
%   Sharif University of Technology             %
%   School of Electrical Engineering            %
%   All Rights Reserved                         %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


global L dT dL 
global Cnt xCnt yCnt X Y
global MaxTimeStep MaxSpeed
global OutputFileName
global xProbe yProbe DifferenceDirection
global xCenter yCenter TimePoints
global Alpha Source DiffusionLength 
global BoundaryType TimeSteps TimeDecimation
global eSigmax mSigmax eSigmay mSigmay Mu Epsilon 
global KappaX KappaY Mode TE TM xPMLCnt yPMLCnt

OutputFileName='Default';

L=1;
dL=1;
MaxTimeStep=dL/MaxSpeed;
dT=dT*MaxTimeStep;

if Mode==TE
    Temp=Epsilon;
    Epsilon=Mu;
    Mu=Temp;
end

KappaX=0;
KappaY=0;
InitializePML;

DiffusionLength=1.3;

xCenter=xCenter+xPMLCnt;
yCenter=yCenter+yPMLCnt;

xProbe=xProbe+xPMLCnt;
yProbe=yCenter+yPMLCnt;

TimePoints=round(TimeSteps/TimeDecimation);
DifferenceDirection=+1;

InitializeSource;