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

    function PlotStructure

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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 Epsilon Mu BoundaryType xPMLCnt yPMLCnt X Y
global DrawStructure True False Mode TE TM

if DrawStructure==False
   return
end

Ep=Epsilon(xPMLCnt+1:X-xPMLCnt,yPMLCnt+1:Y-yPMLCnt).';
Nu=Mu(xPMLCnt+1:X-xPMLCnt,yPMLCnt+1:Y-yPMLCnt).';

if Mode==TE
    T=Ep;
    Ep=Nu;
    Nu=T;
end

figure
surf(Ep)
shading interp
axis equal
view(2)
title('Permittivity')

figure
surf(Nu)
shading interp
axis equal
view(2)
title('Permeability')