📄 plotsnapshot.m
字号:
function PlotSnapshot
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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 U X Y xPMLCnt yPMLCnt BoundaryType Time dT
global Mode TE TM Epsilon Mu StructureColor
global ShowStructure ShowPML False True
e=abs(BlochDiff(Epsilon,1,1,0))+abs(BlochDiff(Mu,1,1,0))+...
abs(BlochDiff(Epsilon,2,1,0))+abs(BlochDiff(Mu,2,1,0));
e=sign(e);
V=real(U);
a=(2*max(max(V))+min(min(V)))*StructureColor;
if ShowStructure==True
V=(1-e).*real(V)+a*e;
end
if ShowPML==False
V=V(xPMLCnt+1:X-xPMLCnt,yPMLCnt+1:Y-yPMLCnt);
end
figure(1);
surf(V.')
view(2)
shading interp
axis equal
axis tight
if Mode==TE
t=sprintf('TE Field (Timestep=%g, Normalized Time=%g)',Time,(Time-1)*dT);
else
t=sprintf('TM Field (Timestep=%g, Normalized Time=%g)',Time,(Time-1)*dT);
end
title(t)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -